Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: media/formats/mp2t/mp2t_stream_parser.h

Issue 539343002: Make the timestamp unroll offset consistent accross PES pids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing timestamp unroller. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_;
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_;
132
133 // The timestamp unroller might create negative timestamps,
134 // we need to add a time offset to make sure all timestamps are positive.
126 base::TimeDelta time_offset_; 135 base::TimeDelta time_offset_;
127 136
128 DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); 137 DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser);
129 }; 138 };
130 139
131 } // namespace mp2t 140 } // namespace mp2t
132 } // namespace media 141 } // namespace media
133 142
134 #endif 143 #endif
135 144
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698