enum
{
PROP_0,
+ PROP_OTHER_CONTEXT,
PROP_PATTERN,
PROP_TIMESTAMP_OFFSET,
PROP_IS_LIVE
const GValue * value, GParamSpec * pspec);
static void gst_gl_test_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
+static void gst_gl_test_src_dispose (GObject * object);
static gboolean gst_gl_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
static GstCaps *gst_gl_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps);
gobject_class->set_property = gst_gl_test_src_set_property;
gobject_class->get_property = gst_gl_test_src_get_property;
+ gobject_class->dispose = gst_gl_test_src_dispose;
+ g_object_class_install_property (gobject_class, PROP_OTHER_CONTEXT,
+ g_param_spec_object ("other-context",
+ "External OpenGL context",
+ "Give an external OpenGL context with which to share textures",
+ GST_GL_TYPE_CONTEXT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_PATTERN,
g_param_spec_enum ("pattern", "Pattern",
"Type of test pattern to generate", GST_TYPE_GL_TEST_SRC_PATTERN,
}
static void
+gst_gl_test_src_dispose (GObject * object)
+{
+ GstGLTestSrc *src = GST_GL_TEST_SRC (object);
+
+ if (src->other_context)
+ gst_object_unref (src->other_context);
+ src->other_context = NULL;
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
gst_gl_test_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstGLTestSrc *src = GST_GL_TEST_SRC (object);
switch (prop_id) {
+ case PROP_OTHER_CONTEXT:
+ if (src->other_context)
+ gst_object_unref (src->other_context);
+ src->other_context = g_value_dup_object (value);
+ break;
case PROP_PATTERN:
gst_gl_test_src_set_pattern (src, g_value_get_enum (value));
break;
GstGLTestSrc *src = GST_GL_TEST_SRC (object);
switch (prop_id) {
+ case PROP_OTHER_CONTEXT:
+ g_value_set_object (value, src->other_context);
+ break;
case PROP_PATTERN:
g_value_set_enum (value, src->pattern_type);
break;
}
}
+ if (src->other_context) {
+ if (!other_context) {
+ other_context = src->other_context;
+ } else {
+ GST_ELEMENT_WARNING (src, LIBRARY, SETTINGS,
+ ("%s", "Cannot share with more than one GL context"),
+ ("%s", "Cannot share with more than one GL context"));
+ }
+ }
+
if (!src->context) {
src->context = gst_gl_context_new (src->display);
if (!gst_gl_context_create (src->context, other_context, &error))