Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
21 | trait Formats |
||
22 | { |
||
23 | /** @var object */ |
||
24 | protected $format; |
||
25 | |||
26 | /** |
||
27 | * @param string $videoCodec |
||
28 | * @return $this |
||
29 | * @throws Exception |
||
30 | */ |
||
31 | public function X264($videoCodec = 'libx264') |
||
32 | { |
||
33 | $this->setFormat(new X264($videoCodec)); |
||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $videoCodec |
||
39 | * @return $this |
||
40 | * @throws Exception |
||
41 | */ |
||
42 | public function HEVC($videoCodec = 'libx265') |
||
43 | { |
||
44 | $this->setFormat(new HEVC($videoCodec)); |
||
45 | return $this; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param string $videoCodec |
||
50 | * @return $this |
||
51 | * @throws Exception |
||
52 | */ |
||
53 | public function WebM($videoCodec = 'libvpx-vp9') |
||
54 | { |
||
55 | $this->setFormat(new VP9($videoCodec)); |
||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return FormatInterface|mixed |
||
61 | */ |
||
62 | public function getFormat(): FormatInterface |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param mixed $format |
||
69 | * @return $this |
||
70 | * @throws Exception |
||
71 | */ |
||
72 | public function setFormat($format) |
||
80 | } |
||
81 | } |