gst-ducati: fix < 0 checks
gst-ducati: reorder H.264 frames ourselves
ducatih264dec: re-enable auto for display-delay
Needed for clips w/ more than 1 B frame to play properly.
Needed for clips w/ more than 1 B frame to play properly.
configure: ensure HAVE_ENCODERS is placed in config.h
ducatividdec: do not skip outputID processing when outBufsInUseFlag is set
twi thinks the codec may possibly output a partially decoded buffer while
still outputting a valid full frame for display. The docs aren't very
clear, so I'll revert that particular change.
I see no difference with this change on or off in the test streams I have
here, so I'm not sure there's a difference in practice.
twi thinks the codec may possibly output a partially decoded buffer while
still outputting a valid full frame for display. The docs aren't very
clear, so I'll revert that particular change.
I see no difference with this change on or off in the test streams I have
here, so I'm not sure there's a difference in practice.
ducatividdec: rename drop_frame to can_drop_frame
This makes it less confusing, as I thought drop_frame was actually
dropping the frame before looking at the implementation.
This makes it less confusing, as I thought drop_frame was actually
dropping the frame before looking at the implementation.
Revert "ducatividdec: perform QoS after feeding the data to the hardware decoder"
This reverts commit 5fa560d82caf91230fbc04b3768952727e1bd022.
It turns out that drop_frame does not in fact drop those frames that are
necessary for decoding future frames.
This reverts commit 5fa560d82caf91230fbc04b3768952727e1bd022.
It turns out that drop_frame does not in fact drop those frames that are
necessary for decoding future frames.
ducati: fix build when encoders are missing
This just tests for the H264 encoder header, I'm not sure if that's
safe enough or if one can have a random set of encoders installed,
in which case each header should be tested separately.
For now though, it fixes the build.
This just tests for the H264 encoder header, I'm not sure if that's
safe enough or if one can have a random set of encoders installed,
in which case each header should be tested separately.
For now though, it fixes the build.
ducatividdec: perform QoS after feeding the data to the hardware decoder
We do not want to drop frames before decoding them, or we will be unable
to recover a good image till next keyframe (or equivalent). Instead, we
always feed the data to the hardware decoder, and drop the decoder frames.
The "wait for a keyframe" code was split off the unrelated QoS code and
kept before feeding the data.
We do not want to drop frames before decoding them, or we will be unable
to recover a good image till next keyframe (or equivalent). Instead, we
always feed the data to the hardware decoder, and drop the decoder frames.
The "wait for a keyframe" code was split off the unrelated QoS code and
kept before feeding the data.
ducatividdec: add a comment about a fishy, but OK, bit of code
I can't think of a good way to size this statically, and that size
seems like a good enough bound, even though it's technically wrong.
I can't think of a good way to size this statically, and that size
seems like a good enough bound, even though it's technically wrong.
ducatividdec: do not discard unused input data
The video decoder may not use all data applied to it in a decode call.
When this happens, we want to supply the remaining data again next time,
or corruption will happen due to "missing" data.
The data is currently copied, which is not an issue in practice as this
seems to happen not often, and more a small amount of data.
The video decoder may not use all data applied to it in a decode call.
When this happens, we want to supply the remaining data again next time,
or corruption will happen due to "missing" data.
The data is currently copied, which is not an issue in practice as this
seems to happen not often, and more a small amount of data.
ducatividdec: only send buffers when the decoder is done
For interlaced streams, a decoder may supply a partially filled buffer,
and will set a flag when that buffer is not yet fully filled.
In such a case, we do not want to send it downstream, but wait for it
to be filled before doing so.
Also instruct the codec to force a frame start on flush, just in case.
For interlaced streams, a decoder may supply a partially filled buffer,
and will set a flag when that buffer is not yet fully filled.
In such a case, we do not want to send it downstream, but wait for it
to be filled before doing so.
Also instruct the codec to force a frame start on flush, just in case.
ducatividdec: delay flushing till the end of the codec processing
This avoids resetting various state in the middle of processing,
which could lead to buffer leaks, and generally more confusing flow.
This avoids resetting various state in the middle of processing,
which could lead to buffer leaks, and generally more confusing flow.
ducatividdec: print error when there actually is one
(and print the right one while we're at it)
(and print the right one while we're at it)
ducatimpeg4dec: add note about xvid being broken with base params
Revert "ducatimpeg4dec: switch to using base params"
This reverts commit 40817373191324531a110448bcb1c28fcd79d9bf.
Using base params seems to break xvid decoding. Hrm.
This reverts commit 40817373191324531a110448bcb1c28fcd79d9bf.
Using base params seems to break xvid decoding. Hrm.
ducatih264enc: set numTemporalLayer to 1
numTemporalLayer=0 is not supported and makes SETPARAMS fail
numTemporalLayer=0 is not supported and makes SETPARAMS fail
Set IDRFrameInterval to 1 on the H264 encoder
Without this, IDRFrameInterval is left at 0, making only the
first I frame an IDR frame (and marked as keyframe).
Without this, IDRFrameInterval is left at 0, making only the
first I frame an IDR frame (and marked as keyframe).
Expose the intra-frame interval as a property
Mark I frames as keyframes for encoders other than H264
Remove duplicate assignments
Both variables assigned are already assigned the same values
above.
Both variables assigned are already assigned the same values
above.
Clear the right pointer after freeing
Re-enable ducatih264enc and ducatimpeg4enc
videnc: port to drm/rpmsg
ducatividdec: fix a miniobject and bo leak
ducati: add some more detailed logging about video decoder extended errors
ducatimpeg4dec: switch to using base params
ducatividdec: fix event leak
ducatividdec: fix buffer leaks on error paths
ducatividdec: fix deadlocks on early out paths
ducatividdec: prevent overread when all buffer slots are used
ducatividdec: detect unsupported codecs when switching from NULL to READY
This should allow playbin2 to try other codecs, if available.
This should allow playbin2 to try other codecs, if available.
ducatividdec: support crop qdata
Note: eventually remove crop event.. but for now leave it until other
elements are updated.
Note: eventually remove crop event.. but for now leave it until other
elements are updated.
use GstDRMBufferPool and dmabuf for sharing buffers
Use GstDRMBufferPool instead of own private bufferpool, and use
dmabuf to import buffers (either allocated by our bufferpool or
by downstream element) and qdata to attach our own private data
to the buffer. In this way the differences in code path between
using our own buffers and a downstream element's buffers is
minimized.
Use GstDRMBufferPool instead of own private bufferpool, and use
dmabuf to import buffers (either allocated by our bufferpool or
by downstream element) and qdata to attach our own private data
to the buffer. In this way the differences in code path between
using our own buffers and a downstream element's buffers is
minimized.
Revert "ducatividdec: share the drm fd with other elements in the pipeline"
Instead use dmabuf fd's to share w/ other elements in the pipeline. This
way we don't need to share a common fd for the drm/omapdce device.
This reverts commit c115a41edd4abbc4784e6921e5a9c30a17b63dfa.
Instead use dmabuf fd's to share w/ other elements in the pipeline. This
way we don't need to share a common fd for the drm/omapdce device.
This reverts commit c115a41edd4abbc4784e6921e5a9c30a17b63dfa.
ducatih264dec: force free outbufs on error 0x201 (concealment, no slice)
When the codec returns error 0x201, it doesn't free the output buffer, leading
to (downstream) buffer pool exhaustion. Special case this condition, partly
reverting 1c65dfe58e9c178503cae32dfcf10eb18c8e1bf2.
When the codec returns error 0x201, it doesn't free the output buffer, leading
to (downstream) buffer pool exhaustion. Special case this condition, partly
reverting 1c65dfe58e9c178503cae32dfcf10eb18c8e1bf2.
ducatividdec: share the drm fd with other elements in the pipeline
Implement the GstVideoContext interface to share the drm fd with
other elements in the pipeline
Implement the GstVideoContext interface to share the drm fd with
other elements in the pipeline
Initial port to omapdce
Disable encoders as they aren't supported by omapdce yet
Remove dependency on libtimemmgr
ducatih264dec: don't free inArgs->inputID twice on some error conditions
Remove some code that used to force-free inArgs->inputID on some errors. Now we
flush the codec so the buffer is unlocked during flushing.
Remove some code that used to force-free inArgs->inputID on some errors. Now we
flush the codec so the buffer is unlocked during flushing.
ducatividdec: never leave the flow_ret outarg uninitialized in codec_process
README update
ducatibufferpool: fix race in gst_ducati_bufferpool_destroy
Pop items from ->freelist with the pool lock taken to avoid races with other
threads unreffing outstanding buffers.
Pop items from ->freelist with the pool lock taken to avoid races with other
threads unreffing outstanding buffers.
ducatividdec: propagate downstream flow errors
ducatividdec: reset outArgs in flush()
Reset outArgs in flush() so that it isn't left in an inconsistent state if
flush() is called from codec_process() during error handling.
Reset outArgs in flush() so that it isn't left in an inconsistent state if
flush() is called from codec_process() during error handling.
ducatividdec: fix getcaps method adding rowstride
For yuv-strided formats we need to add the rowstride field with the
allowed range to make caps intersect properly.
For yuv-strided formats we need to add the rowstride field with the
allowed range to make caps intersect properly.
ducatividdec: Implement src pad getcaps function
The caps of the src pad should not change with upstream negotiation
except between regular yuv and rowstrided.
The caps of the src pad should not change with upstream negotiation
except between regular yuv and rowstrided.
ducatividdec: Fix indentation
ducatividenc: err.. mark keyframes on IVIDEO_IDR_FRAME frames
ducatividenc: add cropping support
ducatividenc: mark keyframes
ducatih264enc: set output caps
ducatividenc: don't memcpy input if it's already tiler backed
ducatih264dec: implement LATENCY query
ducatividdec: store upstream framerate
ducatih264dec: det displayDelay to IVIDDEC3_DISPLAY_DELAY_1
ducatividdec: flush the codec on caps changes
Flush the codec when caps change. Needed for downstream sinks that provide a
buffer pool and need to destroy all the outstanding buffers before they can
negotiate new caps (hello v4l2sink).
Flush the codec when caps change. Needed for downstream sinks that provide a
buffer pool and need to destroy all the outstanding buffers before they can
negotiate new caps (hello v4l2sink).
ducatividdec: send a crop event every time caps change
ducatih264dec: don't leak on decode errors
ducatih264dec: handle IH264VDEC_ERR_NOSLICE errors
Handle IH264VDEC_ERR_NOSLICE errors by flushing and skipping to the next
keyframe.
Handle IH264VDEC_ERR_NOSLICE errors by flushing and skipping to the next
keyframe.
ducatividdec: make codec_flush non-static so it can be used by derived classes
Rename codec_flush to gst_ducati_viddec_codec_flush and make it non-static so
derived elements can use it (for example during error recovering).
Rename codec_flush to gst_ducati_viddec_codec_flush and make it non-static so
derived elements can use it (for example during error recovering).
ducatividdec: add var to skip buffers until the next keyframe
Add wait_keyframe variable that is set to TRUE whenever we need to skip buffers
until the next keyframe.
Add wait_keyframe variable that is set to TRUE whenever we need to skip buffers
until the next keyframe.
ducatih264dec: implement B frame dropping strategy similar to ducativc1dec
ducatividdec: don't discard input timestamps at stream start
Don't discard input timestamps when forcing the allocation of buffers from the
internal pool (see 9471fe2). Fixes sync glitches with interlaced streams.
Don't discard input timestamps when forcing the allocation of buffers from the
internal pool (see 9471fe2). Fixes sync glitches with interlaced streams.
12 years agoducatividdec: workaround for the mpeg2 decoder giving wrong crop_height for interlace...
ducatividdec: workaround for the mpeg2 decoder giving wrong crop_height for interlaced streams
ducatividdec: don't renegotiate while flushing
Fixes a crash introduced by calling codec_flush in PAUSED=>READY
Fixes a crash introduced by calling codec_flush in PAUSED=>READY
ducatividdec: flush the codec going to READY
Flush the codec going to READY so we don't leak buffers if state is changed to
<= READY before EOS.
Flush the codec going to READY so we don't leak buffers if state is changed to
<= READY before EOS.
bufferpool: reset ->orig to NULL in _finalize
Reset ->orig to NULL on _finalize so that if a buffer is recycled we don't
_unref invalid memory.
Reset ->orig to NULL on _finalize so that if a buffer is recycled we don't
_unref invalid memory.
ducativc1dec: when dropping frames, drop only bframes
ducatividdec: make it possible for subclasses to participate in qos handling
ducatimpeg4dec: don't leak input buffers
ducatividdec: destroy the internal pool once we have an output buffer
We use the internal pool until we get the first output buffer, then we switch to
downstream provided buffers. Destroy the internal pool once we get the first
output buffer so that we release memory. The pool is then recreated when/if
needed.
We use the internal pool until we get the first output buffer, then we switch to
downstream provided buffers. Destroy the internal pool once we get the first
output buffer so that we release memory. The pool is then recreated when/if
needed.
ducatividdec: update the internal pool caps when switching interlaced mode
set encoders' ranks to PRIMARY + 1
Increase encoders' ranks to make them be chosen before other
primary encoders.
Increase encoders' ranks to make them be chosen before other
primary encoders.
gstducati: Fix indentation
ducatividdec: workaround for interlaced clips that are detected as progressive from upstream
Sometimes upstream thinks that some input is progressive (usually if interlaced
isn't marked correctly at the container level) when it's actually interlaced.
Detect such cases with help from the codec and adjust caps (and buffers)
accordingly.
Sometimes upstream thinks that some input is progressive (usually if interlaced
isn't marked correctly at the container level) when it's actually interlaced.
Detect such cases with help from the codec and adjust caps (and buffers)
accordingly.
ducatividdec: fix regression with clips having outBufsInUseFlag==TRUE
ducatimpeg4dec: don't forget to push the codec data buffer
ducatividdec: auto-detect when input ts are PTS
When input timestamps are in ascending order, and output timestamps
are not, that must mean the parser/demuxser is giving us the timestamps
in presentation order (PTS), not decode order (DTS).
When input timestamps are in ascending order, and output timestamps
are not, that must mean the parser/demuxser is giving us the timestamps
in presentation order (PTS), not decode order (DTS).
ducatividdec: some minor trace cleanups
ducatimpeg2dec: we want parsed stream
ducativc1dec: workaround to not abort decoding on broken frames
When on some broken frames the codec returns fatal error 0x00409000, pretend it
isn't fatal and just carry on as the codec seems to be able to continue
decoding subsequent valid frames correctly.
When on some broken frames the codec returns fatal error 0x00409000, pretend it
isn't fatal and just carry on as the codec seems to be able to continue
decoding subsequent valid frames correctly.
ducatividdec: make it possible for decoders to implement their own error handling
Useful to implement decoder specific hacks to workaround broken error reporting
from codecs.
Useful to implement decoder specific hacks to workaround broken error reporting
from codecs.
mpeg4dec: don't enable deblocking filter. Fixes codec creation failures.
Set outloopDeBlocking to FALSE as the codec doesn't seem to support that being
TRUE on recent ducati.
Set outloopDeBlocking to FALSE as the codec doesn't seem to support that being
TRUE on recent ducati.
ducatimpeg2dec: fix mpeg2 playback with 1d buffers
ducatimpeg4dec: fix compiler warnings on glp1.4
ducatividdec: fix memory leak with bufferpool buffers
If we don't have an input frame, and unref the outbuf, and the original
buffer was replaced by a bufferpool buffer, we need to unref the new
buffer, not the original.
If we don't have an input frame, and unref the outbuf, and the original
buffer was replaced by a bufferpool buffer, we need to unref the new
buffer, not the original.
ducatimpeg4dec: enabling workarounds for XviD too
ducatividdec: fix seek issue with xvid (ts_is_pts) clips
ducatimpeg4dec/ducatividdec: implement DTS queue
When packed frames are used, the timestamps we get from demuxer are
actually PTS, not DTS. Detect this and fix up the timestamps on
the outgoing buffers.
This commit implements detection of packed frames (PB-frames) in
ducatimpeg4dec, and a DTS queue in the base ducatividdec (which
could be used by other decoders). When packed frames are detected,
we assume the demuxer doesn't properly understand B-frames, and
therefore timestamps from demuxer must actually be PTS timestamps.
Because the codec is unaware of this, and re-ordering frames to
display order, if we preserve the original timestamps the video
sink ends up seeing timestamps out of order. To work around this
we pop the DTS from the demuxer out of a queue and use that
instead.
When packed frames are used, the timestamps we get from demuxer are
actually PTS, not DTS. Detect this and fix up the timestamps on
the outgoing buffers.
This commit implements detection of packed frames (PB-frames) in
ducatimpeg4dec, and a DTS queue in the base ducatividdec (which
could be used by other decoders). When packed frames are detected,
we assume the demuxer doesn't properly understand B-frames, and
therefore timestamps from demuxer must actually be PTS timestamps.
Because the codec is unaware of this, and re-ordering frames to
display order, if we preserve the original timestamps the video
sink ends up seeing timestamps out of order. To work around this
we pop the DTS from the demuxer out of a queue and use that
instead.
ducatimpeg4dec: xvid support
Handle xvid streams with B-frames encoded in containers that don't
support B-frames natively (ie. PB-frames). Packed frames are split
and passed to the codec in successive _process() calls, and non-coded
frames are discarded.
Handle xvid streams with B-frames encoded in containers that don't
support B-frames natively (ie. PB-frames). Packed frames are split
and passed to the codec in successive _process() calls, and non-coded
frames are discarded.
Revert "ducatimpeg4dec: use base VIDDEC3_* structs in allocate_params"
This reverts commit cad4102f744ea191dbce0d2a0d4e637320b387e8.
This commit broke KungFuPanda_1280x720_orig.mp4 which makes me a sad panda.
This reverts commit cad4102f744ea191dbce0d2a0d4e637320b387e8.
This commit broke KungFuPanda_1280x720_orig.mp4 which makes me a sad panda.
ducatividdec: fix NPE if outcaps are EMPTY
ducatividdec: reduce debug verbosity
ducatividdec: add support for outBufsInUseFlag
When outArgs->outBufsInUseFlag is set, the codec needs the current output buffer
to be passed for the next input frame.
When outArgs->outBufsInUseFlag is set, the codec needs the current output buffer
to be passed for the next input frame.
ducativc1dec: remove WMV1/WMV2 support
The codec can only do WMV3/VC1.
The codec can only do WMV3/VC1.
ducatih264dec: specify in template caps that the decoder can do up to profile=high,level=4.2
ducatividdec: emit a STREAM DECODE error when codec_process fails
ducatividdec: implement QoS handling
Helps a lot with large resolution clips where occasionally, especially at
the beginning, the codecs can't keep up decoding in realtime.
Helps a lot with large resolution clips where occasionally, especially at
the beginning, the codecs can't keep up decoding in realtime.