-
Notifications
You must be signed in to change notification settings - Fork 11
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
hmtheboy154
wants to merge
8
commits into
waydroid:lineage-18.1
Choose a base branch
from
hmtheboy154:update
base: lineage-18.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Increase input buffer size (needs to be larger than default 4k). - Make extractor compatible with Google codec, which expects the magic sequence and STREAMINFO header as part of init data.
Use yadif filter for SW-only, and VA-API for HW-accelerated deinterlacing. Using hw-accelerated deinterlacing reduces the CPU usage of the FFMPEG codec, up to 50% for full HD streams. Deinterlacing is controlled by new properties: - debug.ffmpeg-codec2.deinterlace = auto | software | none - debug.ffmpeg-codec2.deinterlace.vaapi = default | bob | weave | motion_adaptive | motion_compensated This requires FFMPEG >= 3.4. Previous version of FFMPEG (3.3-dev) had an issue with bottom-first interlaced streams, resulting in no-deinterlacing when using VA-API. Interlaced status is determined during the first 30 frames, to handle case of sporadic interlaced frames in progressive stream.
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.
- move all extractor-specific utilities into the extractor lib (this drastically reduces the amount of deps for ffmpeg_utils) - use library constructor to initialize FFMPEG logging - use library constructor to initialize ffmpeg_source - drop initialization of FFMPEG network, streaming this is handled by Android and the extractor accesses data through CDataSource interface - move FFMPEG headers #include where they're actually needed - rename FFMPEG{Audio|Video}CodecInfo to C2FFMPEG{Audio|Video}CodecInfo and move to codec2; use library header to provide access to structures to extractor - remove unnecessary headers - use MakeAVCCodecSpecificData from libstagefright_foundation in extractor, libstagefright_metadatautils is not available to vendor This does not achieve full Treble-compatibility yet. THe extractor should probably be moved to /system partition.
This declares the FFMPEG codec2 service to support AV1 codec. It requires FFMPEG to provide at least one working AV1 codec implementation.
…g_omx in vendor In order to build libffmpeg_omx on trble builds without touching libraries in system, we clone getOMXChannelMapping() from ACodec, which will help us cut from needing to link to libstagefright so we can finally build on vendor Signed-off-by: hmtheboy154 <[email protected]>
Signed-off-by: hmtheboy154 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.