Commit graph

900 commits

Author SHA1 Message Date
Hyunjun Ko
4ff22ef6d2 rtsp-stream: get valid clock-rate from last-sample
clock-rate in last-sample's caps is integer, not unsigned.
To get this value properly, variable needs to be type-casted to int.

https://bugzilla.gnome.org/show_bug.cgi?id=747614
2015-04-27 12:41:59 +02:00
Hyunjun Ko
de590b4b2a rtsp-stream: fix to get valid each stream data for request-aux-sender signal
Because of duplicated g_signal_connect for request-aux-sender signal,
wrong stream pointer is passed to the signal handler.
Instead of passing each stream, pass stream array and get the relevant stream.

https://bugzilla.gnome.org/show_bug.cgi?id=747839
2015-04-15 15:14:04 +02:00
Sebastian Dröge
ef3bfd757b rtsp-stream: Limit the queues to 1 buffer
We only need them to be able to pre-roll, queueing up more data here
is only going to harm latency and memory usage.
2015-03-23 21:04:43 +01:00
Sebastian Dröge
357af7aea6 rtsp-stream: Update comment and ASCII art to the latest code
We have a queue in front of the udpsink too to prevent the pipeline from
locking up.
2015-03-23 20:59:52 +01:00
Nicolas Dufresne
dfb053add3 rtsp-media: Properly return first rtptime
Instead we where returning first GstBuffer timestamp. This would result
in clock skew and unwanted behaviour in RTSP playback.

https://bugzilla.gnome.org/show_bug.cgi?id=746479
2015-03-21 11:04:05 -04:00
Nicolas Dufresne
01562286ba rtsp-stream: Don't leave buffer mapped
If the seq is NULL, the RTP buffer was left mapped. We should always
unmap the buffer.
2015-03-18 16:44:19 -04:00
Tim-Philipp Müller
896767b041 Fix double semicolons 2015-03-10 09:39:22 +00:00
Sebastian Dröge
852cc09f54 rtsp-stream: Get the seqnum-base and other information from the last buffer in the sink
This gives more accurate values than asking the payloader. There might be
queueing happening between the payloader and the sink.

https://bugzilla.gnome.org/show_bug.cgi?id=745704
2015-03-09 16:00:38 +01:00
Sebastian Dröge
b58af93d83 rtsp-media: Don't seek for PLAY if the position will not change
https://bugzilla.gnome.org/show_bug.cgi?id=745704
2015-03-09 13:00:25 +01:00
Sebastian Dröge
93bdbb6acd rtsp-media: Don't include payload type in the caps for framesize
When the sdp media attribute framesize are converted to caps
the <payload> should not be included.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725335

Based on the patch for rtspsrc by Linus Svensson <linussn@axis.com>
2015-03-09 10:21:49 +01:00
Linus Svensson
9dadaed2fd rtsp-sdp: add payload type to the sdp framesize attribute
The sdp framesize attribute is desribed in RFC6064. It is specified
for payloading of H263 and has the following form
a=framesize:<payload type> <width>-<height>. The <width>-<height> part
should be added to the caps in a payloader and the <payload type> should
be added by the rtsp-server.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725334
2015-03-09 09:26:38 +01:00
Jan Schmidt
db42945c2c rtsp-media-factory: Add functions to set/get the media gtype
Allow specifying the GType of a GstRtspMedia subclass to create
as a simpler way to get the factory to create a custom
GstRtspMedia sub-class, without subclassing GstRtspMediaFactory.
2015-03-03 11:53:16 +11:00
Gregor Boirie
bc7765eee7 rtsp-media: fix double unlock in _get_buffer_size()
Fixes an abort when calling gst_rtsp_media_get_buffer_size()
because of double g_mutex_unlock () usage.

https://bugzilla.gnome.org/show_bug.cgi?id=745434
2015-03-02 10:50:57 +00:00
Kent-Inge Ingesson
d2f1997c4b rtsp-session: Use monotonic time for RTSP session timeout
Changed RTSP session timeout handling to monotonic time
and deprecating the API for current system time.

This fixes timeouts when the system time changes.

https://bugzilla.gnome.org/show_bug.cgi?id=743346
2015-02-19 10:43:30 +02:00
Sebastian Dröge
51ed357597 rtsp-client: Only error out in PLAY if seeking actually failed
If the media was just not seekable, we continue from whatever position we are
and let the client decide if that is what is wanted or not.

Only if the actual seek failed, we can't really recover and should error out.
2015-02-13 12:21:16 +02:00
Andreas Frisch
bac59c52f1 rtsp-stream: Add necessary queues between tee and multiudpsink
https://bugzilla.gnome.org/show_bug.cgi?id=744379
2015-02-13 11:28:43 +02:00
Sebastian Dröge
98b162f54b rtsp-media: If seeking fails, don't wait forever for the media to preroll again
Instead error out properly the same way as if the SEEKING query already
failed.
2015-02-12 16:53:27 +02:00
Tim-Philipp Müller
dc43f427a9 rtsp-stream: minor code formatting fix 2015-02-11 17:25:35 +00:00
Luis de Bethencourt
ec7bf5379e rtsp-media: fix logic for collect_streams
Fix the logic of gst_rtsp_media_collect_streams() so after looping collecting
all streams it knows if it got any, and can check if the transport mode is OK.

CID #1268400
2015-02-10 16:45:23 +00:00
Sebastian Dröge
8405cfad3a rtsp-media: Don't set the transport mode based on what elements we find
Just print a warning if the one that was set before disagrees with what
elements we found. It must already be set to something before as this
function is called after we received the SDP from ANNOUNCE in RECORD mode,
and we would reject ANNOUNCE if the RECORD flag was not set.
2015-02-09 10:21:50 +01:00
Tim-Philipp Müller
57c21c8f9e rtsp-client: fix awkward if clause 2015-02-08 12:08:36 +00:00
Sebastian Dröge
a93ed7e5d4 rtsp-media: Use flags to distinguish between PLAY and RECORD media 2015-02-06 09:42:50 +01:00
Tim-Philipp Müller
e9ce91634c rtsp-client: fix a couple of leaks in handle_announce 2015-02-06 09:42:50 +01:00
Sebastian Dröge
35b2b10cf4 rtsp-media: Expose latency setting for setting the rtpbin latency 2015-02-06 09:42:50 +01:00
Sebastian Dröge
844add610d rtsp-stream: Put the timestamp of receival of the initial packet over TCP on the first buffer 2015-02-06 09:42:50 +01:00
Sebastian Dröge
ccf6c6eb53 Add initial support for RECORD
We currently only support media that is RECORD or PLAY only, not both at once.

https://bugzilla.gnome.org/show_bug.cgi?id=743175
2015-02-06 09:42:42 +01:00
Anila Balavan
18668bf495 rtsp-stream: RTCP and RTP transport cache cookies seperated
RTCP packets were not sent because the same tr_cache_cookie was used for
both RTP and RTCP. So only one of the tr_cache lists were populated
depending on which one was sent first. If the tr_cache list is not
populated then no packets can be sent. Most often this happened to be
RTCP. Now seperate RTCP and RTP transport cache cookies are added which
resulted in both the tr_cache_lists to be populated regardless of which
one was sent first.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=743734
2015-01-30 18:26:44 +01:00
Tim-Philipp Müller
6987a00fa9 rtsp-stream: fix false compiler warning
rtsp-stream.c:3034: error: ‘visited’ may be used uninitialized in this function
2015-01-21 14:58:19 +00:00
Tim-Philipp Müller
cc3e0ed39b rtsp-client: log interleaved data received 2015-01-19 23:24:28 +00:00
Tim-Philipp Müller
47eaac5b9e rtsp-client: fix unintentional fallthrough to debug warning when receiving interleaved data 2015-01-19 23:18:02 +00:00
Sebastian Dröge
fcef562f35 rtsp-client: If we have a single-stream media and SETUP contains no control, use the one and only stream 2015-01-19 13:09:20 +01:00
Sebastian Dröge
69e346419a rtsp-client: Use a random session ID in the SDP
RFC4566 Section 5.2 says that it should make the username, session id,
nettype, addrtype and unicast address tuple globally unique. Always using
1188340656180883 is not going to guarantee that: https://xkcd.com/221/

Instead let's create a 64 bit random number, which at least brings us
closer to the goal of global uniqueness.

https://tools.ietf.org/html/rfc4566#section-5.2
2015-01-18 19:08:36 +01:00
Sebastian Dröge
586fe4ea4b rtsp-client: Drop trailing \0 of RTSP DATA messages
We add a trailing \0 in GstRTSPConnection to make parsing of
string message bodies easier (e.g. the SDP from DESCRIBE) but
for actual data this means we have to drop it or otherwise
create invalid data.
2015-01-16 20:06:57 +01:00
Göran Jönsson
0d2de69db9 rtsp-stream: Have one copy of the transports cache for RTP and RTCP each
Fixes crash when two threads access handle_new_sample() at the same
time, one for RTP, one for RTCP.

Otherwise, when iterating over the transports cache, it might be modified by
another thread at the same time if the transports cookie has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=742954
2015-01-16 12:52:43 +01:00
Sebastian Dröge
fe8e877dd9 rtsp-stream: Set format=TIME on our app sources for TCP 2015-01-15 19:35:01 +01:00
Sebastian Rasmussen
94f3e18c5b Revert "rtsp-session-pool: Make sure session IDs are properly URI-escaped"
This reverts commit 935e8f852d.

RFC 2326 states that session IDs may consist of alphanumeric as well as
the safe characters $-_.+ -- N.B. the percent character is not allowed.

Previously the session ID was URI-escaped, this meant that any character
which was not alphanumeric or any of the characters +-._~ would be
percent encoded. While the RFC (surprisingly) mentions that linear white
space in session IDs should be URI-escaped, it does not say anything
about other characters. Moreover no white space is allowed in the
session ID. Finally the percent character which is the result of
URI-escaping is not allowed in a session ID.

So there is no reason to do any URI-escaping, and now it is removed.

https://bugzilla.gnome.org/show_bug.cgi?id=742869
2015-01-14 18:43:37 +01:00
Sebastian Dröge
79e41bc2be rtsp-client: Add a send_message default signal handler
This allows subclasses to easily hook into the response sending
mechanism without doing everything from a signal, which seems
awkward from subclasses.
2014-12-29 12:06:50 +01:00
Sebastian Dröge
a44b564f59 rtsp-stream: Fix some minor memory leaks 2014-12-16 16:46:15 +01:00
Sebastian Dröge
8ae3566591 rtsp-media: Some minor cleanup 2014-12-16 16:46:06 +01:00
Sebastian Dröge
06bfc0697b rtsp-stream: Fix compiler warnings
rtsp-stream.c:1351:3: error: non-void function 'gst_rtsp_stream_get_retransmission_time' should return a value [-Wreturn-type]
  g_return_if_fail (GST_IS_RTSP_STREAM (stream));
  ^

rtsp-stream.c:1384:3: error: non-void function 'gst_rtsp_stream_get_retransmission_pt' should return a value [-Wreturn-type]
  g_return_if_fail (GST_IS_RTSP_STREAM (stream));
  ^
2014-12-16 16:42:13 +01:00
Matthew Waters
4f40781fff media: implement ssrc-multiplexed retransmission support
based off RFC 4588 and the server-rtpaux example in -good
2014-12-16 16:41:08 +01:00
Göran Jönsson
058698c9cf rtsp: Ref transports in hash table.
Also ref streams for transports.
This solves a crash when reciving a rtcp after teardown but before
client finalize.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740845
2014-12-02 16:29:24 +01:00
Wim Taymans
bd8b2d3fb9 client: refactor cleanup of cached media 2014-11-07 12:48:53 +01:00
Linus Svensson
088eee6590 client: Configure transport after creating session media
The default implementation of configure_client_transport() in
rtsp-client uses the session media when it chooses channels for
interleaved traffic.

https://bugzilla.gnome.org/show_bug.cgi?id=739112
2014-11-07 12:42:48 +01:00
Linus Svensson
a455181aff client: Stop caching media in client when doing setup
If the media has been managed by a session media, it should not be
cached in the client any longer. The GstRTSPSessionMedia object is now
responsible for unpreparing the GstRTSPMedia object using
gst_rtsp_media_unprepare(). Unprepare the media when finalizing the
session media.

https://bugzilla.gnome.org/show_bug.cgi?id=739112
2014-11-07 12:34:23 +01:00
Aleix Conchillo Flaqué
7c267928ff rtsp-stream: unref srtp decoder when leaving bin
https://bugzilla.gnome.org/show_bug.cgi?id=739481
2014-11-01 11:26:14 +00:00
Aleix Conchillo Flaqué
ef9dc6c9e4 rtsp-client: mikey memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=739383
2014-10-30 10:34:56 +00:00
Vincent Penquerc'h
f803be2dc8 rtsp-media: deactivate media when shutting down from paused
This was only done when going directly from playing.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=737829
2014-10-21 11:52:27 +02:00
Aleix Conchillo Flaqué
0aad92531d rtsp-client: add stream transport to context
We add the stream transport to the context so we can get the configured
client stream transport in the setup request signal.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=738905
2014-10-21 11:44:40 +02:00
Aleix Conchillo Flaqué
966065a018 stream: release lock even not all transports have been removed
We don't want to keep the lock even we return FALSE because not all the
transports have been removed. This could lead into a deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=737797
2014-10-21 10:08:44 +02:00
Olivier Crête
dde6a89928 rtsp-sdp: Rename clock-base and seqnum-base to timestamp-offset and seqnum-offset
These were renamed in GstRTPBasePayload in 1.0
2014-10-10 18:43:00 -04:00
Aleix Conchillo Flaqué
6c0c90c9d2 client: set session media to NULL without the lock
We need to set session medias to NULL without the client lock otherwise
we can end up in a deadlock if another thread is waiting for the lock
and media unprepare is also waiting for that thread to end.

https://bugzilla.gnome.org/show_bug.cgi?id=737690
2014-10-01 10:31:04 +01:00
Sebastian Dröge
1badcd83c3 rtsp-media: Set state to UNPREPARING in all cases 2014-09-30 23:22:45 +03:00
Ognyan Tonchev
d48e022c13 media: set state to unpreparing when unprepare is initiated
https://bugzilla.gnome.org/show_bug.cgi?id=737675
2014-09-30 23:15:29 +03:00
Sebastian Rasmussen
404a80e38a rtsp-client: Remove backlog limit while processings requests
If the backlog limit is kept two cases of deadlocks may be
encountered when streaming over TCP. Without the backlog
limit this deadlocks can not happen, at the expence of
memory usage.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=737631
2014-09-30 12:22:49 +02:00
Ognyan Tonchev
17f5785638 rtsp-client: do not free main context before rtsp watch
https://bugzilla.gnome.org/show_bug.cgi?id=737110
2014-09-24 10:42:16 +03:00
Branko Subasic
2218510cae rtsp-*: Treat sending packets to clients as keepalive
As long as gst-rtsp-server can successfully send RTP/RTCP data to
clients then the client must be reading. This change makes the server
timeout the connection if the client stops reading.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736647
2014-09-24 10:37:59 +03:00
Branko Subasic
733ef1162b rtsp-client: Allow backlog to grow while expiring session
Allow the send backlog in the RTSP watch to grow to unlimited size while
attempting to bring the media pipeline to NULL due to a session
expiring.  Without this change the appsink element cannot change state
because it is blocked while rendering data in the new_sample callback.
This callback will block until it has successfully put the data into the
send backlog. There is a chance that the send backlog is full at this
point which means that the callback may block for a long time, possibly
forever. Therefore the media pipeline may also be prevented from
changing state for a long time.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736647
2014-09-24 10:37:49 +03:00
Edward Hervey
980553547d rtsp-client: Make old compilers happy
rtsp-client.c:2553:50: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Just in case that guint8 doesn't fit in a pointer. Just in case ...
2014-09-22 09:30:39 +02:00
Göran Jönsson
23b9d8fbb0 client: raise the backlog limits before pausing
We need to raise the backlog limits before pausing the pipeline or else
the appsink might be blocking in the render method in wait_backlog() and
we would deadlock waiting for paused.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736322
2014-09-16 11:41:52 +02:00
Göran Jönsson
ebd9be59fe client: make define for the WATCH_BACKLOG
See https://bugzilla.gnome.org/show_bug.cgi?id=736322
2014-09-16 11:29:38 +02:00
Wim Taymans
0292be09ea client: simplify session transport handling
link/unlink of the transport in a session was done to keep track of all
TCP transports and to send RTP/RTCP data to the streams. We can simplify
that by putting all the TCP transports in a hashtable indexed with the
channel number.

We also don't need to link/unlink the transports when we pause/resume
the streams. The same effect is already achieved when we pause/play the
media. Indeed, when we pause the media, the transport is removed from
the media and the callbacks will not be called anymore.

See https://bugzilla.gnome.org/show_bug.cgi?id=736041
2014-09-16 10:46:13 +02:00
Wim Taymans
ea5d4cfc7e stream-transport: make method to handle received data
Make a method to handle the data received on a channel. It sends the
data to the stream of the transport on the RTP or RTCP pads based on
the channel number.
2014-09-16 10:45:20 +02:00
Srimanta Panda
376488d8c7 rtsp-media: Make sure that sequence numbers are monotonic after pause
The sequence number is not monotonic for RTP packets after pause. The
reason is basepayloader generates a randon sequence number when the
pipeline goes from ready to pause. With this fix generation of sequence
number will be monotonic when going from pause to play request.

https://bugzilla.gnome.org/show_bug.cgi?id=736017
2014-09-12 17:29:30 +03:00
Göran Jönsson
09bf2025f8 rtsp-client: Protect saved clients watch with a mutex
Fixes a crash when close() is called while merging clients
in handle_tunnel(). In that case close() would destroy the
watch while it is still being used in handle_tunnel().

https://bugzilla.gnome.org/show_bug.cgi?id=735570
2014-09-04 10:35:56 +03:00
Sebastian Dröge
1b47b6d9b0 rtsp-stream: Remove the multicast group udp sources when removing from the bin 2014-08-25 10:39:04 +03:00
Sebastian Dröge
6ba5ca447f rtsp-media: Query position and stop time only on the RTP parts of the pipeline
The RTCP parts, in specific the RTCP udpsinks, are not flushed when
seeking and will always continue counting the time. This leads to
the NPT after a backwards seek to be something completely different
to the actual seek position.

https://bugzilla.gnome.org/show_bug.cgi?id=732644
2014-08-12 10:54:12 +03:00
Arun Raghavan
e297dd1fee signals: Fix copy-pasto in target-state signal offset 2014-08-04 14:16:26 +05:30
Sebastian Dröge
3159b374b9 rtsp-stream: Listen on the multicast group for RTP/RTCP packets
When a UDP multicast transport is used it is expected that the server listens
for RTP and RTCP packets on the multicast group with the corresponding port.
Without this we will never get RTCP packets from clients in multicast mode.

https://bugzilla.gnome.org/show_bug.cgi?id=732238
2014-07-22 14:26:49 +02:00
Hyunjun Ko
a8e604355c media: correct misspelled words in description
https://bugzilla.gnome.org/show_bug.cgi?id=733244
2014-07-16 12:50:48 +01:00
Wim Taymans
ecde0051db server: implement client REMOVE filter 2014-07-10 17:10:06 +02:00
Wim Taymans
ced406cc28 client: expose _close() method
Expose a previously internal close method to close the client
connection.
2014-07-10 17:05:13 +02:00
Wim Taymans
301585b30f session-pool: signal session-removed outside of the lock
Release the lock before emiting the session-removed signal.
2014-07-10 12:20:15 +02:00
Wim Taymans
945c93fde0 filter: Release lock in filter functions
Release the object lock before calling the filter functions. We need to
keep a cookie to detect when the list changed during the filter
callback. We also keep a hashtable to make sure we only call the filter
function once for each object in case of concurrent modification.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732950
2014-07-10 11:36:55 +02:00
Ognyan Tonchev
6543082d2b client: check if watch is set in handle_teardown()
The unit tests run without a watch
2014-07-09 16:17:00 +02:00
Ognyan Tonchev
e0bc97e40c client: keep ref to client for the session removed handler
This extra ref will be dropped when all client sessions have been
removed. A session is removed when a client sends teardown, closes its
endpoint of the TCP connection or the sessions expires.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732226
2014-07-09 16:16:50 +02:00
Wim Taymans
5aec4af1b9 client: manage media in session as a last step
Once we manage a media in a session, we can't unmanage it anymore
without destroying it. Therefore, first check everything before we
manage the media, otherwise if something is wrong we have no way to
unmanage the media.
If we created a new session and something went wrong, remove the session
again. Fixes a leak in the unit test.
2014-07-08 14:46:13 +02:00
Wim Taymans
99f670d8bc rtsp: fix for MIKEY api change 2014-07-02 16:04:53 +02:00
Wim Taymans
72a57e792f client: free watch context only once
The watch context is freed when the source is destroyed. Avoids
a CRITICAL when we try to unref the context twice.
2014-07-01 16:12:13 +02:00
Wim Taymans
517bb78ae3 client: fix build 2014-07-01 15:02:15 +02:00
Wim Taymans
5e2afcefdd client: protect sessions with lock
Protect the list of sessions with the lock.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732226
2014-07-01 14:41:14 +02:00
Wim Taymans
fe081e7301 Client: keep a ref to the session
Don't just keep a weak ref to the session objects but use a hard ref. We
will be notified when a session is removed from the pool (expired) with
the new session-removed signal.
Don't automatically close the RTSP connection when all the sessions of
a client are removed, a client can continue to operate and it can create
a new session if it wants. If you want to remove the client from the
server, you have to use gst_rtsp_server_client_filter() now.

Based on patch from Ognyan Tonchev <ognyan.tonchev at axis.com>

See https://bugzilla.gnome.org/show_bug.cgi?id=732226
2014-07-01 12:28:41 +02:00
Wim Taymans
964ca3c988 session-pool: add session-removed signal
Add a signal to be notified when a session is removed from the pool.
2014-06-30 15:14:34 +02:00
Evan Nemerson
41d1ef7ed3 Make rtsp-server.h a single-include header, use it for G-I
https://bugzilla.gnome.org/show_bug.cgi?id=732411
2014-06-30 09:45:11 +02:00
Wim Taymans
db95746f6b stream: crypto can be NULL 2014-06-27 16:55:07 +02:00
Evan Nemerson
cecc2cb4ff introspection: add missing allow-none annotations
https://bugzilla.gnome.org/show_bug.cgi?id=730952
2014-06-26 19:08:56 +02:00
Evan Nemerson
34e6ac3b9f introspection: add (nullable) annotations to return values
https://bugzilla.gnome.org/show_bug.cgi?id=730952
2014-06-26 19:08:16 +02:00
Evan Nemerson
d08b46f4b7 gi: improve annotations
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730953
2014-06-24 09:48:45 +02:00
Wim Taymans
661f4d928f signals: use generic marshal function
Use the generic C marshal function.
Use more explicit type instead of G_TYPE_POINTER
2014-06-24 09:43:44 +02:00
Wim Taymans
aa44c03439 context: add type macro 2014-06-24 09:42:47 +02:00
Wim Taymans
d676c56888 sdp: hide key length defines
They don't have a namespace.
2014-06-24 09:34:50 +02:00
Aleix Conchillo Flaqué
32432b5c61 mikey: add different key length parameters
Add encryption and authentication key length parameters to MIKEY. For
the encoders, the key lengths are obtained from the cipher and auth
algorithms set in the caps. For the decoders, they are obtained while
parsing the key management from the client.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730472
2014-06-19 16:06:27 +02:00
Ognyan Tonchev
f2b1aa8c81 client: ref the context until rtsp watch is alive
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731569
2014-06-18 15:23:15 +02:00
Ognyan Tonchev
9715252588 client: Destroy the rtsp watch after connection close 2014-06-18 15:21:23 +02:00
Wim Taymans
e327af8a26 media: fix confusing comment 2014-06-13 16:46:06 +02:00
Göran Jönsson
aaf921cac4 rtsp-session: Timeout in header.
Adding the possbilty to always have timout in header.
This is configurabe with setting "timeout-always-visible".

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728264
2014-06-05 10:36:11 +02:00
Wim Taymans
5aa06b8058 client: store TCP ports in transport
Store the TCP ports in the transport when we are doing RTSP over TCP.
This way, we can easily get to the ports from the transport.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=729776
2014-05-20 15:57:30 +02:00
Aleix Conchillo Flaqué
17322693f6 stream: add signals for new RTP/RTCP encoders
New signals to allow the user to configure the dynamically created
encoders.

https://bugzilla.gnome.org/show_bug.cgi?id=730228
2014-05-16 16:27:52 +02:00
Ognyan Tonchev
0fb7922e9b media: Make suspend()/unsuspend() virtual
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730109
2014-05-15 15:42:18 +02:00
Aleix Conchillo Flaqué
d01beef7c5 client: fix send-message signal marshaller
Use generic marshalling for the send-message signal. It has
two POINTER arguments, not just one.

https://bugzilla.gnome.org/show_bug.cgi?id=729900
2014-05-10 12:23:16 +01:00
Tim-Philipp Müller
efd079546a rtsp-client: handle Require headers and respond with OPTION_NOT_SUPPORTED
Servers must handle Require headers and must report a failure
if they don't handle any of the Required options, see RFC 2326,
section 12.32: https://tools.ietf.org/html/rfc2326#page-54

https://bugzilla.gnome.org/show_bug.cgi?id=729426
2014-05-09 13:55:21 +01:00
Wim Taymans
ea4543efc8 client: emit a signal before sending a message
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728970
2014-05-01 06:17:06 +02:00
Wim Taymans
4c42aec6dd client: pass context to send_message
Pass the current context to send_message, we will need it later.
2014-05-01 06:07:08 +02:00
Wim Taymans
a646e278d3 client: fix typo in comment 2014-05-01 05:29:54 +02:00
Ognyan Tonchev
7cce8e2dde media: Do not stop thread twice if default_prepare() fails 2014-04-21 12:21:37 +02:00
Wim Taymans
e69241ac97 client: set the watch to flushing before going to NULL
First set the watch to flushing so that we unblock any current and
future attempt to send data on the watch, Then set the pipeline to
NULL.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728153
2014-04-15 16:51:17 +02:00
Linus Svensson
9219509bcf rtsp-session-pool: Fixes annotation
Fixes annotation for gst_rtsp_session_pool_create() and memory leaks
in the sessionpool test.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728060
2014-04-12 06:15:03 +02:00
Ognyan Tonchev
80474e9e5e media: make media_prepare virtual
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728029
2014-04-12 06:04:13 +02:00
Ognyan Tonchev
da19a3c21a media: stop the thread in more error cases 2014-04-12 05:57:00 +02:00
Ognyan Tonchev
de2a70bb10 media: allow NULL as the thread
Use the default context whan passing a NULL thread.
2014-04-12 05:55:02 +02:00
Vincent Penquerc'h
adc3e8907e rtsp-client: indent cleanup
Coverity was moaning about unreachable code, and I think it was just
confused by { being before the label. We'll see if it pops up again.

Coverity 1197705
2014-04-10 16:39:11 +01:00
Göran Jönsson
11369d38ef client: Add drop-backlog property
When we have too many messages queued for a client (currently hardcoded
to 100) we overflow and drop the messages. Add a drop-backlog property
to control this behaviour. Setting this property to FALSE will retry
to send the messages to the client by waiting for more room in the
backlog.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725898
2014-04-10 16:08:06 +02:00
Ognyan Tonchev
0493a63a65 client: support for POST before GET when setting up a tunnel 2014-04-08 16:20:44 +02:00
Ognyan Tonchev
132f77751d client: remove watch of the second client after http tunnel setup
The second client will be freed after the HTTP tunnel has been set up.
Make sure it's RTSP watch is never dispatched again.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727488
2014-04-08 16:17:30 +02:00
Ognyan Tonchev
9c0ef4d9f8 media: Make media_prepare() fail if port allocation fails
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727376
2014-04-08 15:11:25 +02:00
Linus Svensson
a3e6b11f11 rtsp-media: Unblock blocked streams in unprepare
The streams will be blocked when a live media is prepared.
The streams should be unblocked in gst_rtsp_media_unprepare.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727231
2014-04-08 14:58:23 +02:00
Wim Taymans
fd5e949169 media: release the state lock when going to NULL
Set our state to UNPREPARING and release the state-lock before
setting the pipeline to the NULL state. This way, any pad-added
callback will be able to take the state-lock and check that we are now
unpreparing instead of deadlocking.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727102
2014-04-08 14:49:41 +02:00
Wim Taymans
7f40d3d87f media: protect status with lock
Make sure we only update the status with the lock.
2014-04-08 12:08:17 +02:00
Wim Taymans
248db04720 rtsp: update for MIKEY API changes 2014-04-04 17:39:36 +02:00
Wim Taymans
0d22b798ae client: parse the mikey response from the client
Parse the mikey response from the client and update the policy for
each SSRC.
2014-04-03 17:42:25 +02:00
Wim Taymans
377ca6ed0f stream: add method to set crypto info
Make a method to configure the crypto information of a stream.
Set udpsrc in READY instead of PAUSED so that we can configure caps
later.
2014-04-03 17:26:12 +02:00
Wim Taymans
f8a6a5668d client: cleanup error paths 2014-04-03 12:57:13 +02:00
Wim Taymans
07ae06a595 media: fix docs 2014-04-02 12:27:24 +02:00
Wim Taymans
3d6175c745 stream: add SRTP support
Install srtp encoder and decoder elements in rtpbin
Add MIKEY in SDP
2014-03-25 10:31:21 +01:00
Sebastian Rasmussen
b1b5301577 gobject-introspection: Add annotations to support language bindings
In addition a few cosmetic changes:

 * Adjust the order of arguments
 * Fix typo: occured -> occurred
 * Fix indentation after Return:-clauses

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726941
2014-03-24 00:36:42 +00:00
Sebastian Rasmussen
0b617dd5bd rtsp-stream: Don't mix IPv4 and IPv6 addresses
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726362
2014-03-15 15:44:25 +01:00
Wim Taymans
2c7ffe97ca stream: take caps after the session manager
Take the caps for the SDP after they leave the rtpbin so that we can
also get the properties added by rtpbin elements.
2014-03-13 14:27:15 +01:00
Wim Taymans
50ca10e751 stream: release lock while pushing out packets
Keep a cache of the transports and use this to iterate the transport
while pushing packets. This allows us to release the lock early.

See https://bugzilla.gnome.org/show_bug.cgi?id=725898
2014-03-13 14:20:17 +01:00
David Svensson Fors
faf0b31cbb rtsp-client: vmethod for modifying tunnel GET response
Add a vmethod tunnel_http_response where the response to the HTTP GET
for tunneled connections can be modified.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725879
2014-03-11 11:17:04 +01:00
Wim Taymans
dffdbbf090 sdp: make 1 media line per profile
If we have multiple profiles (AVP or AVPF) for a stream, make one m=
line in the SDP for each profile. The client is then supposed to pick
one of the profiles in the SETUP request. Because the m= lines have the
same pt, the client also knows that only 1 option is possible.
2014-03-03 16:59:09 +01:00
Wim Taymans
4b74afcc78 factory: add profile property and pass to media and streams 2014-03-03 16:55:48 +01:00
Wim Taymans
2bd90b539c sdp: pass multicast connection for multicast-only stream
Pass the multicast address of the stream in the connection info in the
SDP so that clients try a multicast connection first.
Only allow multicast connections in the test-multicast example. Also
increase the TTL a little.
2014-03-03 15:12:55 +01:00
Wim Taymans
48b6b8e3e6 stream: release some locks in error cases 2014-03-03 12:17:48 +01:00
Sebastian Rasmussen
81a2928c89 docs: Enable and fix gtk-doc warnings
* Makefile: Enable gtk-doc warnings, like the rest of GStreamer
 * addresspool/mediafactory: Add missing annotation colon
 * stream: Annotate return value

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725528
2014-03-03 09:43:05 +01:00
Branko Subasic
7ed2a6ef98 rtsp-media: don't loose frames handling new PLAY request
If client supplied a range check if the range specifies the start point.
If not, then do an accurate seek to the current position. If a start
point was specified do do a key unit seek to make sure the streaming
starts with decodeable frames.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724611
2014-02-18 16:59:41 +01:00
Wim Taymans
73551543b8 Revert "media: only flush when setting a new start position"
This reverts commit f67fc23aab.

We need to do the flush in all cases, demuxer block currently for
non-flushing seeks.
2014-02-18 16:58:45 +01:00
Wim Taymans
f67fc23aab media: only flush when setting a new start position
Only flush the pipeline when we change the start position with
a seek.

See https://bugzilla.gnome.org/show_bug.cgi?id=724611
2014-02-18 16:38:39 +01:00
Göran Jönsson
a7f0feff23 stream: set ttl-mc before adding the socket
Set ttl-mc before adding the socket. Otherwise the value ttl-mc will
never be set on socket.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724531
2014-02-18 11:10:51 +01:00
Aleix Conchillo Flaqué
0bd687f210 media: stop thread if media is already prepared
in gst_rtsp_media_prepare() the thread is not used if media is already
prepared (e.g. media shared) so we want to stop the thread. otherwise, a
leak occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=724182
2014-02-18 11:02:24 +01:00
Sebastian Dröge
957a4a65c6 rtsp-server: Fix lots of compiler warnings with clang 2014-02-09 10:45:28 +01:00
Sebastian Dröge
902b59f823 Revert "rtsp-server: support build against last stable release"
This reverts commit 099a10f61f.

Let us require 1.2.3 now, which is going to be released in a few
minutes.
2014-02-09 10:19:50 +01:00
Wim Taymans
8bd53dcf9c session: improve RTP-Info
Ignore streams that can't generate RTP-Info instead of failing.
Don't return the empty string when all streams are unconfigured but
return NULL so that we don't generate and empty RTP-Info header.
Improve docs a little.
2014-02-07 16:39:49 +01:00
Andrey Utkin
271f533098 Don't free rtpinfo GString when it is NULL
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723554
2014-02-07 16:24:08 +01:00
Wim Taymans
450b9d0a14 media: only set keyframe flag when modifying start
Only set the keyframe flag when we modify the start position. The
keyframe flag should probably be ignored when no change is requested but
until we can claim this is all documented properly and all demuxer
implement this, avoid setting the flag.

See also https://bugzilla.gnome.org/show_bug.cgi?id=723075
2014-02-06 09:48:05 +01:00
Ognyan Tonchev
b1845b0864 thread-pool: Unref source after mainloop has quit to avoid races in GLib
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723741
2014-02-06 09:26:39 +01:00
Wim Taymans
9048d87ff4 stream: handle NULL seqnum and rtptime arguments 2014-02-04 16:28:00 +01:00
Ognyan Tonchev
274d4b017f thread-pool: Unref reused threads in gst_rtsp_thread_stop()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723519
2014-02-04 14:47:49 +01:00
Wim Taymans
71c45fce5a stream: add fallback for missing stats property
Use a fallback when the payloader does not have a stats property

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723554
2014-02-04 10:14:45 +01:00
Wim Taymans
036f2760bf stream: don't leak stats structure
Don't leak the stats structure and deal with NULL stats.
2014-01-28 14:51:26 +01:00
Sebastian Rasmussen
7edaa6ca20 stream: Get rtpinfo properties atomically from payloader
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=722844
2014-01-27 15:19:30 +01:00