Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Detection of AVPixelFormat containing Alpha channel #619

Merged
merged 1 commit into from Jan 27, 2021

Conversation

jonoomph
Copy link
Member

Improved detection of AVPixelFormat containing Alpha channel, I'm going with a simple list. Not sure if this will work well with older versions of FFmpeg though, as these items change over time. Waiting to see how build servers handle it.

…a channel, I'm going with a simple list. Not sure if this will work well with older versions of FFmpeg though, as these items change over time. Waiting to see how build servers handle it.
@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

Merging #619 (292b9a8) into develop (2563c3c) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #619      +/-   ##
===========================================
+ Coverage    52.24%   52.32%   +0.07%     
===========================================
  Files          129      129              
  Lines        10774    10791      +17     
===========================================
+ Hits          5629     5646      +17     
  Misses        5145     5145              
Impacted Files Coverage Δ
src/FFmpegUtilities.h 95.83% <100.00%> (+10.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2563c3c...292b9a8. Read the comment docs.

@jonoomph jonoomph merged commit 5cc0455 into develop Jan 27, 2021
@jonoomph jonoomph deleted the alpha-pixfmt-detection branch January 27, 2021 00:08
@ferdnyc
Copy link
Contributor

ferdnyc commented Jan 27, 2021

@jonoomph

Not sure if this will work well with older versions of FFmpeg though, as these items change over time.

That's my biggest worry. In FFmpeg 3.2, the last four are undefined:

$ for format in AV_PIX_FMT_ARGB AV_PIX_FMT_RGBA AV_PIX_FMT_ABGR \
AV_PIX_FMT_BGRA AV_PIX_FMT_YUVA420P AV_PIX_FMT_YA16LE \
AV_PIX_FMT_YA16BE AV_PIX_FMT_YA8 AV_PIX_FMT_GBRAP \
AV_PIX_FMT_GBRAP10BE AV_PIX_FMT_GBRAP10LE AV_PIX_FMT_GBRAP12BE \
AV_PIX_FMT_GBRAP12LE AV_PIX_FMT_GBRAP16BE AV_PIX_FMT_GBRAP16LE \
AV_PIX_FMT_GBRPF32BE AV_PIX_FMT_GBRPF32LE AV_PIX_FMT_GBRAPF32BE \
AV_PIX_FMT_GBRAPF32LE; do echo -n "$format: "; grep -c $format pixfmt.h; done
AV_PIX_FMT_ARGB: 1
AV_PIX_FMT_RGBA: 4
AV_PIX_FMT_ABGR: 1
AV_PIX_FMT_BGRA: 4
AV_PIX_FMT_YUVA420P: 10
AV_PIX_FMT_YA16LE: 1
AV_PIX_FMT_YA16BE: 1
AV_PIX_FMT_YA8: 3
AV_PIX_FMT_GBRAP: 10
AV_PIX_FMT_GBRAP10BE: 1
AV_PIX_FMT_GBRAP10LE: 1
AV_PIX_FMT_GBRAP12BE: 1
AV_PIX_FMT_GBRAP12LE: 1
AV_PIX_FMT_GBRAP16BE: 1
AV_PIX_FMT_GBRAP16LE: 1
AV_PIX_FMT_GBRPF32BE: 0
AV_PIX_FMT_GBRPF32LE: 0
AV_PIX_FMT_GBRAPF32BE: 0
AV_PIX_FMT_GBRAPF32LE: 0

In older versions, there will be even more missing.

The committed code should be fully compatible with FFmpeg 3.4+, but only those versions. (We aren't testing anything older in the CI currently, due to the Github Actions switchover.)

As you know, I'm a big proponent of dropping all support for versions prior to 3.4, along with the associated maintenance headaches involved... this code effectively does just that. So if we're going to keep it, we can drop a lot of legacy code, which would be great. There's no reason to keep the pre-3.4 compatibility code hanging around when those versions will no longer compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants