1. 04 May, 2018 2 commits
    • Aman Gupta's avatar
      avcodec/mediacodecdec: add workaround for buggy amlogic mpeg2 decoder · 9b563f65
      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: 's avatarAman Gupta <aman@tmm1.net>
      Signed-off-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
      9b563f65
    • Aman Gupta's avatar
      avcodec/mediacodecdec: restructure mediacodec_receive_frame · f6681fed
      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: 's avatarAman Gupta <aman@tmm1.net>
      Signed-off-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
      f6681fed
  2. 25 Apr, 2018 1 commit
  3. 13 Mar, 2018 1 commit
  4. 08 Mar, 2018 1 commit
    • Aman Gupta's avatar
      avcodec/mediacodecdec: add delay_flush option · 2a0eb868
      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: 's avatarAman Gupta <aman@tmm1.net>
      Signed-off-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
      2a0eb868
  5. 03 Mar, 2018 3 commits
  6. 19 Feb, 2018 1 commit
    • Aman Gupta's avatar
      avcodec/mediacodecdec: refactor to take advantage of new decoding api · f611fef3
      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: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
      f611fef3
  7. 30 Jan, 2018 1 commit
  8. 06 Jan, 2018 2 commits
  9. 15 Dec, 2017 1 commit
  10. 14 Dec, 2017 1 commit
    • wm4's avatar
      avcodec: add metadata to identify wrappers and hardware decoders · b945fed6
      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.
      b945fed6
  11. 01 Dec, 2017 1 commit
  12. 26 Nov, 2017 1 commit
    • Mark Thompson's avatar
      lavc: Add hardware config metadata for decoders supporting hardware output · 758fbc54
      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.
      758fbc54
  13. 31 Oct, 2017 1 commit
  14. 13 Jun, 2017 1 commit
  15. 08 Jun, 2017 1 commit
  16. 05 May, 2017 1 commit
  17. 09 Apr, 2017 1 commit
  18. 04 Apr, 2017 2 commits
  19. 23 Mar, 2017 1 commit
  20. 19 Oct, 2016 3 commits
  21. 12 Oct, 2016 2 commits
  22. 06 Oct, 2016 1 commit
  23. 15 Sep, 2016 1 commit
  24. 08 Jul, 2016 1 commit
  25. 23 Jun, 2016 4 commits
  26. 20 Jun, 2016 1 commit
  27. 15 Jun, 2016 1 commit
    • Matthieu Bouron's avatar
      lavc/mediacodec: refactor ff_AMediaCodecList_getCodecByType · e452abc5
      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.
      e452abc5
  28. 07 Jun, 2016 2 commits