summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_examiner.cc13
-rw-r--r--src/lib/ffmpeg_examiner.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 46f4f236e..ed6f21094 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -384,6 +384,19 @@ FFmpegExaminer::bits_per_pixel () const
bool
+FFmpegExaminer::has_alpha() const
+{
+ if (video_codec_context()->pix_fmt == -1) {
+ return false;
+ }
+
+ auto const d = av_pix_fmt_desc_get(video_codec_context()->pix_fmt);
+ DCPOMATIC_ASSERT(d);
+ return d->flags & AV_PIX_FMT_FLAG_ALPHA;
+}
+
+
+bool
FFmpegExaminer::yuv () const
{
switch (video_codec_context()->pix_fmt) {
diff --git a/src/lib/ffmpeg_examiner.h b/src/lib/ffmpeg_examiner.h
index 10d060707..4747929b5 100644
--- a/src/lib/ffmpeg_examiner.h
+++ b/src/lib/ffmpeg_examiner.h
@@ -77,6 +77,8 @@ public:
boost::optional<int> bits_per_pixel () const;
+ bool has_alpha() const;
+
boost::optional<double> rotation () const {
return _rotation;
}