ducativc1dec: move log where it will be displayed
Revert "h264dec: Actually do not accept level 5.1 in High profiles"
We had the confirmation that 5.1 HP is supported
This reverts commit bd0024c9af7016e897192e66bcb3c5717f9faf08.
We had the confirmation that 5.1 HP is supported
This reverts commit bd0024c9af7016e897192e66bcb3c5717f9faf08.
ducatividdec: remove another leftover -strided caps remnant
ducativc1dec: use const where appropriate
ducatividdec: print timestamp difference, not start timestamp
ducatih264enc: check dpb size calculation for negative values
It will happen if the required input parameters are unknown.
It will happen if the required input parameters are unknown.
ducatividdec: fix typo in log
ducatih264enc: add num-reorder-frames on caps
Since we know in advance how many frames will be required for
reordering, and since ducati doesn't seem to put that information
in the stream, we can set it in caps to tell the decoder it
doesn't have to use a conservative high bound that will most
likely be way too much.
Since we know in advance how many frames will be required for
reordering, and since ducati doesn't seem to put that information
in the stream, we can set it in caps to tell the decoder it
doesn't have to use a conservative high bound that will most
likely be way too much.
ducatividenc/ducatividdec: time VIDENC/VIDDEC call time in ms
Makes it easier to read than ns, and the encoder was missing it.
Makes it easier to read than ns, and the encoder was missing it.
ducatividdec: remove -strided caps remnants
ducatividenc: add ordering info to encoded buffers
Since we know about the ordering, doing so lets us avoid
needing a parser fill this in (if we have a parser that
can do it in the first place).
Since we know about the ordering, doing so lets us avoid
needing a parser fill this in (if we have a parser that
can do it in the first place).
ducatividenc: properly timestamp frames to cater for B frames
This relies on an assumption about the codec which is explained
in a comment in the source.
This relies on an assumption about the codec which is explained
in a comment in the source.
ducatividdec: do not push all frames on IDR
h264parse now generates an ordering that doesn't reset on IDR frames,
so we do not need to do this, which breaks in some cases, and we now
always rely on the ordering information we get.
h264parse now generates an ordering that doesn't reset on IDR frames,
so we do not need to do this, which breaks in some cases, and we now
always rely on the ordering information we get.
ducatividenc: change default keyframe interval to 16
For some unclear reason, the ducati H264 encoder only accepts
some particular pairs of values for inter and intra intervals.
While 15 was working fine with no B frames, the default intra
interval does not like being used with 15, but accepts 16.
For some unclear reason, the ducati H264 encoder only accepts
some particular pairs of values for inter and intra intervals.
While 15 was working fine with no B frames, the default intra
interval does not like being used with 15, but accepts 16.
ducatih264enc: force inter-interval to 1 for low delay case
This is a setup requirement of the ducati encoder.
This is a setup requirement of the ducati encoder.
ducatih264enc: fix B frames being disabled
The dynparams also need overriding, or the settings in
params will get ignored.
The dynparams also need overriding, or the settings in
params will get ignored.
ducatividenc: change the "None" rate-preset value to "none", for consistency
ducatividenc: remove duplicate casts and assignments
ducatih264enc: override params after letting the base class set defaults
Make max-reorder-frames an actual max, not a default max
This is more user friendly, and more useful.
This is more user friendly, and more useful.
ducatividdec: do not reorder frames when reordering info is absent
This will happen for H264 if no parser is used, for instance.
This will happen for H264 if no parser is used, for instance.
ducatih264enc: default to using B frames
Also reword the inter-interval description for clarity,
it wasn't quite correct on the exact number of B frames.
Also reword the inter-interval description for clarity,
it wasn't quite correct on the exact number of B frames.
ducativideodec: add a max-reorder-frames decoder property
It allows giving a default high bound for the number of
previous frames to buffer in order to do reordering, for
those codecs with B frames. This will be used instead of
the default high bound of 16 if a stream limit can not
be found, allowing latency to be kept in check.
It allows giving a default high bound for the number of
previous frames to buffer in order to do reordering, for
those codecs with B frames. This will be used instead of
the default high bound of 16 if a stream limit can not
be found, allowing latency to be kept in check.
ducatividenc: log how many bytes the encoded data is
ducatih264enc: expose number of B frames allowed
Make the sync point determination codec specific
This removes some H264 special casing code from the base class.
This removes some H264 special casing code from the base class.
ducatividenc: use the defines from the dce header where possible
ducatimpeg4enc: set caps in configure
If this is not done, then a buffer-alloc call will be done
downstream before caps are set, and downstream will not yet
know stream particularities such as width and height.
This fixes pipelines with ducatimpeg4enc ! ducatimpeg4dec
without an intervening mpeg4videoparse.
If this is not done, then a buffer-alloc call will be done
downstream before caps are set, and downstream will not yet
know stream particularities such as width and height.
This fixes pipelines with ducatimpeg4enc ! ducatimpeg4dec
without an intervening mpeg4videoparse.
ducatih264enc: fix hrd-buffer-size property type
It is unsigned, not signed.
It is unsigned, not signed.
ducatih264enc: include profile and level on src caps
ducatih264dec: assume no B frames for baseline profile
... and constrained-baseline too, as this doesn't appear in my
H264 spec and it looks like it should be stricter than baseline
from the name.
... and constrained-baseline too, as this doesn't appear in my
H264 spec and it looks like it should be stricter than baseline
from the name.
ducatimpeg2dec: add frame reordering
ducatividdec: move frame reordering to the base class
It was made for H264, but MPEG2 is going to need it as well.
When reordering is enabled, the buffer end offset is used as
an opaque value to compare buffer. H264 sets it to the POC,
but it may be set to a timestamp, or anything else.
It was made for H264, but MPEG2 is going to need it as well.
When reordering is enabled, the buffer end offset is used as
an opaque value to compare buffer. H264 sets it to the POC,
but it may be set to a timestamp, or anything else.
ducatih264dec: use num-reorder-frames to size the frame backlog array
Using the number of reference frames is incorrect, I did not realize
when I wrote this code that all frames may not be used as reference,
and so the numbers may differ.
Using the number of reference frames is incorrect, I did not realize
when I wrote this code that all frames may not be used as reference,
and so the numbers may differ.
ducatih264dec: reorder buffers by picture order count
This fixes out of order frames when H264 video comes from
demuxers which timestamp by decoding order instead of
presentation order (such as MPEG/TS and AVI).
This fixes out of order frames when H264 video comes from
demuxers which timestamp by decoding order instead of
presentation order (such as MPEG/TS and AVI).
h264enc: Expose the SliceMode property
h264enc: Expose the EntropyCodingMode property
videnc: Allow 'None' and 'user defined' values for VidEncRatePreset
h264enc: expose the HRDBufferSize parameter
h264enc: Expose qpI/qpMinI/qpMaxI parameters
h264enc: Expose the rcAlgo parameter
ducatividdec: set number of out buffers to 0 when we don't pass any
This fixes a spurious error from the codec on flushing, when we
call process with no output buffers, while still being configured
for two output buffers.
This fixes a spurious error from the codec on flushing, when we
call process with no output buffers, while still being configured
for two output buffers.
ducatih264enc: fix alignment misnamed align
h264dec: Actually do not accept level 5.1 in High profiles
The codec documentation is not very clear about whether it is supported
or not. To avoid accepting files that would make the codec crashing
make sure not to use the ducati decoder in that case.
The codec documentation is not very clear about whether it is supported
or not. To avoid accepting files that would make the codec crashing
make sure not to use the ducati decoder in that case.
h264dec: Set the maxNumRefFrames attribute we get from the caps
In some corner case the one computed in ivahd did not correspond to
the real value of the file. We do have the right value ourself so
rely on it.
Fixes: "#101 decoder error / planet.mkv / DCE / glp1.x"
In some corner case the one computed in ivahd did not correspond to
the real value of the file. We do have the right value ourself so
rely on it.
Fixes: "#101 decoder error / planet.mkv / DCE / glp1.x"
h264dec: Set the max level to 5.1 in caps as IVAHD actually supports it
+ Pass gstducatih264dec through gst-indent
+ Pass gstducatih264dec through gst-indent
ducatividenc: log extended error info, and use the correct one from _process
ducatih264enc: announce stream-format and align in template caps
Since these are set to specific values when the source pad is
set up, they are not subject to negotiation, so it's best to
announce them in the template caps so linking can fail early.
Since these are set to specific values when the source pad is
set up, they are not subject to negotiation, so it's best to
announce them in the template caps so linking can fail early.
ducatividdec: do not tell ducati we pass input when we do not
ducatividenc: cleanup param initialization
Use a local params pointer, and remove a nop assignment
and a duplicate one.
Use a local params pointer, and remove a nop assignment
and a duplicate one.
ducatimpeg4enc: avoid casting before checking if the cast is valid
Especially as the cast was made after again.
Especially as the cast was made after again.
viddec: Add a lookup table between decoder arrays and the buffers we pass in
This avoid leak if we flush and some buffers have not been "officially" freed by
the decoders.
This avoid leak if we flush and some buffers have not been "officially" freed by
the decoders.
viddec: Do not rely on the decoder setting freeBufID to unref our buffers when possible
In some corner cases this is not reliable and once a buffer is processed and pushed through the
pad we can just drop our references without any problem.
In some corner cases this is not reliable and once a buffer is processed and pushed through the
pad we can just drop our references without any problem.
viddec: Pass through gst-indent
ducati: fix spelling mistake in plugin description
Revert "ducati: fix build when encoders are missing"
This reverts commit d17883fbb7224040671dadb422f7613439abac48.
This reverts commit d17883fbb7224040671dadb422f7613439abac48.
mpeg4enc: the codec header is not used so don't include it
ducatividdec: remove the interlaced MPEG2 half height hack
It breaks a sample I have, and should not be needed anymore.
It breaks a sample I have, and should not be needed anymore.
mpeg4enc: switch to base params (fixes l3 errors)
Base params Are Good (tm) and as a side effect, they seem to fix those
"L3 standard error: TARGET:DMM1 at address 0x0" errors we were getting.
Base params Are Good (tm) and as a side effect, they seem to fix those
"L3 standard error: TARGET:DMM1 at address 0x0" errors we were getting.
ducatividdec: ensure status is zeroed at start
Some data (eg, buf) must be NULL when unused, so zero everything
to make sure everything that has to be is.
Some data (eg, buf) must be NULL when unused, so zero everything
to make sure everything that has to be is.
Revert "configure: ensure HAVE_ENCODERS is placed in config.h"
This reverts commit d5d385a284f5754fb30ccd44ec429dff63bacc1a.
This reverts commit d5d385a284f5754fb30ccd44ec429dff63bacc1a.
ducatividdec: only heed bytesConsumed when not in entire frame mode
This value seems to be invalid when in entire frame input mode.
This fixes VC-1 playback.
This value seems to be invalid when in entire frame input mode.
This fixes VC-1 playback.
ducatih264dec: fix caps specifying "align" instead of "alignment"
This caused a caps intersection to succeed when it should have failed.
This caused a caps intersection to succeed when it should have failed.
ducatividdec: remove memory dump debug trace
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.