1. 21 Jun, 2016 1 commit
    • Anton Khirnov's avatar
      lavc: export the timestamps when decoding in AVFrame.pts · 32c83590
      Anton Khirnov authored
      Currently it's exported as AVFrame.pkt_pts, which is also the only use
      for that field. The reason it is done like this is that lavc used to
      export various codec-specific "timing" information in AVFrame.pts, which
      is not done anymore.
      
      Since it is confusing to the callers to have a separate field which is
      used only for decoder timestamps and nothing else, deprecate pkt_pts and
      use just AVFrame.pts everywhere.
      32c83590
  2. 04 May, 2016 1 commit
  3. 30 Apr, 2016 8 commits
  4. 12 Apr, 2016 1 commit
  5. 04 Oct, 2015 2 commits
    • wm4's avatar
      mmaldec: be more tolerant against MMAL not returning decoded output · 39f01e34
      wm4 authored
      In some situations, MMAL won't return a decoded frame for certain input
      frames. This can happen if a frame fails to decode, or if a packet does
      not actually contain a complete frame. In these situations, we would
      deadlock (or actually timeout) waiting for an expected output frame,
      which is not ideal. On the other hand, there are situations where we
      definitely have to block to avoid deadlocks. (This mess is a
      consequence of trying to map MMAL's asynchronous and flexible
      dataflow to libavcodec, which is more static and rigid.)
      
      Solve this by doing a blocking wait only if the amount of buffered data
      is too big. The whole purpose of the blocking wait is to avoid excessive
      buffering of input data, so we can skip it if it appears to be low. The
      consequence is that libavcodec can gracefully return no frame to the
      API user.
      
      We want to track the number of full packets to make our heuristic work.
      But MMAL buffers are fixed-size, requiring splitting large packets. This
      is why the previous commit is needed. We use the ..._FRAME_END flag to
      remember packet boundaries, but MMAL does not preserve these buffer
      flags when returning buffers to the user.
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      39f01e34
    • wm4's avatar
      mmaldec: refactor to have more context per MMAL input buffer · 65db4899
      wm4 authored
      The next commit needs 1 bit of additional information per MMAL buffer
      sent to the MMAL input port. This information will be needed when the
      buffer is recycled (i.e. returned by the input port's callback).
      Normally, we could use MMAL_BUFFER_HEADER_FLAG_USER0, but that is
      unexpectedly not preserved.
      
      Do this by storing a pointer to FFBufferEntry in the MMAL buffer's
      user data, instead of an AVBufferRef. This also changes the lifetime
      of FFBufferEntry.
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      65db4899
  6. 24 Sep, 2015 3 commits
  7. 12 Sep, 2015 5 commits
    • wm4's avatar
      mmaldec: fix pkt_dts determination · 99404597
      wm4 authored
      This also drops setting the frame->pts field. This is usually not set by
      decoders, so this would be an inconsistency that's at worst a danger to
      the API user.
      
      It appears the buffer->dts field is normally not set by the MMAL
      decoder, so don't use it. If it's ever going to be set by MMAL, we
      don't know whether the value will be what we want.
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      99404597
    • wm4's avatar
      lavc: allow asynchronous decoders to return correct pkt_dts values · 87a051f9
      wm4 authored
      The generic code in utils.c sets the AVFrame.pkt_dts field from the
      packet it was supposedly decoded. This does not have to be true for a
      fully asynchronous decoder like mmaldec. It could be overwritten with an
      incorrect value. Even if the decoder doesn't determine the DTS (but sets
      it to AV_NOPTS_VALUE), it's impossible to determine a correct value in
      utils.c.
      
      Decoders can now be marked with FF_CODEC_CAP_SETS_PKT_DTS, in which case
      utils.c won't overwrite the field. The decoders are expected to set this
      field (even if they only set it to AV_NOPTS_VALUE).
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      87a051f9
    • wm4's avatar
      mmaldec: disable timestamp interpolation · b7ab6e18
      wm4 authored
      This MMAL feature fills in missing timestamps from the framerate set on
      the input port. This is generally unwanted, since libavcodec decoders
      merely pass through timestamps without ever "fixing" them. The framerate
      is also unknown, and even the timebase doesn't have to be set.
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      b7ab6e18
    • wm4's avatar
      mmaldec: fix problems with flush logic · 6b652c02
      wm4 authored
      Don't try to do a blocking wait for MMAL output if we haven't even sent
      a single real packet, but only flush packets. Obviously we can't expect
      to get anything back.
      
      Additionally, don't send a flush packet to MMAL in the same case. It
      appears the MMAL decoder will sometimes hang in mmal_vc_port_disable()
      (called from ffmmal_close_decoder()), waiting for a reply from the GPU
      which never arrives. Either MMAL disallows sending flush packets without
      preceding real data, or it's a MMAL bug.
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      6b652c02
    • wm4's avatar
      mmaldec: hack against buffering problems on broken input · b84675d6
      wm4 authored
      I can't come up with a nice way to handle this. It's hard to keep the
      lock-stepped input/output in this case. You can't predict whether the
      MMAL decoder will output a picture (because it's asynchronous), so
      you have to assume in general that any packet could produce 0 or 1
      frames. You can't continue to write input packets to the decoder,
      because then you might get too many output frames, which you can't
      get rid of because the lavc decoding API does not allow the decoder
      to return an output frame without consuming an input frame (except
      when flushing).
      
      The ideal fix is a M:N decoding API (preferably asynchronous), which
      would make this code potentially much cleaner. For now, this hack
      will do.
      Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
      b84675d6
  8. 27 Jul, 2015 1 commit
  9. 14 Apr, 2015 2 commits
  10. 29 Mar, 2015 1 commit