| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_STREAM_PARSER_BUFFER_H_ | 5 #ifndef MEDIA_BASE_STREAM_PARSER_BUFFER_H_ |
| 6 #define MEDIA_BASE_STREAM_PARSER_BUFFER_H_ | 6 #define MEDIA_BASE_STREAM_PARSER_BUFFER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "media/base/decoder_buffer.h" | 10 #include "media/base/decoder_buffer.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 public: | 103 public: |
| 104 // Value used to signal an invalid decoder config ID. | 104 // Value used to signal an invalid decoder config ID. |
| 105 enum { kInvalidConfigId = -1 }; | 105 enum { kInvalidConfigId = -1 }; |
| 106 | 106 |
| 107 typedef DemuxerStream::Type Type; | 107 typedef DemuxerStream::Type Type; |
| 108 typedef StreamParser::TrackId TrackId; | 108 typedef StreamParser::TrackId TrackId; |
| 109 | 109 |
| 110 static scoped_refptr<StreamParserBuffer> CreateEOSBuffer(); | 110 static scoped_refptr<StreamParserBuffer> CreateEOSBuffer(); |
| 111 | 111 |
| 112 static scoped_refptr<StreamParserBuffer> CopyFrom( | 112 static scoped_refptr<StreamParserBuffer> CopyFrom( |
| 113 const uint8* data, int data_size, bool is_keyframe, Type type, | 113 const uint8* data, int data_size, bool is_key_frame, Type type, |
| 114 TrackId track_id); | 114 TrackId track_id); |
| 115 static scoped_refptr<StreamParserBuffer> CopyFrom( | 115 static scoped_refptr<StreamParserBuffer> CopyFrom( |
| 116 const uint8* data, int data_size, | 116 const uint8* data, int data_size, |
| 117 const uint8* side_data, int side_data_size, bool is_keyframe, Type type, | 117 const uint8* side_data, int side_data_size, bool is_key_frame, Type type, |
| 118 TrackId track_id); | 118 TrackId track_id); |
| 119 bool IsKeyframe() const { return is_keyframe_; } | |
| 120 | 119 |
| 121 // Decode timestamp. If not explicitly set, or set to kNoTimestamp(), the | 120 // Decode timestamp. If not explicitly set, or set to kNoTimestamp(), the |
| 122 // value will be taken from the normal timestamp. | 121 // value will be taken from the normal timestamp. |
| 123 DecodeTimestamp GetDecodeTimestamp() const; | 122 DecodeTimestamp GetDecodeTimestamp() const; |
| 124 void SetDecodeTimestamp(DecodeTimestamp timestamp); | 123 void SetDecodeTimestamp(DecodeTimestamp timestamp); |
| 125 | 124 |
| 126 // Gets/sets the ID of the decoder config associated with this buffer. | 125 // Gets/sets the ID of the decoder config associated with this buffer. |
| 127 int GetConfigId() const; | 126 int GetConfigId() const; |
| 128 void SetConfigId(int config_id); | 127 void SetConfigId(int config_id); |
| 129 | 128 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void SetPrerollBuffer(const scoped_refptr<StreamParserBuffer>& preroll); | 166 void SetPrerollBuffer(const scoped_refptr<StreamParserBuffer>& preroll); |
| 168 const scoped_refptr<StreamParserBuffer>& preroll_buffer() { | 167 const scoped_refptr<StreamParserBuffer>& preroll_buffer() { |
| 169 return preroll_buffer_; | 168 return preroll_buffer_; |
| 170 } | 169 } |
| 171 | 170 |
| 172 void set_timestamp(base::TimeDelta timestamp) override; | 171 void set_timestamp(base::TimeDelta timestamp) override; |
| 173 | 172 |
| 174 private: | 173 private: |
| 175 StreamParserBuffer(const uint8* data, int data_size, | 174 StreamParserBuffer(const uint8* data, int data_size, |
| 176 const uint8* side_data, int side_data_size, | 175 const uint8* side_data, int side_data_size, |
| 177 bool is_keyframe, Type type, | 176 bool is_key_frame, Type type, |
| 178 TrackId track_id); | 177 TrackId track_id); |
| 179 ~StreamParserBuffer() override; | 178 ~StreamParserBuffer() override; |
| 180 | 179 |
| 181 bool is_keyframe_; | |
| 182 DecodeTimestamp decode_timestamp_; | 180 DecodeTimestamp decode_timestamp_; |
| 183 int config_id_; | 181 int config_id_; |
| 184 Type type_; | 182 Type type_; |
| 185 TrackId track_id_; | 183 TrackId track_id_; |
| 186 BufferQueue splice_buffers_; | 184 BufferQueue splice_buffers_; |
| 187 scoped_refptr<StreamParserBuffer> preroll_buffer_; | 185 scoped_refptr<StreamParserBuffer> preroll_buffer_; |
| 188 | 186 |
| 189 DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer); | 187 DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer); |
| 190 }; | 188 }; |
| 191 | 189 |
| 192 } // namespace media | 190 } // namespace media |
| 193 | 191 |
| 194 #endif // MEDIA_BASE_STREAM_PARSER_BUFFER_H_ | 192 #endif // MEDIA_BASE_STREAM_PARSER_BUFFER_H_ |
| OLD | NEW |