Files
ffmpeg-patched/libavformat/hls_sample_encryption.h
gx dcecd42de4 FFmpeg 7.1 + cuframes input demuxer
Snapshot FFmpeg n7.1 (release tag) с применённым patch'ем для cuframes
input format. Используется как FFMPEG_REPO_OVERRIDE в NickM-27/FFmpeg-Builds
fork для статической сборки patched binary под Frigate (Debian 12 / glibc 2.36).

Apply changes:
  + libavformat/cuframesdec.c (новый — реализация демуксера)
  M libavformat/Makefile (CONFIG_CUFRAMES_DEMUXER target)
  M libavformat/allformats.c (extern declaration)
  M configure (--enable-libcuframes option + dep check)

Patch source: https://git.goldix.org/gx/cuframes (filter/ffmpeg-7.1-cuframes-demuxer.patch)

History сброшена (snapshot вместо fork) потому что upstream shallow clone
не позволял push в gitea. Полная история FFmpeg — на github.com/FFmpeg/FFmpeg n7.1.
2026-05-17 11:43:10 +01:00

67 lines
2.1 KiB
C

/*
* Apple HTTP Live Streaming Sample Encryption/Decryption
*
* Copyright (c) 2021 Nachiket Tarate
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Apple HTTP Live Streaming Sample Encryption
* https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption
*/
#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 /* AVFORMAT_HLS_SAMPLE_ENCRYPTION_H */