1
- using System . Xml . Serialization ;
1
+ using System . Collections . Generic ;
2
+ using System . Xml . Serialization ;
2
3
3
4
namespace MediaBrowser . Model . Dlna . Profiles
4
5
{
5
6
[ XmlRoot ( "Profile" ) ]
6
7
public class AndroidProfile : DefaultProfile
7
8
{
8
- public AndroidProfile ( )
9
+ public AndroidProfile ( bool supportsHls , bool supportsMpegDash )
9
10
{
10
11
Name = "Android" ;
11
12
12
- TranscodingProfiles = new [ ]
13
+ List < TranscodingProfile > transcodingProfiles = new List < TranscodingProfile > ( ) ;
14
+
15
+ transcodingProfiles . Add ( new TranscodingProfile
13
16
{
14
- new TranscodingProfile
15
- {
16
- Container = "mp3" ,
17
- AudioCodec = "mp3" ,
18
- Type = DlnaProfileType . Audio
19
- } ,
20
- new TranscodingProfile
17
+ Container = "mp3" ,
18
+ AudioCodec = "mp3" ,
19
+ Type = DlnaProfileType . Audio
20
+ } ) ;
21
+
22
+ if ( supportsMpegDash )
23
+ {
24
+
25
+ }
26
+ if ( supportsHls )
27
+ {
28
+ transcodingProfiles . Add ( new TranscodingProfile
21
29
{
22
30
Protocol = "hls" ,
23
31
Container = "ts" ,
@@ -26,17 +34,19 @@ public AndroidProfile()
26
34
Type = DlnaProfileType . Video ,
27
35
VideoProfile = "Baseline" ,
28
36
Context = EncodingContext . Streaming
29
- } ,
30
- new TranscodingProfile
31
- {
32
- Container = "mp4" ,
33
- VideoCodec = "h264" ,
34
- AudioCodec = "aac" ,
35
- Type = DlnaProfileType . Video ,
36
- VideoProfile = "Baseline" ,
37
- Context = EncodingContext . Static
38
- }
39
- } ;
37
+ } ) ;
38
+ }
39
+ transcodingProfiles . Add ( new TranscodingProfile
40
+ {
41
+ Container = "mp4" ,
42
+ VideoCodec = "h264" ,
43
+ AudioCodec = "aac" ,
44
+ Type = DlnaProfileType . Video ,
45
+ VideoProfile = "Baseline" ,
46
+ Context = EncodingContext . Static
47
+ } ) ;
48
+
49
+ TranscodingProfiles = transcodingProfiles . ToArray ( ) ;
40
50
41
51
DirectPlayProfiles = new [ ]
42
52
{
@@ -88,6 +98,22 @@ public AndroidProfile()
88
98
new CodecProfile
89
99
{
90
100
Type = CodecType . Video ,
101
+ Codec = "h264" ,
102
+
103
+ Conditions = new [ ]
104
+ {
105
+ new ProfileCondition ( ProfileConditionType . SubstringOf , ProfileConditionValue . VideoProfile , "baseline" ) ,
106
+ new ProfileCondition ( ProfileConditionType . LessThanEqual , ProfileConditionValue . Width , "1920" ) ,
107
+ new ProfileCondition ( ProfileConditionType . LessThanEqual , ProfileConditionValue . Height , "1080" ) ,
108
+ new ProfileCondition ( ProfileConditionType . LessThanEqual , ProfileConditionValue . VideoBitDepth , "8" ) ,
109
+ new ProfileCondition ( ProfileConditionType . NotEquals , ProfileConditionValue . IsAnamorphic , "true" )
110
+ }
111
+ } ,
112
+
113
+ new CodecProfile
114
+ {
115
+ Type = CodecType . Video ,
116
+
91
117
Conditions = new [ ]
92
118
{
93
119
new ProfileCondition ( ProfileConditionType . LessThanEqual , ProfileConditionValue . Width , "1920" ) ,
0 commit comments