Commit graph

7701 commits

Author SHA1 Message Date
Nicolas Dufresne
596dfbdf37 h264parse: Remove no-op assignment
upstream was set to *out_ts, setting *out_ts to upstream here will
have no effect.
2020-04-15 14:10:15 +00:00
Sebastian Dröge
5394269c91 mpegtsmux: Chain up pad dispose function to the one of the parent class
Otherwise we will leak various memory.
2020-04-15 09:07:24 +00:00
Sebastian Dröge
b41ed0fbb0 mpegtsmux: Properly release requests pads by chaining up to aggregators function 2020-04-15 09:07:24 +00:00
Vivia Nikolaidou
fecd38c8f6 tsmux: Ability for streams to disappear and reappear
Until now, any streams in tsmux had to be present when the element
started its first buffer. Now they can appear at any point during the
stream, or even disappear and reappear later using the same PID.
2020-04-15 09:07:24 +00:00
Nicolas Dufresne
4a91a98ea1 mpegtsdemux: Don't pretend doing NAL alignment
Per specification in 2.14.2 "For PES packetization, no specific data
alignment constraints apply". So we should not advertise NAL
alignment.

This bug was introduced at the same moment the alignment field was introduced
10 years ago. The plan was that alignment=none (or no alignment field) was to
be used for mpegtsdemux, but no one noticed the error. The reason is that at
the same moment, everything dealing with H264 started defaulting to AU
alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=606662#c22

This patch will have a side effect that a parser is now needed after the
tsdemux element. The following pipeline will not negotiate anymore as the
mpegtsmux element requires alignment={nal,au}.

  ... ! tsdemux ! mpegtsmux ! ...

As a side effect, anyone that forked from tsdemux should updated their code to
fix this bug.
2020-04-14 11:36:16 -04:00
Seungha Yang
462a8130a6 h264parse: Remove useless comparison
sei_pic_struct is unsigned and GST_H264_SEI_PIC_STRUCT_FRAME is zero.

CID: 1461467
2020-04-13 12:28:14 +00:00
Nicolas Dufresne
eea520fe6d h264parse: Fix content light level value changes
Same as for H265, was found by Coverity.
2020-04-08 14:01:23 -04:00
Nicolas Dufresne
84a58b3633 h265parse: Fix content light level value changes
The comparision was not testing anything meaninful. This fixes the comparision
so we now update the caps whenever the value differ. This was detected by
coverity.

CID 1461291
2020-04-08 13:58:51 -04:00
Jan Alexander Steffens (heftig)
6680b70781
rtmp2: Avoid a deadlock when getting stats
We need to do this without holding the lock as the `g_async_queue_pop`
waits on the loop thread to deliver the stats. The loop thread might
attempt to take the lock as well, leading to a deadlock.

Taking a reference to the connection should be enough to keep this
safe.
2020-04-08 18:41:01 +02:00
Seungha Yang
be8cec5348 h264parse: Add support for inband timecode update
Add new property "update-timecode" to allow updating timecode
in picture timing SEI depending on timecode meta. Since the picture
timing SEI message requires proper VUI setting but we don't support
re-writing SPS, this might not work for some streams
2020-04-08 15:39:12 +00:00
Seungha Yang
fffbec11e4 h264parse: Don't unconditionally append timecode meta
If upstream buffer has its own timecode metatdata, don't append
new timecode meta into the buffer.
2020-04-08 15:39:12 +00:00
Seungha Yang
1a09251699 h264parser: Parse all SEI payload type even if it's not handled by parser
... so that user can handle it from outside of parser API
2020-04-08 15:39:12 +00:00
Michael Olbrich
01628fa847 sdpdemux: don't send EOS for unknown SSRC
The rtpbin sends signals for all SSRCs. Don't send an EOS when the SSRC
does not match the stream SSRC.

This avoids problems when an SSRC from another receiver times out.
2020-04-08 13:24:34 +00:00
Philippe Normand
12ff0a4797 fakevideosink: Allow allocation meta flags fine-tuning
In some scenarios the fakevideosink shouldn't advertize the overlay-composition
meta for instance, so that overlay elements perform subtitles blending
themselves.
2020-04-07 14:40:37 -04:00
Michael Olbrich
468408c6a6 mpegtspacketizer: be more tolerant when parsing the adaptation field
According to the specification, the adaptation field length must be 183 if
there is no payload data and < 183 if the packet contains an adaptation
field and payload data.

Unfortunately some payloaders always set the flag for payload data, even if
the adaptation field length is 183.

Don't return with an error in this case. Clear the payload data flag
instead and parse the adaptation field as usual. This avoids visual
artefacts for such streams.
2020-04-07 08:21:04 +00:00
Jan Schmidt
b9ebd885ff tsdemux: Send instant-rate-change event if requested in the SEEK event
Convert instant-rate-change seek events into a downstream
instant-rate-change event and skip any further local seek handling.
2020-04-02 11:26:46 +00:00
Seungha Yang
f05effe024 h264parse,h265parse: Update for video-hdr struct change
See the change of -base https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/594
2020-04-01 05:18:11 +00:00
Zeeshan Ali
355719bae7 h265parse: Set duration on buffers base on framerate 2020-03-31 14:13:30 +00:00
Zeeshan Ali
158d69fd45 h265parse: Derive src fps from vui_time_scale & vui_num_units_in_tick 2020-03-31 14:13:30 +00:00
Zeeshan Ali
51bc67d4ef h265parse: Handle interlaced video
For interlaced video:
* set the interlace mode in the src caps
* double the height from SPS in the caps.
* set field latency, instead of frame latency.

Fix #778
2020-03-31 14:13:30 +00:00
Seungha Yang
d81438a69e h264parse: Print all the syntax elements of frame packing for debugging
Other values might be useful for debugging
2020-03-31 08:30:50 +00:00
Seungha Yang
7f5347a664 rtmp2src: Add idle-timeout property
Add new property to signalling that there is no incoming data
from peer. This can be useful if users want to stop the streaming
when the connection is alive but no packet is arriving.
2020-03-27 10:25:37 +00:00
Guillaume Desmottes
c3a9d2dc64 interlace: add alternate support
Allow downstream elements to negotiate the alternate interlace mode,
splitting each input buffer in two fields, each having their own buffer.
2020-03-24 09:57:53 +01:00
Guillaume Desmottes
2db7c4e22c interlace: factor out interlace_mode_from_pattern() 2020-03-24 09:53:43 +01:00
Guillaume Desmottes
e755c45863 interlace: factor out gst_interlace_push_buffer() 2020-03-24 09:53:43 +01:00
Guillaume Desmottes
5bfbddf859 interlace: factor out gst_interlace_decorate_buffer_ts() 2020-03-24 09:53:43 +01:00
Guillaume Desmottes
eb914c127d interlace: rename copy_field()
It is actually copying both fields (to a single frame/buffer).
2020-03-24 09:53:43 +01:00
Seungha Yang
085f10340e tsdemux: Set mpegversion for AAC ADTS stream based on parsed ADTS header
Both 2 and 4 are supported version of AAC ADTS format stream.
So we need to set correct version to help negotiation
especially for non-autopluggable pipeline.
2020-03-23 10:57:26 +00:00
rubenrua
6c3f092afc asfmux: Fix typo in property description
s/milisecs/milliseconds/g
2020-03-12 18:38:11 +01:00
Thibault Saunier
fb888dada1 timecodestamper: Plug a leak 2020-03-11 21:38:13 -03:00
Edward Hervey
fa2916a159 mpegts: Add a property to ignore broken PCR streams
Some mpeg-ts (HLS, DVB, ...) streams out there have completely broken
PCR streams on which we can't reliably recover correct timestamps.

For those, provide a property that will ignore the program PCR stream
(by faking that it's not present (0x1fff)).
2020-03-11 16:28:03 +00:00
Seungha Yang
8e45fd27d1 mpegdemux: Add ignore-scr property to ignore broken SCR
Some MPEG-PS streams might not be compliant but the SCR can be ignored
if PTS/DTS in PES header is consistently increased.
2020-03-11 21:06:20 +09:00
Seungha Yang
f6328cec89 mpegdemux: Remove whitespace 2020-03-11 17:42:18 +09:00
Seungha Yang
4b06b1a56e h265parse: In-band sps/pps update if only codec_data differs in src caps
Apply in-band sps/pps resending implementation to h265parse.
2020-03-10 08:51:04 +00:00
Seungha Yang
82a7d1cd99 h264parse: In-band sps/pps update if only codec_data differs in src caps
Initially the case "only codec_data is different" was addressed in
https://bugzilla.gnome.org/show_bug.cgi?id=705333 in order for
unusual bitstreams to be handled. That's the case where sps and pps
are placed in bitstream. When sps/pps are signalled only via caps
by upstream, however, the updated codec_data is mandatory for decoder
and therefore we shouldn't ignore them.
2020-03-10 08:51:04 +00:00
Dong Il Park
691b066ec6 tsdemux: Add format_identifier for AC4 codec
According to following spec document, add format_identifier for AC4 in tsdemux.

ETSI TS 103 190-2 V1.2.1 : Annex D : AC-4 in MPEG-2 transport stream
2020-03-10 16:32:59 +09:00
yychao
adc3d12741 tsdemux: Add support for AC4
According to following two specs, add support for AC4 in tsdemux.

1. ETSI TS 103 190-2 V1.2.1 (2018-02) : Annex D (normative): AC-4 in MPEG-2 transport streams
2. ETSI EN 300 468 V1.16.1 (2019-08) : Annex D (normative):Service information implementation of AC-3, EnhancedAC-3, and AC-4 audio in DVB systems
2020-03-09 21:54:09 +00:00
Seungha Yang
959320264a h265parser: Add helper macro for nal type classification
Add some macros to remove code duplication and to make it more readable
2020-03-05 23:22:34 +09:00
Thibault Saunier
924006279a transcodebin: Avoid elements name duplication
By just letting GStreamer choose a good name
2020-03-05 09:17:49 -03:00
Guillaume Desmottes
469d2cac2f transcodebin: add converters before filters
User doesn't have any guarantee about the actual raw format decodebin will
produce so their filters may or may not fit.

Fix #1228
2020-03-04 14:15:34 +00:00
Guillaume Desmottes
667eadac92 transcodebin: fix logs when failing to link filter
- Display caps of the pad we actually tried to link.
- Use the template caps as the filter is likely to not have any caps set
  yet.
- Log pad name as well.
2020-03-04 14:15:34 +00:00
Thibault Saunier
a0423ee20f timecodestamper: Add seeking support
The approach is quite simple and doesn't take all use cases into account,
it only implements support when we are using the internal timecode we
create ourself.

Also the way we compute the sought frame count is naive, but it works
for simple cases.
2020-03-04 12:36:45 +00:00
Jan Alexander Steffens (heftig)
e83888302d rtmp2: Only grab stats on close when connection exists
If the connection attempt failed, self->connection is NULL.
2020-03-03 10:27:31 +00:00
Guillaume Desmottes
09367da35c transcodebin: mark properties as GST_PARAM_MUTABLE_READY
They are all used in the READY to PAUSED transition so should not be
changed after.
2020-02-28 16:57:30 +00:00
Guillaume Desmottes
de4ea94766 transcodebin: force decoding if a filter is defined
Filter operates on raw data so don't allow decodebin to produce
encoded data if one is defined.

My use case here is keeping the video stream untouched but apply a filter
on the audio one, while keeping the same audio format.
2020-02-28 16:57:30 +00:00
Guillaume Desmottes
4b6164339f transcodebin: logs when inserting, or not, a filter
It's not easy atm to figure out from the logs if a filter has actually be
inserted or not.
2020-02-28 16:57:30 +00:00
Olivier Crête
26ac42f7c0 fakevideosink: Align max-lateness/processing-deadline to GstVideoSink
To emulate correctly the timing video of a real sink, let's set those
properties just like a real video sink.
2020-02-27 23:25:44 +00:00
Guillaume Desmottes
2cb7c66ac7 transcodebin: consider 'any' as no restriction
gstreamer-rs set 'any' as default restriction which actually means 'no
restriction' so handle it as the absence of restriction.
2020-02-26 13:12:37 +00:00
Guillaume Desmottes
54d8360baa transcodebin: fix caps leak
encodecaps was leaked if the profile has restrictions.
2020-02-26 03:23:20 +00:00
Jan Alexander Steffens (heftig)
91a033a85e
rtmp2: Allow setting flash-version
In case the application has to deal with fussy servers. User agent
sniffing is so last decade.

Adds a property to set the Flash version on both the sink and the src.
The default stays the same (IIRC, Flash plugin for Linux from 2009).
2020-02-25 15:10:28 +01:00