sfan5
a7425f712a
avcodec/mediacodec_wrapper: use MediaCodecInfo.isSoftwareOnly() when available
...
Added in Android 10 it provides a reliable way of filtering out
software decoders, unlike existing string-based checks.
4 years ago
sfan5
1a033008e8
avcodec/mediacodec_wrapper: check if codec is software earlier
4 years ago
Matthieu Bouron
5216edbc54
avcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak
...
Fixes ticket #8607 .
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
5 years ago
Matthieu Bouron
817235b195
avcodec/mediacodec_wrapper: remove unused local variables in ff_AMediaCodec_getCodecNameByType()
6 years ago
Matthieu Bouron
3f232d713d
avcodec/mediacodec_wrapper: fix a potential local reference leak in ff_AMediaCodec_getCodecNameByType()
6 years ago
Matthieu Bouron
9cb8875c16
avcodec/mediacodec_wrapper: fix a local reference leak in ff_AMediaCodec_getName()
6 years ago
Aman Gupta
f6d48b618a
avcodec/mediacodec: add av_mediacodec_render_buffer_at_time()
...
The existing av_mediacodec_release_buffer allows the user to render
or discard the Surface-backed frame. This new method allows the user
to control exactly when the frame will be rendered to its SurfaceView.
Available since Android API 21.
Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years ago
Aman Gupta
fe0a6bcbda
avcodec/mediacodec_wrapper: add helper to fetch SDK_INT
...
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
7 years ago
Michael Niedermayer
c0bce367e4
avcodec: Fix AVClass .version
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Stefan _
5ab0ecf283
avcodec/mediacodec_wrapper: fix false positives in swdec blacklist
...
'OMX.SEC.avc.dec' is a valid hardware decoder, while the decoders
we seek to blacklist all match 'OMX.SEC.*.sw.dec'.
7 years ago
Stefan _
313b6057fb
avcodec/mediacodec_wrapper: blacklist more software decoders
...
Additionally blacklist ffmpeg, Samsung and Qualcomm
software implementations offered through MediaCodec.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
7 years ago
Matthieu Bouron
c55ba52a6a
avcodec/mediacodec_wrapper: load and use MediaFormat.constainsKey()
...
Avoids triggering an exception in MediaFormat getter functions if the
key does not exist.
7 years ago
Matthieu Bouron
e30b46b1ae
lavc/mediacodec_wrapper: allocate MediaCodec.BufferInfo once
7 years ago
Matthieu Bouron
1f1207145a
lavc/mediacodec_wrapper: fix potential jni global reference leak
7 years ago
Matthieu Bouron
f3cffd121b
lavc/mediacodec_wrapper: factorize MediaCodec creation functions
7 years ago
Matthieu Bouron
dd8ffb191f
lavc/mediacodec_wrapper: fix jni vaargs types
...
Fixes decoding on 32-bit devices with Android NDK >= 15.
8 years ago
Matthieu Bouron
fb3228bee8
lavc/mediacodec_wrapper: do not declare JNIAMedia{Codec,CodecList,Format}Fields on the stack
8 years ago
Matthieu Bouron
224bb46fb8
lavc/mediacodec_wrapper: fix local reference leaks
8 years ago
Matthieu Bouron
1795dccde0
lavc/mediacodec_wrapper: fix local reference leaks
...
Reviewed-by: Clément Bœsch <u@pkh.me>
8 years ago
Matthieu Bouron
b8c158a4ed
lavc/mediacodec_wrapper: do not discard codecs reporting they do not support any profile
...
Depending on the device, some (VP8/VP9/...) decoders report that they do
not support any profiles.
8 years ago
Matthieu Bouron
140da8e810
lavc: add hevc mediacodec decoder
9 years ago
Matthieu Bouron
376d8fb2c5
lavc/ffjni: replace ff_jni_{attach,detach} with ff_jni_get_env
...
If a JNI environment is not already attached to the thread where the
MediaCodec calls are made the current implementation will attach /
detach an environment for each MediaCodec call wasting some CPU time.
ff_jni_get_env replaces ff_jni_{attach,detach} by permanently attaching
an environment (if it is not already the case) to the current thread.
The environment will be automatically detached at the thread destruction
using a pthread_key callback.
Saves around 5% of CPU time (out of 20%) while decoding a stream with
MediaCodec.
9 years ago
Matthieu Bouron
0f2654c9a3
lavc: add mediacodec hwaccel support
9 years ago
Matthieu Bouron
346b3c5c41
lavc/mediacodec: re-indent after previous commit
9 years ago
Matthieu Bouron
e452abc5c2
lavc/mediacodec: refactor ff_AMediaCodecList_getCodecByType
...
Allows to select a codec (encoder or decoder) only if it supports a
specific profile.
Adds ff_AMediaCodecProfile_getProfileFromAVCodecContext to convert an
AVCodecContext profile to a MediaCodec profile. It only supports H264
for now.
The codepath using MediaCodecList.findDecoderForFormat() (Android >= 5.0)
has been dropped as this method does not allow to select a decoder
compatible with a specific profile.
9 years ago
Matthieu Bouron
93f4d1646e
lavc/mediacodec: bypass width/height restrictions when looking for a decoder
...
Codec width/height restrictions seem hardcoded at the OMX level and
seem arbitrary. Bypassing those restrictions allows a device to decode
streams at higher resolutions.
For example it allows a Nexus 5 to decode h264 streams with a resolution
higher than 1920x1080.
9 years ago
Matthieu Bouron
cb89fd2334
lavc/mediacodec: rename MediaFormat field clazz to mediaformat_class for consistency
9 years ago
Matthieu Bouron
56ef387e21
lavc/mediacodec: move struct declarations at the begin
9 years ago
Matthieu Bouron
79efd3b8b8
lavc/mediacodec: rename jfields_mapping to jni_amediacodeclist_mapping
9 years ago
Matthieu Bouron
f2e7f9966e
lavc/mediacodec: do not delete a local reference twice in case of error
9 years ago
Matthieu Bouron
d14deeb6bc
lavc/mediacodec: add missing MediaCodec.Get{Input,Output}Buffer() checks
9 years ago
Matthieu Bouron
fbc9359d85
lavc/mediacodec: factorize static fields initialization
9 years ago
Matthieu Bouron
03a6ed83b0
lavc/mediacodec: remove stray empty lines
9 years ago
Matthieu Bouron
4737fe6907
lavc: add h264 mediacodec decoder
9 years ago