gltransformation: implement passthrough handling
authorMatthew Waters <matthew@centricular.com>
Thu, 14 Jan 2016 07:42:05 +0000 (18:42 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:14 +0000 (19:32 +0000)
ext/gl/gstgltransformation.c

index 8449178df6db00a5c1dbb3ab5d365d530f7802d8..4183bf0fe15a58665760648ade3800cd134575f8 100644 (file)
@@ -327,6 +327,20 @@ gst_gl_transformation_build_mvp (GstGLTransformation * transformation)
       &transformation->view_matrix, &modelview_matrix);
   graphene_matrix_multiply (&modelview_matrix,
       &transformation->projection_matrix, &transformation->mvp_matrix);
+
+  if (filter->in_info.finfo) {
+    gboolean passthrough = transformation->xtranslation == 0.
+        && transformation->ytranslation == 0.
+        && transformation->ztranslation == 0.
+        && transformation->xrotation == 0.
+        && transformation->yrotation == 0.
+        && transformation->zrotation == 0.
+        && transformation->xscale == 1.
+        && transformation->yscale == 1.
+        && gst_video_info_is_equal (&filter->in_info, &filter->out_info);
+    gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (transformation),
+        passthrough);
+  }
 }
 
 static void