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

Unified Diff: media/formats/mp2t/mp2t_stream_parser.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/mp2t_stream_parser.h
diff --git a/media/formats/mp2t/mp2t_stream_parser.h b/media/formats/mp2t/mp2t_stream_parser.h
index 2bd7fa5941f0774920804a9e2000d426de92bceb..22bacc0e73fc8a9d9a6fc10d705d2718b7abf14f 100644
--- a/media/formats/mp2t/mp2t_stream_parser.h
+++ b/media/formats/mp2t/mp2t_stream_parser.h
@@ -19,10 +19,12 @@
namespace media {
+class DecryptConfig;
class StreamParserBuffer;
namespace mp2t {
+class Descriptors;
class PidState;
class MEDIA_EXPORT Mp2tStreamParser : public StreamParser {
@@ -44,6 +46,7 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser {
private:
typedef std::map<int, PidState*> PidMap;
+ typedef std::pair<int, PidState*> PidMapElement;
struct BufferQueueWithConfig {
BufferQueueWithConfig(bool is_cfg_sent,
@@ -66,7 +69,11 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser {
// Possible values for |stream_type| are defined in:
// ISO-13818.1 / ITU H.222 Table 2.34 "Stream type assignments".
// |pes_pid| is part of the Program Map Table refered by |pmt_pid|.
- void RegisterPes(int pmt_pid, int pes_pid, int stream_type);
+ // Some stream types are qualified by additional |descriptors|.
+ void RegisterPes(int pmt_pid,
+ int pes_pid,
+ int stream_type,
+ const Descriptors& descriptors);
// Since the StreamParser interface allows only one audio & video streams,
// an automatic PID filtering should be applied to select the audio & video
@@ -93,6 +100,24 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser {
scoped_refptr<StreamParserBuffer> stream_parser_buffer);
bool EmitRemainingBuffers();
+#ifdef ENABLE_HLS_SAMPLE_AES
+ // Register the parser for CA Table.
+ PidMap::iterator RegisterCat();
+ void UnregisterCat();
+
+ // Register the PIDs for the Cenc packets (CENC-ECM and CENC-PSSH).
+ void RegisterCencPids(int ca_pid, int pssh_pid);
+ void UnregisterCencPids();
+
+ // Register the DecryptConfig (parsed from CENC-ECM).
+ void RegisterDecryptConfig(const DecryptConfig& config);
+
+ // Register the PSSH (parsed from CENC-PSSH).
+ void RegisterPsshBoxes(const std::vector<uint8> init_data);
+
+ const DecryptConfig& GetDecryptConfig() { return *decrypt_config_.get(); }
+#endif
+
// List of callbacks.
InitCB init_cb_;
NewConfigCB config_cb_;
@@ -130,6 +155,10 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser {
// So the unroller is global between PES pids.
TimestampUnroller timestamp_unroller_;
+#ifdef ENABLE_HLS_SAMPLE_AES
+ scoped_ptr<DecryptConfig> decrypt_config_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser);
};

Powered by Google App Engine
This is Rietveld 408576698