summaryrefslogtreecommitdiff
path: root/gst/rtmp2
AgeCommit message (Collapse)Author
2020-12-09rtmp2/connection: pass the parent cancellable down to the connectionMatthew Waters
Otherwise, when rtpm2src cancels an inflight operation that has a queued message stored, then the rtmp connection operation is not stopped. If the cancellation occurs during rtmp connection start up, then rtpm2src does not have any way of accessing the connection object as it has not been returned yet. As a result, rtpm2src will cancel, the connection will still be processing things and the GMainContext/GMainLoop associated with the outstanding operation will be destroyed. All outstanding operations and the rtmpconnection object will therefore be leaked in this case. Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1425 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1865>
2020-10-12rtmp2sink: don't expose stop-commands property in backported patchesTim-Philipp Müller
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1628>
2020-10-12rtmp2sink: add docs section with since marker on new stop-commands propertyNazar Mokrynskyi
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1628>
2020-10-12rtmp2: fix code style, update documentation cacheNazar Mokrynskyi
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1628>
2020-10-12rtmp2: Clean up (improve) GstRtmpStopCommands typeJan Alexander Steffens (heftig)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1628>
2020-10-12rtmp2sink: handle EOS event and close streamNazar Mokrynskyi
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1285 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1628>
2020-10-02rtmp2: Replace stats queue with stats lockJan Alexander Steffens (heftig)
Making the thread receiving the stats wait on the loop to respond was not a good idea, as the latter can get blocked on the streaming thread. Have get_stats read the values directly, adding a lock to ensure we don't read garbage. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1629>
2020-08-30rtmp2: Need to unescape the userinfo before settingNirbheek Chauhan
This regressed in 827afa206d8c9675f2a7af402396552c2ed1df09. The same fix was also committed to the webrtc element, but rtmp2 was missed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1547>
2020-08-03webrtc, rtmp2: Warn if the user or password aren't escapedNirbheek Chauhan
If the user/pass aren't escaped, the userinfo will be ambiguous and we won't know where to split. We will accidentally get it right if the : belongs in the password. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1481>
2020-08-03webrtc, rtmp2: Fix parsing of userinfo in URI stringsNirbheek Chauhan
While parsing the string, `gst_uri_from_string()` also unescapes the userinfo. This is bad if your username contains a `:` character, since we will then split the userinfo at the wrong location when parsing it. To fix this, we can use the new `gst_uri_from_string_escaped()` API that was added in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/583 Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/831 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1481>
2020-07-10docs: fix element names in section headersTim-Philipp Müller
Hopefully that'll make hotdoc pick up the docs for these elements. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1428>
2020-07-01rtmp2: Set connect args like libavformat doesJan Alexander Steffens (heftig)
To improve our compatibility. Critically, a server might elide data for codecs we don't advertise. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01rtmp2: Add support for AGGREGATE messagesJan Alexander Steffens (heftig)
They're multiple frames (tags) of FLV data wrapped into a message. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01rtmp2: Move FLV tag header parsing into rtmputils.cJan Alexander Steffens (heftig)
To be shared with the AGGREGATE handling. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01rtmp2: Mark our memory singleton as leakableJan Alexander Steffens (heftig)
So it doesn't appear in the leaks tracer. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-07-01rtmp2: Remove GST_ERROR from rtmputils.cJan Alexander Steffens (heftig)
This file does not have debug logging set up. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1384>
2020-06-23docs: mark more types as plugin APIMathieu Duponchelle
2020-06-06plugins: uddate gst_type_mark_as_plugin_api() callsMathieu Duponchelle
2020-06-04plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin typesSebastian Dröge
2020-05-20rtmp2src: Answer scheduling queryEdward Hervey
Just like for rtmpsrc, we must inform downstream that we are a sequential (i.e. don't do random access efficiently) and bandwith-limited (i.e. might need buffering downstream) element Fixes buffering issues with playbin3 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1282>
2020-04-08rtmp2: Avoid a deadlock when getting statsJan Alexander Steffens (heftig)
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-03-27rtmp2src: Add idle-timeout propertySeungha Yang
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-03rtmp2: Only grab stats on close when connection existsJan Alexander Steffens (heftig)
If the connection attempt failed, self->connection is NULL.
2020-02-25rtmp2: Allow setting flash-versionJan Alexander Steffens (heftig)
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-21rtmp2: Expose connection stats as propertyJan Alexander Steffens (heftig)
Save the stats before we destroy the connection, so we can still retrieve them afterwards.
2020-02-21rtmp2: Add gst_rtmp_connection_get_stats and _get_null_statsJan Alexander Steffens (heftig)
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-21rtmp2: Count outgoing bytes and acked bytesJan Alexander Steffens (heftig)
For statistics.
2020-02-21rtmp2sink: Add a property for the outgoing chunk sizeJan Alexander Steffens (heftig)
2020-02-21rtmp2: Add gst_rtmp_connection_set_chunk_sizeJan Alexander Steffens (heftig)
2020-02-21rtmp2: Handle outgoing set chunk/window size properlyJan Alexander Steffens (heftig)
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-21rtmp2: Chunk messages as buffers in loop threadJan Alexander Steffens (heftig)
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-21rtmp2: Consistently use GstBuffer for RTMP chunksJan Alexander Steffens (heftig)
2020-02-21rtmp2: Add gst_rtmp_chunk_stream_serialize_allJan Alexander Steffens (heftig)
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-21rtmp2: Add gst_rtmp_output_stream_write_all_buffer_asyncJan Alexander Steffens (heftig)
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-21rtmp2: Improve handling incoming set chunk/window sizeJan Alexander Steffens (heftig)
Reject out-of-spec sizes and warn about suspiciously small sizes.
2020-02-21rtmp2: Lock self->lock before OBJECT_LOCKJan Alexander Steffens (heftig)
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-21rtmp2: Reject oversized messagesJan Alexander Steffens (heftig)
We only have 24 bits for the size, so reject anything larger.
2020-02-21rtmp2: Count in_bytes_acked instead of in_bytes_unackedJan Alexander Steffens (heftig)
This is nicer for statistics.
2020-02-21rtmp2: rtmpconnection: Use more appropriate size typesJan Alexander Steffens (heftig)
- guint32 for chunk size and window size - guint64 for running counters
2020-02-21rtmp2: Add a g_return_val_if_failJan Alexander Steffens (heftig)
2020-02-21rtmp2: Replace explicit unref with g_main_context_invoke_fullJan Alexander Steffens (heftig)
2020-02-21rtmp2: rtmpconnection: Use GST_*_OBJECT loggingJan Alexander Steffens (heftig)
GstRtmpConnection isn't a GstObject with a name or path, but we still get the GObject's type and address.
2019-12-03rtmp2sink: Only apply @setDataFrame to onMetaData messagesJan Alexander Steffens (heftig)
Only the metadata needs to be made "sticky". Custom data messages should be passed on unmodified. https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03rtmp2: Add gst_rtmp_message_is_metadataJan Alexander Steffens (heftig)
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03rtmp2: Add gst_rtmp_connection_set_data_frameJan Alexander Steffens (heftig)
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03rtmp2: Add single-value AMF0 parsing and serializingJan Alexander Steffens (heftig)
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03rtmp2: Minor changesJan Alexander Steffens (heftig)
- Remove an unneeded initialization to zero from AmfParser - Add missing initialization to gst_amf_serialize_command_valist - Add a g_return_if_fail to gst_rtmp_connection_request_window_size https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-11-12rtmp2: Fix NULL check in gst_rtmp_meta_transformJan Alexander Steffens (heftig)
Coverity rightly complains that checking a pointer for NULL after dereferencing it is pointless. Remove the check, and to be safe, assert that gst_buffer_add_meta returns non-NULL. CID 1455485
2019-11-12rtmp2: Check for missing GstRtmpMetaJan Alexander Steffens (heftig)
The message buffers are created using `gst_rtmp_message_new` and thus always contain a GstRtmpMeta. Add checks to appease Coverity's static analysis. CID 1455596 CID 1455384
2019-11-12rtmp2sink: Add a check that meta isn't NULL before accessingVivia Nikolaidou
It really can't be NULL, this is just to convince coverity CID 1455553