You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
The aim of this is twofold: a) Clang warns when setting a deprecated
field in a definition and because several of the widely set
AVCodec fields are deprecated, one gets several hundred warnings
from Clang for an ordinary build. Yet fortunately Clang (unlike GCC)
allows to disable deprecation warnings inside a definition, so
that one can create simple macros to set these fields that also suppress
deprecation warnings for Clang. This has already been done in
fdff1b9cbf for AVCodec.channel_layouts.
b) Using macros will allow to easily migrate these fields to internal ones.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
95 lines
2.8 KiB
C
95 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,
|
|
CODEC_SAMPLEFMTS(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),
|
|
FF_CODEC_ENCODE_CB(null_encode),
|
|
};
|
|
#endif
|
|
|
|
#endif
|