Failed Conditions
Push — master ( dedbae...8af529 )
by Sébastien
02:19
created

GoogleVod2019Preset::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 0
cts 5
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 getParams(string $file, ?int $width = null, ?int $height = null): VideoConvertParams
32
    {
33
        $params = (new VideoConvertParams())
34
            ->withVideoCodec('vp9');
35
36
        return $params;
37
    }
38
39
    public function getFileExtension(): string
40
    {
41
        return 'webm';
42
    }
43
}
44