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

Side by Side Diff: media/mpeg2/mpeg2ts_pes.h

Issue 23566013: Mpeg2 TS stream parser for media source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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_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/mpeg2/mpeg2ts_section_parser.h"
15
16 namespace media {
17 namespace mpeg2ts {
18
19 class EsParser;
20
21 class Mpeg2TsPesParser : public Mpeg2TsSectionParser {
22 public:
23 explicit Mpeg2TsPesParser(EsParser* es_parser);
24 virtual ~Mpeg2TsPesParser();
25
26 // Mpeg2TsSectionParser implementation.
27 virtual bool Parse(bool payload_unit_start_indicator,
28 const uint8* buf, int size) OVERRIDE;
29 virtual void Flush() OVERRIDE;
30
31 private:
32 bool InternalParse();
33
34 // Bytes of the current PES.
35 std::vector<uint8> raw_pes_;
36
37 // ES parser.
38 scoped_ptr<EsParser> es_parser_;
39
40 // Do not start parsing before getting a unit start indicator.
41 bool wait_for_unit_start_;
42
43 // Used to unroll PTS and DTS.
44 bool previous_pts_valid_;
45 int64 previous_pts_;
46 bool previous_dts_valid_;
47 int64 previous_dts_;
48
49 DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPesParser);
50 };
51
52 } // namespace mpeg2ts
53 } // namespace media
54
55 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698