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

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

Issue 1517473002: Support HLS MPEG2 TS with SAMPLE-AES encryption. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@encryption_scheme
Patch Set: tidying up prior to review Created 5 years 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/descriptors.h
diff --git a/media/formats/mp2t/descriptors.h b/media/formats/mp2t/descriptors.h
new file mode 100644
index 0000000000000000000000000000000000000000..03c6e86789bfe2e645c070aac64685fc959a548f
--- /dev/null
+++ b/media/formats/mp2t/descriptors.h
@@ -0,0 +1,68 @@
+// Copyright 2015 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_DESCRIPTORS_H_
+#define MEDIA_FORMATS_MP2T_DESCRIPTORS_H_
+
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/basictypes.h"
+
+namespace media {
+
+class BitReader;
+
+namespace mp2t {
+
+// Representation of a list of descriptors, used in the MPEG-2 Systems standard
ddorwin 2015/12/10 20:10:58 Is there a reason we didn't need this before? Is t
dougsteed 2015/12/14 22:51:46 Part 9 does require a descriptor, and so also does
+// to extend the definitions of programs or program elements. While the standard
+// appears to permit multiple descriptors in such a list to have the same tag
+// value, the implementation herein will not support this.
+class Descriptors {
+ public:
+ Descriptors();
+ ~Descriptors();
+
+ // Attempts to read a (possibly empty) list of descriptors from the |reader|.
+ // If |size| > 0, the descriptors must occupy exactly |size| bytes, Otherwise,
+ // the descriptors should use all available bits from the reader.
+ bool Read(BitReader* reader, int size);
+
+ // Indicates whether a Registration descriptor is present. If so, the
+ // |format_identifier| and |additional_info| values are populated with the
+ // contents of the descriptor.
+ bool HasRegistrationDescriptor(int64* format_identifier,
+ std::string* additional_info) const;
+
+ // Indicates whether a CA descriptor is present. If so, the |system_id|,
+ // |pid|, and |private_data| values are populated with the contents of the
+ // descriptor.
+ bool HasCADescriptor(int* system_id,
+ int* pid,
+ std::string* private_data) const;
+
+ // Indicates whether a CA descriptor is present, and if so, whether it is
+ // of the type defined by ISO/IEC 23001-9:2014 (i.e. with a specific
+ // system_id value and layout of the private_data). If so, the |ca_pid| and
+ // |pssh_pid| are populated with the contents of the descriptor.
+ bool HasCADescriptorCenc(int* ca_pid, int* pssh_pid) const;
+
+ // Indicates whether a Private Data Indicator descriptor is present with a
+ // particular |value|.
+ bool HasPrivateDataIndicator(int64 value) const;
+
+ private:
+ typedef std::pair<int, std::string> Descriptor;
+ std::map<int, std::string> descriptors_;
+
+ // Allow copy and assign so that it can be used in a std C++ container.
+};
+
+} // namespace mp2t
+} // namespace media
+
+#endif // MEDIA_FORMATS_MP2T_DESCRIPTOR_LIST_H_

Powered by Google App Engine
This is Rietveld 408576698