mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-24 17:32:22 +08:00
Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump. Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -423,18 +423,18 @@ static const AVOption options[]={
|
||||
|
||||
static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };
|
||||
|
||||
void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type){
|
||||
void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
|
||||
int flags=0;
|
||||
memset(s, 0, sizeof(AVCodecContext));
|
||||
|
||||
s->av_class= &av_codec_context_class;
|
||||
|
||||
s->codec_type = codec_type;
|
||||
if(codec_type == CODEC_TYPE_AUDIO)
|
||||
if(codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
flags= AV_OPT_FLAG_AUDIO_PARAM;
|
||||
else if(codec_type == CODEC_TYPE_VIDEO)
|
||||
else if(codec_type == AVMEDIA_TYPE_VIDEO)
|
||||
flags= AV_OPT_FLAG_VIDEO_PARAM;
|
||||
else if(codec_type == CODEC_TYPE_SUBTITLE)
|
||||
else if(codec_type == AVMEDIA_TYPE_SUBTITLE)
|
||||
flags= AV_OPT_FLAG_SUBTITLE_PARAM;
|
||||
av_opt_set_defaults2(s, flags, flags);
|
||||
|
||||
@@ -453,7 +453,7 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type)
|
||||
s->reordered_opaque= AV_NOPTS_VALUE;
|
||||
}
|
||||
|
||||
AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){
|
||||
AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){
|
||||
AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
|
||||
|
||||
if(avctx==NULL) return NULL;
|
||||
@@ -464,10 +464,10 @@ AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){
|
||||
}
|
||||
|
||||
void avcodec_get_context_defaults(AVCodecContext *s){
|
||||
avcodec_get_context_defaults2(s, CODEC_TYPE_UNKNOWN);
|
||||
avcodec_get_context_defaults2(s, AVMEDIA_TYPE_UNKNOWN);
|
||||
}
|
||||
|
||||
AVCodecContext *avcodec_alloc_context(void){
|
||||
return avcodec_alloc_context2(CODEC_TYPE_UNKNOWN);
|
||||
return avcodec_alloc_context2(AVMEDIA_TYPE_UNKNOWN);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user