gst: Don't declare variables inside the for loop header

This is a C99 feature.
This commit is contained in:
Sebastian Dröge 2016-12-13 22:39:01 +02:00 committed by Tim-Philipp Müller
parent 7da132c327
commit aeb5d4edaf
3 changed files with 9 additions and 6 deletions

View file

@ -334,7 +334,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info)
plane_indices = g_new0 (gushort, N_QUADS * 6);
/* top row */
for (int i = 0; i < 7; i++) {
for (i = 0; i < 7; i++) {
coord[color_idx * 4 + 0].X = -1.0f + i * (2.0f / 7.0f);
coord[color_idx * 4 + 0].Y = 1.0f / 3.0f;
coord[color_idx * 4 + 1].X = -1.0f + (i + 1) * (2.0f / 7.0f);
@ -347,7 +347,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info)
}
/* middle row */
for (int i = 0; i < 7; i++) {
for (i = 0; i < 7; i++) {
coord[color_idx * 4 + 0].X = -1.0f + i * (2.0f / 7.0f);
coord[color_idx * 4 + 0].Y = 0.5f;
coord[color_idx * 4 + 1].X = -1.0f + (i + 1) * (2.0f / 7.0f);
@ -360,7 +360,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info)
}
/* bottom row, left three */
for (int i = 0; i < 3; i++) {
for (i = 0; i < 3; i++) {
coord[color_idx * 4 + 0].X = -1.0f + i / 3.0f;
coord[color_idx * 4 + 0].Y = 1.0f;
coord[color_idx * 4 + 1].X = -1.0f + (i + 1) / 3.0f;
@ -373,7 +373,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info)
}
/* bottom row, middle three (the blacks) */
for (int i = 0; i < 3; i++) {
for (i = 0; i < 3; i++) {
coord[color_idx * 4 + 0].X = i / 6.0f;
coord[color_idx * 4 + 0].Y = 1.0f;
coord[color_idx * 4 + 1].X = (i + 1) / 6.0f;

View file

@ -441,6 +441,7 @@ gst_egl_image_from_dmabuf (GstGLContext * context,
EGLImageKHR img;
gint atti = 0;
gint fourcc;
gint i;
fourcc = _drm_fourcc_from_info (in_info, plane);
type =
@ -466,7 +467,7 @@ gst_egl_image_from_dmabuf (GstGLContext * context,
attribs[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane);
attribs[atti] = EGL_NONE;
for (int i = 0; i < atti; i++)
for (i = 0; i < atti; i++)
GST_LOG ("attr %i: %" G_GINTPTR_FORMAT, i, attribs[i]);
g_assert (atti == 12);

View file

@ -1487,7 +1487,9 @@ restart:
upload->priv->method->perform (upload->priv->method_impl, buffer,
&outbuf);
if (ret == GST_GL_UPLOAD_UNSHARED_GL_CONTEXT) {
for (int i = 0; i < G_N_ELEMENTS (upload_methods); i++) {
gint i;
for (i = 0; i < G_N_ELEMENTS (upload_methods); i++) {
if (upload_methods[i] == &_raw_data_upload) {
upload->priv->method = &_raw_data_upload;
upload->priv->method_impl = upload->priv->upload_impl[i];