run gst-indent over c files

This commit is contained in:
Matthew Waters 2019-03-26 16:09:10 +11:00
parent 75122bd55b
commit 28fdf37d17
2 changed files with 19 additions and 25 deletions

View file

@ -108,7 +108,7 @@ send_response_200_ok (Client * client)
{ {
gchar *response; gchar *response;
response = g_strdup_printf ("%s 200 OK\r\n%s\r\n", client->http_version, response = g_strdup_printf ("%s 200 OK\r\n%s\r\n", client->http_version,
content_type); content_type);
write_bytes (client, response, strlen (response)); write_bytes (client, response, strlen (response));
g_free (response); g_free (response);
} }
@ -242,10 +242,10 @@ on_read_bytes (GPollableInputStream * stream, Client * client)
client_message (client, (gchar *) client->current_message->data, len); client_message (client, (gchar *) client->current_message->data, len);
g_byte_array_remove_range (client->current_message, 0, len); g_byte_array_remove_range (client->current_message, 0, len);
tmp = client->current_message->data; tmp = client->current_message->data;
tmp_len = client->current_message->len; tmp_len = client->current_message->len;
} else { } else {
tmp++; tmp++;
tmp_len--; tmp_len--;
} }
} }
@ -372,8 +372,8 @@ on_client_socket_removed (GstElement * element, GSocket * socket,
remove_client (client); remove_client (client);
} }
static void on_stream_caps_changed (GObject *obj, GParamSpec *pspec, static void
gpointer user_data) on_stream_caps_changed (GObject * obj, GParamSpec * pspec, gpointer user_data)
{ {
GstPad *src_pad; GstPad *src_pad;
GstCaps *src_caps; GstCaps *src_caps;
@ -389,27 +389,22 @@ static void on_stream_caps_changed (GObject *obj, GParamSpec *pspec,
* type is OK in HTTP. Required for MJPEG streams. * type is OK in HTTP. Required for MJPEG streams.
*/ */
int i = 0; int i = 0;
const gchar *mimetype = gst_structure_get_name(gstrc); const gchar *mimetype = gst_structure_get_name (gstrc);
while (known_mimetypes[i] != NULL) while (known_mimetypes[i] != NULL) {
{ if (strcmp (mimetype, known_mimetypes[i]) == 0) {
if (strcmp(mimetype, known_mimetypes[i]) == 0)
{
if (content_type) if (content_type)
g_free(content_type); g_free (content_type);
/* Handle the (maybe not so) especial case of multipart to add boundary */ /* Handle the (maybe not so) especial case of multipart to add boundary */
if (strcmp(mimetype, "multipart/x-mixed-replace") == 0 && if (strcmp (mimetype, "multipart/x-mixed-replace") == 0 &&
gst_structure_has_field_typed(gstrc, "boundary", G_TYPE_STRING)) gst_structure_has_field_typed (gstrc, "boundary", G_TYPE_STRING)) {
{ const gchar *boundary = gst_structure_get_string (gstrc, "boundary");
const gchar *boundary = gst_structure_get_string(gstrc, "boundary");
content_type = g_strdup_printf ("Content-Type: " content_type = g_strdup_printf ("Content-Type: "
"multipart/x-mixed-replace;boundary=--%s\r\n", boundary); "multipart/x-mixed-replace;boundary=--%s\r\n", boundary);
} } else {
else
{
content_type = g_strdup_printf ("Content-Type: %s\r\n", mimetype); content_type = g_strdup_printf ("Content-Type: %s\r\n", mimetype);
} }
g_print("%s", content_type); g_print ("%s", content_type);
break; break;
} }
i++; i++;
@ -455,7 +450,7 @@ main (gint argc, gchar ** argv)
} }
const gchar *port_str = argv[1]; const gchar *port_str = argv[1];
const int port = (int) g_ascii_strtoll(port_str, NULL, 10); const int port = (int) g_ascii_strtoll (port_str, NULL, 10);
bin = gst_parse_launchv ((const gchar **) argv + 2, &err); bin = gst_parse_launchv ((const gchar **) argv + 2, &err);
if (!bin) { if (!bin) {
@ -481,8 +476,7 @@ main (gint argc, gchar ** argv)
content_type = g_strdup (""); content_type = g_strdup ("");
g_signal_connect (srcpad, "notify::caps", g_signal_connect (srcpad, "notify::caps",
G_CALLBACK (on_stream_caps_changed), G_CALLBACK (on_stream_caps_changed), NULL);
NULL);
ghostpad = gst_ghost_pad_new ("src", srcpad); ghostpad = gst_ghost_pad_new ("src", srcpad);
gst_element_add_pad (GST_ELEMENT (bin), ghostpad); gst_element_add_pad (GST_ELEMENT (bin), ghostpad);

View file

@ -409,10 +409,10 @@ play_current_uri (GtkPlay * play, GList * uri, const gchar * ext_suburi)
{ {
/* reset the button/widget state to default */ /* reset the button/widget state to default */
g_signal_handlers_block_by_func (play->seekbar, g_signal_handlers_block_by_func (play->seekbar,
seekbar_value_changed_cb, play); seekbar_value_changed_cb, play);
gtk_range_set_range (GTK_RANGE (play->seekbar), 0, 0); gtk_range_set_range (GTK_RANGE (play->seekbar), 0, 0);
g_signal_handlers_unblock_by_func (play->seekbar, g_signal_handlers_unblock_by_func (play->seekbar,
seekbar_value_changed_cb, play); seekbar_value_changed_cb, play);
gtk_widget_set_sensitive (play->prev_button, g_list_previous (uri) != NULL); gtk_widget_set_sensitive (play->prev_button, g_list_previous (uri) != NULL);
gtk_widget_set_sensitive (play->next_button, g_list_next (uri) != NULL); gtk_widget_set_sensitive (play->next_button, g_list_next (uri) != NULL);
gtk_label_set_label (play->rate_label, NULL); gtk_label_set_label (play->rate_label, NULL);