avformat/dashdec: accept and relay CENC decryption key
Allows to process CENC-encrypted media segments. Option arg syntax is same as that for option decryption_key in MOV demuxer
This commit is contained in:
parent
b90341d1d5
commit
8b64d8d9aa
@ -274,6 +274,17 @@ which streams to actually receive.
|
|||||||
Each stream mirrors the @code{id} and @code{bandwidth} properties from the
|
Each stream mirrors the @code{id} and @code{bandwidth} properties from the
|
||||||
@code{<Representation>} as metadata keys named "id" and "variant_bitrate" respectively.
|
@code{<Representation>} as metadata keys named "id" and "variant_bitrate" respectively.
|
||||||
|
|
||||||
|
@subsection Options
|
||||||
|
|
||||||
|
This demuxer accepts the following option:
|
||||||
|
|
||||||
|
@table @option
|
||||||
|
|
||||||
|
@item cenc_decryption_key
|
||||||
|
16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
|
||||||
|
|
||||||
|
@end table
|
||||||
|
|
||||||
@section imf
|
@section imf
|
||||||
|
|
||||||
Interoperable Master Format demuxer.
|
Interoperable Master Format demuxer.
|
||||||
|
@ -150,6 +150,7 @@ typedef struct DASHContext {
|
|||||||
char *allowed_extensions;
|
char *allowed_extensions;
|
||||||
AVDictionary *avio_opts;
|
AVDictionary *avio_opts;
|
||||||
int max_url_size;
|
int max_url_size;
|
||||||
|
char *cenc_decryption_key;
|
||||||
|
|
||||||
/* Flags for init section*/
|
/* Flags for init section*/
|
||||||
int is_init_section_common_video;
|
int is_init_section_common_video;
|
||||||
@ -1893,6 +1894,9 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation
|
|||||||
pls->ctx->pb = &pls->pb.pub;
|
pls->ctx->pb = &pls->pb.pub;
|
||||||
pls->ctx->io_open = nested_io_open;
|
pls->ctx->io_open = nested_io_open;
|
||||||
|
|
||||||
|
if (c->cenc_decryption_key)
|
||||||
|
av_dict_set(&in_fmt_opts, "decryption_key", c->cenc_decryption_key, AV_OPT_FLAG_DECODING_PARAM);
|
||||||
|
|
||||||
// provide additional information from mpd if available
|
// provide additional information from mpd if available
|
||||||
ret = avformat_open_input(&pls->ctx, "", in_fmt, &in_fmt_opts); //pls->init_section->url
|
ret = avformat_open_input(&pls->ctx, "", in_fmt, &in_fmt_opts); //pls->init_section->url
|
||||||
av_dict_free(&in_fmt_opts);
|
av_dict_free(&in_fmt_opts);
|
||||||
@ -2344,6 +2348,7 @@ static const AVOption dash_options[] = {
|
|||||||
OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
|
OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
|
||||||
{.str = "aac,m4a,m4s,m4v,mov,mp4,webm,ts"},
|
{.str = "aac,m4a,m4s,m4v,mov,mp4,webm,ts"},
|
||||||
INT_MIN, INT_MAX, FLAGS},
|
INT_MIN, INT_MAX, FLAGS},
|
||||||
|
{ "cenc_decryption_key", "Media decryption key (hex)", OFFSET(cenc_decryption_key), AV_OPT_TYPE_STRING, {.str = NULL}, INT_MIN, INT_MAX, .flags = FLAGS },
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user