gltransformation: implement passthrough handling
authorMatthew Waters <matthew@centricular.com>
Thu, 14 Jan 2016 07:42:05 +0000 (18:42 +1100)
committerMatthew Waters <matthew@centricular.com>
Fri, 15 Jan 2016 01:05:02 +0000 (12:05 +1100)
ext/gl/gstgltransformation.c

index 8449178..4183bf0 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