mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
media: reindent
This commit is contained in:
parent
851e8aa744
commit
d45eae2edd
1 changed files with 92 additions and 91 deletions
|
@ -56,7 +56,8 @@ static void gst_rtsp_media_set_property (GObject *object, guint propid,
|
||||||
static void gst_rtsp_media_finalize (GObject * obj);
|
static void gst_rtsp_media_finalize (GObject * obj);
|
||||||
|
|
||||||
static gpointer do_loop (GstRTSPMediaClass * klass);
|
static gpointer do_loop (GstRTSPMediaClass * klass);
|
||||||
static gboolean default_handle_message (GstRTSPMedia *media, GstMessage *message);
|
static gboolean default_handle_message (GstRTSPMedia * media,
|
||||||
|
GstMessage * message);
|
||||||
static gboolean default_unprepare (GstRTSPMedia * media);
|
static gboolean default_unprepare (GstRTSPMedia * media);
|
||||||
static void unlock_streams (GstRTSPMedia * media);
|
static void unlock_streams (GstRTSPMedia * media);
|
||||||
|
|
||||||
|
@ -77,8 +78,9 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass)
|
||||||
gobject_class->finalize = gst_rtsp_media_finalize;
|
gobject_class->finalize = gst_rtsp_media_finalize;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_SHARED,
|
g_object_class_install_property (gobject_class, PROP_SHARED,
|
||||||
g_param_spec_boolean ("shared", "Shared", "If this media pipeline can be shared",
|
g_param_spec_boolean ("shared", "Shared",
|
||||||
DEFAULT_SHARED, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
"If this media pipeline can be shared", DEFAULT_SHARED,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_REUSABLE,
|
g_object_class_install_property (gobject_class, PROP_REUSABLE,
|
||||||
g_param_spec_boolean ("reusable", "Reusable",
|
g_param_spec_boolean ("reusable", "Reusable",
|
||||||
|
@ -229,8 +231,7 @@ collect_media_stats (GstRTSPMedia *media)
|
||||||
media->range.min.seconds = -1;
|
media->range.min.seconds = -1;
|
||||||
media->range.max.type = GST_RTSP_TIME_END;
|
media->range.max.type = GST_RTSP_TIME_END;
|
||||||
media->range.max.seconds = -1;
|
media->range.max.seconds = -1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* get the position */
|
/* get the position */
|
||||||
format = GST_FORMAT_TIME;
|
format = GST_FORMAT_TIME;
|
||||||
if (!gst_element_query_position (media->pipeline, &format, &position)) {
|
if (!gst_element_query_position (media->pipeline, &format, &position)) {
|
||||||
|
@ -245,22 +246,20 @@ collect_media_stats (GstRTSPMedia *media)
|
||||||
duration = -1;
|
duration = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_INFO ("stats: position %"GST_TIME_FORMAT", duration %"GST_TIME_FORMAT,
|
GST_INFO ("stats: position %" GST_TIME_FORMAT ", duration %"
|
||||||
GST_TIME_ARGS (position), GST_TIME_ARGS (duration));
|
GST_TIME_FORMAT, GST_TIME_ARGS (position), GST_TIME_ARGS (duration));
|
||||||
|
|
||||||
if (position == -1) {
|
if (position == -1) {
|
||||||
media->range.min.type = GST_RTSP_TIME_NOW;
|
media->range.min.type = GST_RTSP_TIME_NOW;
|
||||||
media->range.min.seconds = -1;
|
media->range.min.seconds = -1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
media->range.min.type = GST_RTSP_TIME_SECONDS;
|
media->range.min.type = GST_RTSP_TIME_SECONDS;
|
||||||
media->range.min.seconds = ((gdouble) position) / GST_SECOND;
|
media->range.min.seconds = ((gdouble) position) / GST_SECOND;
|
||||||
}
|
}
|
||||||
if (duration == -1) {
|
if (duration == -1) {
|
||||||
media->range.max.type = GST_RTSP_TIME_END;
|
media->range.max.type = GST_RTSP_TIME_END;
|
||||||
media->range.max.seconds = -1;
|
media->range.max.seconds = -1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
media->range.max.type = GST_RTSP_TIME_SECONDS;
|
media->range.max.type = GST_RTSP_TIME_SECONDS;
|
||||||
media->range.max.seconds = ((gdouble) duration) / GST_SECOND;
|
media->range.max.seconds = ((gdouble) duration) / GST_SECOND;
|
||||||
}
|
}
|
||||||
|
@ -470,8 +469,7 @@ gst_rtsp_media_seek (GstRTSPMedia *media, GstRTSPTimeRange *range)
|
||||||
GST_INFO ("prerolled again");
|
GST_INFO ("prerolled again");
|
||||||
|
|
||||||
collect_media_stats (media);
|
collect_media_stats (media);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
GST_INFO ("no seek needed");
|
GST_INFO ("no seek needed");
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -758,7 +756,8 @@ find_transport (GstRTSPMediaStream *stream, const gchar *rtcp_from)
|
||||||
min = trans->transport->client_port.min;
|
min = trans->transport->client_port.min;
|
||||||
max = trans->transport->client_port.max;
|
max = trans->transport->client_port.max;
|
||||||
|
|
||||||
if ((strcmp (trans->transport->destination, dest) == 0) && (min == port || max == port)) {
|
if ((strcmp (trans->transport->destination, dest) == 0) && (min == port
|
||||||
|
|| max == port)) {
|
||||||
result = trans;
|
result = trans;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -787,7 +786,8 @@ on_new_ssrc (GObject *session, GObject *source, GstRTSPMediaStream *stream)
|
||||||
|
|
||||||
rtcp_from = gst_structure_get_string (stats, "rtcp-from");
|
rtcp_from = gst_structure_get_string (stats, "rtcp-from");
|
||||||
if ((trans = find_transport (stream, rtcp_from))) {
|
if ((trans = find_transport (stream, rtcp_from))) {
|
||||||
GST_INFO ("%p: found transport %p for source %p", stream, trans, source);
|
GST_INFO ("%p: found transport %p for source %p", stream, trans,
|
||||||
|
source);
|
||||||
|
|
||||||
/* keep ref to the source */
|
/* keep ref to the source */
|
||||||
trans->rtpsource = source;
|
trans->rtpsource = source;
|
||||||
|
@ -808,7 +808,8 @@ on_ssrc_sdes (GObject *session, GObject *source, GstRTSPMediaStream *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_ssrc_active (GObject *session, GObject *source, GstRTSPMediaStream *stream)
|
on_ssrc_active (GObject * session, GObject * source,
|
||||||
|
GstRTSPMediaStream * stream)
|
||||||
{
|
{
|
||||||
GstRTSPMediaTrans *trans;
|
GstRTSPMediaTrans *trans;
|
||||||
|
|
||||||
|
@ -838,7 +839,8 @@ on_bye_ssrc (GObject *session, GObject *source, GstRTSPMediaStream *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_bye_timeout (GObject *session, GObject *source, GstRTSPMediaStream *stream)
|
on_bye_timeout (GObject * session, GObject * source,
|
||||||
|
GstRTSPMediaStream * stream)
|
||||||
{
|
{
|
||||||
GstRTSPMediaTrans *trans;
|
GstRTSPMediaTrans *trans;
|
||||||
|
|
||||||
|
@ -882,8 +884,7 @@ handle_new_buffer (GstAppSink *sink, gpointer user_data)
|
||||||
if (GST_ELEMENT_CAST (sink) == stream->appsink[0]) {
|
if (GST_ELEMENT_CAST (sink) == stream->appsink[0]) {
|
||||||
if (tr->send_rtp)
|
if (tr->send_rtp)
|
||||||
tr->send_rtp (buffer, tr->transport->interleaved.min, tr->user_data);
|
tr->send_rtp (buffer, tr->transport->interleaved.min, tr->user_data);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (tr->send_rtcp)
|
if (tr->send_rtcp)
|
||||||
tr->send_rtcp (buffer, tr->transport->interleaved.max, tr->user_data);
|
tr->send_rtcp (buffer, tr->transport->interleaved.max, tr->user_data);
|
||||||
}
|
}
|
||||||
|
@ -958,12 +959,12 @@ setup_stream (GstRTSPMediaStream *stream, guint idx, GstRTSPMedia *media)
|
||||||
stream);
|
stream);
|
||||||
g_signal_connect (stream->session, "on-ssrc-sdes", (GCallback) on_ssrc_sdes,
|
g_signal_connect (stream->session, "on-ssrc-sdes", (GCallback) on_ssrc_sdes,
|
||||||
stream);
|
stream);
|
||||||
g_signal_connect (stream->session, "on-ssrc-active", (GCallback) on_ssrc_active,
|
g_signal_connect (stream->session, "on-ssrc-active",
|
||||||
stream);
|
(GCallback) on_ssrc_active, stream);
|
||||||
g_signal_connect (stream->session, "on-bye-ssrc", (GCallback) on_bye_ssrc,
|
g_signal_connect (stream->session, "on-bye-ssrc", (GCallback) on_bye_ssrc,
|
||||||
stream);
|
stream);
|
||||||
g_signal_connect (stream->session, "on-bye-timeout", (GCallback) on_bye_timeout,
|
g_signal_connect (stream->session, "on-bye-timeout",
|
||||||
stream);
|
(GCallback) on_bye_timeout, stream);
|
||||||
g_signal_connect (stream->session, "on-timeout", (GCallback) on_timeout,
|
g_signal_connect (stream->session, "on-timeout", (GCallback) on_timeout,
|
||||||
stream);
|
stream);
|
||||||
|
|
||||||
|
@ -1123,8 +1124,7 @@ default_handle_message (GstRTSPMedia *media, GstMessage *message)
|
||||||
if (media->target_state == GST_STATE_PLAYING) {
|
if (media->target_state == GST_STATE_PLAYING) {
|
||||||
GST_INFO ("Buffering done, setting pipeline to PLAYING");
|
GST_INFO ("Buffering done, setting pipeline to PLAYING");
|
||||||
gst_element_set_state (media->pipeline, GST_STATE_PLAYING);
|
gst_element_set_state (media->pipeline, GST_STATE_PLAYING);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
GST_INFO ("Buffering done");
|
GST_INFO ("Buffering done");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1134,8 +1134,7 @@ default_handle_message (GstRTSPMedia *media, GstMessage *message)
|
||||||
/* we were not buffering but PLAYING, PAUSE the pipeline. */
|
/* we were not buffering but PLAYING, PAUSE the pipeline. */
|
||||||
GST_INFO ("Buffering, setting pipeline to PAUSED ...");
|
GST_INFO ("Buffering, setting pipeline to PAUSED ...");
|
||||||
gst_element_set_state (media->pipeline, GST_STATE_PAUSED);
|
gst_element_set_state (media->pipeline, GST_STATE_PAUSED);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
GST_INFO ("Buffering ...");
|
GST_INFO ("Buffering ...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1175,7 +1174,8 @@ default_handle_message (GstRTSPMedia *media, GstMessage *message)
|
||||||
case GST_MESSAGE_STREAM_STATUS:
|
case GST_MESSAGE_STREAM_STATUS:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_INFO ("%p: got message type %s", media, gst_message_type_get_name (type));
|
GST_INFO ("%p: got message type %s", media,
|
||||||
|
gst_message_type_get_name (type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1434,7 +1434,8 @@ default_unprepare (GstRTSPMedia *media)
|
||||||
* Returns: %TRUE on success.
|
* Returns: %TRUE on success.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_rtsp_media_set_state (GstRTSPMedia *media, GstState state, GArray *transports)
|
gst_rtsp_media_set_state (GstRTSPMedia * media, GstState state,
|
||||||
|
GArray * transports)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
@ -1450,7 +1451,8 @@ gst_rtsp_media_set_state (GstRTSPMedia *media, GstState state, GArray *transport
|
||||||
|
|
||||||
add = remove = FALSE;
|
add = remove = FALSE;
|
||||||
|
|
||||||
GST_INFO ("going to state %s media %p", gst_element_state_get_name (state), media);
|
GST_INFO ("going to state %s media %p", gst_element_state_get_name (state),
|
||||||
|
media);
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case GST_STATE_NULL:
|
case GST_STATE_NULL:
|
||||||
|
@ -1619,4 +1621,3 @@ gst_rtsp_media_remove_elements (GstRTSPMedia *media)
|
||||||
gst_object_unref (media->pipeline);
|
gst_object_unref (media->pipeline);
|
||||||
media->pipeline = NULL;
|
media->pipeline = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue