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");
159 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
This structure describes decoded (raw) audio or video data.
#define LIBAVUTIL_VERSION_INT
static AVCodec dummy_v3_encoder
static int dummy_encode(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
static const AVOption dummy_options[]
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static AVCodec dummy_v4_encoder
static const AVClass dummy_v2_class
int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
const char * name
Name of the codec implementation.
static void test_copy_print_codec(const AVCodecContext *ctx)
static AVCodec dummy_v2_encoder
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
int width
picture width / height.
static AVCodec dummy_v1_encoder
#define FF_ARRAY_ELEMS(a)
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
void avcodec_free_context(AVCodecContext **avctx)
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.
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
static const AVClass dummy_v1_class
const AVClass * priv_class
AVClass for the private context.
static void test_copy(const AVCodec *c1, const AVCodec *c2)
static int dummy_close(AVCodecContext *ctx)
static int dummy_init(AVCodecContext *ctx)
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
Options definition for AVCodecContext.
void avcodec_register(AVCodec *codec)
Register the codec codec and initialize libavcodec.
This structure stores compressed data.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)