56 #define OFFSET(x) offsetof(Dummy12Context, x) 57 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM 80 .
name =
"dummy_v1_codec",
92 .
name =
"dummy_v2_codec",
104 .
name =
"dummy_v3_codec",
115 .
name =
"dummy_v4_codec",
125 printf(
"%-14s: %dx%d prv: %s",
134 printf(
" opts: %"PRId64
" %s", i64, str);
143 printf(
"%s -> %s\nclosed:\n", c1 ? c1->
name :
"NULL", c2 ? c2->
name :
"NULL");
160 fprintf(stderr,
"avcodec_open2 failed\n");
186 for (i = 0; dummy_codec[
i]; i++)
189 printf(
"testing avcodec_copy_context()\n");
192 test_copy(dummy_codec[i], dummy_codec[j]);
const struct AVCodec * codec
static AVCodec dummy_v3_encoder
This structure describes decoded (raw) audio or video data.
#define LIBAVUTIL_VERSION_INT
const char * av_default_item_name(void *ptr)
Return the context name.
#define FF_ARRAY_ELEMS(a)
static void test_copy(const AVCodec *c1, const AVCodec *c2)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static AVCodec dummy_v1_encoder
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
av_cold void avcodec_register(AVCodec *codec)
Register the codec codec and initialize libavcodec.
static int dummy_init(AVCodecContext *ctx)
const char * name
Name of the codec implementation.
static void test_copy_print_codec(const AVCodecContext *ctx)
static const AVClass dummy_v1_class
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
int width
picture width / height.
static const AVOption dummy_options[]
static const AVClass dummy_v2_class
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
static AVCodec dummy_v2_encoder
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
void avcodec_free_context(AVCodecContext **pavctx)
Free the codec context and everything associated with it and write NULL to the provided pointer...
main external API structure.
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
static int dummy_close(AVCodecContext *ctx)
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
const AVClass * priv_class
AVClass for the private context.
static AVCodec dummy_v4_encoder
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
printf("static const uint8_t my_array[100] = {\n")
Options definition for AVCodecContext.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
This structure stores compressed data.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
static int dummy_encode(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)