Commit graph

929 commits

Author SHA1 Message Date
Thibault Saunier 8608c1cae4 rtsp-media: Initialize scalar variable
CID 1418985
2017-10-09 14:44:40 +02:00
Thibault Saunier 9706199efb Start support for RTSP 2.0
This adds basic support for new 2.0 features, though the protocol is
subposdely backward incompatible, most semantics are the sames.

This commit adds:

- features:
 * version negotiation
 * pipelined requests support
 * Media-Properties support
 * Accept-Ranges support

- APIs:
  * gst_rtsp_media_seekable

The RTSP methods that have been removed when using 2.0 now return
BAD_REQUEST.

https://bugzilla.gnome.org/show_bug.cgi?id=781446
2017-10-05 13:23:48 -03:00
Thibault Saunier 8b38aa9c46 stream: Use stream duration as stream-stop if segment was not configured with a stop
Allowing client to know stream duration when no seeking happened.

https://bugzilla.gnome.org/show_bug.cgi?id=783435
2017-10-05 12:07:13 -03:00
Sebastian Dröge c04e3b07dd rtsp-media-factory: Don't cache any media if NULL was returned as key
The docs already mentioned this, but we actually stored it in the hash
table with key==NULL and leaked its reference forever.
2017-09-25 19:41:33 +03:00
Satya Prakash Gupta d690fbd37d sdp: fix Memory leak in error case
https://bugzilla.gnome.org/show_bug.cgi?id=787059
2017-08-31 11:04:05 +01:00
Sebastian Dröge ffbabb1529 rtsp-client: Fix typo in debug message 2017-08-14 21:04:58 +03:00
Julien Isorce d72284bdf8 rtsp-stream: fix connection delay due to wrong assumption on last-sample
Commit 852cc09f54 assumed that
multiudpsink's last-sample always comes from the payloader. Which
is wrong if auxiliary streams are multiplexed in the same stream.

So check the buffer's ssrc against the caps'ssrc before to use its
seqnum. If not the same ssrc just use the payloader as done prior
the commit above or when there is no last-sample yet.

https://bugzilla.gnome.org/show_bug.cgi?id=784094
2017-06-29 14:52:09 +01:00
Tim-Philipp Müller b344248630 Mark symbols explicitly for export with GST_EXPORT 2017-05-18 10:35:18 +01:00
Thibault Saunier b56930704f gi: Fix some annotations and docstrings 2017-04-13 14:20:10 -03:00
Thibault Saunier 133e91462a meson: Build gir 2017-04-13 14:11:43 -03:00
Sebastian Dröge cd4e675f0c rtsp-client: Also handle the (S|G)ET_PARAMETER case of size==0 || !data as keep-alive
If there is no Content-Length header, no body would be allocated and the
'\0' would also not be appended to the body.
2017-01-19 14:57:19 +02:00
Sebastian Dröge ac1124efb4 rtsp-client: Fix handling of keep-alive GET_PARAMETER/SET_PARAMETER
While they logically have 0 bytes length, GstRTSPConnection is appending
a '\0' to everything making the size be 1 instead.
2017-01-19 14:24:07 +02:00
Sebastian Dröge 6e145fadf9 rtsp-session: Only remove deprecated API if requested to do so, not just when disabling
gst_rtsp_session_is_expired() and gst_rtsp_session_next_timeout() were
affected.
2017-01-12 19:04:23 +02:00
Patricia Muscalu fb7833245d rtsp-stream: corrected if-statement in _get_server_port()
This bug was accidentally introduced while fixing a segfault
in _get_server_port() function.

https://bugzilla.gnome.org/show_bug.cgi?id=776345
2017-01-10 10:38:13 +00:00
Patricia Muscalu f47e6ab9f6 rtsp-stream: fixed segmenation fault in _get_server_port()
Calling function gst_rtsp_stream_get_server_port() results in
segmenation fault in the RTP/RTSP/TCP case.
Port that the server will use to receive RTCP makes only
sense in the UDP case, however the function should handle
the TCP case in a nicer way.

https://bugzilla.gnome.org/show_bug.cgi?id=776345
2017-01-09 15:27:40 +02:00
Aleksandr Slobodeniuk b27e7c6b5b dosc: Fix a little typo
https://bugzilla.gnome.org/show_bug.cgi?id=777037
2017-01-09 10:19:53 +00:00
Patricia Muscalu 42f270e7f2 rtsp-stream: Fixed TCP transport case
Make sure that the appsink element is actually added to
the bin before trying to link it with the elements in it.

https://bugzilla.gnome.org/show_bug.cgi?id=776343
2016-12-22 14:21:54 +02:00
Edward Hervey dea000f2e3 media: Fix pt map caps
Since decryption is handled within rtpbin, all outcoming stream
caps will be application/x-rtp (i.e. regular rtp)

Fixes RECORD with SRTP streams
2016-12-02 15:47:12 +01:00
Edward Hervey 8317139121 media-factory: Create media objects with the proper transport mode
The function called immediately afterwards (collect_streams()) will
need it to work properly
2016-12-02 15:47:12 +01:00
Sebastian Dröge d633c0103a rtsp-auth: Don't remove digest-auth nonces that already/still have a client connected 2016-12-02 14:36:50 +02:00
Sebastian Dröge 708fd3c325 rtsp-media-factory: Don't create a pipeline for the media pipeline string
We're going to put a pipeline into a pipeline otherwise, which is not
exactly ideal.
2016-12-01 18:04:34 +02:00
Kseniia Vasilchuk 09e499387d media: Fix race condition around finish_unprepare() if called multiple time
https://bugzilla.gnome.org/show_bug.cgi?id=755329
2016-12-01 16:39:00 +02:00
Matthew Waters b38eb8e99e stream: block the output of rtpbin instead of the source pipeline
85c52e194b introduced a more correct
detection of the srtp rollover counter to add to the SDP.

Unfortunately, it was incomplete for live pipelines where the logic
blocks the source bin before creating the SDP and thus would never have
the necessary informaiton to create a correct SDP with srtp encryption.

Move the pad blocks to rtpbin's output pads instead so that the
necessary information can be created before we need the information for
the SDP.

https://bugzilla.gnome.org/show_bug.cgi?id=770239
2016-11-23 23:08:16 +11:00
Dag Gullberg f00ac2daf2 rtsp-client: add IDLE timeout, before session exists
The RTSP server will not timeout an idle RTSP connection
(note this is different from doing timeout on a RTSP
session).

At least for Apache this is a problem when running RTSP over
HTTPS since it uses one of the threads (there is a rather
limited number) that are available for handling requests.

https://bugzilla.gnome.org/show_bug.cgi?id=771830
2016-11-23 09:45:33 +00:00
Göran Jönsson 335d279a96 rtsp-stream: Set close-socket FALSE on UDP src:es
With this RTSP server can use the sockets independent on the udpsrc
state.
When the udp src is finalized it will unref socket and when g_socket
is finalized the socket will be closed.

https://bugzilla.gnome.org/show_bug.cgi?id=765673
2016-11-22 13:59:30 +02:00
Sebastian Dröge 927a44c55b rtsp-auth: Add support for Digest authentication
https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-11-19 11:59:34 +02:00
Scott D Phillips d7676bfba3 Enable building with MSVC
https://bugzilla.gnome.org/show_bug.cgi?id=774640
2016-11-19 11:58:05 +02:00
Scott D Phillips 01ef7f32b6 client: update do_send_message to match type GstRTSPClientSendFunc
This type mismatch fails building with MSVC

https://bugzilla.gnome.org/show_bug.cgi?id=774640
2016-11-17 23:38:15 +00:00
Sebastian Dröge 179eb9ae89 rtsp-sdp: Fix indentation 2016-11-11 14:42:08 +02:00
Neha Arora 166a903594 rtsp-media: Only signal "new-state" if the state has actually changed
https://bugzilla.gnome.org/show_bug.cgi?id=774173
2016-11-10 13:16:23 +02:00
Branko Subasic 8425ea6969 client: emit signal in the beginning of each rtsp request
These signals let the application validate the requests, configure the
media/stream in a certain way and also generate error status code in
case of error or bad request.

https://bugzilla.gnome.org/show_bug.cgi?id=758062
2016-11-01 20:25:22 +02:00
Göran Jönsson dbf91ab231 rtsp-client: Session filter in unwatch session
Call session filter with filter_session_media as paramer in
client_unwatch_session if using drop_backlog = FALSE.

In client_unwatch_session its allowed to grow the watchs backlog.
If using drop_backlog = FALSE and the backlog is full it will cause
a deadlock when setting session media state to NULL
if the backlog is not allowed to grow.

https://bugzilla.gnome.org/show_bug.cgi?id=771983
2016-10-25 12:55:59 +03:00
Nikita Bobkov ff65732270 rtsp-client: Fix factory leaking in find_media() in error cases
https://bugzilla.gnome.org/show_bug.cgi?id=771488
2016-10-20 14:01:38 +03:00
Xavier Claessens c0f24fea83 stream: Fix randomly missing streams from SDP with dynamic elements
When using dynamic elements, gst_rtsp_stream_join_bin() is called from
"pad-added" signal. In that case priv->srcpad could already have its caps,
and they'll be sent to priv->send_src[0] pad. That means that when it
connects "notify::caps" signal, that pad could already have received its
caps and the signal won't be emitted anymore.

In that case priv->caps stay to NULL and when building the SDP that stream
gets ignored. Leading to missing video or audio when playing in client side.

https://bugzilla.gnome.org/show_bug.cgi?id=772478
2016-10-06 19:05:36 +03:00
Ian Jamison 34389831cb rtsp-server: Hint that set_multicast_iface expects the name of the interface
To prevent any possibly confusion with IPs or anything else.

https://bugzilla.gnome.org/show_bug.cgi?id=771530
2016-09-18 10:00:29 -04:00
Sebastian Dröge 800bed8c9c rtsp-media: Call g_free() instead of g_object_unref() on multicast-iface strings
https://bugzilla.gnome.org/show_bug.cgi?id=763000#c5
2016-09-18 09:58:55 -04:00
Sebastian Dröge 74c8a9f4cf rtsp-stream: Remove unused _locked() variant of a function
It was added during refactoring.
2016-09-07 18:44:34 +03:00
Xavier Claessens e882fe9e06 stream: cosmetic cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-07 18:40:57 +03:00
Xavier Claessens f5f350645a stream: Compare IP addresses case insensitive in more places
https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-07 18:40:57 +03:00
Xavier Claessens f90ab92547 stream: Fix leaked joined_bin
There is no need to keep a strong ref on it, and _leave_bin() was
setting it to NULL before calling g_clear_object() so it was leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-07 18:40:57 +03:00
Sebastian Dröge d33eca6156 rtsp-stream: Compare IP address strings case insensitive
Otherwise IPv6 addresses might fail this comparision.
2016-09-06 19:15:23 +03:00
Sebastian Dröge e5a49efa7f rtsp-stream: Bind multicast sockets to ANY as before
https://bugzilla.gnome.org/show_bug.cgi?id=766612#c48
2016-09-06 19:10:21 +03:00
Kseniia 6136ef66d4 rtsp-session: Fix segfault when doing keep-alive after removing the session
If keep-alive happens after removing the session but before finalizing the
stream transport, we would segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=750544
2016-09-05 22:57:52 +03:00
Sebastian Dröge ca855abae1 rtsp-stream: Always create multicast UDP elements if the protocol flag is set
Adding them later will cause deadlocks due to
1) pre-rolling and staying in PAUSED with the unicast/TCP sinks
2) adding the multicast sink
3) waiting for it to get data to preroll again

3) never happens because the queues after the tee are full.
2016-09-05 18:09:22 +03:00
Sebastian Dröge be4b9718e3 rtsp-stream: Fix up various multicast related issues 2016-09-05 16:32:57 +03:00
Xavier Claessens 8495c47a9d stream: revert back to create udpsrc/udpsink on DESCRIBE for unicast
This is basically reverting changes introduced in commit f62a9a7,
because it was introducing various regressions:

- It introduces a leak of udpsrc elements that got wrongly fixed by adding
  an hash table in commit cba045e. We should have at most 4 udpsrc for unicast:
  ipv4/ipv6, rtp/rtcp. They can be reused for all unicast clients.
- If a mcast client connects, it creates a new socket in SETUP to try to respect
  the destination/port given by the client in the transport, and overrides the
  socket already set on the udpsink element. That means that if we already had a
  client connected, the source address on the udp packets it receives suddenly
  changes.
- If a 2nd mcast client connects, the destination/port in its transport is
  ignored but its transport wasn't updated.

What this patch does:

- Revert back to create udpsrc/udpsink for unicast clients on DESCRIBE.
- Always have a tee+queue when udp is enabled. This could be optimized
  again in a later patch, but is more complicated. If no unicast clients
  connects then those elements are useless, this could be also optimized
  in a later patch.
- When mcast transport is added, it creates a new set of udpsrc/udpsink,
  seperated from those for unicast clients. Since we already support only
  one mcast address, we also create only one set of elements.

https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-05 13:36:17 +03:00
Xavier Claessens aa0e60445d stream: factor our plug_src function
https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-05 13:26:08 +03:00
Xavier Claessens 47a3956b48 stream: factor out plug_sink function
https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-05 13:26:02 +03:00
Xavier Claessens a44f198ffc stream: small documentation clarification
https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-05 13:25:57 +03:00
Xavier Claessens 82a618c2e6 stream: rename addr_v4/6 to mcast_addr_v4/6 for clarity
https://bugzilla.gnome.org/show_bug.cgi?id=766612
2016-09-05 13:25:51 +03:00