media: move default implementations to where they are used

This commit is contained in:
Wim Taymans 2013-11-26 17:23:04 +01:00
parent b8ae2570d9
commit b3baa2801d

View file

@ -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;
}