Go to the documentation of this file.
67 if (
info->codec_tag ==
MKTAG(
'z',
'a',
'a',
'c'))
69 else if (
info->codec_tag ==
MKTAG(
'z',
'a',
'c',
'3'))
71 else if (
info->codec_tag ==
MKTAG(
'z',
'e',
'c',
'3'))
79 info->version = *buf++;
80 info->setup_data_length = *buf++;
82 if (
info->setup_data_length >
size - 8)
88 memcpy(
info->setup_data, buf,
info->setup_data_length);
122 int data_rate, fscod, acmod, lfeon;
160 while (i < nalu->length) {
175 const uint8_t *nalu_start =
ctx->buf_ptr;
177 if (
ctx->buf_end -
ctx->buf_ptr >= 4 &&
AV_RB32(
ctx->buf_ptr) == 0x00000001)
179 else if (
ctx->buf_end -
ctx->buf_ptr >= 3 &&
AV_RB24(
ctx->buf_ptr) == 0x000001)
186 while (
ctx->buf_ptr <
ctx->buf_end) {
187 if (
ctx->buf_end -
ctx->buf_ptr >= 4 &&
AV_RB32(
ctx->buf_ptr) == 0x00000001)
189 else if (
ctx->buf_end -
ctx->buf_ptr >= 3 &&
AV_RB24(
ctx->buf_ptr) == 0x000001)
216 rem_bytes = nalu->
length - 32;
218 memcpy(iv, crypto_ctx->
iv, 16);
220 while (rem_bytes > 0) {
221 if (rem_bytes > 16) {
227 rem_bytes -=
FFMIN(144, rem_bytes);
241 memset(&
ctx, 0,
sizeof(
ctx));
247 while (
ctx.buf_ptr <
ctx.buf_end) {
248 memset(&nalu, 0,
sizeof(nalu));
252 if ((nalu.
type == 0x01 || nalu.
type == 0x05) && nalu.
length > 48) {
253 int encrypted_nalu_length = nalu.
length;
257 move_nalu = nalu.
length != encrypted_nalu_length;
276 while (
ctx->buf_ptr <
ctx->buf_end - 1) {
277 if (*
ctx->buf_ptr == 0xFF && (*(
ctx->buf_ptr + 1) & 0xF0) == 0xF0)
282 if (
ctx->buf_ptr >=
ctx->buf_end - 1)
285 frame->data = (uint8_t*)
ctx->buf_ptr;
306 while (
ctx->buf_ptr <
ctx->buf_end - 1) {
307 if (*
ctx->buf_ptr == 0x0B && *(
ctx->buf_ptr + 1) == 0x77)
312 if (
ctx->buf_ptr >=
ctx->buf_end - 1)
315 frame->data = (uint8_t*)
ctx->buf_ptr;
316 frame->header_length = 0;
346 int num_of_encrypted_blocks;
354 num_of_encrypted_blocks = (
frame->length -
frame->header_length - 16)/16;
367 memset(&
ctx, 0,
sizeof(
ctx));
371 while (
ctx.buf_ptr <
ctx.buf_end) {
376 if (
frame.length -
frame.header_length > 31) {
static int get_next_adts_frame(CodecParserContext *ctx, AudioFrame *frame)
int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt)
Initialize an AVAES context.
const uint16_t ff_ac3_channel_layout_tab[8]
Map audio coding mode (acmod) to channel layout mask.
static int decrypt_video_frame(HLSCryptoContext *crypto_ctx, AVPacket *pkt)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define AV_AAC_ADTS_HEADER_SIZE
static int get_next_sync_frame(enum AVCodecID codec_id, CodecParserContext *ctx, AudioFrame *frame)
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
static int get_next_ac3_eac3_sync_frame(CodecParserContext *ctx, AudioFrame *frame)
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const int eac3_sample_rate_tab[]
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
void ff_hls_senc_read_audio_setup_info(HLSAudioSetupInfo *info, const uint8_t *buf, size_t size)
static int get_next_nal_unit(CodecParserContext *ctx, NALUnit *nalu)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define AV_CH_LOW_FREQUENCY
static const uint16_t mask[17]
FF_ENABLE_DEPRECATION_WARNINGS int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int decrypt_audio_frame(enum AVCodecID codec_id, HLSCryptoContext *crypto_ctx, AVPacket *pkt)
void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
Encrypt or decrypt a buffer using a previously initialized context.
AVChannelLayout ch_layout
Audio only.
int sample_rate
Audio only.
AVCodecID
Identify the syntax and semantics of the bitstream.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
int ff_hls_senc_decrypt_frame(enum AVCodecID codec_id, HLSCryptoContext *crypto_ctx, AVPacket *pkt)
#define i(width, name, range_min, range_max)
#define HLS_MAX_AUDIO_SETUP_DATA_LEN
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info)
static void remove_scep_3_bytes(NALUnit *nalu)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
static int decrypt_sync_frame(enum AVCodecID codec_id, HLSCryptoContext *crypto_ctx, AudioFrame *frame)
static int decrypt_nal_unit(HLSCryptoContext *crypto_ctx, NALUnit *nalu)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24