Commit graph

264 commits

Author SHA1 Message Date
Wim Taymans
4b74afcc78 factory: add profile property and pass to media and streams 2014-03-03 16:55:48 +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
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
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
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
Wim Taymans
e04d9ac34d media: refactor state change functions and signals
Make functions to set the target state and the pipeline state and emit
the signals from those functions.
2014-01-21 14:46:47 +01:00
Ognyan Tonchev
5eca958d5e media: add signal to notify of pending state changes 2014-01-21 14:25:42 +01:00
Tim-Philipp Müller
099a10f61f rtsp-server: support build against last stable release
Until 1.2.3 is out with the new get_type function and we
can require that.
2014-01-12 16:55:21 +00:00
Wim Taymans
ae1fe21436 stream: add property to configure profiles 2014-01-07 12:39:58 +01:00
Aleix Conchillo Flaqué
3fdae13fb7 media: add setup_sdp vmethod
gst/rtsp-server/rtsp-media.[ch]: added setup_sdp vmethod and public
gst_rtsp_media_setup_sdp.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720155
2013-12-19 15:10:30 +01:00
Aleix Conchillo Flaqué
ab3651d339 media: add new create_rtpbin vmethod
* gst/rtsp-server/rtsp-media.[ch]: add new create_rtpbin vmethod.

  https://bugzilla.gnome.org/show_bug.cgi?id=719734
2013-12-09 17:14:26 +01:00
Ognyan Tonchev
3b4894c4f1 media: also do state change in suspended state 2013-11-29 15:50:23 +01:00
Wim Taymans
53859ac34b media: also handle prepare and range in suspended state
When we are suspended, we are already prepared.
We can get the range in the suspended state.
2013-11-29 10:53:08 +01:00
Wim Taymans
2f17369e9d media: add suspend modes
Add support for different suspend modes. The stream is suspended right after
producing the SDP and after PAUSE. Different suspend modes are available that
affect the state of the pipeline. NONE leaves the pipeline state unchanged and
is the current and old behaviour, PAUSE will set the pipeline to the PAUSED
state and RESET will bring the pipeline to the NULL state.
A stream is also unsuspended when it goes back to PLAYING, for RESET streams,
this means that the pipeline needs to be prerolled again.

Base on patches by Ognyan Tonchev <ognyan@axis.com>

See https://bugzilla.gnome.org/show_bug.cgi?id=711257
2013-11-28 16:18:39 +01:00
Wim Taymans
db771c5167 media: start live streams in blocked state
Start live streams in the blocked state and make them preroll using the
messages. This ensure that no data is played by the sink until we explicitly
unblock the stream right before going to PLAYING.

See https://bugzilla.gnome.org/show_bug.cgi?id=711257
2013-11-28 16:18:39 +01:00
Wim Taymans
6ce48c51a2 media: refactor starting and waiting for preroll
Based on patches from Ognyan Tonchev <ognyan@axis.com>

See https://bugzilla.gnome.org/show_bug.cgi?id=711257
2013-11-28 16:18:39 +01:00
Wim Taymans
b3baa2801d media: move default implementations to where they are used 2013-11-26 17:23:04 +01:00
Wim Taymans
b8ae2570d9 media: take the right lock in gst_rtsp_media_set_pipeline_state()
We need to take the state_lock when calling this method.
2013-11-26 16:25:37 +01:00
Wim Taymans
9da7b5eeb5 media: handle add-added on non-bins too
Handle dynamic payloaders that are not bins, as used in the unit-test.
2013-11-26 16:24:35 +01:00
Sebastian Rasmussen
1ebc2c703e rtsp-media/-factory: Fix request pad name comments
These must be escaped for gtk-doc to parse the comments without warnings.
2013-11-22 11:53:04 +01:00
Aleix Conchillo Flaque
b6d4a29d75 rtsp-media: remove transports if media is in error status
* gst/rtsp-server/rtsp-media.c (gst_rtsp_media_set_state): if we are
  trying to change to GST_STATE_NULL and media is in error status, we
  remove all transports.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712776
2013-11-22 11:25:15 +01:00
Wim Taymans
7b5763179a rtsp-media: use element metadata to find payloader
Use the element metadata to find the payloader instead of checking
for the base class.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712396
2013-11-22 11:19:35 +01:00
Aleix Conchillo Flaque
e5332535a7 rtsp-stream: add getter for payload type
* gst/rtsp-server/rtsp-stream.c: add new method gst_rtsp_stream_get_pt.

* gst/rtsp-server/rtsp-media.c (pad_added_cb): find real payloader
  element and create the stream with this one instead of the dynpay%d
  element.

  https://bugzilla.gnome.org/show_bug.cgi?id=712396
2013-11-22 11:19:35 +01:00
Sebastian Rasmussen
08160e0913 rtsp-*: Refer to NULL as a constant in comments
Plus one typo fix.

https://bugzilla.gnome.org/show_bug.cgi?id=714988
2013-11-22 09:13:14 +00:00
Sebastian Pölsterl
e756324490 Fixed several GIR warnings 2013-11-12 11:15:58 +01:00
Wim Taymans
59b53c90c3 rtsp-media: remove old line 2013-10-04 05:48:52 +02:00
Youness Alaoui
917bbfcc20 media: Check dynamically if the pipeline supports seeking
We should not depend on whether or not the pipeline state change
returned NO_PREROLL or not. A media could dynamically change its
element and switch from seekable to non seekable so it's best to test
the seekable nature of the pipeline dynamically when we try to do a seek.
2013-10-02 06:00:10 +02:00
Youness Alaoui
33dc78209c media: Return FALSE if seeking is not supported 2013-10-02 05:57:15 +02:00
Wim Taymans
d138f79da0 rtsp-media: don't seek accurate by default
Accurate seeking is perhaps a little overkill in the most common situation and
causes some formats (mp3) over slow media to seek extremely slowly.
2013-10-01 17:16:11 +02:00
Jonas Holmberg
19178a413c auth, media, media-factory: unref permissions
https://bugzilla.gnome.org/show_bug.cgi?id=707638
2013-09-06 18:57:55 +01:00
Wim Taymans
f094256add media: set protocols on streams 2013-08-16 16:34:56 +02:00
Wim Taymans
04d2da4d03 media-factory: allow all protocols 2013-08-16 16:19:27 +02:00
Wim Taymans
cf96774e6d media: configure protocols in new streams 2013-08-16 16:10:43 +02:00
Youness Alaoui
cdbb6bcc15 rtsp-media: send state in "new-state" signal
https://bugzilla.gnome.org/show_bug.cgi?id=705110
2013-08-13 16:41:53 +01:00
Youness Alaoui
a95ab4b29e Add vmethod for rtsp-media subclass to access rtpbin 2013-08-02 16:59:04 +02:00
Wim Taymans
6ac547cc34 media: add docs for new method 2013-08-02 16:57:26 +02:00
Youness Alaoui
050b16ad84 Add API to rtsp-media set the pipeline's state 2013-08-02 16:53:07 +02:00
Youness Alaoui
5e642c7ef1 Update current position/duration when gst_rtsp_media_get_range_string is called 2013-08-02 16:51:15 +02:00
Wim Taymans
041b1b79a1 docs: improve docs 2013-07-16 12:32:51 +02:00
Wim Taymans
0b3644a21b docs: improve docs 2013-07-11 16:57:14 +02:00
Wim Taymans
ccceb1de11 docs: update docs 2013-07-11 12:18:26 +02:00
Wim Taymans
d1e4baab6c media: Accept a thread in _prepare
Remove out own threadpool handling and use the provided thread and
maincontext for the bus messages and the state changes.
2013-07-10 17:08:14 +02:00
Wim Taymans
c4c9c873b8 media: start media pipeline in context
Start the media pipeline in the provided context (or our default one
when NULL). This makes sure that we run the bus thread in this context and that
all media threads are children of this context.
2013-07-09 20:44:51 +02:00
Wim Taymans
0499a1ec7d media: make it possible to set permissions
Make it possible to set permissions on media and media factory objects
2013-07-09 14:33:43 +02:00
Wim Taymans
12583e819c media: add optional context for bus messages
Add an optional mainloop to _prepare that will handle the bus messages instead
of always using the shared mainloop.
2013-07-08 11:10:20 +02:00
Wim Taymans
19cffc7999 auth: remove auth from media and factory
Remove the auth object from media and factory. We want to have the RTSPClient
authenticate and authorize resources, there is no need to place another auth
manager on the media/factory.
2013-07-05 20:53:19 +02:00
Wim Taymans
3999bd4e4e media: add method to find a stream by control url 2013-07-03 15:14:39 +02:00
Ognyan Tonchev
cd4120ef26 rtsp-media: Do not leak the query in default_query_stop
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703120
2013-06-26 15:42:01 +02:00
Wim Taymans
81c3843ad1 media: don't unlock when conversion fails
Don't unlock the state lock when conversion fails because it was not locked.
2013-06-25 15:46:41 +02:00
Youness Alaoui
0b94f50eab Add query_position and query_stop vmethods to rtsp-media 2013-06-25 15:23:36 +02:00
Youness Alaoui
842f5ad9c4 Fix typo in property install for rtsp-media's time-provider 2013-06-25 15:12:36 +02:00
Wim Taymans
aab1198516 media: add _get_element() method
Add method to get the element used when creating the media.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703008
2013-06-24 23:56:57 +02:00
Wim Taymans
6d69a4ae80 media: fix docs 2013-06-24 23:51:38 +02:00
Wim Taymans
23ec78faea media: handle segment query format mismatch
It's possible that the segment query returns with a different format than what
we asked for, handle this case also.
2013-06-20 11:14:31 +02:00
David Svensson Fors
52eb796bec media: use segment stop in collect_media_stats
Use segment stop instead of duration as range end point.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701185
2013-06-20 10:17:32 +02:00
Ognyan Tonchev
d9e245e62e rtsp-media: Do not leak the element in take_pipeline
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702470
2013-06-17 17:18:40 +02:00
David Svensson Fors
6151072a2e media: convert_range replaces get_range_times
get_range_times worked for handling UTC ranges for seeks, but we also
need to convert back from NPT to the requested unit in
get_range_string. convert_range is now used for both.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702084
2013-06-14 16:11:34 +02:00
David Svensson Fors
7efa871c1f media: possibility to override range time conversion
Make it possible to override the conversion from GstRTSPTimeRange to
GstClockTimes, that is done before seeking on the media
pipeline. Overriding can be useful for UTC ranges, where the default
conversion gives nanoseconds since 1900.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701191
2013-06-03 14:29:05 +02:00
Wim Taymans
573b10bc83 media: release lock when removing fakesink 2013-04-23 10:28:35 +02:00
Wim Taymans
b80b8824be media: listen to pad-removed signals
Listen to the pad-removed signal and remove the stream associated with the
removed pad.
Add signal to be notified of the removed pad.
Remove the fakesink in unprepare()
Fix signatures of the signal methods
2013-04-22 17:34:37 +02:00
Ognyan Tonchev
a26b06cc69 media: disconnect from signal handlers in unprepare()
We connected to the pad-added and no-more-pads signals in prepare() so
we need to disconnect from them in unprepare().

See https://bugzilla.gnome.org/show_bug.cgi?id=698376
2013-04-22 16:40:48 +02:00
Ognyan Tonchev
9b31fcc7f8 media: don't free streams array
Don't free the streams array in the unprepare() method, they were not
added in prepare().

See https://bugzilla.gnome.org/show_bug.cgi?id=698376
2013-04-22 16:25:17 +02:00
Ognyan Tonchev
0bdff0161c media: don't unref the pipeline in unprepare
Unprepare() should undo what prepare() does. Because the pipeline is
not created in prepare(), we should not unref it in unprepare()
2013-04-22 16:19:35 +02:00
Wim Taymans
a64cb68164 media: add method to get the base_time of the pipeline
Together with a shared clock, this base-time could eventually be sent to
the client so that it can reconstruct the exact running-time of the clock
on the server.
2013-04-12 11:34:38 +01:00
Wim Taymans
36ff679558 media: add GstNetTimeProvider support
Add a property to let the media provide a GstNetTimeProvider for its clock.
Make methods to get the clock and nettimeprovider
Add a x-gst-clock property to the SDP with the IP and port number of the nettime
provider and also the current time of the clock. This should make it possible
for (GStreamer) clients to slave their clock to the server clock.
2013-04-09 22:38:44 +02:00
Wim Taymans
95bf53513f media: wait for buffering to complete
Wait for buffering to complete before changing the state to the target state.
2013-04-09 20:39:58 +02:00
Wim Taymans
ec0718d7c9 media: small cleanup 2013-04-09 20:11:35 +02:00
Olivier Crête
c18eafbb24 rtsp-media/client: Reply to PLAY request with same type of Range
Remember the type of Range from the PLAY request and use the same type for
the reply.
2013-03-22 15:53:06 +01:00
Olivier Crête
b9d111372e Document locking and its order 2013-03-11 11:07:19 +01:00
Ognyan Tonchev
0844e8afbc rtsp-media: Make the element a constructor parameter
https://bugzilla.gnome.org/show_bug.cgi?id=689594
2012-12-10 10:25:57 +01:00
Wim Taymans
6beabf1ed4 media: match prepare with unprepare
Really unprepare when there were an equal amount of prepare calls.
2012-11-30 15:03:15 +01:00
Wim Taymans
ca26588c7e media: media has to be unprepared in finalize
Because unprepare takes away the last ref on the media.
2012-11-30 14:58:46 +01:00
Wim Taymans
119674a828 media: let the source unref the last media ref
the last ref to the media is held by the source so we don't need to add more ref
and unrefs, we simply destroy the media when the source is gone.
2012-11-30 13:35:05 +01:00
Wim Taymans
339ea9b085 media: improve debug 2012-11-30 12:54:10 +01:00
Wim Taymans
241baba20a media: check state
Make sure we are in the right state when collecting the position and duration.
Only make ourselves PREPARED when we were previously PREPARING.
2012-11-30 12:53:02 +01:00
Wim Taymans
edf2ef4f0b media: use g_object_ref/unref for GObjects 2012-11-30 10:05:48 +01:00
Alessandro Decina
00d9a94e1a Fix compiler warning 2012-11-30 06:17:46 +01:00
Wim Taymans
28fd887547 media: avoid element leak 2012-11-29 17:20:56 +01:00
Wim Taymans
4eb010824e media: require an element in media constructor 2012-11-29 17:20:26 +01:00
Wim Taymans
ad00c5e792 rtsp: make object details private
Make all object details private
Add methods to access private bits
2012-11-29 11:11:05 +01:00
Wim Taymans
e11287eb7c media: check if prepared for some methods
Check that the media object is prepared before doing seek and getting the
current position etc.
Add some g_return checks.
2012-11-28 14:45:30 +01:00
Wim Taymans
fe71114a7d media: unref pipeline in finalize to avoid leaking it 2012-11-28 12:39:37 +01:00
Wim Taymans
d43a31055e rtsp: use gst_object_unref on GstObjects 2012-11-28 12:10:47 +01:00
Wim Taymans
0f93879b2c media: fix seeking 2012-11-21 17:21:28 +01:00
Wim Taymans
5eb5fd45f3 media: support more Range formats
Use the new -base methods to convert the Range string into a seek start and stop
value.
2012-11-21 16:41:56 +01:00
Wim Taymans
989f004e24 media: unref source in finish_unprepare
The source is created in prepare, unref it in finish_unprepare.

See https://bugzilla.gnome.org/show_bug.cgi?id=688707
2012-11-20 09:46:40 +01:00
David Svensson Fors
01973c924d rtsp-media: remove bus watch before finalizing
* A GDestroyNotify function is set for the bus watch in gst_rtsp_media_prepare.
* An extra media ref is added for the bus watch. This extra ref is unreffed by
the GDestroyNotify function.
* gst_rtsp_media_unprepare destroys the source so the bus watch is removed.
* GstRTSPClient, which calls gst_rtsp_media_prepare, also calls
gst_rtsp_media_unprepare before unreffing the media.

This way, the bus watch will be removed before the media is finalized.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688707
2012-11-20 09:46:00 +01:00
Wim Taymans
e4ea72ccdf stream: use the address managed by the stream
Use the address managed by the stream for multicast. This allows us to have 1
multicast address for each stream.
Because the address is now managed by the stream we don't have to pass it around
anymore.
Set the address pool on the streams.
2012-11-15 16:18:29 +01:00
Wim Taymans
ba21661ce4 rtsp: improve debug 2012-11-15 16:15:20 +01:00
Wim Taymans
c34f5d1c1a media: add signal for new streams
This allows applications to listen for new streams and configure properties on
them, like the address pool.
2012-11-15 15:41:42 +01:00
Wim Taymans
4168a67992 media: configure address pool in new streams 2012-11-15 15:41:19 +01:00
Wim Taymans
1b4ac6e5b0 media: remove MTU property
It is a stream property
2012-11-15 15:32:43 +01:00
Wim Taymans
f15ffb521c rtsp: use AddressPool
Remove the multicast_group property.
Use the configured addresspool to allocate multicast addresses.
2012-11-14 17:23:59 +01:00
Wim Taymans
dfe3efef74 media: wait for concurrent _prepare
If a prepare is busy, wait for the result.
2012-11-13 11:54:17 +01:00
Wim Taymans
47127bd270 media: add lock around message handler
We don't want to dispatch messages while we are still processing the result of
the state change.
2012-11-13 11:49:08 +01:00
Wim Taymans
9a97de88ea media: add lock to protect state changes 2012-11-13 11:15:35 +01:00
Tim-Philipp Müller
4dba434f16 Fix FSF address 2012-11-04 00:14:25 +00:00
Sebastian Pölsterl
75598337a9 rtsp-server: added annotations to indicate type of ownership transfer of return values
https://bugzilla.gnome.org/show_bug.cgi?id=680777
2012-10-28 15:39:04 +00:00