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");
187 for (i = 0; dummy_codec[i]; i++)
190 printf(
"testing avcodec_copy_context()\n");
193 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.
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)
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 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
static AVCodec dummy_v2_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 **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)
Options definition for AVCodecContext.
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)