Removed unused VideoCaptureCapability parameters.
[chromium-blink-merge.git] / media / mp2t / ts_section_pes.h
blobb80473a58a573b70ba960e85a68b00955350c853
1 // Copyright 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.
5 #ifndef MEDIA_MP2T_TS_SECTION_PES_H_
6 #define MEDIA_MP2T_TS_SECTION_PES_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "media/base/byte_queue.h"
12 #include "media/mp2t/ts_section.h"
14 namespace media {
15 namespace mp2t {
17 class EsParser;
19 class TsSectionPes : public TsSection {
20 public:
21 explicit TsSectionPes(scoped_ptr<EsParser> es_parser);
22 virtual ~TsSectionPes();
24 // TsSection implementation.
25 virtual bool Parse(bool payload_unit_start_indicator,
26 const uint8* buf, int size) OVERRIDE;
27 virtual void Flush() OVERRIDE;
28 virtual void Reset() OVERRIDE;
30 private:
31 // Emit a reassembled PES packet.
32 // Return true if successful.
33 // |emit_for_unknown_size| is used to force emission for PES packets
34 // whose size is unknown.
35 bool Emit(bool emit_for_unknown_size);
37 // Parse a PES packet, return true if successful.
38 bool ParseInternal(const uint8* raw_pes, int raw_pes_size);
40 void ResetPesState();
42 // Bytes of the current PES.
43 ByteQueue pes_byte_queue_;
45 // ES parser.
46 scoped_ptr<EsParser> es_parser_;
48 // Do not start parsing before getting a unit start indicator.
49 bool wait_for_pusi_;
51 // Used to unroll PTS and DTS.
52 bool previous_pts_valid_;
53 int64 previous_pts_;
54 bool previous_dts_valid_;
55 int64 previous_dts_;
57 DISALLOW_COPY_AND_ASSIGN(TsSectionPes);
60 } // namespace mp2t
61 } // namespace media
63 #endif