OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_MPEG2_MPEG2TS_PES_PARSER_H_ | |
6 #define MEDIA_MPEG2_MPEG2TS_PES_PARSER_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/callback.h" | |
12 #include "base/compiler_specific.h" | |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "media/base/byte_queue.h" | |
15 #include "media/mpeg2/mpeg2ts_section_parser.h" | |
16 | |
17 namespace media { | |
18 namespace mpeg2ts { | |
19 | |
20 class EsParser; | |
21 | |
22 class Mpeg2TsPesParser : public Mpeg2TsSectionParser { | |
23 public: | |
24 explicit Mpeg2TsPesParser(EsParser* es_parser); | |
acolwell GONE FROM CHROMIUM
2013/09/05 18:29:10
nit: use scoped_ptr<EsParser> here
damienv1
2013/09/09 23:29:45
Done.
| |
25 virtual ~Mpeg2TsPesParser(); | |
26 | |
27 // Mpeg2TsSectionParser implementation. | |
28 virtual bool Parse(bool payload_unit_start_indicator, | |
29 const uint8* buf, int size) OVERRIDE; | |
30 virtual void Flush() OVERRIDE; | |
31 | |
32 private: | |
33 bool Emit(bool emit_for_unknown_size); | |
acolwell GONE FROM CHROMIUM
2013/09/05 18:29:10
docs
damienv1
2013/09/09 23:29:45
Done.
| |
34 bool ParseInternal(); | |
35 void ResetState(); | |
36 | |
37 // Bytes of the current PES. | |
38 ByteQueue pes_byte_queue_; | |
39 | |
40 // ES parser. | |
41 scoped_ptr<EsParser> es_parser_; | |
42 | |
43 // Do not start parsing before getting a unit start indicator. | |
44 bool wait_for_pusi_; | |
45 | |
46 // Used to unroll PTS and DTS. | |
47 bool previous_pts_valid_; | |
48 int64 previous_pts_; | |
49 bool previous_dts_valid_; | |
50 int64 previous_dts_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPesParser); | |
53 }; | |
54 | |
55 } // namespace mpeg2ts | |
56 } // namespace media | |
57 | |
58 #endif | |
OLD | NEW |