Commit graph

7664 commits

Author SHA1 Message Date
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
Jan Alexander Steffens (heftig)
02a6a794ec
rtmp2: Expose connection stats as property
Save the stats before we destroy the connection, so we can still
retrieve them afterwards.
2020-02-21 19:26:35 +01:00
Jan Alexander Steffens (heftig)
f1a9a3146a
rtmp2: Add gst_rtmp_connection_get_stats and _get_null_stats
The former uses a thread-safe way of getting statistics from the
connection without having to protect the fields with a lock.

The latter produces a zeroed statistics structure for use when no
connection exists.
2020-02-21 19:26:35 +01:00
Jan Alexander Steffens (heftig)
5d720eb59e
rtmp2: Count outgoing bytes and acked bytes
For statistics.
2020-02-21 19:26:33 +01:00
Jan Alexander Steffens (heftig)
0c344a7efb rtmp2sink: Add a property for the outgoing chunk size 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
f7bb2cdeb7 rtmp2: Add gst_rtmp_connection_set_chunk_size 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
63ec837824 rtmp2: Handle outgoing set chunk/window size properly
Apply outgoing sizes only after writing the chunk to the peer. This is
important particularly for the set chunk size and allows exposing it
without threading issues.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
a566461294 rtmp2: Chunk messages as buffers in loop thread
Move output chunking from gst_rtmp_connection_queue_message into
gst_rtmp_connection_start_write, which effectively moves it from the
streaming thread into the loop thread.

This allows us to handle the outgoing chunk-size message (which is
generated by changing the future chunk-size property) properly, which
could come from any other thread.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
9a13df9ba5 rtmp2: Consistently use GstBuffer for RTMP chunks 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
b03780233e rtmp2: Add gst_rtmp_chunk_stream_serialize_all
Serializes an RTMP message into a series of chunks, all in one buffer.

Similar to what gst_rtmp_connection_queue_message does to serialize
into a GByteArray.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
cb7f0c4be7 rtmp2: Add gst_rtmp_output_stream_write_all_buffer_async
Similar to gst_rtmp_output_stream_write_all_bytes_async, but takes a
GstBuffer instead of a GBytes. It can also return the number of bytes
written, which might be lower in case of an error.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
286a3829b6 rtmp2: Improve handling incoming set chunk/window size
Reject out-of-spec sizes and warn about suspiciously small sizes.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
14fd7e0884 rtmp2: Lock self->lock before OBJECT_LOCK
OBJECT_LOCK is used to protect property access only. self->lock is
used to access the RtmpConnection, mostly between the streaming thread
and the loop thread.

To avoid deadlocks involving these two locks, we obey a lock order:
If both self->lock and OBJECT_LOCK are needed, self->lock must be locked
first. Clarify this.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
6583e00d50 rtmp2: Reject oversized messages
We only have 24 bits for the size, so reject anything larger.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
0044e7a1ba rtmp2: Count in_bytes_acked instead of in_bytes_unacked
This is nicer for statistics.
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
11a1de0053 rtmp2: rtmpconnection: Use more appropriate size types
- guint32 for chunk size and window size
- guint64 for running counters
2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
279e3c333c rtmp2: Add a g_return_val_if_fail 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
03c3257f0f rtmp2: Replace explicit unref with g_main_context_invoke_full 2020-02-21 15:20:41 +00:00
Jan Alexander Steffens (heftig)
baad4fd91b rtmp2: rtmpconnection: Use GST_*_OBJECT logging
GstRtmpConnection isn't a GstObject with a name or path, but we still
get the GObject's type and address.
2020-02-21 15:20:41 +00:00
Marc Leeman
424c593871 rist: fix two minor memory leaks 2020-02-21 12:16:31 +01:00
Marc Leeman
6da6b6f3f0 rtpmanagerbad: fix two minor memory leaks 2020-02-21 12:16:28 +01:00
Marc Leeman
a710fbc12b rtpmanagerbad: reduce lock in rtpsink 2020-02-21 12:16:21 +01:00
Marc Leeman
61b062a12e rtpmanagerbad: documentation comment fix 2020-02-21 12:16:17 +01:00
Vivia Nikolaidou
3df3c3c5f6 tsparse: Add split-on-rai property
If set, buffers sized smaller than the alignment will be sent so that
RAI packets are at the start of a new buffer.

Fixes: #1190
2020-02-11 10:56:54 +00:00
Thiago Santos
0a128155b3 sdpdemux: check if connections are available on media entry before get
Otherwise we trigger an assert.
2020-02-02 22:15:40 +00:00
Vivia Nikolaidou
8d522bf3e6 mpegtsparse: Moved dispose function into finalize
dispose can be called several times and would double-free the flow
combiner in that case.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
0d2e908523 mpegtsparse: Added alignment property
alignment works like in mpegtsmux, joining several MpegTS packets into
one buffer. Default value of 0 joins as many as possible for each
incoming buffer, to optimise CPU usage.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
2f946274d5 mpegtsparse: Set delta unit flag on non-random-access buffers
If they don't have the random access flag set, they cannot be decoded
independently.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
34af8ed66a mpegtsparse: Packetize output on default srcpad
Align buffer boundaries with mpeg-ts packets, instead of keeping
whatever packetization we have from the source (network, file reading).
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
e44cbfb1da mpegtsparse: Factor common code into mpegts_packet_to_buffer
The same code was used twice for turning an MpegTSPacketizerPacket into
a GstBuffer.
2020-01-29 20:39:44 +00:00
Vivia Nikolaidou
68f69d419b mpegtspacketizer: Fix typo in flag name 2020-01-29 20:39:44 +00:00
Sebastian Dröge
287f9b18b0 mpegdemux: Update the last_ts correctly if we have no DTS
If we have no DTS but a PTS then this means both are the same, and we
should update the last_ts with the PTS. Only if both are unknown then we
don't know the current position and should not update it at all.

Previously we would always update the last_ts to GST_CLOCK_TIME_NONE if
the DTS is unknown, which caused the position to jump around and to
cause spurious gap events to be sent.
2020-01-21 23:50:52 +00:00
Sebastian Dröge
5f95a9ec61 mpegpsdemux: Send gap events for late streams whenever updating the SCR
Instead of doing it on each packet and doing it based on the distance to
the previous SCR instead of based on the DTS.

Previously we would send gap events for audio all the time if the SCR
distance was 400ms because the threshold for audio is 300ms and by only
ever updating the position when the SCR updates we would always be 100ms
above the threshold and send needless gap events.

This fixes audio glitches on various files caused by gap events.
2020-01-21 10:08:53 +00:00
Jan Schmidt
e2bdc0c48d yadif: Re-renable MMX asm on x86_64 with meson
The meson build doesn't automatically set HAVE_CPU_* defines
like autotools did, so the yadif plugin was being built without
the MMX assembler support
2020-01-19 08:50:19 +00:00
Jan Schmidt
1986d4f942 yadif: Only build inline Asm with gcc/clang 2020-01-19 08:50:19 +00:00
Tim-Philipp Müller
415c798b73 mxfdemux: add support for Apple ProRes 2020-01-15 11:51:20 +00:00
Sebastian Dröge
f72aaed9c7 timecodestamper: Add property to set the extra latency to introduce for waiting for LTC timecodes
Default to 150ms instead of 8 frames, which seems to work in the
majority of cases.
2020-01-13 18:17:23 +00:00
Sebastian Dröge
fdca7ebb4c timecodestamper: Add some more debug output 2020-01-13 18:17:23 +00:00