[536/906] GstGLFilterGlass: update for GstGLMeta

This commit is contained in:
Matthew Waters 2012-07-11 13:37:55 +10:00
parent a93c464c5b
commit 5402a43d80

View file

@ -65,7 +65,7 @@ static void gst_gl_filter_glass_get_property (GObject * object, guint prop_id,
static void gst_gl_filter_glass_reset (GstGLFilter * filter);
static gboolean gst_gl_filter_glass_init_shader (GstGLFilter * filter);
static gboolean gst_gl_filter_glass_filter (GstGLFilter * filter,
GstGLBuffer * inbuf, GstGLBuffer * outbuf);
GstBuffer * inbuf, GstBuffer * outbuf);
static void gst_gl_filter_glass_draw_background_gradient ();
static void gst_gl_filter_glass_draw_video_plane (GstGLFilter * filter,
@ -173,17 +173,30 @@ gst_gl_filter_glass_init_shader (GstGLFilter * filter)
}
static gboolean
gst_gl_filter_glass_filter (GstGLFilter * filter, GstGLBuffer * inbuf,
GstGLBuffer * outbuf)
gst_gl_filter_glass_filter (GstGLFilter * filter, GstBuffer * inbuf,
GstBuffer * outbuf)
{
gpointer glass_filter = GST_GL_FILTER_GLASS (filter);
GstGLMeta *in_meta, *out_meta;
GstVideoMeta *in_v_meta;
GST_GL_FILTER_GLASS (glass_filter)->timestamp = GST_BUFFER_TIMESTAMP (inbuf);
in_meta = gst_buffer_get_gl_meta (inbuf);
out_meta = gst_buffer_get_gl_meta (outbuf);
in_v_meta = gst_buffer_get_video_meta (inbuf);
if (!in_meta || !out_meta || !in_v_meta) {
GST_WARNING ("A buffer does not contain required GstGLMeta "
"or GstVideoMeta");
return FALSE;
}
//blocking call, use a FBO
gst_gl_display_use_fbo (filter->display, filter->width, filter->height,
filter->fbo, filter->depthbuffer, outbuf->texture,
gst_gl_filter_glass_callback, inbuf->width, inbuf->height, inbuf->texture,
80, (gdouble) filter->width / (gdouble) filter->height, 1.0, 5000.0,
filter->fbo, filter->depthbuffer, out_meta->memory->tex_id,
gst_gl_filter_glass_callback, in_v_meta->width, in_v_meta->height,
in_meta->memory->tex_id, 80,
(gdouble) filter->width / (gdouble) filter->height, 1.0, 5000.0,
GST_GL_DISPLAY_PROJECTION_PERSPECTIVE, (gpointer) glass_filter);
return TRUE;