summaryrefslogtreecommitdiff
path: root/libavformat/avformat.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-07 08:49:58 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-10 07:49:09 +0200
commit2831fa7aed2c39d64f60aed4b2c95e7cacfc498d (patch)
treeb5fcd2cb83c4beb0b8835a240d859078722001db /libavformat/avformat.c
parent9825d488d6fdfb7c14d2d702d1a890311f5b2943 (diff)
avformat/utils: Move ff_is_intra_only to avformat.c
It is an auxiliary function only used by the generic muxing and demuxing code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/avformat.c')
-rw-r--r--libavformat/avformat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index a828e6db55..eabccffcb0 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -30,6 +30,7 @@
#include "libavutil/samplefmt.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bsf.h"
+#include "libavcodec/codec_desc.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
#include "demux.h"
@@ -679,3 +680,14 @@ const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
return avcodec_find_decoder(codec_id);
}
+
+int ff_is_intra_only(enum AVCodecID id)
+{
+ const AVCodecDescriptor *d = avcodec_descriptor_get(id);
+ if (!d)
+ return 0;
+ if ((d->type == AVMEDIA_TYPE_VIDEO || d->type == AVMEDIA_TYPE_AUDIO) &&
+ !(d->props & AV_CODEC_PROP_INTRA_ONLY))
+ return 0;
+ return 1;
+}