Total Complexity | 7 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class FFMpegConfig |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $binary; |
||
13 | |||
14 | /** @var FFmpegProcess */ |
||
15 | protected $process; |
||
16 | |||
17 | /** @var int|null */ |
||
18 | protected $threads; |
||
19 | |||
20 | /** @var int|null */ |
||
21 | protected $conversionTimeout; |
||
22 | |||
23 | /** @var int|null */ |
||
24 | protected $conversionIdleTimeout; |
||
25 | |||
26 | /** |
||
27 | * FFMpegConfig constructor. |
||
28 | * |
||
29 | * @param string $binary |
||
30 | * @param int|null $threads number fo threads used for conversion, null means single threads, 0 all cores, .... |
||
31 | * @param int|null $conversionTimeout max allowed time (in seconds) for conversion |
||
32 | * @param int|null $conversionIdleTimeout max allowed idle time (in seconds) for conversion |
||
33 | */ |
||
34 | 1 | public function __construct(string $binary, ?int $threads = null, ?int $conversionTimeout = null, ?int $conversionIdleTimeout = null) |
|
35 | { |
||
36 | 1 | $this->binary = $binary; |
|
37 | 1 | $this->threads = $threads; |
|
38 | 1 | $this->conversionTimeout = $conversionTimeout; |
|
39 | 1 | $this->conversionIdleTimeout = $conversionIdleTimeout; |
|
40 | 1 | } |
|
41 | |||
42 | 1 | public function getBinary(): string |
|
43 | { |
||
44 | 1 | return $this->binary; |
|
45 | } |
||
46 | |||
47 | 1 | public function getThreads(): ?int |
|
48 | { |
||
49 | 1 | return $this->threads; |
|
50 | } |
||
51 | |||
52 | 1 | public function getConversionTimeout(): ?int |
|
53 | { |
||
54 | 1 | return $this->conversionTimeout; |
|
55 | } |
||
56 | |||
57 | 1 | public function getConversionIdleTimeout(): ?int |
|
58 | { |
||
59 | 1 | return $this->conversionIdleTimeout; |
|
60 | } |
||
61 | |||
62 | 1 | public function getProcess(): FFmpegProcess |
|
69 | } |
||
70 | } |
||
71 |