Commit graph

17 commits

Author SHA1 Message Date
Tim-Philipp Müller
7f9f3d38b2 rtp: h265: use common meta utility functions
https://bugzilla.gnome.org/show_bug.cgi?id=761606
2016-02-16 00:25:46 +00:00
Luis de Bethencourt
139108c83a gstrtph265depay: keep consistency with rtph264depay
Use gst_rtp_drop_meta() and the same function prototype for
gst_rtp_copy_meta() to keep consistency with the RTP elements in
gst-plugins-good
2016-02-16 00:24:41 +00:00
Luis de Bethencourt
403ac009fa rtph265depay: fix termination of access unit
Only consider the access unit complete when the next-occurring VCL NAL unit
has the first bit after its NAL unit header equal to 1.
2016-02-16 00:24:41 +00:00
Luis de Bethencourt
983e30f658 rtph265depay: fix unneeded sub-buffer creation
We create a sub-buffer just to copy over its metas and then throw it
away immediately, just use the original input buffer directly.
2016-02-16 00:24:41 +00:00
Luis de Bethencourt
698e5bbfb5 rtph265depay: make sure we call handle_nal for each NAL
Call handle_nal for each NAL in the STAP-A RTP packet. This makes sure
we correctly extract the SPS and PPS.

https://bugzilla.gnome.org/show_bug.cgi?id=730999
2016-02-16 00:24:41 +00:00
Luis de Bethencourt
f1e2849438 rtph265depay: copy metadata in the depayloader, but only the relevant ones
The payloader didn't copy anything so far, the depayloader copied every
possible meta. Let's make it consistent and just copy all metas without
tags or with only the video tag.

https://bugzilla.gnome.org/show_bug.cgi?id=751774
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
3bede1c95b rtph265depay: checking if depay has sps/pps nals before insertion
Related to: https://bugzilla.gnome.org/show_bug.cgi?id=753430

https://bugzilla.gnome.org/show_bug.cgi?id=753228
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
18b628824b rtph265depay: only update the srcpad caps if something else than the codec_data changed
h264parse and gstrtph264depay do the same, let's keep the behaviour
consistent. As we now include the codec_data inside the stream, this causes
less caps renegotiation.

https://bugzilla.gnome.org/show_bug.cgi?id=753228
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
3979ffa6a3 rtph265depay: PPS replaces old PPS if it has the same id
https://bugzilla.gnome.org/show_bug.cgi?id=753228
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
d10b6f1e3a rtph265depay: Insert SPS/PPS NALs into the stream
rtph264depay does the same and this fixes decoding of some streams with 32
SPS (or 256 PPS). It is allowed to have SPS ID 0 to 31 (or PPS ID 0 to 255),
but the field in the codec_data for the number of SPS or PPS is only 5
(or 8) bit. As such, 32 SPS (or 256 PPS) are interpreted as 0 everywhere.

This looks like a mistake in the part of the spect about the codec_data.
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
0bfa97b047 rtph265depay: implement process_rtp_packet() vfunc
For more optimised RTP packet handling: means we don't need to map the
input buffer again but can just re-use the mapping the base class has
already done.

Based on: https://bugzilla.gnome.org/show_bug.cgi?id=750235

https://bugzilla.gnome.org/show_bug.cgi?id=753228
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
a526d014db rtph265depay: Use GST_BUFFER_PTS() instead of GST_BUFFER_TIMESTAMP()
Switching to GST_BUFFER_TIMESTAMP() to be consistent with other rtp code.
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
470c8b3720 rtph265depay: prevent trying to get 0 bytes from adapter
This causes an assertion and would lead to getting a NULL instead
of a buffer. Without proper checking this would easily lead to a
segfault.

Related to rpth264depay: https://bugzilla.gnome.org/show_bug.cgi?id=737199
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
51791d8fe2 rtp: donl_present variable unused
donl_present is not implemented, yet the value is set and checked a few times.
Cleaning this.

CID #1249687
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
59fea44503 rtp: fix nal unit type check
After further investigation the previous commit is wrong. The code intended to
check if the type is 39 or the ranges 41-44 and 48-55. Just like gsth265parse.c
does. Type 40 would not be complete.
2016-02-16 00:24:40 +00:00
Luis de Bethencourt
d215b18a20 rtp: fix dead code and check for impossible values
nal_type is the index for a GstH265NalUnitType enum. There are two types of dead
code here:
First, after checking if nal_type is >= 39 there are two OR conditionals that
check if the value is in ranges higher than that number, so if nal_type >= 39
falls in the True branch those other conditions aren't checked and if it falls
in the False branch and they are checked, they will always also be False. They
are redundant.
Second, the enum has a range of 0 to 40. So the checks for ranges higher than 41
should never be True.
Removing this redundant checks.

CID 1249684
2016-02-16 00:24:40 +00:00
Thijs Vermeir
544c0d75ce rtp: add h265 RTP payloader + depayloader 2016-02-16 00:24:40 +00:00