Passed
Push — master ( ac0e9d...b23da5 )
by Amin
04:21
created

HEVC   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getAvailableVideoCodecs() 0 3 1
A getAvailableAudioCodecs() 0 3 1
A __construct() 0 6 2
A supportBFrames() 0 3 1
A getModulus() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of the PHP-FFmpeg-video-streaming package.
5
 *
6
 * (c) Amin Yazdanpanah <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Streaming\Format;
13
14
final class HEVC extends Video
15
{
16
17
    /**
18
     * HEVC constructor.
19
     * @param string $video_codec
20
     * @param string|null $audio_codec
21
     */
22
    public function __construct(string $video_codec = 'libx265', string $audio_codec = null)
23
    {
24
        $this->setVideoCodec($video_codec);
25
26
        if($audio_codec){
27
            $this->setAudioCodec($audio_codec);
28
        }
29
    }
30
31
    /**
32
     * Returns the list of available audio codecs for this format.
33
     *
34
     * @return array
35
     */
36
    public function getAvailableAudioCodecs()
37
    {
38
        return [''];
39
    }
40
41
    public function getAvailableVideoCodecs(): array
42
    {
43
        return ['libx265', 'h265'];
44
    }
45
46
    /**
47
     * @return int
48
     */
49
    public function getModulus()
50
    {
51
        return 2;
52
    }
53
54
    /**
55
     * Returns true if the current format supports B-Frames.
56
     *
57
     * @see https://wikipedia.org/wiki/Video_compression_picture_types
58
     *
59
     * @return Boolean
60
     */
61
    public function supportBFrames()
62
    {
63
        return true;
64
    }
65
}