FFmpeg
Loading...
Searching...
No Matches
hls_sample_encryption.h
Go to the documentation of this file.
1/*
2 * Apple HTTP Live Streaming Sample Encryption/Decryption
3 *
4 * Copyright (c) 2021 Nachiket Tarate
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23/**
24 * @file
25 * Apple HTTP Live Streaming Sample Encryption
26 * https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption
27 */
28
29#ifndef AVFORMAT_HLS_SAMPLE_ENCRYPTION_H
30#define AVFORMAT_HLS_SAMPLE_ENCRYPTION_H
31
32#include <stddef.h>
33#include <stdint.h>
34
35#include "libavcodec/codec_id.h"
36#include "libavcodec/packet.h"
37#include "avformat.h"
38
39
40#define HLS_MAX_ID3_TAGS_DATA_LEN 138
41#define HLS_MAX_AUDIO_SETUP_DATA_LEN 10
42
43typedef struct HLSCryptoContext {
44 struct AVAES *aes_ctx;
45 uint8_t key[16];
46 uint8_t iv[16];
48
57
58
59void ff_hls_senc_read_audio_setup_info(HLSAudioSetupInfo *info, const uint8_t *buf, size_t size);
60
62
64
65#endif /* AVFORMAT_HLS_SAMPLE_ENCRYPTION_H */
Main libavformat public API header.
static AVPacket * pkt
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition codec_id.h:47
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
Definition defs.h:40
int ff_hls_senc_decrypt_frame(enum AVCodecID codec_id, HLSCryptoContext *crypto_ctx, AVPacket *pkt)
int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info)
#define HLS_MAX_AUDIO_SETUP_DATA_LEN
void ff_hls_senc_read_audio_setup_info(HLSAudioSetupInfo *info, const uint8_t *buf, size_t size)
This structure stores compressed data.
Definition packet.h:580
Stream structure.
Definition avformat.h:766
uint8_t setup_data[HLS_MAX_AUDIO_SETUP_DATA_LEN+AV_INPUT_BUFFER_PADDING_SIZE]
int size
enum AVCodecID codec_id