- 04 May, 2018 2 commits
-
-
Aman Gupta authored
I tested the previous mediacodec changes on seven different Android TV devices, with both mpeg2 and h264 content. All except one worked as expected. The exception was the MiBox3 running Android 6.0.1, where playback would freeze on a frame every few seconds. I tested two other AMLogic devices with newer Android versions that did not show the same problem. H264 decoding on the MiBox3 was also not affected, so this workaround applies only to OMX.amlogic.mpeg2.decoder.awesome on Android API22. There is a rumor that Xiaomi is planning to release Android Oreo for the MiBox3, so I will revisit in a few months to confirm whether this is specific to os/driver version or the chipset used in that device. Signed-off-by:
Aman Gupta <aman@tmm1.net> Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
Aman Gupta authored
The new logic follows a recommendation by @rcombs to use dequeueInputBuffer with a timeout of 0 as a way to detect whether the codec wants more data. The dequeued buffer index is kept in MediaCodecDecContext until it can be used next. A similar technique is also used by the Google's official media player Exoplayer: see MediaCodecRenderer.feedInputBuffer(). Signed-off-by:
Aman Gupta <aman@tmm1.net> Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
- 25 Apr, 2018 1 commit
-
-
Aman Gupta authored
As of 2a0eb868, ff_mediacodec_dec_is_flushing() only returns true in delay_flush mode. Make this more obvious by adding delay_flush to the if statement. Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by:
Aman Gupta <aman@tmm1.net>
-
- 13 Mar, 2018 1 commit
-
-
Aman Gupta authored
In cases where the mediacodec decoder consumed a partial packet, receive_frame() would start returning EAGAIN if the rest of the packet couldn't be flushed and no frames were immediately available. This fixes receive_frame() to perform its normal blocking wait for new frames before returning EAGAIN. Fixes an issue I could reproduce fairly often on a FireOS 6 device, and reported to be happening intermittently by two mpv users. Signed-off-by:
Aman Gupta <aman@tmm1.net> Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
- 08 Mar, 2018 1 commit
-
-
Aman Gupta authored
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>
-
- 03 Mar, 2018 3 commits
-
-
Matthieu Bouron authored
-
Matthieu Bouron authored
-
Matthieu Bouron authored
libavutil/internal.h defines NULL_IF_CONFIG_SMALL.
-
- 19 Feb, 2018 1 commit
-
-
Aman Gupta authored
This refactor splits up the main mediacodec decode loop into two send/receive helpers, which are then used to rewrite the receive_frame callback and take full advantage of the new decoding api. Since we can now request packets on demand with ff_decode_get_packet(), the fifo buffer is no longer necessary and has been removed. This change was motivated by behavior observed on certain Android TV devices, featuring hardware mpeg2/h264 decoders which also deinterlace content (to produce multiple frames per field). Previously, this code caused buffering issues because queueInputBuffer() was always invoked before each dequeueOutputBuffer(), even though twice as many output buffers were being generated. With this patch, the decoder will always attempt to drain new frames first before sending more data into the underlying codec. Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
- 30 Jan, 2018 1 commit
-
-
James Almer authored
Fixes memleaks. Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 06 Jan, 2018 2 commits
-
-
Matthieu Bouron authored
-
Aman Gupta authored
Using the new API gives the decoder the ability to produce N frames per input packet. This is particularly useful with mpeg2 decoders on some android devices, which automatically deinterlace video and produce one frame per field. Signed-off-by:
Aman Gupta <aman@tmm1.net> Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
- 15 Dec, 2017 1 commit
-
-
Aman Gupta authored
Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
- 14 Dec, 2017 1 commit
-
-
wm4 authored
Explicitly identify decoder/encoder wrappers with a common name. This saves API users from guessing by the name suffix. For example, they don't have to guess that "h264_qsv" is the h264 QSV implementation, and instead they can just check the AVCodec .codec and .wrapper_name fields. Explicitly mark AVCodec entries that are hardware decoders or most likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing API users listing hardware decoders in a more generic way. The proposed AVCodecHWConfig does not provide this information fully, because it's concerned with decoder configuration, not information about the fact whether the hardware is used or not. AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software implementations in case the hardware is not capable. Based on a patch by Philip Langdale <philipl@overt.org>. Merges Libav commit 47687a2f.
-
- 01 Dec, 2017 1 commit
-
-
Jan Ekström authored
Enables the decoder to utilize the type AVCodecHWConfigInternal.
-
- 26 Nov, 2017 1 commit
-
-
Mark Thompson authored
This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
-
- 31 Oct, 2017 1 commit
-
-
James Almer authored
Cosmetic change skipped in 0b30cb8d by mistake. Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 13 Jun, 2017 1 commit
-
-
Matthieu Bouron authored
-
- 08 Jun, 2017 1 commit
-
-
Aman Gupta authored
Android TV and FireOS hardware supports mpeg2 hardware decoding via MediaCodec. Signed-off-by:
Matthieu Bouron <matthieu.bouron@gmail.com>
-
- 05 May, 2017 1 commit
-
-
James Almer authored
They may be available in hvcc style extradata. Based on a patch by Hendrik Leppkes. Reviewed-by:
Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by:
Aaron Levinson <alevinsn@aracnet.com> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 09 Apr, 2017 1 commit
-
-
James Almer authored
Reviewed-by: nevcairiel Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 04 Apr, 2017 2 commits
-
-
Matthieu Bouron authored
-
Matthieu Bouron authored
-
- 23 Mar, 2017 1 commit
-
-
James Almer authored
Reviewed-by:
wm4 <nfxjfg@googlemail.com> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 19 Oct, 2016 3 commits
-
-
Matthieu Bouron authored
Adds the following changes: * mediacodecdec.{c,h} -> mediacodecdec_common.{c,h} * mediacodecdec_h2645.c -> mediacodecdec.c
-
Matthieu Bouron authored
-
Matthieu Bouron authored
-
- 12 Oct, 2016 2 commits
-
-
Matthieu Bouron authored
-
Matthieu Bouron authored
-
- 06 Oct, 2016 1 commit
-
-
Matthieu Bouron authored
Fixes incompatible pointer type warning on 64-bit systems.
-
- 15 Sep, 2016 1 commit
-
-
Matthieu Bouron authored
-
- 08 Jul, 2016 1 commit
-
-
Matthieu Bouron authored
-
- 23 Jun, 2016 4 commits
-
-
Matthieu Bouron authored
Increase buffer dequeue timeout when the codec needs to be drained as it could happen that no input buffer is available when we receive a null packet for the first time (meaning we are unable to signal end of stream and mark the codec as draining). Fixes potential loss of last frames after sending a null packet.
-
Matthieu Bouron authored
-
Matthieu Bouron authored
-
Matthieu Bouron authored
Their only purpose is to carry the end of stream flag.
-
- 20 Jun, 2016 1 commit
-
-
Matthieu Bouron authored
And sets frames pkt_dts to AV_NOPTS_VALUE as we do not want lavc/utils to overwrite the field with incorrect values as the decoder is asynchronous.
-
- 15 Jun, 2016 1 commit
-
-
Matthieu Bouron authored
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.
-
- 07 Jun, 2016 2 commits
-
-
Matthieu Bouron authored
-
Matthieu Bouron authored
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.
-