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

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

Issue 447963003: Introduce DecodeTimestamp class to make it easier to distiguish presentation and decode timestamps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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_ES_PARSER_H_ 5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H_
6 #define MEDIA_FORMATS_MP2T_ES_PARSER_H_ 6 #define MEDIA_FORMATS_MP2T_ES_PARSER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "media/base/stream_parser_buffer.h"
12 13
13 namespace media { 14 namespace media {
14 15
15 class StreamParserBuffer; 16 class StreamParserBuffer;
16 17
17 namespace mp2t { 18 namespace mp2t {
18 19
19 class EsParser { 20 class EsParser {
20 public: 21 public:
21 typedef base::Callback<void(scoped_refptr<StreamParserBuffer>)> EmitBufferCB; 22 typedef base::Callback<void(scoped_refptr<StreamParserBuffer>)> EmitBufferCB;
22 23
23 EsParser() {} 24 EsParser() {}
24 virtual ~EsParser() {} 25 virtual ~EsParser() {}
25 26
26 // ES parsing. 27 // ES parsing.
27 // Should use kNoTimestamp when a timestamp is not valid. 28 // Should use kNoTimestamp when a timestamp is not valid.
28 virtual bool Parse(const uint8* buf, int size, 29 virtual bool Parse(const uint8* buf, int size,
29 base::TimeDelta pts, 30 base::TimeDelta pts,
30 base::TimeDelta dts) = 0; 31 DecodeTimestamp dts) = 0;
31 32
32 // Flush any pending buffer. 33 // Flush any pending buffer.
33 virtual void Flush() = 0; 34 virtual void Flush() = 0;
34 35
35 // Reset the state of the ES parser. 36 // Reset the state of the ES parser.
36 virtual void Reset() = 0; 37 virtual void Reset() = 0;
37 }; 38 };
38 39
39 } // namespace mp2t 40 } // namespace mp2t
40 } // namespace media 41 } // namespace media
41 42
42 #endif 43 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698