OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ | 5 #ifndef MEDIA_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ |
6 #define MEDIA_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ | 6 #define MEDIA_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "media/base/audio_decoder_config.h" | 13 #include "media/base/audio_decoder_config.h" |
14 #include "media/base/byte_queue.h" | 14 #include "media/base/byte_queue.h" |
15 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
16 #include "media/base/stream_parser.h" | 16 #include "media/base/stream_parser.h" |
17 #include "media/base/video_decoder_config.h" | 17 #include "media/base/video_decoder_config.h" |
| 18 #include "media/formats/mp2t/timestamp_unroller.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 class StreamParserBuffer; | 22 class StreamParserBuffer; |
22 | 23 |
23 namespace mp2t { | 24 namespace mp2t { |
24 | 25 |
25 class PidState; | 26 class PidState; |
26 | 27 |
27 class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { | 28 class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 int selected_video_pid_; | 117 int selected_video_pid_; |
117 | 118 |
118 // Pending audio & video buffers. | 119 // Pending audio & video buffers. |
119 std::list<BufferQueueWithConfig> buffer_queue_chain_; | 120 std::list<BufferQueueWithConfig> buffer_queue_chain_; |
120 | 121 |
121 // Whether |init_cb_| has been invoked. | 122 // Whether |init_cb_| has been invoked. |
122 bool is_initialized_; | 123 bool is_initialized_; |
123 | 124 |
124 // Indicate whether a segment was started. | 125 // Indicate whether a segment was started. |
125 bool segment_started_; | 126 bool segment_started_; |
126 base::TimeDelta time_offset_; | 127 |
| 128 // Timestamp unroller. |
| 129 // Timestamps in PES packets must be unrolled using the same offset. |
| 130 // So the unroller is global between PES pids. |
| 131 TimestampUnroller timestamp_unroller_; |
127 | 132 |
128 DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); | 133 DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); |
129 }; | 134 }; |
130 | 135 |
131 } // namespace mp2t | 136 } // namespace mp2t |
132 } // namespace media | 137 } // namespace media |
133 | 138 |
134 #endif | 139 #endif |
135 | 140 |
OLD | NEW |