summaryrefslogtreecommitdiffstats
path: root/libavcodec/mediacodec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mediacodec: add av_mediacodec_render_buffer_at_time()Aman Gupta2018-10-111-0/+21
| | | | | | | | | | 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/mediacodecdec: add debug logging around hw buffer lifecycleAman Gupta2018-03-121-3/+4
| | | | | | | | | | | | | Some Android devices are very finicky about how quicky output buffers are returned back to the decoder, especially when they are associated with a Surface. This commit adds a new counter that keeps track of exactly how many hw output buffers are being retained by the user, along with DEBUG level logging that makes it easy to track the lifecycle of these buffers. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* avcodec/mediacodecdec: add more trace logging of input/output buffersAman Gupta2018-03-071-0/+3
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* avcodec/mediacodecdec: add delay_flush optionAman Gupta2018-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The default behavior of the mediacodec decoder before this commit was to delay flushes until all pending hardware frames were returned to the decoder. This was useful for certain types of applications, but was unexpected behavior for others. The new default behavior with this commit is now to execute flushes immediately to invalidate all pending frames. The old behavior can be enabled by setting delay_flush=1. With the new behavior, video players implementing seek can simply call flush on the decoder without having to worry about whether they have one or more mediacodec frames still buffered in their rendering pipeline. Previously, all these frames had to be explictly freed (or rendered) before the seek/flush would execute. The new behavior matches the behavior of all other lavc decoders, reducing the amount of special casing required when using the mediacodec decoder. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* lavc: Delete all fake hwaccelsMark Thompson2017-11-261-1/+1
| | | | They are now unused.
* avcodec/mediacodec: convert to stdatomicJames Almer2017-03-231-3/+2
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/mediacodec: use more meaningful filenamesMatthieu Bouron2016-10-191-1/+2
| | | | | | Adds the following changes: * mediacodecdec.{c,h} -> mediacodecdec_common.{c,h} * mediacodecdec_h2645.c -> mediacodecdec.c
* avcodec/mediacodec: Factor duplicate includeMichael Niedermayer2016-10-181-3/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mediacodec: Return ENOSYS on unsupported platformsTimothy Gu2016-08-021-2/+4
|
* lavc/ffjni: replace ff_jni_{attach,detach} with ff_jni_get_envMatthieu Bouron2016-07-271-12/+2
| | | | | | | | | | | | | | 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-0/+133
OpenPOWER on IntegriCloud