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/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 |
| 55 |
OLD | NEW |