[Cogl] [PATCH 04/13] cogl-gst: video-sink: introduce specific min/mag filters per layers

Lionel Landwerlin llandwerlin at gmail.com
Mon Dec 9 03:17:51 PST 2013


---
 cogl-gst/cogl-gst-video-sink.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index 273c9eb..94e54bc 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -47,6 +47,8 @@
 
 #include "cogl-gst-video-sink.h"
 
+#define MAX_LAYERS (3)
+
 #define COGL_GST_DEFAULT_PRIORITY G_PRIORITY_HIGH_IDLE
 
 #define BASE_SINK_CAPS "{ AYUV," \
@@ -148,6 +150,7 @@ typedef struct _CoglGstRenderer
   int flags;
   GstStaticCaps caps;
   int n_layers;
+  CoglPipelineFilter layers_filters[2 * MAX_LAYERS];
   void (*setup_pipeline) (CoglGstVideoSink *sink,
                           CoglPipeline *pipeline);
   CoglBool (*upload) (CoglGstVideoSink *sink,
@@ -200,9 +203,13 @@ cogl_gst_video_sink_attach_frame (CoglGstVideoSink *sink,
   int i;
 
   for (i = 0; i < G_N_ELEMENTS (priv->frame); i++)
-    if (priv->frame[i] != NULL)
+    if (priv->frame[i] != NULL) {
       cogl_pipeline_set_layer_texture (pln, i + priv->custom_start,
                                        priv->frame[i]);
+      cogl_pipeline_set_layer_filters (pln, i + priv->custom_start,
+                                       priv->renderer->layers_filters[2 * i],
+                                       priv->renderer->layers_filters[2 * i + 1]);
+    }
 }
 
 static CoglBool
@@ -560,6 +567,7 @@ static CoglGstRenderer rgb24_renderer =
   0,
   GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:SystemMemory", "{ RGB, BGR }")),
   1, /* n_layers */
+  { COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR, },
   cogl_gst_rgb_setup_pipeline,
   cogl_gst_rgb24_upload,
 };
@@ -606,6 +614,7 @@ static CoglGstRenderer rgb32_renderer =
   0,
   GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES("memory:SystemMemory", "{ RGBA, BGRA }")),
   1, /* n_layers */
+  { COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR, },
   cogl_gst_rgb_setup_pipeline,
   cogl_gst_rgb32_upload,
 };
@@ -748,6 +757,11 @@ static CoglGstRenderer yv12_glsl_renderer =
   COGL_GST_RENDERER_NEEDS_GLSL,
   GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES("memory:SystemMemory", "YV12")),
   3, /* n_layers */
+  {
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+  },
   cogl_gst_yv12_glsl_setup_pipeline,
   cogl_gst_yv12_upload,
 };
@@ -759,6 +773,11 @@ static CoglGstRenderer i420_glsl_renderer =
   COGL_GST_RENDERER_NEEDS_GLSL,
   GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES("memory:SystemMemory", "I420")),
   3, /* n_layers */
+  {
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+  },
   cogl_gst_yv12_glsl_setup_pipeline,
   cogl_gst_i420_upload,
 };
@@ -837,6 +856,11 @@ static CoglGstRenderer ayuv_glsl_renderer =
   COGL_GST_RENDERER_NEEDS_GLSL,
   GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES("memory:SystemMemory", "AYUV")),
   3, /* n_layers */
+  {
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+    COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR,
+  },
   cogl_gst_ayuv_glsl_setup_pipeline,
   cogl_gst_ayuv_upload,
 };
-- 
1.8.5



More information about the Cogl mailing list