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

Unified Diff: media/formats/mp2t/es_parser_test_helper.h

Issue 399433003: Mpeg2 TS - Fail when no valid timestamp in the ADTS parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/formats/mp2t/es_parser_test_helper.h
diff --git a/media/formats/mp2t/es_parser_test_helper.h b/media/formats/mp2t/es_parser_test_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..df0f42be52a48023dd8ea56a918fa428a56dc65d
--- /dev/null
+++ b/media/formats/mp2t/es_parser_test_helper.h
@@ -0,0 +1,46 @@
+// Copyright 2014 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_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_
+#define MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_
+
+#include <vector>
+
+#include "base/time/time.h"
+
+namespace media {
+namespace mp2t {
+class EsParser;
+
+struct Packet {
+ Packet();
+
+ // Offset in the stream.
+ size_t offset;
+
+ // Size of the packet.
+ size_t size;
+
+ // Timestamp of the packet.
+ base::TimeDelta pts;
+};
+
+// Compute the size of each packet assuming packets are given in stream order
+// and the last packet covers the end of the stream.
+void ComputePacketSize(std::vector<Packet>* packets, size_t stream_size);
+
+// Process the PES packets.
+// When |force_timing| is true, even the invalid negative timestamps will be
+// given to the ES parser.
+// Return true if successful, false otherwise.
+bool ProcessPesPackets(
+ EsParser* es_parser,
+ const std::vector<uint8>& stream,
+ const std::vector<Packet>& pes_packets,
+ bool force_timing);
+
+} // namespace mp2t
+} // namespace media
+
+#endif // MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698