From 1f562870ee16ee2cbfc94022bf84894c95ee5f7c Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 28 Nov 2018 13:35:35 +0200 Subject: [PATCH] Run gst-indent through the files This is required before we enabled an indent test in the CI. https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33 --- ext/dtls/gstdtlsagent.c | 1 - ext/dtls/gstdtlscertificate.c | 2 +- ext/dtls/gstdtlsconnection.c | 14 ++-- ext/webrtc/gstwebrtcice.c | 6 +- sys/androidmedia/gstamcvideodec.c | 122 +++++++++++++++++++--------------- sys/decklink/win/DeckLinkAPI_i.c | 4 ++ sys/winks/ksdeviceprovider.c | 5 +- tests/check/libs/planaraudioadapter.c | 4 +- 8 files changed, 90 insertions(+), 68 deletions(-) diff --git a/ext/dtls/gstdtlsagent.c b/ext/dtls/gstdtlsagent.c index 994fa34..8f8ced2 100644 --- a/ext/dtls/gstdtlsagent.c +++ b/ext/dtls/gstdtlsagent.c @@ -120,7 +120,6 @@ _gst_dtls_init_openssl (void) OPENSSL_VERSION_TEXT); g_assert_not_reached (); } - #if OPENSSL_VERSION_NUMBER < 0x10100000L GST_INFO_OBJECT (NULL, "initializing openssl %lx", OPENSSL_VERSION_NUMBER); SSL_library_init (); diff --git a/ext/dtls/gstdtlscertificate.c b/ext/dtls/gstdtlscertificate.c index 4c1d459..4e44849 100644 --- a/ext/dtls/gstdtlscertificate.c +++ b/ext/dtls/gstdtlscertificate.c @@ -246,7 +246,7 @@ init_generated (GstDtlsCertificate * self) X509_set_version (priv->x509, 2); ASN1_INTEGER_set (X509_get_serialNumber (priv->x509), 0); X509_gmtime_adj (X509_getm_notBefore (priv->x509), 0); - X509_gmtime_adj (X509_getm_notAfter (priv->x509), 31536000L); /* A year */ + X509_gmtime_adj (X509_getm_notAfter (priv->x509), 31536000L); /* A year */ X509_set_pubkey (priv->x509, priv->private_key); name = X509_get_subject_name (priv->x509); diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c index 6b6e90c..ab43ee7 100644 --- a/ext/dtls/gstdtlsconnection.c +++ b/ext/dtls/gstdtlsconnection.c @@ -602,13 +602,13 @@ log_state (GstDtlsConnection * self, const gchar * str) GstDtlsConnectionPrivate *priv = self->priv; guint states = 0; - states |= (!!SSL_is_init_finished (priv->ssl) << 0); - states |= (!!SSL_in_init (priv->ssl) << 4); - states |= (!!SSL_in_before (priv->ssl) << 8); - states |= (!!SSL_in_connect_init (priv->ssl) << 12); - states |= (!!SSL_in_accept_init (priv->ssl) << 16); - states |= (!!SSL_want_write (priv->ssl) << 20); - states |= (!!SSL_want_read (priv->ssl) << 24); + states |= (! !SSL_is_init_finished (priv->ssl) << 0); + states |= (! !SSL_in_init (priv->ssl) << 4); + states |= (! !SSL_in_before (priv->ssl) << 8); + states |= (! !SSL_in_connect_init (priv->ssl) << 12); + states |= (! !SSL_in_accept_init (priv->ssl) << 16); + states |= (! !SSL_want_write (priv->ssl) << 20); + states |= (! !SSL_want_read (priv->ssl) << 24); #if OPENSSL_VERSION_NUMBER < 0x10100001L GST_LOG_OBJECT (self, "%s: role=%s buf=(%d,%p:%d/%d) %x|%x %s", diff --git a/ext/webrtc/gstwebrtcice.c b/ext/webrtc/gstwebrtcice.c index 5da7b7b..595d90e 100644 --- a/ext/webrtc/gstwebrtcice.c +++ b/ext/webrtc/gstwebrtcice.c @@ -362,7 +362,8 @@ _add_turn_server (GstWebRTCICE * ice, struct NiceStreamItem *item, for (i = 0; i < relay_n; i++) { ret = nice_agent_set_relay_info (ice->priv->nice_agent, item->nice_stream_id, NICE_COMPONENT_TYPE_RTP, - gst_uri_get_host (turn_server), gst_uri_get_port (turn_server), user, pass, relays[i]); + gst_uri_get_host (turn_server), gst_uri_get_port (turn_server), user, + pass, relays[i]); if (!ret) { gchar *uri = gst_uri_to_string (turn_server); GST_ERROR_OBJECT (ice, "Failed to set TURN server '%s'", uri); @@ -371,7 +372,8 @@ _add_turn_server (GstWebRTCICE * ice, struct NiceStreamItem *item, } ret = nice_agent_set_relay_info (ice->priv->nice_agent, item->nice_stream_id, NICE_COMPONENT_TYPE_RTCP, - gst_uri_get_host (turn_server), gst_uri_get_port (turn_server), user, pass, relays[i]); + gst_uri_get_host (turn_server), gst_uri_get_port (turn_server), user, + pass, relays[i]); if (!ret) { gchar *uri = gst_uri_to_string (turn_server); GST_ERROR_OBJECT (ice, "Failed to set TURN server '%s'", uri); diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c index 45ea531..7b1c161 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -983,52 +983,71 @@ _gl_sync_release_next_buffer (struct gl_sync *sync, gboolean render) } #define I(x,y) ((y)*4+(x)) -static int affine_inverse (float in[], float out[]) { - float s0, s1, s2, s3, s4, s5; - float c0, c1, c2, c3, c4, c5; - float det, invdet; - - s0 = in[0] * in[I(1,1)] - in[I(1,0)] * in[I(0,1)]; - s1 = in[0] * in[I(1,2)] - in[I(1,0)] * in[I(0,2)]; - s2 = in[0] * in[I(1,3)] - in[I(1,0)] * in[I(0,3)]; - s3 = in[1] * in[I(1,2)] - in[I(1,1)] * in[I(0,2)]; - s4 = in[1] * in[I(1,3)] - in[I(1,1)] * in[I(0,3)]; - s5 = in[2] * in[I(1,3)] - in[I(1,2)] * in[I(0,3)]; - - c0 = in[I(2,0)] * in[I(3,1)] - in[I(3,0)] * in[I(2,1)]; - c1 = in[I(2,0)] * in[I(3,2)] - in[I(3,0)] * in[I(2,2)]; - c2 = in[I(2,0)] * in[I(3,3)] - in[I(3,0)] * in[I(2,3)]; - c3 = in[I(2,1)] * in[I(3,2)] - in[I(3,1)] * in[I(2,2)]; - c4 = in[I(2,1)] * in[I(3,3)] - in[I(3,1)] * in[I(2,3)]; - c5 = in[I(2,2)] * in[I(3,3)] - in[I(3,2)] * in[I(2,3)]; - - det = s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0; - if (det == 0.0) - return 0; - invdet = 1.0 / det; - - out[I(0,0)] = ( in[I(1,1)] * c5 - in[I(1,2)] * c4 + in[I(1,3)] * c3) * invdet; - out[I(0,1)] = (-in[I(0,1)] * c5 + in[I(0,2)] * c4 - in[I(0,3)] * c3) * invdet; - out[I(0,2)] = ( in[I(3,1)] * s5 - in[I(3,2)] * s4 + in[I(3,3)] * s3) * invdet; - out[I(0,3)] = (-in[I(2,1)] * s5 + in[I(2,2)] * s4 - in[I(2,3)] * s3) * invdet; - - out[I(1,0)] = (-in[I(1,0)] * c5 + in[I(1,2)] * c2 - in[I(1,3)] * c1) * invdet; - out[I(1,1)] = ( in[I(0,0)] * c5 - in[I(0,2)] * c2 + in[I(0,3)] * c1) * invdet; - out[I(1,2)] = (-in[I(3,0)] * s5 + in[I(3,2)] * s2 - in[I(3,3)] * s1) * invdet; - out[I(1,3)] = ( in[I(2,0)] * s5 - in[I(2,2)] * s2 + in[I(2,3)] * s1) * invdet; - - out[I(2,0)] = ( in[I(1,0)] * c4 - in[I(1,1)] * c2 + in[I(1,3)] * c0) * invdet; - out[I(2,1)] = (-in[I(0,0)] * c4 + in[I(0,1)] * c2 - in[I(0,3)] * c0) * invdet; - out[I(2,2)] = ( in[I(3,0)] * s4 - in[I(3,1)] * s2 + in[I(3,3)] * s0) * invdet; - out[I(2,3)] = (-in[I(2,0)] * s4 + in[I(2,1)] * s2 - in[I(2,3)] * s0) * invdet; - - out[I(3,0)] = (-in[I(1,0)] * c3 + in[I(1,1)] * c1 - in[I(1,2)] * c0) * invdet; - out[I(3,1)] = ( in[I(0,0)] * c3 - in[I(0,1)] * c1 + in[I(0,2)] * c0) * invdet; - out[I(3,2)] = (-in[I(3,0)] * s3 + in[I(3,1)] * s1 - in[I(3,2)] * s0) * invdet; - out[I(3,3)] = ( in[I(2,0)] * s3 - in[I(2,1)] * s1 + in[I(2,2)] * s0) * invdet; - - return 1; +static int +affine_inverse (float in[], float out[]) +{ + float s0, s1, s2, s3, s4, s5; + float c0, c1, c2, c3, c4, c5; + float det, invdet; + + s0 = in[0] * in[I (1, 1)] - in[I (1, 0)] * in[I (0, 1)]; + s1 = in[0] * in[I (1, 2)] - in[I (1, 0)] * in[I (0, 2)]; + s2 = in[0] * in[I (1, 3)] - in[I (1, 0)] * in[I (0, 3)]; + s3 = in[1] * in[I (1, 2)] - in[I (1, 1)] * in[I (0, 2)]; + s4 = in[1] * in[I (1, 3)] - in[I (1, 1)] * in[I (0, 3)]; + s5 = in[2] * in[I (1, 3)] - in[I (1, 2)] * in[I (0, 3)]; + + c0 = in[I (2, 0)] * in[I (3, 1)] - in[I (3, 0)] * in[I (2, 1)]; + c1 = in[I (2, 0)] * in[I (3, 2)] - in[I (3, 0)] * in[I (2, 2)]; + c2 = in[I (2, 0)] * in[I (3, 3)] - in[I (3, 0)] * in[I (2, 3)]; + c3 = in[I (2, 1)] * in[I (3, 2)] - in[I (3, 1)] * in[I (2, 2)]; + c4 = in[I (2, 1)] * in[I (3, 3)] - in[I (3, 1)] * in[I (2, 3)]; + c5 = in[I (2, 2)] * in[I (3, 3)] - in[I (3, 2)] * in[I (2, 3)]; + + det = s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0; + if (det == 0.0) + return 0; + invdet = 1.0 / det; + + out[I (0, 0)] = + (in[I (1, 1)] * c5 - in[I (1, 2)] * c4 + in[I (1, 3)] * c3) * invdet; + out[I (0, 1)] = + (-in[I (0, 1)] * c5 + in[I (0, 2)] * c4 - in[I (0, 3)] * c3) * invdet; + out[I (0, 2)] = + (in[I (3, 1)] * s5 - in[I (3, 2)] * s4 + in[I (3, 3)] * s3) * invdet; + out[I (0, 3)] = + (-in[I (2, 1)] * s5 + in[I (2, 2)] * s4 - in[I (2, 3)] * s3) * invdet; + + out[I (1, 0)] = + (-in[I (1, 0)] * c5 + in[I (1, 2)] * c2 - in[I (1, 3)] * c1) * invdet; + out[I (1, 1)] = + (in[I (0, 0)] * c5 - in[I (0, 2)] * c2 + in[I (0, 3)] * c1) * invdet; + out[I (1, 2)] = + (-in[I (3, 0)] * s5 + in[I (3, 2)] * s2 - in[I (3, 3)] * s1) * invdet; + out[I (1, 3)] = + (in[I (2, 0)] * s5 - in[I (2, 2)] * s2 + in[I (2, 3)] * s1) * invdet; + + out[I (2, 0)] = + (in[I (1, 0)] * c4 - in[I (1, 1)] * c2 + in[I (1, 3)] * c0) * invdet; + out[I (2, 1)] = + (-in[I (0, 0)] * c4 + in[I (0, 1)] * c2 - in[I (0, 3)] * c0) * invdet; + out[I (2, 2)] = + (in[I (3, 0)] * s4 - in[I (3, 1)] * s2 + in[I (3, 3)] * s0) * invdet; + out[I (2, 3)] = + (-in[I (2, 0)] * s4 + in[I (2, 1)] * s2 - in[I (2, 3)] * s0) * invdet; + + out[I (3, 0)] = + (-in[I (1, 0)] * c3 + in[I (1, 1)] * c1 - in[I (1, 2)] * c0) * invdet; + out[I (3, 1)] = + (in[I (0, 0)] * c3 - in[I (0, 1)] * c1 + in[I (0, 2)] * c0) * invdet; + out[I (3, 2)] = + (-in[I (3, 0)] * s3 + in[I (3, 1)] * s1 - in[I (3, 2)] * s0) * invdet; + out[I (3, 3)] = + (in[I (2, 0)] * s3 - in[I (2, 1)] * s1 + in[I (2, 2)] * s0) * invdet; + + return 1; } + #undef I /* caller should remove from the gl_queue after calling this function. @@ -1089,15 +1108,14 @@ _gl_sync_render_unlocked (struct gl_sync *sync) /* The transform from mediacodec applies to the texture coords, but * GStreamer affine meta applies to the video geometry, which is the * opposite - so we invert it */ - if (affine_inverse(matrix, inv_mat)) { + if (affine_inverse (matrix, inv_mat)) { gst_video_affine_transformation_meta_apply_matrix (af_meta, inv_mat); - } - else { - GST_WARNING ("Failed to invert display transform - the video won't display right. " + } else { + GST_WARNING + ("Failed to invert display transform - the video won't display right. " "Transform matrix [ %f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f ]", - matrix[0], matrix[1], matrix[2], matrix[3], - matrix[4], matrix[5], matrix[6], matrix[7], - matrix[8], matrix[9], matrix[10], matrix[11], + matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], + matrix[6], matrix[7], matrix[8], matrix[9], matrix[10], matrix[11], matrix[12], matrix[13], matrix[14], matrix[15]); } gst_video_affine_transformation_meta_apply_matrix (af_meta, yflip_matrix); diff --git a/sys/decklink/win/DeckLinkAPI_i.c b/sys/decklink/win/DeckLinkAPI_i.c index e69d976..5bec7f5 100644 --- a/sys/decklink/win/DeckLinkAPI_i.c +++ b/sys/decklink/win/DeckLinkAPI_i.c @@ -1,3 +1,5 @@ +/* *INDENT-OFF* */ + /* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ @@ -376,3 +378,5 @@ MIDL_DEFINE_GUID(IID, IID_IDeckLinkInput_v7_1,0x2B54EDEF,0x5B32,0x429F,0xBA,0x11 + +/* *INDENT-ON* */ diff --git a/sys/winks/ksdeviceprovider.c b/sys/winks/ksdeviceprovider.c index b54cba2..28e9b5b 100644 --- a/sys/winks/ksdeviceprovider.c +++ b/sys/winks/ksdeviceprovider.c @@ -344,8 +344,7 @@ msg_window_message_proc (HWND window_handle, UINT message, break; devices = - ks_enumerate_devices (&bcdi->dbcc_classguid, - &KSCATEGORY_CAPTURE); + ks_enumerate_devices (&bcdi->dbcc_classguid, &KSCATEGORY_CAPTURE); if (devices == NULL) break; @@ -357,7 +356,7 @@ msg_window_message_proc (HWND window_handle, UINT message, if ((source == NULL) && (g_ascii_strcasecmp (entry->path, bcdi->dbcc_name) == 0)) - source = new_video_source (entry); /* Or audio source, not implemented yet */ + source = new_video_source (entry); /* Or audio source, not implemented yet */ ks_device_entry_free (entry); } diff --git a/tests/check/libs/planaraudioadapter.c b/tests/check/libs/planaraudioadapter.c index 8f845d8..9650393 100644 --- a/tests/check/libs/planaraudioadapter.c +++ b/tests/check/libs/planaraudioadapter.c @@ -60,7 +60,7 @@ generate_buffer (GstAudioInfo * info, gsize nsamples, } static void -verify_buffer_contents (GstBuffer * buf, GstAudioInfo *info, +verify_buffer_contents (GstBuffer * buf, GstAudioInfo * info, gint expect_n_planes, gsize expect_plane_size, gpointer base, gsize real_plane_size, gsize expect_plane_start_offset) { @@ -84,7 +84,7 @@ verify_buffer_contents (GstBuffer * buf, GstAudioInfo *info, /* verify all contents */ byte = abuf.planes[i]; while (byte < ((guint8 *) abuf.planes[i]) + expect_plane_size) { - GST_TRACE("%d | %p", i, byte); + GST_TRACE ("%d | %p", i, byte); fail_unless_equals_int_hex (*byte, i | 0xF0); ++byte; } -- 2.7.4