gst_caps_unref (glimage_sink->out_caps);
glimage_sink->out_caps = NULL;
}
+ if (glimage_sink->in_caps) {
+ gst_caps_unref (glimage_sink->in_caps);
+ glimage_sink->in_caps = NULL;
+ }
break;
}
case GST_STATE_CHANGE_READY_TO_NULL:
gboolean input_is_mono = FALSE;
GstVideoMultiviewMode mv_mode;
GstGLWindow *window = NULL;
+ GstCaps *out_caps;
gboolean ret;
*out_info = glimage_sink->in_info;
glimage_sink->out_info.height = MAX (1, glimage_sink->display_rect.h);
GST_LOG_OBJECT (glimage_sink, "Set 3D output scale to %d,%d",
glimage_sink->display_rect.w, glimage_sink->display_rect.h);
+ }
+
+ out_caps = gst_video_info_to_caps (out_info);
+ gst_caps_set_features (out_caps, 0,
+ gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
+
+ if (glimage_sink->convert_views) {
+ gst_caps_set_simple (out_caps, "texture-target", G_TYPE_STRING,
+ GST_GL_TEXTURE_TARGET_2D_STR, NULL);
GST_GLIMAGE_SINK_UNLOCK (glimage_sink);
- gst_gl_view_convert_set_format (glimage_sink->convert_views,
- &glimage_sink->in_info, &glimage_sink->out_info);
+ gst_gl_view_convert_set_caps (glimage_sink->convert_views,
+ glimage_sink->in_caps, out_caps);
g_object_set (glimage_sink->convert_views, "downmix-mode",
glimage_sink->mview_downmix_mode, NULL);
GST_GLIMAGE_SINK_LOCK (glimage_sink);
}
+ if (glimage_sink->out_caps)
+ gst_caps_unref (glimage_sink->out_caps);
+ glimage_sink->out_caps = out_caps;
+
glimage_sink->output_mode_changed = FALSE;
if (glimage_sink->context)
gst_object_unref (window);
}
- if (glimage_sink->out_caps)
- gst_caps_unref (glimage_sink->out_caps);
- glimage_sink->out_caps = gst_video_info_to_caps (out_info);
-
return ret;
}
return FALSE;
GST_GLIMAGE_SINK_LOCK (glimage_sink);
+ if (glimage_sink->in_caps)
+ gst_caps_unref (glimage_sink->in_caps);
+ glimage_sink->in_caps = gst_caps_ref (caps);
glimage_sink->in_info = vinfo;
ok = update_output_format (glimage_sink);
_negotiated_caps (GstVideoAggregator * vagg, GstCaps * caps)
{
GstGLStereoMix *mix = GST_GL_STEREO_MIX (vagg);
+ GstCaps *in_caps;
GST_LOG_OBJECT (mix, "Configured output caps %" GST_PTR_FORMAT, caps);
/* We can configure the view_converter now */
gst_gl_view_convert_set_context (mix->viewconvert,
GST_GL_BASE_MIXER (mix)->context);
- gst_gl_view_convert_set_format (mix->viewconvert, &mix->mix_info,
- &mix->out_info);
- return TRUE;
+ in_caps = gst_video_info_to_caps (&mix->mix_info);
+ gst_caps_set_features (in_caps, 0,
+ gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
+ gst_caps_set_simple (in_caps, "texture-target", G_TYPE_STRING,
+ GST_GL_TEXTURE_TARGET_2D_STR, NULL);
+ gst_gl_view_convert_set_caps (mix->viewconvert, in_caps, caps);
+
+ return TRUE;
}
static gboolean
gst_gl_view_convert_reset (viewconvert);
}
-gboolean
-gst_gl_view_convert_set_format (GstGLViewConvert * viewconvert,
+static gboolean
+_view_convert_set_format (GstGLViewConvert * viewconvert,
GstVideoInfo * in_info, GstVideoInfo * out_info)
{
g_return_val_if_fail (GST_IS_GL_VIEW_CONVERT (viewconvert), FALSE);
if (!gst_video_info_from_caps (&out_info, out_caps))
return FALSE;
- return gst_gl_view_convert_set_format (viewconvert, &in_info, &out_info);
+ return _view_convert_set_format (viewconvert, &in_info, &out_info);
}
/* Function that can halve the value
gl->BindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
}
- gl->BindTexture (GL_TEXTURE_2D, 0);
viewconvert->initted = TRUE;
return TRUE;
error:
GType gst_gl_view_convert_get_type (void);
GstGLViewConvert * gst_gl_view_convert_new (void);
-gboolean gst_gl_view_convert_set_format (GstGLViewConvert *viewconvert, GstVideoInfo *in_info,
- GstVideoInfo *out_info);
gboolean gst_gl_view_convert_set_caps (GstGLViewConvert * viewconvert, GstCaps * in_caps, GstCaps * out_caps);
GstCaps * gst_gl_view_convert_transform_caps (GstGLViewConvert * viewconvert,
GstPadDirection direction, GstCaps * caps, GstCaps * filter);