Skip to content

Commit 94fc889

Browse files
authored
Add support for FRAME-RATE attribute (#37)
1 parent b9c881d commit 94fc889

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Source/M3U8ExtXStreamInf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ NSString * NSStringFromMediaResolution(MediaResoulution resolution);
3838
#define M3U8_EXT_X_STREAM_INF_PROGRAM_ID @"PROGRAM-ID" // The value is a decimal-integer that uniquely identifies a particular presentation within the scope of the Playlist file.
3939
#define M3U8_EXT_X_STREAM_INF_CODECS @"CODECS" // The value is a quoted-string containing a comma-separated list of formats.
4040
#define M3U8_EXT_X_STREAM_INF_RESOLUTION @"RESOLUTION" // The value is a decimal-resolution describing the approximate encoded horizontal and vertical resolution of video within the presentation.
41+
#define M3U8_EXT_X_STREAM_INF_FRAME_RATE @"FRAME-RATE" // The value is a decimal-floating-point describing the maximum frame rate for all the video in the Variant Stream, rounded to three decimal places.
4142
#define M3U8_EXT_X_STREAM_INF_AUDIO @"AUDIO" // The value is a quoted-string.
4243
#define M3U8_EXT_X_STREAM_INF_VIDEO @"VIDEO" // The value is a quoted-string.
4344
#define M3U8_EXT_X_STREAM_INF_SUBTITLES @"SUBTITLES" // The value is a quoted-string.
@@ -52,6 +53,7 @@ NSString * NSStringFromMediaResolution(MediaResoulution resolution);
5253
@property (nonatomic, readonly, assign) NSInteger programId; // removed by draft 12
5354
@property (nonatomic, readonly, copy) NSArray *codecs;
5455
@property (nonatomic, readonly) MediaResoulution resolution;
56+
@property (nonatomic, readonly, assign) float frameRate;
5557
@property (nonatomic, readonly, copy) NSString *audio;
5658
@property (nonatomic, readonly, copy) NSString *video;
5759
@property (nonatomic, readonly, copy) NSString *subtitles;

Source/M3U8ExtXStreamInf.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ - (MediaResoulution)resolution {
8686
return resolution;
8787
}
8888

89+
- (float)frameRate
90+
{
91+
return [self.dictionary[M3U8_EXT_X_STREAM_INF_FRAME_RATE] floatValue];
92+
}
93+
8994
- (NSString *)audio {
9095
return self.dictionary[M3U8_EXT_X_STREAM_INF_AUDIO];
9196
}

Source/M3U8TagsAndAttributes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
#define M3U8_EXT_X_STREAM_INF_PROGRAM_ID @"PROGRAM-ID" // The value is a decimal-integer that uniquely identifies a particular presentation within the scope of the Playlist file.
209209
#define M3U8_EXT_X_STREAM_INF_CODECS @"CODECS" // The value is a quoted-string containing a comma-separated list of formats.
210210
#define M3U8_EXT_X_STREAM_INF_RESOLUTION @"RESOLUTION" // The value is a decimal-resolution describing the approximate encoded horizontal and vertical resolution of video within the presentation.
211+
#define M3U8_EXT_X_STREAM_INF_FRAME_RATE @"FRAME-RATE" // The value is a decimal-floating-point describing the maximum frame rate for all the video in the Variant Stream, rounded to three decimal places.
211212
#define M3U8_EXT_X_STREAM_INF_AUDIO @"AUDIO" // The value is a quoted-string.
212213
#define M3U8_EXT_X_STREAM_INF_VIDEO @"VIDEO" // The value is a quoted-string.
213214
#define M3U8_EXT_X_STREAM_INF_SUBTITLES @"SUBTITLES" // The value is a quoted-string.

0 commit comments

Comments
 (0)