Completed
Push — master ( 359fe7...152344 )
by Sébastien
03:49
created

GoogleVod2019Preset::convert()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 3
dl 0
loc 11
ccs 0
cts 8
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\MediaTools\Preset\WebM;
6
7
use Soluble\MediaTools\Preset\PresetInterface;
8
use Soluble\MediaTools\Video\VideoAnalyzerInterface;
9
use Soluble\MediaTools\Video\VideoConverterInterface;
10
use Soluble\MediaTools\Video\VideoConvertParams;
11
use Soluble\MediaTools\Video\VideoInfoReaderInterface;
12
13
class GoogleVod2019Preset implements PresetInterface
14
{
15
    /** @var VideoInfoReaderInterface */
16
    private $reader;
17
18
    /** @var VideoConverterInterface */
19
    private $converter;
20
21
    /** @var VideoAnalyzerInterface */
22
    private $analyzer;
23
24
    public function __construct(VideoInfoReaderInterface $reader, VideoConverterInterface $converter, VideoAnalyzerInterface $analyzer)
25
    {
26
        $this->converter = $converter;
27
        $this->reader    = $reader;
28
        $this->analyzer  = $analyzer;
29
    }
30
31
    public function getName(): string
32
    {
33
        return __CLASS__;
34
    }
35
36
    public function getParams(string $file, ?int $width = null, ?int $height = null): VideoConvertParams
37
    {
38
        $params = (new VideoConvertParams())
39
            ->withVideoCodec('vp9');
40
41
        return $params;
42
    }
43
}
44