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

Unified Diff: media/mpeg2/mpeg2ts_section_parser.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_section_parser.h
diff --git a/media/mpeg2/mpeg2ts_section_parser.h b/media/mpeg2/mpeg2ts_section_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc299a329aefc75927a9d4110bf6a9da6e648da7
--- /dev/null
+++ b/media/mpeg2/mpeg2ts_section_parser.h
@@ -0,0 +1,40 @@
+// 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_SECTION_PARSER_H_
+#define MEDIA_MPEG2_MPEG2TS_SECTION_PARSER_H_
+
+namespace media {
+namespace mpeg2ts {
+
+class Mpeg2TsSectionParser {
+ public:
+ // From ISO/IEC 13818-1 or ITU H.222 spec: Table 2-3 - PID table.
+ enum SpecialPid {
+ kPidPat = 0x0,
+ kPidCat = 0x1,
+ kPidTsdt = 0x2,
+ kPidNullPacket = 0x1fff,
+ kPidMax = 0x1fff,
+ };
+
+ virtual ~Mpeg2TsSectionParser() {}
+
+ // Parse the data bytes of the TS packet.
+ // Return true if parsing is successful.
+ virtual bool Parse(bool payload_unit_start_indicator,
+ const uint8* buf, int size) = 0;
+
+ // Process bytes that have not been processed yet (pending buffers in the
+ // pipe). Flush might thus results in frame emission, as an example.
+ virtual void Flush() = 0;
+
+ // Reset the state of the parser to its initial state.
+ virtual void Reset() = 0;
+};
+
+} // namespace mpeg2ts
+} // namespace media
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698