1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc: Add a AVClass for AVFrames.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-03 21:17:52 +01:00
parent dff97be808
commit fef411ef3b
2 changed files with 32 additions and 0 deletions

View File

@ -4687,4 +4687,12 @@ enum AVMediaType avcodec_get_type(enum CodecID codec_id);
*/ */
const AVClass *avcodec_get_class(void); const AVClass *avcodec_get_class(void);
/**
* Get the AVClass for AVFrame. It can be used in combination with
* AV_OPT_SEARCH_FAKE_OBJ for examining options.
*
* @see av_opt_find().
*/
const AVClass *avcodec_get_frame_class(void);
#endif /* AVCODEC_AVCODEC_H */ #endif /* AVCODEC_AVCODEC_H */

View File

@ -700,3 +700,27 @@ const AVClass *avcodec_get_class(void)
{ {
return &av_codec_context_class; return &av_codec_context_class;
} }
#define FOFFSET(x) offsetof(AVFrame,x)
static const AVOption frame_options[]={
{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.dbl = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.dbl = -1 }, INT64_MIN, INT64_MAX, 0},
{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
{"format", "", FOFFSET(format), AV_OPT_TYPE_INT, {.dbl = -1 }, 0, INT_MAX, 0},
{NULL},
};
static const AVClass av_frame_class = {
.class_name = "AVFrame",
.item_name = NULL,
.option = frame_options,
.version = LIBAVUTIL_VERSION_INT,
};
const AVClass *avcodec_get_frame_class(void)
{
return &av_frame_class;
}