Chromium Code Reviews| Index: media/base/stream_parser_buffer.h |
| diff --git a/media/base/stream_parser_buffer.h b/media/base/stream_parser_buffer.h |
| index 44ca1abed2c58577c1f52049cd94ab6b3cdfe1b5..a11767aadba849e07f68225dbe35c1908a5ef2ee 100644 |
| --- a/media/base/stream_parser_buffer.h |
| +++ b/media/base/stream_parser_buffer.h |
| @@ -15,12 +15,18 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer { |
| // Value used to signal an invalid decoder config ID. |
| enum { kInvalidConfigId = -1 }; |
| + enum Type { |
|
xhwang
2014/01/29 08:04:50
Does it make sense to reuse DemuxerStream::Type? I
wolenetz
2014/02/05 02:49:53
tl;dr: Seems reasonable to me. I've made the chang
|
| + kAudio, |
| + kVideo, |
| + kText |
| + }; |
|
xhwang
2014/01/29 08:04:50
FYI, we are moving from kCamelCase to UPPER_CASE s
wolenetz
2014/02/05 02:49:53
Cool. Thank you.
|
| + |
| static scoped_refptr<StreamParserBuffer> CreateEOSBuffer(); |
| static scoped_refptr<StreamParserBuffer> CopyFrom( |
| - const uint8* data, int data_size, bool is_keyframe); |
| + const uint8* data, int data_size, bool is_keyframe, Type type); |
| static scoped_refptr<StreamParserBuffer> CopyFrom( |
| const uint8* data, int data_size, |
| - const uint8* side_data, int side_data_size, bool is_keyframe); |
| + const uint8* side_data, int side_data_size, bool is_keyframe, Type type); |
| bool IsKeyframe() const { return is_keyframe_; } |
| // Decode timestamp. If not explicitly set, or set to kNoTimestamp(), the |
| @@ -28,11 +34,19 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer { |
| base::TimeDelta GetDecodeTimestamp() const; |
| void SetDecodeTimestamp(const base::TimeDelta& timestamp); |
| - // Gets/sets the ID of the decoder config associated with this |
| - // buffer. |
| + // Gets/sets the ID of the decoder config associated with this buffer. |
| int GetConfigId() const; |
| void SetConfigId(int config_id); |
| + // Gets the parser's media type associated with this buffer. Value is |
| + // meaningless for EOS buffers. |
| + Type type() const { return type_; } |
| + |
| + // Gets/sets the parser's text track number associated with this buffer. Value |
| + // is meaningless for EOS buffers or buffers whose type() is not |kText|. |
| + int text_track_number() const { return text_track_number_; } |
| + void set_text_track_number(int track_num) { text_track_number_ = track_num; } |
| + |
| // Buffers to be exhausted before using the data in this DecoderBuffer. Used |
| // to implement the Audio Splice Frame Algorithm per the MSE specification. |
| const std::vector<scoped_refptr<StreamParserBuffer> >& GetFadeOutPreroll() |
| @@ -43,12 +57,14 @@ class MEDIA_EXPORT StreamParserBuffer : public DecoderBuffer { |
| private: |
| StreamParserBuffer(const uint8* data, int data_size, |
| const uint8* side_data, int side_data_size, |
| - bool is_keyframe); |
| + bool is_keyframe, Type type); |
| virtual ~StreamParserBuffer(); |
| bool is_keyframe_; |
| base::TimeDelta decode_timestamp_; |
| int config_id_; |
| + Type type_; |
| + int text_track_number_; |
|
xhwang
2014/01/29 08:04:50
document range of |text_track_number|, e.g. -1 is
wolenetz
2014/02/05 02:49:53
For the current WebM Tracks Parser, -1 is indeed i
|
| std::vector<scoped_refptr<StreamParserBuffer> > fade_out_preroll_; |
| DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer); |