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_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/mpeg2/mpeg2ts_section_parser.h" |
| 13 |
| 14 namespace media { |
| 15 |
| 16 class BitReader; |
| 17 |
| 18 namespace mpeg2ts { |
| 19 |
| 20 class Mpeg2TsPsiParser : public Mpeg2TsSectionParser { |
| 21 public: |
| 22 Mpeg2TsPsiParser(); |
| 23 virtual ~Mpeg2TsPsiParser(); |
| 24 |
| 25 // Mpeg2TsSectionParser implementation. |
| 26 virtual bool Parse(bool payload_unit_start_indicator, |
| 27 const uint8* buf, int size) OVERRIDE; |
| 28 virtual void Flush() OVERRIDE; |
| 29 |
| 30 // Parse the content of the PSI section. |
| 31 virtual bool ParsePsiSection(BitReader* bit_reader) = 0; |
| 32 |
| 33 private: |
| 34 bool ParseInternal(bool payload_unit_start_indicator, |
| 35 const uint8* buf, int size); |
| 36 void ResetState(); |
| 37 |
| 38 // Bytes of the current PSI. |
| 39 std::vector<uint8> raw_psi_; |
| 40 |
| 41 // Do not start parsing before getting a unit start indicator. |
| 42 bool wait_for_pusi_; |
| 43 |
| 44 // Number of leading bytes to discard (pointer field). |
| 45 int leading_bytes_to_discard_; |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPsiParser); |
| 48 }; |
| 49 |
| 50 } // namespace mpeg2ts |
| 51 } // namespace media |
| 52 |
| 53 #endif |
OLD | NEW |