aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mediacodec_wrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mediacodec_wrapper: add async mode supportZhao Zhili2024-11-201-0/+130
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec_wrapper: Fix unused variable warningZhao Zhili2024-04-231-0/+1
|
* avcodec/mediacodec_wrapper: link to NDK mediacodec API directlyZhao Zhili2024-04-231-129/+35
| | | | Drop support of Android version before 5.0.
* avcodec/mediacodec_wrapper: remove unnecessary NULL checks before calling ↵Matthieu Bouron2024-03-231-142/+47
| | | | | | Delete{Global,Local}Ref() Delete{Global,Local}Ref already handle NULL.
* avcodec/mediacodec_wrapper: use an OFFSET() macro where relevantMatthieu Bouron2024-03-231-66/+72
| | | | Reduces a bit the horizontal spacing.
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+4
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-4/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* definesAndreas Rheinhardt2023-09-071-38/+38
| | | | | | | | | These defines are also used in other contexts than just AVCodecContext ones, e.g. in libavformat. Furthermore, given that these defines are public, the AV-prefix is the right one, so deprecate (and not just move) the FF-macros. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mediacodec: Add AV1 encoderSamuel Mira2023-05-171-0/+19
| | | | | | | Connected FFmpeg to Mediacodec AV1 encoder Signed-off-by: Samuel Mira <samuel.mira@qt.io> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec: add mpeg4 encoderSamuel Raposo Vieira Mira2023-04-021-0/+55
| | | | | | | This patch will add MPEG4 encoder using Android Mediacodec Signed-off-by: Samuel Mira <samuel.mira@qt.io<mailto:samuel.mira@qt.io>> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec: add vp9 encoder using mediacodecSamuel Raposo Vieira Mira2023-04-021-0/+24
| | | | | | | | The only encoders avaliable using mediacodec were h264 and hevc. This patch adds the vp9 encoder. Signed-off-by: Samuel Mira <samuel.mira@qt.io<mailto:samuel.mira@qt.io>> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodecdec: refactor color space utilsZhao Zhili2023-03-181-0/+102
| | | | | | So it can be shared with encoder. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec_wrapper: get api level via NDK methodZhao Zhili2023-01-111-0/+18
| | | | | | | | android_get_device_api_level() is a static inline before API level 29. It was implemented via __system_property_get(). We can do the same thing, but I don't want to mess up with __system_property_get. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec_wrapper: include stdbool.hZhao Zhili2022-12-191-0/+1
| | | | | | | Since NDK failed to do that: https://github.com/android/ndk/issues/1281 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec_wrapper: use hardcoded value of profiles from MediaCodecInfoZhao Zhili2022-12-081-65/+33
| | | | | | | | Those are static const values and documented at https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel No runtime query is needed. Now the method can be used without JVM. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec: fix missing crop info when use NDK MediaCodecZhao Zhili2022-12-081-3/+35
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec: add MediaCodec encoderZhao Zhili2022-11-211-5/+96
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec: add ANativeWindow supportZhao Zhili2022-11-211-7/+23
| | | | ANativeWindow can be used without JVM.
* avcodec/mediacodec: add NDK media codec wrapperZhao Zhili2022-11-211-4/+592
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/mediacodec_wrapper: separate implementation from interfaceZhao Zhili2022-11-211-68/+176
| | | | | | This is in preparation for NDK media codec wrapper. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* libavcodec, libavdevice: Remove unnecessary includes of version.hMartin Storsjö2022-02-241-1/+0
| | | | | | | | | | | | | | | xvmc.h used FF_API_* macros before, but they were removed in 1c63aed232febf4404659bf006237ee4f7f17c9c, leaving the include unused. The ones in android_camera.c and mediacodec_wrapper.c have been added due to a misunderstanding, fixed in c0bce367e4932f0fb09195e6978ac1a5a60480a4 and 13b77af2f0b56d6c87bb147947337981c21f4245. The one in mediacodec.c seems to never have been used at all. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/mediacodec_wrapper: use MediaCodecInfo.isSoftwareOnly() when availablesfan52021-03-101-0/+13
| | | | | Added in Android 10 it provides a reliable way of filtering out software decoders, unlike existing string-based checks.
* avcodec/mediacodec_wrapper: check if codec is software earliersfan52021-03-101-56/+57
|
* avcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leakMatthieu Bouron2020-04-151-0/+6
| | | | | | Fixes ticket #8607. Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* avcodec/mediacodec_wrapper: remove unused local variables in ↵Matthieu Bouron2019-07-221-10/+0
| | | | ff_AMediaCodec_getCodecNameByType()
* avcodec/mediacodec_wrapper: fix a potential local reference leak in ↵Matthieu Bouron2019-07-221-0/+5
| | | | ff_AMediaCodec_getCodecNameByType()
* avcodec/mediacodec_wrapper: fix a local reference leak in ↵Matthieu Bouron2019-07-221-0/+4
| | | | ff_AMediaCodec_getName()
* avcodec/mediacodec: add av_mediacodec_render_buffer_at_time()Aman Gupta2018-10-111-1/+1
| | | | | | | | | | 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>
* avcodec/mediacodec_wrapper: add helper to fetch SDK_INTAman Gupta2018-05-041-0/+15
| | | | | Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec: Fix AVClass .versionMichael Niedermayer2018-04-191-2/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mediacodec_wrapper: fix false positives in swdec blacklistStefan _2018-03-071-1/+1
| | | | | 'OMX.SEC.avc.dec' is a valid hardware decoder, while the decoders we seek to blacklist all match 'OMX.SEC.*.sw.dec'.
* avcodec/mediacodec_wrapper: blacklist more software decodersStefan _2018-03-061-1/+6
| | | | | | | | 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>
* avcodec/mediacodec_wrapper: load and use MediaFormat.constainsKey()Matthieu Bouron2018-03-031-0/+39
| | | | | Avoids triggering an exception in MediaFormat getter functions if the key does not exist.
* lavc/mediacodec_wrapper: allocate MediaCodec.BufferInfo onceMatthieu Bouron2018-01-061-27/+34
|
* lavc/mediacodec_wrapper: fix potential jni global reference leakMatthieu Bouron2017-12-161-0/+3
|
* lavc/mediacodec_wrapper: factorize MediaCodec creation functionsMatthieu Bouron2017-12-161-133/+29
|
* lavc/mediacodec_wrapper: fix jni vaargs typesMatthieu Bouron2017-09-151-5/+5
| | | | Fixes decoding on 32-bit devices with Android NDK >= 15.
* lavc/mediacodec_wrapper: do not declare ↵Matthieu Bouron2017-05-231-3/+3
| | | | JNIAMedia{Codec,CodecList,Format}Fields on the stack
* lavc/mediacodec_wrapper: fix local reference leaksMatthieu Bouron2017-05-231-11/+26
|
* lavc/mediacodec_wrapper: fix local reference leaksMatthieu Bouron2017-05-111-21/+42
| | | | Reviewed-by: Clément Bœsch <u@pkh.me>
* lavc/mediacodec_wrapper: do not discard codecs reporting they do not support ↵Matthieu Bouron2016-10-191-0/+3
| | | | | | | any profile Depending on the device, some (VP8/VP9/...) decoders report that they do not support any profiles.
* lavc: add hevc mediacodec decoderMatthieu Bouron2016-09-151-3/+20
|
* lavc/ffjni: replace ff_jni_{attach,detach} with ff_jni_get_envMatthieu Bouron2016-07-271-161/+39
| | | | | | | | | | | | | | 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.
* lavc: add mediacodec hwaccel supportMatthieu Bouron2016-07-081-4/+1
|
* lavc/mediacodec: re-indent after previous commitMatthieu Bouron2016-06-151-93/+93
|
* lavc/mediacodec: refactor ff_AMediaCodecList_getCodecByTypeMatthieu Bouron2016-06-151-71/+206
| | | | | | | | | | | | | 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.
* lavc/mediacodec: bypass width/height restrictions when looking for a decoderMatthieu Bouron2016-06-071-9/+28
| | | | | | | | | 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.
* lavc/mediacodec: rename MediaFormat field clazz to mediaformat_class for ↵Matthieu Bouron2016-06-071-3/+3
| | | | consistency
* lavc/mediacodec: move struct declarations at the beginMatthieu Bouron2016-06-071-186/+186
|
* lavc/mediacodec: rename jfields_mapping to jni_amediacodeclist_mappingMatthieu Bouron2016-06-071-3/+3
|