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

11 Commits

Author SHA1 Message Date
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>
2018-10-11 20:51:14 -07:00
Aman Gupta
936312d18c avcodec/mediacodecdec: add debug logging around hw buffer lifecycle
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>
2018-03-12 01:23:30 -07:00
Aman Gupta
823a758543 avcodec/mediacodecdec: add more trace logging of input/output buffers
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-07 16:22:50 -08:00
Aman Gupta
2a0eb86857 avcodec/mediacodecdec: add delay_flush option
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>
2018-03-07 16:22:47 -08:00
Mark Thompson
da4e02b196 lavc: Delete all fake hwaccels
They are now unused.
2017-11-26 21:41:14 +00:00
James Almer
005da88c1e avcodec/mediacodec: convert to stdatomic
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-23 11:44:58 -03:00
Matthieu Bouron
d5082a2ce7 lavc/mediacodec: use more meaningful filenames
Adds the following changes:
  * mediacodecdec.{c,h} -> mediacodecdec_common.{c,h}
  * mediacodecdec_h2645.c -> mediacodecdec.c
2016-10-19 10:50:56 +02:00
Michael Niedermayer
9545ff3ec3 avcodec/mediacodec: Factor duplicate include
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-18 15:32:14 +02:00
Timothy Gu
fd242479c6 mediacodec: Return ENOSYS on unsupported platforms 2016-08-02 22:32:12 -07: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