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

Unified 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: Address comments from patch set #3 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 side-by-side diff with in-line comments
Download patch
Index: media/mpeg2/mpeg2ts_psi.h
diff --git a/media/mpeg2/mpeg2ts_psi.h b/media/mpeg2/mpeg2ts_psi.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c7238679a9921aeb2f4fc24c01ea795a970b5c0
--- /dev/null
+++ b/media/mpeg2/mpeg2ts_psi.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_MPEG2_MPEG2TS_PSI_PARSER_H_
+#define MEDIA_MPEG2_MPEG2TS_PSI_PARSER_H_
+
+#include <vector>
damienv1 2013/09/10 04:57:01 Not needed anymore.
damienv1 2013/09/10 21:03:48 Done.
+
+#include "base/callback.h"
damienv1 2013/09/10 04:57:01 callback.h not needed.
damienv1 2013/09/10 21:03:48 Done.
+#include "base/compiler_specific.h"
+#include "media/base/byte_queue.h"
+#include "media/mpeg2/mpeg2ts_section_parser.h"
+
+namespace media {
+
+class BitReader;
+
+namespace mpeg2ts {
+
+class Mpeg2TsPsiParser : public Mpeg2TsSectionParser {
+ public:
+ Mpeg2TsPsiParser();
+ virtual ~Mpeg2TsPsiParser();
+
+ // Mpeg2TsSectionParser implementation.
+ virtual bool Parse(bool payload_unit_start_indicator,
+ const uint8* buf, int size) OVERRIDE;
+ virtual void Flush() OVERRIDE;
+ virtual void Reset() OVERRIDE;
+
+ // Parse the content of the PSI section.
+ virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
+
+ // Reset the state of the PSI section.
+ virtual void ResetPsiSection() = 0;
+
+ private:
+ bool ParseInternal(bool payload_unit_start_indicator,
+ const uint8* buf, int size);
+ void ResetPsiState();
+
+ // Bytes of the current PSI.
+ ByteQueue psi_byte_queue_;
+
+ // Do not start parsing before getting a unit start indicator.
+ bool wait_for_pusi_;
+
+ // Number of leading bytes to discard (pointer field).
+ int leading_bytes_to_discard_;
+
+ DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPsiParser);
+};
+
+} // namespace mpeg2ts
+} // namespace media
+
+#endif
+

Powered by Google App Engine
This is Rietveld 408576698