platform/upstream/gstreamer.git
3 years agodebugutils: Only proxy the properties once
Nicolas Dufresne [Tue, 27 Jul 2021 15:49:47 +0000 (11:49 -0400)]
debugutils: Only proxy the properties once

The needed once call was removed accidently during porting. This was catch by
the CI as memory leaks.

Related to !2426

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2438>

3 years agomxf: Handle D10 "picture only" variant
Edward Hervey [Tue, 27 Jul 2021 10:13:43 +0000 (12:13 +0200)]
mxf: Handle D10 "picture only" variant

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/80

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2436>

3 years agova: filter: refactor convert_surface() to process()
Víctor Manuel Jáquez Leal [Sat, 24 Jul 2021 11:19:39 +0000 (13:19 +0200)]
va: filter: refactor convert_surface() to process()

The idea of this change is to add, in the future,
process_with_generator(), when multiple input surfaces are processed,
for blending.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2431>

3 years agova: filter: Refactor set_formats() to set_video_info().
Víctor Manuel Jáquez Leal [Sun, 18 Jul 2021 10:46:08 +0000 (12:46 +0200)]
va: filter: Refactor set_formats() to set_video_info().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2431>

3 years agovapostproc: Don't add video alignment option in buffer pool.
Víctor Manuel Jáquez Leal [Sun, 18 Jul 2021 15:13:16 +0000 (17:13 +0200)]
vapostproc: Don't add video alignment option in buffer pool.

vapostproc will not call gst_buffer_pool_config_set_video_alignment(),
thus this option is not required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2431>

3 years agomxfvc3: Also accept clip-wrapped vc-3
Edward Hervey [Tue, 27 Jul 2021 07:37:49 +0000 (09:37 +0200)]
mxfvc3: Also accept clip-wrapped vc-3

We can now handle this fine

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2434>

3 years agomxfdemux: Handle EOS with non-frame wrapping
Edward Hervey [Tue, 27 Jul 2021 05:59:52 +0000 (07:59 +0200)]
mxfdemux: Handle EOS with non-frame wrapping

When reaching the end of non-frame wrapping track in pull mode, we want to force
the switch to the next non-eos pad. This is similar to when we exceed the
maximum drift.

Fixes issues on EOS where not everything would be drained out and stray errors
would pop out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2434>

3 years agomxfdemux: More granular interleaved content handling
Edward Hervey [Sun, 25 Jul 2021 05:52:06 +0000 (07:52 +0200)]
mxfdemux: More granular interleaved content handling

An interleave of 500ms can be way too big for some downstream queueing
elements. Instead use a smaller 100ms interleave and silence the various
warnings about resyncing (it's normal)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2434>

3 years agodebugutils: De-duplicate proxy_properties function to a new utils module
Philippe Normand [Fri, 23 Jul 2021 08:36:10 +0000 (09:36 +0100)]
debugutils: De-duplicate proxy_properties function to a new utils module

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2426>

3 years agoIntroduce Steinberg ASIO (Audio Streaming Input/Output) plugin
Seungha Yang [Mon, 7 Jun 2021 16:40:34 +0000 (01:40 +0900)]
Introduce Steinberg ASIO (Audio Streaming Input/Output) plugin

Adds a new plugin for ASIO devices.

Although there is a standard low-level audio API, WASAPI, on Windows,
ASIO is still being broadly used for audio devices which are aiming to
professional use case. In case of such devices, ASIO API might be able
to show better quality and latency performance depending on manufacturer's
driver implementation.

In order to build this plugin, user should provide path to
ASIO SDK as a build option, "asio-sdk-path".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2309>

3 years agoaudiolatency: Expose samplesperbuffer property
Seungha Yang [Sun, 6 Jun 2021 13:32:08 +0000 (22:32 +0900)]
audiolatency: Expose samplesperbuffer property

... for user to be able to set the number of required samples.
For instance, our default value is 240 samples
(about 5ms latency in case that sample rate is 48000), which might
be larger than actual buffer size of audio capture device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2307>

3 years agocodecs: h264decoder: let print_ref_pic_list_b print the correct list name.
He Junyan [Fri, 23 Jul 2021 14:02:05 +0000 (22:02 +0800)]
codecs: h264decoder: let print_ref_pic_list_b print the correct list name.

The print_ref_pic_list_b now not only needs to trace the ref_pic_list_b0/1,
but also need to trace the ref_frame_list_0_short_term. We need to pass the
name directly to it rather than an index to refer to ref_pic_list_b0/1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2425>

3 years agocodecs: h264dec: Fix a typo in construct_ref_field_pic_lists_b.
He Junyan [Fri, 23 Jul 2021 04:31:17 +0000 (12:31 +0800)]
codecs: h264dec: Fix a typo in construct_ref_field_pic_lists_b.

The array sort of ref_frame_list_0_short_term has some typo. The
typo makes this list not in the POC ascend order and generate wrong
decoding result for interlaced streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2425>

3 years agokmssink: Fix fallback path for driver not able to scale scenario
Devarsh Thakkar [Thu, 15 Jul 2021 12:12:37 +0000 (05:12 -0700)]
kmssink: Fix fallback path for driver not able to scale scenario

When driver return error on update plane request, kmssink
disables the scaling and retries plane update.
While doing so kmssink was matching the source rectangle dimensions
to the target rectangle dimensions which were calculated
as per scaling but this is incorrect, instead what we want here is
that target rectangle dimensions should match the source rectangle
dimensions as scaling is disabled now and so we match result
rectangle dimensions with source rectangle dimensions.

While at it, also match the result rectangle coordinates for
horizontal and vertical offsets with source rectange coordinates,
as since there is no scaling being done so no recentering is
required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2415>

3 years agovideoparsers: vp9: Need to process the first frame even not key.
He Junyan [Fri, 23 Jul 2021 08:49:49 +0000 (16:49 +0800)]
videoparsers: vp9: Need to process the first frame even not key.

Some cut VP9 streams begin with a non key frame. The current code
just bail out the parse_process_frame() if not a key frame. Because
of this, we do not set the valid caps before we push the data of the
first frame(even this first frame will be discarded by the downstream
decoder because it is not a key frame).

The pipeline such as:
gst-launch-1.0 filesrc location=some.ivf ! ivfparse ! vp9parse !
  vavp9dec ! fakesink
will get a negotiation error and the pipeline can not continue. The
correct behaviour should be: the decoder discard the first frame and
continue to decode later frames successfully.

So, when the parse does not have valid stream info(should be the first
frame case), we should continue and report caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2427>

3 years agoaudiolatency: Handle audio buffers with invalid duration
Nirbheek Chauhan [Wed, 21 Jul 2021 14:10:17 +0000 (19:40 +0530)]
audiolatency: Handle audio buffers with invalid duration

pipewiresrc outputs audio buffers without a valid duration, so we need
to calculate it manually in that case.

Upstream issue: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1438

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2419>

3 years agova: h265dec: Do not assign the frame->output_buffer until output_picture.
He Junyan [Thu, 22 Jul 2021 14:00:38 +0000 (22:00 +0800)]
va: h265dec: Do not assign the frame->output_buffer until output_picture.

We may need to drop the slices such as RASL pictures with the NoRaslOutputFlag, so
the current picture of h265decoder may be freed. We should not assign the frame->
output_buffer too early until we really output it. Or, the later coming slices will
allocate another picture and trigger the assert of:
  gst_video_decoder_allocate_output_frame_with_params:
  assertion 'frame->output_buffer == NULL' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2421>

3 years agotsdemux: Handle PCR-less streams
Edward Hervey [Thu, 22 Jul 2021 13:14:26 +0000 (15:14 +0200)]
tsdemux: Handle PCR-less streams

Some programs specify a PCR PID but don't actually store any PCR values, or are
way too far apart.

In order to gracefully handle those situations, we will queue up to a certain
amount of pending buffers before deciding to give up on that PCR PID and not use
any (i.e. using DTS/PTS values as-is)

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1629

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2422>

3 years agova: H265: Add odd bit depth and chroma depth in get_rtformat.
He Junyan [Thu, 22 Jul 2021 02:44:27 +0000 (10:44 +0800)]
va: H265: Add odd bit depth and chroma depth in get_rtformat.

In H265, the stream may have odd bit depth such as 9 or 11. And
the bit depth of luma and chroma may differ. For example, the
stream with luma depth of 8 and chroma depth of 9 should use the
10 bit rtformat as the decoded picture format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2420>

3 years agocodecs: h264dec: Improve the algorithm for low latency mode.
He Junyan [Tue, 20 Jul 2021 16:04:18 +0000 (00:04 +0800)]
codecs: h264dec: Improve the algorithm for low latency mode.

In low_latency mode, try to bump the picture as soon as possible
without the frames disorder:
1. We can directly output the continuous non-reference frame.
2. Consider max_num_reorder_frames, which is special useful for
   I-P mode.
3. Consider the leading pictures with negative POC.
4  Output small POC pictures when non-reference frame comes.
4. Output the POC increment<=2 pictures. This is not 100% safe,
   but in practice this condition can be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agocodecs: h264dec: Add help function of dpb_set_max_num_reorder_frames.
He Junyan [Tue, 20 Jul 2021 15:49:12 +0000 (23:49 +0800)]
codecs: h264dec: Add help function of dpb_set_max_num_reorder_frames.

The max_num_reorder_frames can be useful for bump check. We store it
in the DPB and no need for the decoder now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agocodecs: h264dec: Add a flag to record whether picture is reference.
He Junyan [Tue, 20 Jul 2021 15:36:38 +0000 (23:36 +0800)]
codecs: h264dec: Add a flag to record whether picture is reference.

The picture->ref field will change from time to time according to decoder's
state and reference sliding window. We need another flag to record whether
the picture is a reference picture when it is created, and this can help
the bumping check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agocodecs: h264dec: Change the order of dpb_add and dpb_bump.
He Junyan [Sun, 11 Jul 2021 16:31:54 +0000 (00:31 +0800)]
codecs: h264dec: Change the order of dpb_add and dpb_bump.

The current behavior is different from the SPEC. We should check
and bump the DPB or drain the DPB before we insert the current
picture into it. This may cause the output picture disorder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agocodecs: h264dec: Modify the DPB need bump check.
He Junyan [Sun, 11 Jul 2021 16:06:49 +0000 (00:06 +0800)]
codecs: h264dec: Modify the DPB need bump check.

Accord to spec, we should not add the current picture into the DPB
when we check whether it needs to bump, so the checks of the IDR and
the "memory_management_control_operation equal to 5" are no needed.

And the spec also says that the DPB only needs to bump when there is
no empty frame buffer left(We handle the IDR cases in other places).
We need to follow that and the max_num_reorder_frames is useless.

We also minus 1 in has_empty_frame_buffer because the current frame
has not been added yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agocodecs: h264dec: Make dpb_has_empty_frame_buffer a codecs API.
He Junyan [Sun, 11 Jul 2021 16:01:58 +0000 (00:01 +0800)]
codecs: h264dec: Make dpb_has_empty_frame_buffer a codecs API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agocodecs: h264dec: Set picture to a small poc when mem_mgmt_5.
He Junyan [Mon, 5 Jul 2021 15:53:25 +0000 (23:53 +0800)]
codecs: h264dec: Set picture to a small poc when mem_mgmt_5.

When current frame memory_management_control_operation equal to 5, that
means we need to drain the dpb and the current picture act as an IDR frame.
So it should have smaller poc than the later pictures to ensure the output
order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>

3 years agomxfdemux: Make gst-indent on the CI happy
Edward Hervey [Thu, 15 Jul 2021 09:12:01 +0000 (11:12 +0200)]
mxfdemux: Make gst-indent on the CI happy

grmbl

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Handle non-frame wrapping
Edward Hervey [Thu, 15 Jul 2021 08:59:39 +0000 (10:59 +0200)]
mxfdemux: Handle non-frame wrapping

* If we have an index table for non-framed essence, we can handle it

* The demuxer has a state which indicates whether it will next fetch a KLV or
data contained *within* a KLV.

* The position on Essence Tracks always correspond to the next entry to fetch,
demuxer offset will be skipped accordingly whenever we switch between
partitions (in case of resyncs). A copy of the main clip/custom KLV for that
partition is kept to track the position within the essence of that partition.

* For clip/custom-wrapped raw audio, if the edit rate is too small (and would
cause plenty of tiny buffers to be outputted), specify a minimum number of edit
units per buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Use KLV for position/content tracking
Edward Hervey [Thu, 15 Jul 2021 08:45:46 +0000 (10:45 +0200)]
mxfdemux: Use KLV for position/content tracking

* For pull-based, this avoids pulling content if it's not needed (ex: skipping filler
packet, not downloading the content if we only need to know if/where an essence
packet is, etc...). Allows reducing i/o usage to the minimum.

* This also allows doing sub-klv position tracking, and opens the way for
non-frame-wrapping handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Output the topology of the file in debug logs
Edward Hervey [Thu, 15 Jul 2021 08:28:31 +0000 (10:28 +0200)]
mxfdemux: Output the topology of the file in debug logs

This provides a summary of the number/type of tracks in the Material and File
Packages

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Refactor pull seek
Edward Hervey [Thu, 15 Jul 2021 08:16:34 +0000 (10:16 +0200)]
mxfdemux: Refactor pull seek

In order to figure out the exact start position (backed by a keyframe) accross
all tracks, we first figure out the backing keyframe position, and *then* seek
to that position.

Avoids ending up in situations where we would properly seek to the backing
keyframe on video ... but not on the audio streams (they would have been set to
the original non-keyframe position). Fixes key-unit seeking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfaes-bwf: Handle new custom-constant-sized variant
Edward Hervey [Wed, 14 Jul 2021 05:58:01 +0000 (07:58 +0200)]
mxfaes-bwf: Handle new custom-constant-sized variant

Defined by Amendment 2:2013 to SMPTE ST 382:2007

Also define a new "UNKNOWN" wrapping type to make the difference with known
wrapping types

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfmpeg: Fix essence coding detection
Edward Hervey [Wed, 14 Jul 2021 05:54:38 +0000 (07:54 +0200)]
mxfmpeg: Fix essence coding detection

The picture essence coding matching was wrong. Use the proper "base" MXFUL for
video mpeg compression for matching.

Also handle the case where some old files would put the essence container label
in the essence coding field

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Refactor index table and offset handling
Edward Hervey [Thu, 1 Jul 2021 06:35:01 +0000 (08:35 +0200)]
mxfdemux: Refactor index table and offset handling

* Streamline offset <=> entry handling. Historically the demuxer didn't support
information from index tables and stored the discovered information in an array
per track. When index table support was added, a parallel system was setup for
that relationship. This commit unifies this into one system with the
`find_edit_entry()` and `find_entry_for_offset()` functions.

* By extension, per-track offset entry tables are only created/used if no index
table is present for those tracks.

* Use index table information as-is. The index table system from MXF is quite
complex and there are various ways to use the information contained
within. Instead of converting that information we store the data from the tables
as-is and extract the needed information when needed.

* Handle index tables without entries (i.e. all content package units are of the
same size).

* Allow collecting index table segments as we go instead of only once if a
random-index-pack is present. This also improves support of some files in
push-mode.

* When searching for keyframe entries, use the keyframe_offset if
present (speeds up searching).

* For interleaved content (i.e. several tracks in the sample essence container),
we use a system to be able to identify the position of each track in the delta
entries of index tables.

* Handle temporal offset only on tracks which *do* need it (as specified in the
delta entries of the index tables). If present, those offsets are stored in a
pre-processed table which allows computing PTS from DTS with a simple offset.

* Add a quirk for files which are known to be have wrongly stored temporal
offsets.

* Overall opens the way to handle more types of MXF files, especially those with
non-frame-wrapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Drop duplicate seek events
Edward Hervey [Tue, 29 Jun 2021 13:29:36 +0000 (15:29 +0200)]
mxfdemux: Drop duplicate seek events

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxf: Improve index entry debug log
Edward Hervey [Thu, 24 Jun 2021 07:53:08 +0000 (09:53 +0200)]
mxf: Improve index entry debug log

By printing out the various known flag values

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxf: Demote error message when resolving valid empty reference
Edward Hervey [Wed, 23 Jun 2021 07:08:33 +0000 (09:08 +0200)]
mxf: Demote error message when resolving valid empty reference

A Source Clip can have zero'd SourcePackageID and SourceTrackID, this indicates
it terminates the source reference chain

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agomxfdemux: Handle temporal reordering shift
Edward Hervey [Thu, 17 Jun 2021 14:38:54 +0000 (16:38 +0200)]
mxfdemux: Handle temporal reordering shift

This is similar to how the same issue was handled in qtdemux.

In order for the "DTS <= PTS" constraint to be respected, we calculate the
maximum temporal reordering that can happen (via index tables).

If there is a non-0 temporal reordering, we:
* Shift all outgoing PTS by that amount
* Shift segment for that stream by that amount
* Don't modify DTS (i.e. they might end up having negative running-time, before
the start of the segment)

Also ensure all entries have a valid PTS set, previously this wouldn't be set
for entries with a temporal offset of 0.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/584

(and maybe a lot of other issues)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2371>

3 years agova: vp9dec: Minor cleanups.
Víctor Manuel Jáquez Leal [Sat, 17 Jul 2021 18:49:15 +0000 (20:49 +0200)]
va: vp9dec: Minor cleanups.

Added a comment with a future to-do, enhanced another comment and
fixed a typo in an error log message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2417>

3 years agova: decoder: Group decoder methods.
Víctor Manuel Jáquez Leal [Sat, 17 Jul 2021 18:48:21 +0000 (20:48 +0200)]
va: decoder: Group decoder methods.

Move up gst_va_decoder_get_config() to group decoders function in the
same file area.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2417>

3 years agova: Refactor _format_changed() to _config_is_equal().
Víctor Manuel Jáquez Leal [Sat, 17 Jul 2021 18:45:48 +0000 (20:45 +0200)]
va: Refactor _format_changed() to _config_is_equal().

Change gst_va_decoder_format_changed() to
gst_va_decoder_config_is_equal(), which is more similar with other
GStreamer API.

The function call is replaced but it has to be negated because the
return value is the opposite.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2417>

3 years agova: Refactor _change_resolution() to _update_frame_size().
Víctor Manuel Jáquez Leal [Sat, 17 Jul 2021 18:37:52 +0000 (20:37 +0200)]
va: Refactor _change_resolution() to _update_frame_size().

Rename gst_va_decoder_change_resolution() to
gst_va_decoder_update_frame_size() which resembles
gst_va_decoder_set_frame_size().

Also added a comment to clarify the function use and makes more
specific the error message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2417>

3 years agova: Refactor _set_format() to _set_frame_size().
Víctor Manuel Jáquez Leal [Sat, 17 Jul 2021 18:29:45 +0000 (20:29 +0200)]
va: Refactor _set_format() to _set_frame_size().

Renamed gst_va_decoder_set_format() to
gst_va_decoder_set_frame_size_with_surfaces() which resembles better
the passed parameters. Internally it creates the vaContext.

Added gst_va_decoder_set_frame_size() which is an alias of
gst_va_decoder_set_frame_size_with_surfaces() without surfaces. This
is the function which replaces gst_va_decoder_set_format() where
used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2417>

3 years agocodecs: h265decoder: Fix a typo of NumPocTotalCurr when process ref pic list.
He Junyan [Fri, 16 Jul 2021 07:24:11 +0000 (15:24 +0800)]
codecs: h265decoder: Fix a typo of NumPocTotalCurr when process ref pic list.

We should use the NumPocTotalCurr value stored in decoder, which is a calculated
valid value, rather than use the invalid value in the slice header. Most of the
time, the NumPocTotalCurr is 0 and make the tmp_refs a very short length, and
causes the decoder's wrong result.
By the way, the NumPocTotalCurr is not the correct name specified in H265 spec,
its name should be NumPicTotalCurr. We change it to the correct name.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2414>

3 years agova: h265dec: Do not add non reference frames into ref list.
He Junyan [Fri, 16 Jul 2021 05:21:11 +0000 (13:21 +0800)]
va: h265dec: Do not add non reference frames into ref list.

The VA's ReferenceFrames should only contain the reference frame, we
should not add the non reference frames into this list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2414>

3 years agotests: Enable closedcaption test on Windows
Seungha Yang [Thu, 15 Jul 2021 10:44:21 +0000 (19:44 +0900)]
tests: Enable closedcaption test on Windows

... if closedcaption plugin is available

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2411>

3 years agomfvideoenc: Disable RGB format support
Seungha Yang [Thu, 15 Jul 2021 07:44:18 +0000 (16:44 +0900)]
mfvideoenc: Disable RGB format support

Some GPUs support BGRA format and it will be converted to subsampled
YUV format by GPU internally. Disable this implicit conversion
since the conversion parameters such as input/output colorimetry
are not exposed nor it's written in bitstream (e.g., VUI).
We prefer explicit conversion via our conversion elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2410>

3 years agova: h265dec: Fix a temp var overflow bug when write pred weight table.
He Junyan [Thu, 15 Jul 2021 13:32:54 +0000 (21:32 +0800)]
va: h265dec: Fix a temp var overflow bug when write pred weight table.

The temp guint8 var of delta_chroma_offset_l0 and delta_chroma_offset_l1
can not cover the full range of delta_chroma_weight_l0/1 in the slice
header. When overflow happens, the decoder result is wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2412>

3 years agodash: Store entire ContentProtection node in protection event data
Philippe Normand [Mon, 12 Jul 2021 11:08:20 +0000 (12:08 +0100)]
dash: Store entire ContentProtection node in protection event data

Some manifests use the ContentProtection node to store additional information
such as the license server url. Our MPD parser used to process the
ContentProtection node, extracting Playready PSSH boxes. However for other DRM
systems, only the `value` attribute was passed down to the protection event, so
for example, Widevine data was not parsed at all and "Widevine" was passed to
the event, which is not very useful for decryptors that require a PSSH init
data.

Parsing should now be done by decryptors which will receive the entire
ContentProtection XML node as a string. This gives more "freedom" to the
decryptor which can then detect and parse custom nodes as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2400>

3 years agova: vp9dec: We need to check the resolution changes for every frame.
He Junyan [Wed, 14 Jul 2021 14:36:52 +0000 (22:36 +0800)]
va: vp9dec: We need to check the resolution changes for every frame.

The VP9 streams have the ability to change the resolution dynamically
at any time point. It does not send ad KEY frame before change the
resolution, even the INTER frame can change the resolution immediately.
So we need to check the resolution change for each frame and do the
re-negiotiation if needed.

Some insaned stream may play in resolution A first and then dynamically
changes to B, and after 1 or 2 frames, it use a show_existing_frame to
repeat the old frame of resolution A before. So, not only new_picture(),
but also duplicate_picture() need to check this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2407>

3 years agova: vp9dec: Do not re-create context for dynamical resolution change.
He Junyan [Wed, 14 Jul 2021 06:43:51 +0000 (14:43 +0800)]
va: vp9dec: Do not re-create context for dynamical resolution change.

The driver for VP9 should have the ability to handle the dynamical resolution
changes. So if only the resolution changes, we should not re-create the config
and context in negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2407>

3 years agova: decoder: Add helper functions to get and change the resolution.
He Junyan [Wed, 14 Jul 2021 06:27:34 +0000 (14:27 +0800)]
va: decoder: Add helper functions to get and change the resolution.

Some codecs such as VP9, its config and context have the ability to
dynamically. When we only change the width and height, no need to
re-create the config and context. The helper function can just change
the resolution without re-creating config and context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2407>

3 years agompegtsmux: Quieten "missed PCR" warnings in VBR mode.
Jan Schmidt [Fri, 28 May 2021 20:03:26 +0000 (06:03 +1000)]
mpegtsmux: Quieten "missed PCR" warnings in VBR mode.

When the muxer is operating in VBR mode, it's kind of expected
for now that we might not put the PCR in exactly the right place,
because the muxer doesn't schedule packets that way. In that case
don't warn constantly about the PCR ending up a few ms off target.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2295>

3 years agortmp2src: workaround a GLib race when destroying a GMainContext/GSource
Matthew Waters [Tue, 13 Jul 2021 11:38:10 +0000 (21:38 +1000)]
rtmp2src: workaround a GLib race when destroying a GMainContext/GSource

https://gitlab.gnome.org/GNOME/glib/-/issues/803

Basically, if destruction of a GSource and its associated GMainContext are
not synchronised, Then the GSource destruction can access freed
GMainContext resources and cause a crash.  This is not super common but
can happen.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2405>

3 years agocodecs: h265decoder: Always free messages while parsing SEI
Mads Buvik Sandvei [Thu, 8 Jul 2021 12:25:23 +0000 (14:25 +0200)]
codecs: h265decoder: Always free messages while parsing SEI

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2390>

3 years agovp9parse: Skip parsing decode-only frame
Seungha Yang [Wed, 14 Jul 2021 10:39:11 +0000 (19:39 +0900)]
vp9parse: Skip parsing decode-only frame

Decode-only frame (i.e., show_existing_frame == 1) doesn't hold
any valid information apart from the index of frame to be duplicated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2408>

3 years agowpesrcbin: Use gst_buffer_new_memdup()
Philippe Normand [Tue, 13 Jul 2021 15:55:30 +0000 (16:55 +0100)]
wpesrcbin: Use gst_buffer_new_memdup()

g_memdup() is deprecated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2406>

3 years agocodecs: vp9statefulparser: not init segmentation_abs_or_delta_update.
He Junyan [Mon, 12 Jul 2021 15:25:02 +0000 (23:25 +0800)]
codecs: vp9statefulparser: not init segmentation_abs_or_delta_update.

The segmentation_abs_or_delta_update is a stateful var, it should not
be inited every time when parsing the segmentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2403>

3 years agotests: wasapi2: Add more device reuse cases
Seungha Yang [Mon, 12 Jul 2021 14:21:29 +0000 (23:21 +0900)]
tests: wasapi2: Add more device reuse cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2402>

3 years agowasapi2ringbuffer: Close IAudioClient on GstAudioRingBuffer::release
Seungha Yang [Mon, 12 Jul 2021 13:17:22 +0000 (22:17 +0900)]
wasapi2ringbuffer: Close IAudioClient on GstAudioRingBuffer::release

IAudioClient interface is not reusable once it's initialized.
So we should close the handle and reopen it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2402>

3 years agowasapi2ringbuffer: Run gst-indent
Seungha Yang [Mon, 12 Jul 2021 18:35:22 +0000 (03:35 +0900)]
wasapi2ringbuffer: Run gst-indent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2402>

3 years agocodecparsers: av1: fix underflow in last_frame_idx
Daniel Almeida [Mon, 12 Jul 2021 12:01:06 +0000 (09:01 -0300)]
codecparsers: av1: fix underflow in last_frame_idx

The spec mandates this field be parsed using unsigned arithmetic. Nevertheless,
av1parser will use -1 apparently as an uninitialized value in
gst_av1_parse_frame_header. This immediately underflows last_frame_idx
though, since its type was defined as guint8. Fix this by converting to gint8.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2401>

3 years agowasapi: fix reinit of audioclient in prepare()
Jakub Janků [Thu, 18 Mar 2021 09:55:58 +0000 (10:55 +0100)]
wasapi: fix reinit of audioclient in prepare()

When the sink goes from PLAYING to READY and then back to PLAYING,
the initialization of the audioclient in prepare() fails with the
error AUDCLNT_E_ALREADY_INITIALIZED. As a result, the playback
stops.

To fix this, we need to drop the AudioClient in unprepare() and
grab a new one in prepare() to be able to initialize it again
with the new buffer spec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2096>

3 years agowasapi: split gst_wasapi_util_get_device_client()
Jakub Janků [Wed, 17 Mar 2021 21:45:57 +0000 (22:45 +0100)]
wasapi: split gst_wasapi_util_get_device_client()

The functionality now resides in
gst_wasapi_util_get_device() and
gst_wasapi_util_get_audio_client().

This is a preparatory patch. It will be used in the following
patch to init/deinit the AudioClient separately from the device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2096>

3 years agotests: wasapi: check PLAYING -> READY -> PLAYING
Jakub Janků [Sun, 11 Jul 2021 16:14:46 +0000 (18:14 +0200)]
tests: wasapi: check PLAYING -> READY -> PLAYING

Such sequence of state changes is valid and no error should happen.
At the moment, the test fails. Following patches aim to fix it.

Partially based on the code in tests/check/elements/wasapi2.c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2096>

3 years agoplay: Emit correct signal
Guido Günther [Fri, 9 Jul 2021 12:55:43 +0000 (14:55 +0200)]
play: Emit correct signal

SIGNAL_MEDIA_INFO_UPDATED should be emitted on media info changes,
not SIGNAL_VIDEO_DIMENSIONS_CHANGED.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2398>

3 years agovulkan: Declare missing auto-pointer cleanup functions.
Víctor Manuel Jáquez Leal [Fri, 5 Mar 2021 08:18:15 +0000 (09:18 +0100)]
vulkan: Declare missing auto-pointer cleanup functions.

Also removed a couple guards since, given the glib dependency, they
are set.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2396>

3 years agovulkan: filter: Use filter variable name for choosing queue.
Víctor Manuel Jáquez Leal [Wed, 3 Mar 2021 11:54:20 +0000 (12:54 +0100)]
vulkan: filter: Use filter variable name for choosing queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2396>

3 years agovulkansink: Fix element metadata.
Víctor Manuel Jáquez Leal [Wed, 3 Mar 2021 07:50:13 +0000 (08:50 +0100)]
vulkansink: Fix element metadata.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2396>

3 years agomsdkvpp: use NV12 as default format on srcpad
Yinhang Liu [Fri, 25 Jun 2021 01:19:25 +0000 (09:19 +0800)]
msdkvpp: use NV12 as default format on srcpad

By default, sinkpad is NV12 format and srcpad is BGRA format, the
different format will trigger an implicit format conversion in
msdkvpp, which will cause performance drop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2394>

3 years agogst-libs/gst/wayland: handle display passing better
Dominique Martinet [Mon, 31 May 2021 23:40:17 +0000 (08:40 +0900)]
gst-libs/gst/wayland: handle display passing better

failure to pass a display in 'handle' would result in uninitialized value
being returned, which would often segfault later down the road when trying
to initialize gstreamer context with it.
Check the return value of gst_structure_get() to make sure we return valid
data.

Furthermore, the gstglimagesink in gst-plugins-base also has a similar
mechanism but uses 'display' as field name to pass the value; instead of
requiring the application to behave differently depending on what sink
was automatically detected just try to read both values here, with display
being the new default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2292>

3 years agodashdemux: Log protection events on corresponding pad
Philippe Normand [Thu, 8 Jul 2021 13:46:11 +0000 (14:46 +0100)]
dashdemux: Log protection events on corresponding pad

GstDashDemuxStream is not a GstObject, so use its pad as associated object when
emitting log messages.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2389>

3 years agova: vpp: Improve the color properties setting.
He Junyan [Thu, 8 Jul 2021 08:49:27 +0000 (16:49 +0800)]
va: vpp: Improve the color properties setting.

The current setting of color properties are not very correct and
we will get some kind of "unknown Color Standard for YUV format"
warnings printed out by drivers. The video-color already provides
some standard APIs for us, and we can use them directly.
We also change the logic to: Finding the exactly match or explicit
standard first. If not found, we continue to find the most similar
one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2385>

3 years agomfvideosrc: Fix negotiation when interlace-mode is specified
Seungha Yang [Thu, 8 Jul 2021 10:03:06 +0000 (19:03 +0900)]
mfvideosrc: Fix negotiation when interlace-mode is specified

Given caps does not need to be strictly subset of device caps.
Allow accept it if device caps and requested caps can intersect

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1619
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2384>

3 years agocccombiner: mark field 0 as valid when generating padding CDP
Mathieu Duponchelle [Thu, 8 Jul 2021 00:24:18 +0000 (02:24 +0200)]
cccombiner: mark field 0 as valid when generating padding CDP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2383>

3 years agomfvideobuffer: Don't error for unexpected Unlock/Unlock2D call
Seungha Yang [Tue, 6 Jul 2021 08:14:21 +0000 (17:14 +0900)]
mfvideobuffer: Don't error for unexpected Unlock/Unlock2D call

Some GPU vendor's MFT implementation calls IMFMediaBuffer::Unlock()
without previous IMFMediaBuffer::Lock() call. Which is obviously
driver bug but we can ignore the Unlock call.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2381>

3 years agodashsink: fix crash with no pad name for representation
Stéphane Cerveau [Wed, 30 Jun 2021 08:30:43 +0000 (10:30 +0200)]
dashsink: fix crash with no pad name for representation

if there is no pad name, the representation id
was NULL, causing a crash when writing the mpd file.

gst-launch-1.0 videotestsrc num-buffers=900 ! video/x-raw, width=800,
height=600, framerate=30/1 ! x264enc ! video/x-h264, profile=high !
dashsink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2064>

3 years agodashsink: Add signals for allowing custom playlist/fragment
Stéphane Cerveau [Tue, 9 Mar 2021 10:40:43 +0000 (11:40 +0100)]
dashsink: Add signals for allowing custom playlist/fragment

Instead of always going through the file system API we allow the
application to modify the behaviour. For the playlist itself and
fragments, the application can provide a GOutputStream. In addition the
sink notifies the application whenever a fragment can be deleted.

Following the HLS change:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/918

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2064>

3 years agocodecs: h265dec: Disable the POC order warning for negative POC.
He Junyan [Tue, 6 Jul 2021 06:06:24 +0000 (14:06 +0800)]
codecs: h265dec: Disable the POC order warning for negative POC.

There may be leading frames after the IRAP frames, which has negative
POC. This kind of frames are allowed and they will be displayed before
the IRAP frame. So the warning should not be triggered for them. Init
the last_output_poc to G_MININT32 can avoid this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2380>

3 years agocodecs: h264dec: Disable the POC order warning for negative POC.
He Junyan [Tue, 6 Jul 2021 05:38:16 +0000 (13:38 +0800)]
codecs: h264dec: Disable the POC order warning for negative POC.

There may be leading frames after the IDR frame, which has negative
POC. This kind of frames are allowed and they will be displayed before
the IDR frame. So the warning should not be triggered for them. Init
the last_output_poc to G_MININT32 can avoid this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2380>

3 years agointerlace: Push the reconfigure event in the right direction
Jan Alexander Steffens (heftig) [Fri, 25 Jun 2021 13:57:03 +0000 (15:57 +0200)]
interlace: Push the reconfigure event in the right direction

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2361>

3 years agova: basedec: Fix some artifact when do the crop copy.
He Junyan [Mon, 5 Jul 2021 07:44:34 +0000 (15:44 +0800)]
va: basedec: Fix some artifact when do the crop copy.

The default video converter setting will add some artifact into
the picture for 10/12 bits conversion. This make the MD5 checksum
change from the original picture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2379>

3 years agod3d11decoder: Enable zero-copy for Qualcomm
Seungha Yang [Sun, 4 Jul 2021 17:05:03 +0000 (02:05 +0900)]
d3d11decoder: Enable zero-copy for Qualcomm

Qualcomm GPU works fine with current implementation now.
Noticeable difference between when it was disabled and current
d3d11 implementation is that we now support GstD3D11Memory
pool, so there will be no more frequent re-binding decoder surface anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2377>

3 years agomxfdemux: Check validity of interleaved File Package
Edward Hervey [Mon, 5 Jul 2021 05:42:39 +0000 (07:42 +0200)]
mxfdemux: Check validity of interleaved File Package

As specified by the S377 MXF core specification, if a file package has
interleaved content, then all tracks must be using the same Edit Rate

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2378>

3 years agod3d11vp9dec: Fix for incorrect use_prev_in_find_mv_refs setting
Seungha Yang [Sun, 4 Jul 2021 16:54:02 +0000 (01:54 +0900)]
d3d11vp9dec: Fix for incorrect use_prev_in_find_mv_refs setting

Set use_prev_in_find_mv_refs depending on context. The value seems
to be used by AMD and Qualcomm (Intel and NVIDIA doesn't make difference
as per test)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2376>

3 years agogstmsdkvpp: add RGBP and BGRP in src pad
Haihao Xiang [Tue, 11 May 2021 06:07:14 +0000 (14:07 +0800)]
gstmsdkvpp: add RGBP and BGRP in src pad

It requires MFX version 2.4+

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2234>

3 years agomediafoundation: Port to IID_PPV_ARGS
Seungha Yang [Sat, 3 Jul 2021 15:36:27 +0000 (00:36 +0900)]
mediafoundation: Port to IID_PPV_ARGS

Make code short where possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2375>

3 years agomfaudioenc: Remove pointless enumerating for hardware audio encoder
Seungha Yang [Sat, 3 Jul 2021 15:24:09 +0000 (00:24 +0900)]
mfaudioenc: Remove pointless enumerating for hardware audio encoder

Hardware audio encoder can exist in theory, but it's untested
and we are not sure whether it can be preferred over software
implementation which is implemented by MS

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2375>

3 years agomediafoundation: Fix typos
Seungha Yang [Sat, 3 Jul 2021 14:12:08 +0000 (23:12 +0900)]
mediafoundation: Fix typos

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2375>

3 years agomediafoundation: Run gst-indent
Seungha Yang [Sat, 3 Jul 2021 13:56:48 +0000 (22:56 +0900)]
mediafoundation: Run gst-indent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2375>

3 years agova: Consider the compatibility when we get_profile() for H265 decoder.
He Junyan [Sat, 26 Jun 2021 13:42:37 +0000 (21:42 +0800)]
va: Consider the compatibility when we get_profile() for H265 decoder.

Adding the compatile profiles when we decide the final profile used for decoding.
The final profile candidates include:
1. The profile directly specified by SPS, which is the exact one.
2. The compatile profiles decided by the upstream element such as the h265parse.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2322>

3 years agoh265parse: Add special profile case for profile_idc 0.
He Junyan [Sun, 27 Jun 2021 07:34:28 +0000 (15:34 +0800)]
h265parse: Add special profile case for profile_idc 0.

This is a work-around to identify some main profile streams having
wrong profile_idc. There are some wrongly encoded main profile streams
which doesn't have any of the profile_idc values mentioned in Annex-A,
instead, general_profile_idc has been set as zero and the
general_profile_compatibility_flag[general_profile_idc] is TRUE.
Assuming them as MAIN profile for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2322>

3 years agoh265parse: Map -intra profiles to non-intra compatible profiles.
He Junyan [Sat, 26 Jun 2021 07:11:47 +0000 (15:11 +0800)]
h265parse: Map -intra profiles to non-intra compatible profiles.

All the -intra profiles can map to non-intra profiles as compatible
profiles, except the monochrome case for main and main-10.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2322>

3 years agova: vp9dec: update segmentation and store the result.
He Junyan [Thu, 1 Jul 2021 11:27:28 +0000 (19:27 +0800)]
va: vp9dec: update segmentation and store the result.

The segmentation is stateful, its information may depend on the previous
segmentation setting. For example, if loop_filter_delta_enabled is TRUE,
the filter_level[GST_VP9_REF_FRAME_INTRA][1] should inherit the previous
frame's value and can not be calculated by the current frame's segmentation
data only. So we need to maintain the segmentation state inside the vp9
decoder and update it when the new frame header comes.

We also fix the CLAMP issue of lvl_seg and intra_lvl because of their wrong
uint type here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>

3 years agocodecparsers: vp9statefulparser: Fix the gst_vp9_get_qindex clamp issue.
He Junyan [Wed, 30 Jun 2021 07:23:15 +0000 (15:23 +0800)]
codecparsers: vp9statefulparser: Fix the gst_vp9_get_qindex clamp issue.

The alternate quantizer is a delta value and should be int type.
We mark it wrongly as uint, that will make CLAMP (data, 0, 255)
always choose 255 rather than 0 if the data < 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>

3 years agocodecparsers: vp9parser: Use macro to define the size of filter_level in Segmentation.
He Junyan [Wed, 30 Jun 2021 07:32:42 +0000 (15:32 +0800)]
codecparsers: vp9parser: Use macro to define the size of filter_level in Segmentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>

3 years agocodecparsers: vp9parser: Delete the verbose redefine of MAX_LOOP_FILTER.
He Junyan [Wed, 30 Jun 2021 04:15:42 +0000 (12:15 +0800)]
codecparsers: vp9parser: Delete the verbose redefine of MAX_LOOP_FILTER.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>

3 years agova: allocator: dma: Fail when mapping the non-linear buffer.
He Junyan [Tue, 29 Jun 2021 15:21:24 +0000 (23:21 +0800)]
va: allocator: dma: Fail when mapping the non-linear buffer.

The current way of DMA buffer mapping is simply forwarding the job
to parent's map function, which is a mmap(). That can not handle the
non-linear buffers, such as tiling, compressed, etc. The incorrect
mapping of such buffers causes broken images, which are recognized
as bugs. We should directly block this kind of mapping to avoid the
misunderstanding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2353>

3 years agoccconverter: fix framerate caps negotiation from non-cdp to cdp
Matthew Waters [Fri, 2 Jul 2021 03:10:25 +0000 (13:10 +1000)]
ccconverter: fix framerate caps negotiation from non-cdp to cdp

We can only convert from non-cdp to cdp within the confines of valid cdp
framerates.  The existing caps negotiation code was allowing any
framerate to convert to a cdp output which is incorrect and would hit an
assertion later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2372>

3 years agocodecs: h265decoder: Consider the conformance window changes when new_sequence().
He Junyan [Wed, 9 Jun 2021 07:16:39 +0000 (15:16 +0800)]
codecs: h265decoder: Consider the conformance window changes when new_sequence().

The change of conformance_window_flag and crop windows size also has impact on the
output resolution and caps. So it deserves a trigger of new_sequence() to notify
the sub class to update caps and pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2312>