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

Side by Side Diff: media/mpeg2/mpeg2ts_psi.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_PSI_PARSER_H_
6 #define MEDIA_MPEG2_MPEG2TS_PSI_PARSER_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
12 #include "media/base/byte_queue.h"
13 #include "media/mpeg2/mpeg2ts_section_parser.h"
14
15 namespace media {
16
17 class BitReader;
18
19 namespace mpeg2ts {
20
21 class Mpeg2TsPsiParser : public Mpeg2TsSectionParser {
22 public:
23 Mpeg2TsPsiParser();
24 virtual ~Mpeg2TsPsiParser();
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 // Parse the content of the PSI section.
32 virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
33
34 private:
35 bool ParseInternal(bool payload_unit_start_indicator,
36 const uint8* buf, int size);
37 void ResetState();
38
39 // Bytes of the current PSI.
40 ByteQueue psi_byte_queue_;
41
42 // Do not start parsing before getting a unit start indicator.
43 bool wait_for_pusi_;
44
45 // Number of leading bytes to discard (pointer field).
46 int leading_bytes_to_discard_;
47
48 DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPsiParser);
49 };
50
51 } // namespace mpeg2ts
52 } // namespace media
53
54 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698