diff options
author | Wim Taymans <wtaymans@redhat.com> | 2013-11-26 17:23:04 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2013-11-26 17:23:04 +0100 |
commit | b3baa2801d53cc018a00590c24f53c11fa0ee476 (patch) | |
tree | 378e1b0ab06edf06c305500b202cb4e27251183b | |
parent | b8ae2570d9a4807fdd7d97b000a026cddde1b5ae (diff) |
media: move default implementations to where they are used
-rw-r--r-- | gst/rtsp-server/rtsp-media.c | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 90948c0..5529845 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -167,9 +167,8 @@ static gboolean default_handle_message (GstRTSPMedia * media, GstMessage * message); static void finish_unprepare (GstRTSPMedia * media); static gboolean default_unprepare (GstRTSPMedia * media); -static gboolean -default_convert_range (GstRTSPMedia * media, GstRTSPTimeRange * range, - GstRTSPRangeUnit unit); +static gboolean default_convert_range (GstRTSPMedia * media, + GstRTSPTimeRange * range, GstRTSPRangeUnit unit); static gboolean default_query_position (GstRTSPMedia * media, gint64 * position); static gboolean default_query_stop (GstRTSPMedia * media, gint64 * stop); @@ -380,6 +379,30 @@ gst_rtsp_media_set_property (GObject * object, guint propid, } } +static gboolean +default_query_position (GstRTSPMedia * media, gint64 * position) +{ + return gst_element_query_position (media->priv->pipeline, GST_FORMAT_TIME, + position); +} + +static gboolean +default_query_stop (GstRTSPMedia * media, gint64 * stop) +{ + GstQuery *query; + gboolean res; + + query = gst_query_new_segment (GST_FORMAT_TIME); + if ((res = gst_element_query (media->priv->pipeline, query))) { + GstFormat format; + gst_query_parse_segment (query, NULL, &format, NULL, stop); + if (format != GST_FORMAT_TIME) + *stop = -1; + } + gst_query_unref (query); + return res; +} + /* must be called with state lock */ static void collect_media_stats (GstRTSPMedia * media) @@ -1166,6 +1189,14 @@ gst_rtsp_media_find_stream (GstRTSPMedia * media, const gchar * control) return res; } +/* called with state-lock */ +static gboolean +default_convert_range (GstRTSPMedia * media, GstRTSPTimeRange * range, + GstRTSPRangeUnit unit) +{ + return gst_rtsp_range_convert_units (range, unit); +} + /** * gst_rtsp_media_get_range_string: * @media: a #GstRTSPMedia @@ -2307,35 +2338,3 @@ error_status: return FALSE; } } - -/* called with state-lock */ -static gboolean -default_convert_range (GstRTSPMedia * media, GstRTSPTimeRange * range, - GstRTSPRangeUnit unit) -{ - return gst_rtsp_range_convert_units (range, unit); -} - -static gboolean -default_query_position (GstRTSPMedia * media, gint64 * position) -{ - return gst_element_query_position (media->priv->pipeline, GST_FORMAT_TIME, - position); -} - -static gboolean -default_query_stop (GstRTSPMedia * media, gint64 * stop) -{ - GstQuery *query; - gboolean res; - - query = gst_query_new_segment (GST_FORMAT_TIME); - if ((res = gst_element_query (media->priv->pipeline, query))) { - GstFormat format; - gst_query_parse_segment (query, NULL, &format, NULL, stop); - if (format != GST_FORMAT_TIME) - *stop = -1; - } - gst_query_unref (query); - return res; -} |