Chromium Code Reviews| 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 bc24377c1737ed9d637e288d203b083a214b6f7b..c04be21d4702b8b54deec072c9f37e089b6c23e3 100644 |
| --- a/media/formats/mp2t/mp2t_stream_parser.h |
| +++ b/media/formats/mp2t/mp2t_stream_parser.h |
| @@ -16,6 +16,7 @@ |
| #include "media/base/audio_decoder_config.h" |
| #include "media/base/byte_queue.h" |
| #include "media/base/decrypt_config.h" |
| +#include "media/base/encryption_scheme.h" |
| #include "media/base/media_export.h" |
| #include "media/base/stream_parser.h" |
| #include "media/base/video_decoder_config.h" |
| @@ -30,6 +31,7 @@ class StreamParserBuffer; |
| namespace mp2t { |
| class Descriptors; |
| +class EsParser; |
| class PidState; |
| class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { |
| @@ -71,10 +73,9 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { |
| // Callback invoked to register a PES pid. |
| // 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|. |
| + // |pes_pid| is part of the Program Map Table.. |
|
servolk
2017/04/04 20:08:18
nit: extra dot at the end
dougsteed
2017/04/26 20:34:14
Done.
|
| // Some stream types are qualified by additional |descriptors|. |
| - void RegisterPes(int pmt_pid, |
| - int pes_pid, |
| + void RegisterPes(int pes_pid, |
| int stream_type, |
| const Descriptors& descriptors); |
| @@ -103,6 +104,18 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { |
| scoped_refptr<StreamParserBuffer> stream_parser_buffer); |
| bool EmitRemainingBuffers(); |
| + // Functions used to test stream type and create parsers as appropriate. |
| + std::unique_ptr<EsParser> MaybeCreateH264Parser( |
| + int pes_pid, |
| + int stream_type, |
| + const Descriptors& descriptors); |
| + std::unique_ptr<EsParser> MaybeCreateAACParser( |
| + int pes_pid, |
| + int stream_type, |
| + const Descriptors& descriptors); |
| + std::unique_ptr<EsParser> MaybeCreateMpeg1AudioParser(int pes_pid, |
| + int stream_type); |
| + |
| #if BUILDFLAG(ENABLE_HLS_SAMPLE_AES) |
| std::unique_ptr<PidState> MakeCatPidState(); |
| void UnregisterCat(); |
| @@ -111,6 +124,11 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { |
| void RegisterCencPids(int ca_pid, int pssh_pid); |
| void UnregisterCencPids(); |
| + // Register a default encryption scheme to be used for decoder configs. This |
| + // value is only used in the absence of explicit encryption metadata, as might |
| + // be the case during an unencrypted portion of a live stream. |
| + void RegisterEncryptionScheme(const EncryptionScheme& scheme); |
| + |
| // Register the DecryptConfig (parsed from CENC-ECM). |
| void RegisterDecryptConfig(const DecryptConfig& config); |
| @@ -158,6 +176,7 @@ class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { |
| TimestampUnroller timestamp_unroller_; |
| #if BUILDFLAG(ENABLE_HLS_SAMPLE_AES) |
| + EncryptionScheme initial_scheme_; |
| std::unique_ptr<DecryptConfig> decrypt_config_; |
| #endif |