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

Update ffmpeg codecs and move it to /vendor #3

Open
wants to merge 8 commits into
base: lineage-18.1
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Zero-copy VA-API decoding using gralloc DRM prime handle
Create VA surfaces from DRM prime handle provided by gralloc. These can
then be returned by codec2 to framework with zero copy operation.

Hot-patch the ffmpeg HW accel device to inject custom frame pool
handling functions. Use C2BlockPool to generate a buffer and create a VA
surface from the DRM prime handle. Keep track of the generated buffers
based on the IGBP slot index.

Handle video resolution change (e.g. with HLS) by keeping track of the
buffer metadata and recreate the VA surface if necessary (only buffer
dimensions are expected to change).

Patching the ffmpeg HW accel device allows to be compatible with using
VA-API also for filtering (e.g. deinterlace). However all VA surfaces
must have the same dimensions, in particular for cases where frame
actual dimensions is different than the coded one. This is necessary as
one cannot control what IGBP slot will be used in what context, so all
VA surfaces must be interchangeable.

Use of DRM prime can be disabled by setting system property
debug.ffmpeg-codec2.hwaccel.drm = 0.
  • Loading branch information
goffioul authored and hmtheboy154 committed Jan 22, 2024
commit c2c8a46e9e038988f54ee4603e75e33714cc0f7f
3 changes: 3 additions & 0 deletions codec2/Android.mk
Original file line number Diff line number Diff line change
@@ -49,6 +49,9 @@ LOCAL_SHARED_LIBRARIES := \
libswresample \
libswscale \
libutils
ifeq ($(CONFIG_VAAPI),yes)
LOCAL_SHARED_LIBRARIES += libva
endif
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
Loading