|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef AVFORMAT_HLS_SAMPLE_ENCRYPTION_H |
|
#define AVFORMAT_HLS_SAMPLE_ENCRYPTION_H |
|
|
|
#include <stddef.h> |
|
#include <stdint.h> |
|
|
|
#include "libavcodec/codec_id.h" |
|
#include "libavcodec/packet.h" |
|
#include "avformat.h" |
|
|
|
|
|
#define HLS_MAX_ID3_TAGS_DATA_LEN 138 |
|
#define HLS_MAX_AUDIO_SETUP_DATA_LEN 10 |
|
|
|
typedef struct HLSCryptoContext { |
|
struct AVAES *aes_ctx; |
|
uint8_t key[16]; |
|
uint8_t iv[16]; |
|
} HLSCryptoContext; |
|
|
|
typedef struct HLSAudioSetupInfo { |
|
enum AVCodecID codec_id; |
|
uint32_t codec_tag; |
|
uint16_t priming; |
|
uint8_t version; |
|
uint8_t setup_data_length; |
|
uint8_t setup_data[HLS_MAX_AUDIO_SETUP_DATA_LEN]; |
|
} HLSAudioSetupInfo; |
|
|
|
|
|
void ff_hls_senc_read_audio_setup_info(HLSAudioSetupInfo *info, const uint8_t *buf, size_t size); |
|
|
|
int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info); |
|
|
|
int ff_hls_senc_decrypt_frame(enum AVCodecID codec_id, HLSCryptoContext *crypto_ctx, AVPacket *pkt); |
|
|
|
#endif |
|
|
|
|