|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* @see https://github.com/soluble-io/soluble-mediatools-cli for the canonical repository |
|
7
|
|
|
* |
|
8
|
|
|
* @copyright Copyright (c) 2018-2019 Sébastien Vanvelthem. (https://github.com/belgattitude) |
|
9
|
|
|
* @license https://github.com/soluble-io/soluble-mediatools-cli/blob/master/LICENSE.md MIT |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Soluble\MediaTools\Cli\Service; |
|
13
|
|
|
|
|
14
|
|
|
use Soluble\MediaTools\Video\VideoAnalyzerInterface; |
|
15
|
|
|
use Soluble\MediaTools\Video\VideoConverterInterface; |
|
16
|
|
|
use Soluble\MediaTools\Video\VideoInfoReaderInterface; |
|
17
|
|
|
use Soluble\MediaTools\Video\VideoThumbGeneratorInterface; |
|
18
|
|
|
|
|
19
|
|
|
class MediaToolsService implements MediaToolsServiceInterface |
|
20
|
|
|
{ |
|
21
|
|
|
/** @var VideoInfoReaderInterface */ |
|
22
|
|
|
private $reader; |
|
23
|
|
|
|
|
24
|
|
|
/** @var VideoConverterInterface */ |
|
25
|
|
|
private $converter; |
|
26
|
|
|
|
|
27
|
|
|
/** @var VideoAnalyzerInterface */ |
|
28
|
|
|
private $analyzer; |
|
29
|
|
|
|
|
30
|
|
|
/** @var VideoThumbGeneratorInterface */ |
|
31
|
|
|
private $thumbGenerator; |
|
32
|
|
|
|
|
33
|
3 |
|
public function __construct( |
|
34
|
|
|
VideoInfoReaderInterface $reader, |
|
35
|
|
|
VideoConverterInterface $converter, |
|
36
|
|
|
VideoThumbGeneratorInterface $thumbGenerator, |
|
37
|
|
|
VideoAnalyzerInterface $analyzer |
|
38
|
|
|
) { |
|
39
|
3 |
|
$this->converter = $converter; |
|
40
|
3 |
|
$this->reader = $reader; |
|
41
|
3 |
|
$this->analyzer = $analyzer; |
|
42
|
3 |
|
$this->thumbGenerator = $thumbGenerator; |
|
43
|
3 |
|
} |
|
44
|
|
|
|
|
45
|
1 |
|
public function getReader(): VideoInfoReaderInterface |
|
46
|
|
|
{ |
|
47
|
1 |
|
return $this->reader; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function getAnalyzer(): VideoAnalyzerInterface |
|
51
|
|
|
{ |
|
52
|
|
|
return $this->analyzer; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
1 |
|
public function getConverter(): VideoConverterInterface |
|
56
|
|
|
{ |
|
57
|
1 |
|
return $this->converter; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function getThumbGenerator(): VideoThumbGeneratorInterface |
|
61
|
|
|
{ |
|
62
|
|
|
return $this->thumbGenerator; |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|