mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Update ffmpeg
This commit is contained in:
@@ -56,6 +56,10 @@ enum { kCMVideoCodecType_HEVC = 'hvc1' };
|
||||
enum { kCMVideoCodecType_VP9 = 'vp09' };
|
||||
#endif
|
||||
|
||||
#if !HAVE_KCMVIDEOCODECTYPE_AV1
|
||||
enum { kCMVideoCodecType_AV1 = 'av01' };
|
||||
#endif
|
||||
|
||||
#define VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING 12
|
||||
|
||||
typedef struct VTHWFrame {
|
||||
@@ -92,6 +96,26 @@ int ff_videotoolbox_buffer_copy(VTContext *vtctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_videotoolbox_buffer_append(VTContext *vtctx,
|
||||
const uint8_t *buffer,
|
||||
uint32_t size)
|
||||
{
|
||||
void *tmp;
|
||||
|
||||
tmp = av_fast_realloc(vtctx->bitstream,
|
||||
&vtctx->allocated_size,
|
||||
vtctx->bitstream_size + size);
|
||||
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
vtctx->bitstream = tmp;
|
||||
memcpy(vtctx->bitstream + vtctx->bitstream_size, buffer, size);
|
||||
vtctx->bitstream_size += size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame)
|
||||
{
|
||||
int ret;
|
||||
@@ -846,6 +870,13 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
|
||||
if (data)
|
||||
CFDictionarySetValue(avc_info, CFSTR("vpcC"), data);
|
||||
break;
|
||||
#endif
|
||||
#if CONFIG_AV1_VIDEOTOOLBOX_HWACCEL
|
||||
case kCMVideoCodecType_AV1 :
|
||||
data = ff_videotoolbox_av1c_extradata_create(avctx);
|
||||
if (data)
|
||||
CFDictionarySetValue(avc_info, CFSTR("av1C"), data);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
@@ -912,6 +943,9 @@ static int videotoolbox_start(AVCodecContext *avctx)
|
||||
case AV_CODEC_ID_VP9 :
|
||||
videotoolbox->cm_codec_type = kCMVideoCodecType_VP9;
|
||||
break;
|
||||
case AV_CODEC_ID_AV1 :
|
||||
videotoolbox->cm_codec_type = kCMVideoCodecType_AV1;
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user