1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
Matthieu Bouron
e30b46b1ae lavc/mediacodec_wrapper: allocate MediaCodec.BufferInfo once 2018-01-06 22:12:51 +01:00
Matthieu Bouron
1f1207145a lavc/mediacodec_wrapper: fix potential jni global reference leak 2017-12-16 00:52:28 +01:00
Matthieu Bouron
f3cffd121b lavc/mediacodec_wrapper: factorize MediaCodec creation functions 2017-12-16 00:52:28 +01:00
Matthieu Bouron
dd8ffb191f lavc/mediacodec_wrapper: fix jni vaargs types
Fixes decoding on 32-bit devices with Android NDK >= 15.
2017-09-15 14:19:16 +02:00
Matthieu Bouron
fb3228bee8 lavc/mediacodec_wrapper: do not declare JNIAMedia{Codec,CodecList,Format}Fields on the stack 2017-05-23 15:25:07 +02:00
Matthieu Bouron
224bb46fb8 lavc/mediacodec_wrapper: fix local reference leaks 2017-05-23 15:25:03 +02:00
Matthieu Bouron
1795dccde0 lavc/mediacodec_wrapper: fix local reference leaks
Reviewed-by: Clément Bœsch <u@pkh.me>
2017-05-11 16:29:03 +02:00
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.
2016-10-19 09:52:15 +02:00
Matthieu Bouron
140da8e810 lavc: add hevc mediacodec decoder 2016-09-15 21:48:28 +02:00
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.
2016-07-27 15:43:39 +02:00
Matthieu Bouron
0f2654c9a3 lavc: add mediacodec hwaccel support 2016-07-08 17:02:37 +02:00
Matthieu Bouron
346b3c5c41 lavc/mediacodec: re-indent after previous commit 2016-06-15 16:40:36 +02:00
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.
2016-06-15 16:36:13 +02:00
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.
2016-06-07 10:22:20 +02:00
Matthieu Bouron
cb89fd2334 lavc/mediacodec: rename MediaFormat field clazz to mediaformat_class for consistency 2016-06-07 10:20:44 +02:00
Matthieu Bouron
56ef387e21 lavc/mediacodec: move struct declarations at the begin 2016-06-07 10:20:44 +02:00
Matthieu Bouron
79efd3b8b8 lavc/mediacodec: rename jfields_mapping to jni_amediacodeclist_mapping 2016-06-07 10:20:36 +02:00
Matthieu Bouron
f2e7f9966e lavc/mediacodec: do not delete a local reference twice in case of error 2016-06-07 10:18:11 +02:00
Matthieu Bouron
d14deeb6bc lavc/mediacodec: add missing MediaCodec.Get{Input,Output}Buffer() checks 2016-05-25 16:46:47 +02:00
Matthieu Bouron
fbc9359d85 lavc/mediacodec: factorize static fields initialization 2016-05-25 16:46:47 +02:00
Matthieu Bouron
03a6ed83b0 lavc/mediacodec: remove stray empty lines 2016-03-15 10:33:16 +01:00
Matthieu Bouron
4737fe6907 lavc: add h264 mediacodec decoder 2016-03-07 11:28:29 +01:00