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

Side by Side Diff: media/mp2t/ts_section_pes.h

Issue 23566013: Mpeg2 TS stream parser for media source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clang warning fix Created 7 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
« no previous file with comments | « media/mp2t/ts_section_pat.cc ('k') | media/mp2t/ts_section_pes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_MP2T_TS_SECTION_PES_H_
6 #define MEDIA_MP2T_TS_SECTION_PES_H_
7
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"
13
14 namespace media {
15 namespace mp2t {
16
17 class EsParser;
18
19 class TsSectionPes : public TsSection {
20 public:
21 explicit TsSectionPes(scoped_ptr<EsParser> es_parser);
22 virtual ~TsSectionPes();
23
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;
29
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);
36
37 // Parse a PES packet, return true if successful.
38 bool ParseInternal(const uint8* raw_pes, int raw_pes_size);
39
40 void ResetPesState();
41
42 // Bytes of the current PES.
43 ByteQueue pes_byte_queue_;
44
45 // ES parser.
46 scoped_ptr<EsParser> es_parser_;
47
48 // Do not start parsing before getting a unit start indicator.
49 bool wait_for_pusi_;
50
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_;
56
57 DISALLOW_COPY_AND_ASSIGN(TsSectionPes);
58 };
59
60 } // namespace mp2t
61 } // namespace media
62
63 #endif
64
OLDNEW
« no previous file with comments | « media/mp2t/ts_section_pat.cc ('k') | media/mp2t/ts_section_pes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698