Commit graph

155 commits

Author SHA1 Message Date
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
Wim Taymans
0bb0e3733c small fixes to docs and debug 2012-10-27 11:53:51 +02:00
Wim Taymans
6f7d755894 stream: improve join and leave of the pipeline
simplify code
Do the cleanup properly
Add some docs
2012-10-26 17:28:10 +02:00
Wim Taymans
693dd3cfc4 media: move unprepare below default implementation
Makes it easier to find the default implementation
2012-10-26 15:23:16 +02:00
Wim Taymans
0d55e1f50c media: signal unprepared when we actually finish 2012-10-26 15:21:50 +02:00
Wim Taymans
84b7cf1590 media: no need to unlock, unprepare does that when needed 2012-10-26 15:19:23 +02:00
Wim Taymans
6b7ff45ca6 rtsp: fix MTU setting
Fix setting of the MTU. There is no need for a vmethod.
2012-10-26 12:35:20 +02:00
Wim Taymans
de7c72dec2 rtsp: massive refactoring
Make GObjects from the remaining simple structures.
Remove GstRTSPSessionStream, it's not needed.
Rename GstRTSPMediaStream -> GstRTSPStream: It is shorter
Rename GstRTSPMediaTrans -> GstRTSPStreamTransport: It describes how
  a GstRTSPStream should be transported to a client.
Rename GstRTSPMediaFactory::get_element -> create_element because that
  more accurately describes what it does.
Make nice methods instead of poking in the structures.
Move some methods inside the relevant object source code.
Use GPtrArray to store objects instead of plain arrays, it is more
  natural and allows us to more easily clean up.
Move the allocation of udp ports to the Stream object. The Stream object
  contains the elements needed to stream the media to a client.
Improve the prepare and unprepare methods. Unprepare should now undo
  everything prepare did. Improve also async unprepare when doing EOS on
  shutdown. Make sure we always unprepare correctly.
2012-10-25 21:29:58 +02:00
Sebastian Pölsterl
e11e855ac8 rtsp-server: fixed comments and GIR annotations
https://bugzilla.gnome.org/show_bug.cgi?id=680777
2012-10-18 19:17:01 +01:00
Ognyan Tonchev
d581b7bd4e client: Use client transport settings for multicast if allowed.
This patch makes it possible for the client to send transport settings for
multicast (destination && ttl). Client settings must be explicitly allowed or
the server will use its own settings.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685561
2012-10-10 11:07:59 +02:00