diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
commit | 6cc1c73d2baa95c46edc04f57cbe9ed690dc2f21 (patch) | |
tree | 82b5546809a42a56a7bc18bacf8ed6e209ad006e /ext/esd | |
parent | d07ec45fa47fbd0e36224e11bcd8ba2faee1a78c (diff) |
don't mix tabs and spaces
Original commit message from CVS:
don't mix tabs and spaces
Diffstat (limited to 'ext/esd')
-rw-r--r-- | ext/esd/esdmon.c | 65 | ||||
-rw-r--r-- | ext/esd/esdsink.c | 85 |
2 files changed, 77 insertions, 73 deletions
diff --git a/ext/esd/esdmon.c b/ext/esd/esdmon.c index 4a7f4ca1..d06af758 100644 --- a/ext/esd/esdmon.c +++ b/ext/esd/esdmon.c @@ -58,16 +58,16 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = [ 8000, 96000 ], " - "channels = [ 1, 2 ]; " - "audio/x-raw-int, " - "signed = (boolean) FALSE, " - "width = (int) 8, " - "depth = (int) 8, " "rate = [ 8000, 96000 ], " "channels = [ 1, 2 ]") + "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = [ 8000, 96000 ], " + "channels = [ 1, 2 ]; " + "audio/x-raw-int, " + "signed = (boolean) FALSE, " + "width = (int) 8, " + "depth = (int) 8, " "rate = [ 8000, 96000 ], " "channels = [ 1, 2 ]") ); static void gst_esdmon_base_init (gpointer g_class); @@ -96,9 +96,10 @@ gst_esdmon_depths_get_type (void) {16, "16", "16 Bits"}, {0, NULL, NULL}, }; + if (!esdmon_depths_type) { esdmon_depths_type = - g_enum_register_static ("GstEsdmonDepths", esdmon_depths); + g_enum_register_static ("GstEsdmonDepths", esdmon_depths); } return esdmon_depths_type; } @@ -113,9 +114,10 @@ gst_esdmon_channels_get_type (void) {2, "2", "Stereo"}, {0, NULL, NULL}, }; + if (!esdmon_channels_type) { esdmon_channels_type = - g_enum_register_static ("GstEsdmonChannels", esdmon_channels); + g_enum_register_static ("GstEsdmonChannels", esdmon_channels); } return esdmon_channels_type; } @@ -142,8 +144,9 @@ gst_esdmon_get_type (void) 0, gst_esdmon_init, }; + esdmon_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstEsdmon", &esdmon_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstEsdmon", &esdmon_info, 0); } return esdmon_type; } @@ -166,12 +169,12 @@ gst_esdmon_class_init (gpointer g_class, gpointer class_data) parent_class = g_type_class_peek_parent (g_class); - g_object_class_install_property (gobject_class, ARG_BYTESPERREAD, g_param_spec_ulong ("bytes_per_read", "bytes_per_read", "bytes_per_read", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_CUROFFSET, g_param_spec_ulong ("curoffset", "curoffset", "curoffset", 0, G_MAXULONG, 0, G_PARAM_READABLE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_DEPTH, g_param_spec_enum ("depth", "depth", "depth", GST_TYPE_ESDMON_DEPTHS, 16, G_PARAM_READWRITE)); /* CHECKME! */ - g_object_class_install_property (gobject_class, ARG_CHANNELS, g_param_spec_enum ("channels", "channels", "channels", GST_TYPE_ESDMON_CHANNELS, 2, G_PARAM_READWRITE)); /* CHECKME! */ - g_object_class_install_property (gobject_class, ARG_RATE, g_param_spec_int ("frequency", "frequency", "frequency", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_HOST, g_param_spec_string ("host", "host", "host", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_BYTESPERREAD, g_param_spec_ulong ("bytes_per_read", "bytes_per_read", "bytes_per_read", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_CUROFFSET, g_param_spec_ulong ("curoffset", "curoffset", "curoffset", 0, G_MAXULONG, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_DEPTH, g_param_spec_enum ("depth", "depth", "depth", GST_TYPE_ESDMON_DEPTHS, 16, G_PARAM_READWRITE)); /* CHECKME! */ + g_object_class_install_property (gobject_class, ARG_CHANNELS, g_param_spec_enum ("channels", "channels", "channels", GST_TYPE_ESDMON_CHANNELS, 2, G_PARAM_READWRITE)); /* CHECKME! */ + g_object_class_install_property (gobject_class, ARG_RATE, g_param_spec_int ("frequency", "frequency", "frequency", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_HOST, g_param_spec_string ("host", "host", "host", NULL, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_esdmon_set_property; gobject_class->get_property = gst_esdmon_get_property; @@ -246,13 +249,13 @@ gst_esdmon_get (GstPad * pad) /* set caps on src pad */ if (gst_pad_set_explicit_caps (esdmon->srcpad, - gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "signed", G_TYPE_BOOLEAN, sign, - "width", G_TYPE_INT, esdmon->depth, - "depth", G_TYPE_INT, esdmon->depth, - "rate", G_TYPE_INT, esdmon->frequency, - "channels", G_TYPE_INT, esdmon->channels)) <= 0) { + gst_caps_new_simple ("audio/x-raw-int", + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "signed", G_TYPE_BOOLEAN, sign, + "width", G_TYPE_INT, esdmon->depth, + "depth", G_TYPE_INT, esdmon->depth, + "rate", G_TYPE_INT, esdmon->frequency, + "channels", G_TYPE_INT, esdmon->channels)) <= 0) { GST_ELEMENT_ERROR (esdmon, CORE, NEGOTIATION, (NULL), (NULL)); return NULL; } @@ -300,7 +303,7 @@ gst_esdmon_set_property (GObject * object, guint prop_id, const GValue * value, case ARG_RATE: /* Preserve the timestamps */ esdmon->basetime = - esdmon->samples_since_basetime * GST_SECOND / esdmon->frequency; + esdmon->samples_since_basetime * GST_SECOND / esdmon->frequency; esdmon->samples_since_basetime = 0; /* Set the new frequency */ @@ -309,11 +312,11 @@ gst_esdmon_set_property (GObject * object, guint prop_id, const GValue * value, break; case ARG_HOST: if (esdmon->host != NULL) - g_free (esdmon->host); + g_free (esdmon->host); if (g_value_get_string (value) == NULL) - esdmon->host = NULL; + esdmon->host = NULL; else - esdmon->host = g_strdup (g_value_get_string (value)); + esdmon->host = g_strdup (g_value_get_string (value)); break; default: break; @@ -432,7 +435,7 @@ gst_esdmon_change_state (GstElement * element) } else { if (!GST_FLAG_IS_SET (element, GST_ESDMON_OPEN)) { if (!gst_esdmon_open_audio (GST_ESDMON (element))) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c index ce7045e7..c6c5be4d 100644 --- a/ext/esd/esdsink.c +++ b/ext/esd/esdsink.c @@ -59,10 +59,10 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " "rate = 44100, " "channels = 2") + "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " "rate = 44100, " "channels = 2") ); static void gst_esdsink_base_init (gpointer g_class); @@ -104,9 +104,10 @@ gst_esdsink_get_type (void) 0, gst_esdsink_init, }; + esdsink_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstEsdsink", &esdsink_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstEsdsink", &esdsink_info, + 0); } return esdsink_type; } @@ -129,17 +130,17 @@ gst_esdsink_class_init (gpointer g_class, gpointer class_data) parent_class = g_type_class_peek_parent (g_class); - g_object_class_install_property (gobject_class, ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_HOST, g_param_spec_string ("host", "host", "host", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_HOST, g_param_spec_string ("host", "host", "host", NULL, G_PARAM_READWRITE)); /* CHECKME */ g_object_class_install_property (gobject_class, ARG_SYNC, g_param_spec_boolean ("sync", "sync", "Synchronize output to clock", - TRUE, G_PARAM_READWRITE)); + TRUE, G_PARAM_READWRITE)); #if 0 /* This option is disabled because it is dumb in GStreamer's architecture. */ g_object_class_install_property (gobject_class, ARG_FALLBACK, g_param_spec_boolean ("fallback", "fallback", - "Fall back to using OSS if Esound daemon is not present", FALSE, - G_PARAM_READWRITE)); + "Fall back to using OSS if Esound daemon is not present", FALSE, + G_PARAM_READWRITE)); #endif gobject_class->set_property = gst_esdsink_set_property; @@ -255,7 +256,7 @@ gst_esdsink_chain (GstPad * pad, GstData * _data) if (!esdsink->negotiated) { GST_ELEMENT_ERROR (esdsink, CORE, NEGOTIATION, (NULL), - ("element wasn't negotiated before chain function")); + ("element wasn't negotiated before chain function")); goto done; } @@ -264,13 +265,13 @@ gst_esdsink_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: - gst_audio_clock_set_active (GST_AUDIO_CLOCK (esdsink->provided_clock), - FALSE); - gst_pad_event_default (pad, event); - return; + gst_audio_clock_set_active (GST_AUDIO_CLOCK (esdsink->provided_clock), + FALSE); + gst_pad_event_default (pad, event); + return; default: - gst_pad_event_default (pad, event); - return; + gst_pad_event_default (pad, event); + return; } gst_event_unref (event); return; @@ -285,22 +286,22 @@ gst_esdsink_chain (GstPad * pad, GstData * _data) to_write = size; GST_LOG ("fd=%d data=%p size=%d", - esdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); + esdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); while (to_write > 0) { - int done; + int done; - done = write (esdsink->fd, data, to_write); + done = write (esdsink->fd, data, to_write); - if (done < 0) { - if (errno == EINTR) { - goto done; - } - g_assert_not_reached (); - } + if (done < 0) { + if (errno == EINTR) { + goto done; + } + g_assert_not_reached (); + } - to_write -= done; - data += done; - esdsink->handled += done / esdsink->bytes_per_sample; + to_write -= done; + data += done; + esdsink->handled += done / esdsink->bytes_per_sample; } } @@ -330,9 +331,9 @@ gst_esdsink_set_property (GObject * object, guint prop_id, const GValue * value, case ARG_HOST: g_free (esdsink->host); if (g_value_get_string (value) == NULL) - esdsink->host = NULL; + esdsink->host = NULL; else - esdsink->host = g_strdup (g_value_get_string (value)); + esdsink->host = g_strdup (g_value_get_string (value)); break; case ARG_SYNC: esdsink->sync = g_value_get_boolean (value); @@ -376,7 +377,7 @@ gboolean gst_esdsink_factory_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "esdsink", GST_RANK_NONE, - GST_TYPE_ESDSINK)) + GST_TYPE_ESDSINK)) return FALSE; return TRUE; @@ -399,7 +400,7 @@ gst_esdsink_open_audio (GstEsdsink * sink) esdformat |= ESD_BITS8; else { GST_ELEMENT_ERROR (sink, STREAM, FORMAT, (NULL), - ("invalid bit depth (%d)", sink->depth)); + ("invalid bit depth (%d)", sink->depth)); return FALSE; } @@ -409,22 +410,22 @@ gst_esdsink_open_audio (GstEsdsink * sink) esdformat |= ESD_MONO; else { GST_ELEMENT_ERROR (sink, STREAM, FORMAT, (NULL), - ("invalid number of channels (%d)", sink->channels)); + ("invalid number of channels (%d)", sink->channels)); return FALSE; } GST_INFO ("attempting to open connection to esound server"); if (sink->fallback) { sink->fd = - esd_play_stream_fallback (esdformat, sink->frequency, sink->host, - connname); + esd_play_stream_fallback (esdformat, sink->frequency, sink->host, + connname); } else { sink->fd = - esd_play_stream (esdformat, sink->frequency, sink->host, connname); + esd_play_stream (esdformat, sink->frequency, sink->host, connname); } if (sink->fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, (NULL), - ("can't open connection to esound server")); + ("can't open connection to esound server")); return FALSE; } GST_INFO ("successfully opened connection to esound server"); @@ -454,18 +455,18 @@ gst_esdsink_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: if (!gst_esdsink_open_audio (GST_ESDSINK (element))) { - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } break; case GST_STATE_READY_TO_PAUSED: break; case GST_STATE_PAUSED_TO_PLAYING: gst_audio_clock_set_active (GST_AUDIO_CLOCK (esdsink->provided_clock), - TRUE); + TRUE); break; case GST_STATE_PLAYING_TO_PAUSED: gst_audio_clock_set_active (GST_AUDIO_CLOCK (esdsink->provided_clock), - FALSE); + FALSE); esdsink->resync = TRUE; break; case GST_STATE_PAUSED_TO_READY: |