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_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/media_export.h" |
12 #include "media/base/stream_parser_buffer.h" | 13 #include "media/base/stream_parser_buffer.h" |
13 | 14 |
14 namespace media { | 15 namespace media { |
15 | 16 |
16 class StreamParserBuffer; | 17 class StreamParserBuffer; |
17 | 18 |
18 namespace mp2t { | 19 namespace mp2t { |
19 | 20 |
20 class EsParser { | 21 class MEDIA_EXPORT EsParser { |
21 public: | 22 public: |
22 typedef base::Callback<void(scoped_refptr<StreamParserBuffer>)> EmitBufferCB; | 23 typedef base::Callback<void(scoped_refptr<StreamParserBuffer>)> EmitBufferCB; |
23 | 24 |
24 EsParser() {} | 25 EsParser() {} |
25 virtual ~EsParser() {} | 26 virtual ~EsParser() {} |
26 | 27 |
27 // ES parsing. | 28 // ES parsing. |
28 // Should use kNoTimestamp when a timestamp is not valid. | 29 // Should use kNoTimestamp when a timestamp is not valid. |
29 virtual bool Parse(const uint8* buf, int size, | 30 virtual bool Parse(const uint8* buf, int size, |
30 base::TimeDelta pts, | 31 base::TimeDelta pts, |
31 DecodeTimestamp dts) = 0; | 32 DecodeTimestamp dts) = 0; |
32 | 33 |
33 // Flush any pending buffer. | 34 // Flush any pending buffer. |
34 virtual void Flush() = 0; | 35 virtual void Flush() = 0; |
35 | 36 |
36 // Reset the state of the ES parser. | 37 // Reset the state of the ES parser. |
37 virtual void Reset() = 0; | 38 virtual void Reset() = 0; |
38 }; | 39 }; |
39 | 40 |
40 } // namespace mp2t | 41 } // namespace mp2t |
41 } // namespace media | 42 } // namespace media |
42 | 43 |
43 #endif | 44 #endif |
OLD | NEW |