Merge commit 'a5d58fea68b9212e0065a71939e921505504a9bb'
* commit 'a5d58fea68b9212e0065a71939e921505504a9bb': lavc: reimplement avcodec_get_type() using codec descriptors Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
commit
2f63e83c26
@ -2843,3 +2843,9 @@ const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name)
|
|||||||
return desc;
|
return desc;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
|
||||||
|
{
|
||||||
|
const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
|
||||||
|
return desc ? desc->type : AVMEDIA_TYPE_UNKNOWN;
|
||||||
|
}
|
||||||
|
@ -3403,26 +3403,6 @@ void ff_thread_report_progress2(AVCodecContext *avctx, int field, int thread, in
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
|
|
||||||
{
|
|
||||||
AVCodec *c= avcodec_find_decoder(codec_id);
|
|
||||||
if(!c)
|
|
||||||
c= avcodec_find_encoder(codec_id);
|
|
||||||
if(c)
|
|
||||||
return c->type;
|
|
||||||
|
|
||||||
if (codec_id <= AV_CODEC_ID_NONE)
|
|
||||||
return AVMEDIA_TYPE_UNKNOWN;
|
|
||||||
else if (codec_id < AV_CODEC_ID_FIRST_AUDIO)
|
|
||||||
return AVMEDIA_TYPE_VIDEO;
|
|
||||||
else if (codec_id < AV_CODEC_ID_FIRST_SUBTITLE)
|
|
||||||
return AVMEDIA_TYPE_AUDIO;
|
|
||||||
else if (codec_id < AV_CODEC_ID_FIRST_UNKNOWN)
|
|
||||||
return AVMEDIA_TYPE_SUBTITLE;
|
|
||||||
|
|
||||||
return AVMEDIA_TYPE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
int avcodec_is_open(AVCodecContext *s)
|
int avcodec_is_open(AVCodecContext *s)
|
||||||
{
|
{
|
||||||
return !!s->internal;
|
return !!s->internal;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user