Files
ffmpeg-patched/libavcodec/null.c
T
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

98 lines
2.8 KiB
C

/*
* Null codecs
*
* 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
*/
#include "config_components.h"
#include "codec_internal.h"
#include "decode.h"
#include "encode.h"
#if CONFIG_VNULL_DECODER || CONFIG_ANULL_DECODER
static int null_decode(AVCodecContext *avctx, AVFrame *frame,
int *got_frame, AVPacket *avpkt)
{
*got_frame = 0;
return avpkt->size;
}
#if CONFIG_VNULL_DECODER
const FFCodec ff_vnull_decoder = {
.p.name = "vnull",
CODEC_LONG_NAME("null video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_VNULL,
.p.capabilities = AV_CODEC_CAP_DR1,
FF_CODEC_DECODE_CB(null_decode),
};
#endif
#if CONFIG_ANULL_DECODER
const FFCodec ff_anull_decoder = {
.p.name = "anull",
CODEC_LONG_NAME("null audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ANULL,
.p.capabilities = AV_CODEC_CAP_DR1,
FF_CODEC_DECODE_CB(null_decode),
};
#endif
#endif
#if CONFIG_VNULL_ENCODER || CONFIG_ANULL_ENCODER
static int null_encode(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
*got_packet = 0;
return 0;
}
#if CONFIG_VNULL_ENCODER
const FFCodec ff_vnull_encoder = {
.p.name = "vnull",
CODEC_LONG_NAME("null video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_VNULL,
FF_CODEC_ENCODE_CB(null_encode),
};
#endif
#if CONFIG_ANULL_ENCODER
const FFCodec ff_anull_encoder = {
.p.name = "anull",
CODEC_LONG_NAME("null audio"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_ANULL,
.p.capabilities = AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
.p.sample_fmts = (const enum AVSampleFormat[]){
AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64P,
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
AV_SAMPLE_FMT_NONE,
},
FF_CODEC_ENCODE_CB(null_encode),
};
#endif
#endif