mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
[085/906] fix regressions about glvideomaker.
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@497 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
parent
f7b69d5233
commit
6c3eb8de43
6 changed files with 168 additions and 151 deletions
|
@ -170,6 +170,10 @@ gst_gl_display_init (GstGLDisplay *display, GstGLDisplayClass *klass)
|
|||
display->outputVideo_format = 0;
|
||||
display->outputData = NULL;
|
||||
|
||||
display->recordedTexture = 0;
|
||||
display->recordedTextureWidth = 0;
|
||||
display->recordedTextureHeight = 0;
|
||||
|
||||
display->glutWinId = -1;
|
||||
display->winId = 0;
|
||||
display->win_xpos = 0;
|
||||
|
@ -1216,12 +1220,15 @@ gst_gl_display_clearTexture (GstGLDisplay* display, guint texture,
|
|||
/* Called by gst_gl elements */
|
||||
void
|
||||
gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format,
|
||||
gpointer data)
|
||||
gint width, gint height, GLuint recordedTexture, gpointer data)
|
||||
{
|
||||
gst_gl_display_lock (display);
|
||||
//data size is aocciated to the glcontext size
|
||||
display->outputVideo_format = video_format;
|
||||
display->outputData = data;
|
||||
display->recordedTexture = recordedTexture;
|
||||
display->recordedTextureWidth = width;
|
||||
display->recordedTextureHeight = height;
|
||||
gst_gl_display_postMessage (GST_GL_DISPLAY_ACTION_VIDEO, display);
|
||||
g_cond_wait (display->cond_video, display->mutex);
|
||||
gst_gl_display_unlock (display);
|
||||
|
@ -1890,25 +1897,25 @@ gst_gl_display_draw_graphic (GstGLDisplay* display)
|
|||
//check if a client draw callback is registered
|
||||
if (display->clientDrawCallback)
|
||||
{
|
||||
display->clientDrawCallback(display->textureFBO,
|
||||
display->textureFBOWidth, display->textureFBOHeight);
|
||||
display->clientDrawCallback(display->recordedTexture,
|
||||
display->recordedTextureWidth, display->recordedTextureHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glLoadIdentity ();
|
||||
|
||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, display->textureFBO);
|
||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, display->recordedTexture);
|
||||
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
||||
|
||||
glBegin (GL_QUADS);
|
||||
glTexCoord2i (display->textureFBOWidth, 0);
|
||||
glTexCoord2i (display->recordedTextureWidth, 0);
|
||||
glVertex2f (1.0f, 1.0f);
|
||||
glTexCoord2i (0, 0);
|
||||
glVertex2f (-1.0f, 1.0f);
|
||||
glTexCoord2i (0, display->textureFBOHeight);
|
||||
glTexCoord2i (0, display->recordedTextureHeight);
|
||||
glVertex2f (-1.0f, -1.0f);
|
||||
glTexCoord2i (display->textureFBOWidth, display->textureFBOHeight);
|
||||
glTexCoord2i (display->recordedTextureWidth, display->recordedTextureHeight);
|
||||
glVertex2f (1.0f, -1.0f);
|
||||
glEnd ();
|
||||
}
|
||||
|
|
|
@ -182,6 +182,11 @@ struct _GstGLDisplay {
|
|||
gpointer outputData;
|
||||
GLenum multipleRT[3];
|
||||
|
||||
//recorded texture
|
||||
GLuint recordedTexture;
|
||||
GLuint recordedTextureWidth;
|
||||
GLuint recordedTextureHeight;
|
||||
|
||||
//from video to texture
|
||||
|
||||
gchar* textFProgram_YUY2_UYVY;
|
||||
|
@ -241,8 +246,8 @@ void gst_gl_display_textureChanged (GstGLDisplay* display, GstVideoFormat video_
|
|||
void gst_gl_display_clearTexture (GstGLDisplay* display, guint texture,
|
||||
guint texture_u, guint texture_v);
|
||||
|
||||
void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format,
|
||||
gpointer data);
|
||||
void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format,
|
||||
gint width, gint height, GLuint recordedTexture, gpointer data);
|
||||
gboolean gst_gl_display_postRedisplay (GstGLDisplay* display, GLuint texture, gint width, gint height);
|
||||
void gst_gl_display_requestFBO (GstGLDisplay* display, gint width, gint height,
|
||||
guint* fbo, guint* depthbuffer, guint* texture);
|
||||
|
|
|
@ -84,62 +84,64 @@ gst_gl_filter_base_init (gpointer klass)
|
|||
static void
|
||||
gst_gl_filter_class_init (GstGLFilterClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_filter_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_get_property;
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_filter_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_get_property;
|
||||
|
||||
/*GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
/*GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
gst_gl_filter_transform_caps;*/
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_filter_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_filter_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_filter_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_filter_get_unit_size;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->prepare_output_buffer =
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_filter_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_filter_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_filter_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_filter_get_unit_size;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->prepare_output_buffer =
|
||||
gst_gl_filter_prepare_output_buffer;
|
||||
|
||||
klass->set_caps = NULL;
|
||||
klass->filter = NULL;
|
||||
klass->onInitFBO = NULL;
|
||||
klass->set_caps = NULL;
|
||||
klass->filter = NULL;
|
||||
klass->onInitFBO = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_init (GstGLFilter * filter, GstGLFilterClass * klass)
|
||||
{
|
||||
//gst_element_create_all_pads (GST_ELEMENT (filter));
|
||||
//gst_element_create_all_pads (GST_ELEMENT (filter));
|
||||
|
||||
filter->sinkpad = gst_element_get_static_pad (GST_ELEMENT (filter), "sink");
|
||||
filter->srcpad = gst_element_get_static_pad (GST_ELEMENT (filter), "src");
|
||||
filter->sinkpad = gst_element_get_static_pad (GST_ELEMENT (filter), "sink");
|
||||
filter->srcpad = gst_element_get_static_pad (GST_ELEMENT (filter), "src");
|
||||
|
||||
gst_gl_filter_reset (filter);
|
||||
gst_gl_filter_reset (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
//GstGLFilter *filter = GST_GL_FILTER (object);
|
||||
//GstGLFilter *filter = GST_GL_FILTER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
switch (prop_id)
|
||||
{
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
//GstGLFilter *filter = GST_GL_FILTER (object);
|
||||
//GstGLFilter *filter = GST_GL_FILTER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
switch (prop_id)
|
||||
{
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -198,8 +198,9 @@ gst_gl_filter_app_setClientCallbacks (GstGLFilter* filter)
|
|||
gst_gl_display_setClientDrawCallback (filter->display,
|
||||
app_filter->clientDrawCallback);
|
||||
|
||||
gst_gl_display_resetGLcontext (filter->display,
|
||||
app_filter->glcontext_width, app_filter->glcontext_height);
|
||||
if (app_filter->glcontext_width != 0 && app_filter->glcontext_height != 0)
|
||||
gst_gl_display_resetGLcontext (filter->display,
|
||||
app_filter->glcontext_width, app_filter->glcontext_height);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -31,18 +31,18 @@ G_BEGIN_DECLS
|
|||
#define GST_GL_FILTER_CUBE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_FILTER_CUBE,GstGLFilterCubeClass))
|
||||
#define GST_IS_GL_FILTER_CUBE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_FILTER_CUBE))
|
||||
#define GST_GL_FILTER_CUBE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_FILTER_CUBE,GstGLFilterCubeClass))
|
||||
|
||||
typedef struct _GstGLFilterCube GstGLFilterCube;
|
||||
typedef struct _GstGLFilterCubeClass GstGLFilterCubeClass;
|
||||
|
||||
struct _GstGLFilterCube
|
||||
{
|
||||
GstGLFilter filter;
|
||||
|
||||
GstGLFilter filter;
|
||||
};
|
||||
|
||||
struct _GstGLFilterCubeClass
|
||||
{
|
||||
GstGLFilterClass filter_class;
|
||||
GstGLFilterClass filter_class;
|
||||
};
|
||||
|
||||
GType gst_gl_glfiltercube_get_type (void);
|
||||
|
|
|
@ -53,11 +53,11 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
|
||||
enum
|
||||
{
|
||||
PROP_0
|
||||
PROP_0
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_videomaker_debug, "glvideomaker", 0, "glvideomaker element");
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_videomaker_debug, "glvideomaker", 0, "glvideomaker element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLVideomaker, gst_gl_videomaker, GstBaseTransform,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
|
@ -76,49 +76,48 @@ static gboolean gst_gl_videomaker_start (GstBaseTransform* bt);
|
|||
static gboolean gst_gl_videomaker_stop (GstBaseTransform* bt);
|
||||
static GstFlowReturn gst_gl_videomaker_transform (GstBaseTransform* trans,
|
||||
GstBuffer* inbuf, GstBuffer* outbuf);
|
||||
static gboolean
|
||||
gst_gl_videomaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
static gboolean gst_gl_videomaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
guint* size);
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GstElementClass* element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details (element_class, &element_details);
|
||||
gst_element_class_set_details (element_class, &element_details);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_videomaker_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_videomaker_sink_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_videomaker_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_videomaker_sink_pad_template));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_class_init (GstGLVideomakerClass * klass)
|
||||
gst_gl_videomaker_class_init (GstGLVideomakerClass* klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GObjectClass* gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_videomaker_set_property;
|
||||
gobject_class->get_property = gst_gl_videomaker_get_property;
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_videomaker_set_property;
|
||||
gobject_class->get_property = gst_gl_videomaker_get_property;
|
||||
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
gst_gl_videomaker_transform_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_videomaker_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_videomaker_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_videomaker_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_videomaker_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size =
|
||||
gst_gl_videomaker_get_unit_size;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
gst_gl_videomaker_transform_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_videomaker_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_videomaker_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_videomaker_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_videomaker_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size =
|
||||
gst_gl_videomaker_get_unit_size;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_init (GstGLVideomaker* videomaker, GstGLVideomakerClass* klass)
|
||||
{
|
||||
gst_gl_videomaker_reset (videomaker);
|
||||
gst_gl_videomaker_reset (videomaker);
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,134 +125,137 @@ static void
|
|||
gst_gl_videomaker_set_property (GObject* object, guint prop_id,
|
||||
const GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
switch (prop_id)
|
||||
{
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec)
|
||||
gst_gl_videomaker_get_property (GObject* object, guint prop_id,
|
||||
GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_reset (GstGLVideomaker* videomaker)
|
||||
{
|
||||
if (videomaker->display) {
|
||||
g_object_unref (videomaker->display);
|
||||
videomaker->display = NULL;
|
||||
}
|
||||
if (videomaker->display)
|
||||
{
|
||||
g_object_unref (videomaker->display);
|
||||
videomaker->display = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_start (GstBaseTransform* bt)
|
||||
{
|
||||
//GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
//GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_stop (GstBaseTransform* bt)
|
||||
{
|
||||
GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
|
||||
gst_gl_videomaker_reset (videomaker);
|
||||
gst_gl_videomaker_reset (videomaker);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
static GstCaps*
|
||||
gst_gl_videomaker_transform_caps (GstBaseTransform * bt,
|
||||
GstPadDirection direction, GstCaps * caps)
|
||||
GstPadDirection direction, GstCaps* caps)
|
||||
{
|
||||
GstGLVideomaker* videomaker;
|
||||
GstStructure* structure;
|
||||
GstCaps *newcaps, *newothercaps;
|
||||
GstStructure* newstruct;
|
||||
const GValue* width_value;
|
||||
const GValue* height_value;
|
||||
const GValue* framerate_value;
|
||||
const GValue* par_value;
|
||||
GstGLVideomaker* videomaker;
|
||||
GstStructure* structure;
|
||||
GstCaps *newcaps, *newothercaps;
|
||||
GstStructure* newstruct;
|
||||
const GValue* width_value;
|
||||
const GValue* height_value;
|
||||
const GValue* framerate_value;
|
||||
const GValue* par_value;
|
||||
|
||||
videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
|
||||
GST_ERROR ("transform caps %" GST_PTR_FORMAT, caps);
|
||||
GST_ERROR ("transform caps %" GST_PTR_FORMAT, caps);
|
||||
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
|
||||
width_value = gst_structure_get_value (structure, "width");
|
||||
height_value = gst_structure_get_value (structure, "height");
|
||||
framerate_value = gst_structure_get_value (structure, "framerate");
|
||||
par_value = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
||||
width_value = gst_structure_get_value (structure, "width");
|
||||
height_value = gst_structure_get_value (structure, "height");
|
||||
framerate_value = gst_structure_get_value (structure, "framerate");
|
||||
par_value = gst_structure_get_value (structure, "pixel-aspect-ratio");
|
||||
|
||||
if (direction == GST_PAD_SINK)
|
||||
{
|
||||
newothercaps = gst_caps_new_simple ("video/x-raw-rgb", NULL);
|
||||
newstruct = gst_caps_get_structure (newothercaps, 0);
|
||||
gst_structure_set_value (newstruct, "width", width_value);
|
||||
gst_structure_set_value (newstruct, "height", height_value);
|
||||
gst_structure_set_value (newstruct, "framerate", framerate_value);
|
||||
if (par_value)
|
||||
gst_structure_set_value (newstruct, "pixel-aspect-ratio", par_value);
|
||||
else
|
||||
gst_structure_set (newstruct, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||
1, 1, NULL);
|
||||
newcaps = gst_caps_new_simple ("video/x-raw-yuv", NULL);
|
||||
gst_caps_append(newcaps, newothercaps);
|
||||
}
|
||||
else newcaps = gst_caps_new_simple ("video/x-raw-gl", NULL);
|
||||
if (direction == GST_PAD_SINK)
|
||||
{
|
||||
newothercaps = gst_caps_new_simple ("video/x-raw-rgb", NULL);
|
||||
newstruct = gst_caps_get_structure (newothercaps, 0);
|
||||
gst_structure_set_value (newstruct, "width", width_value);
|
||||
gst_structure_set_value (newstruct, "height", height_value);
|
||||
gst_structure_set_value (newstruct, "framerate", framerate_value);
|
||||
if (par_value)
|
||||
gst_structure_set_value (newstruct, "pixel-aspect-ratio", par_value);
|
||||
else
|
||||
gst_structure_set (newstruct, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||
1, 1, NULL);
|
||||
newcaps = gst_caps_new_simple ("video/x-raw-yuv", NULL);
|
||||
gst_caps_append(newcaps, newothercaps);
|
||||
}
|
||||
else newcaps = gst_caps_new_simple ("video/x-raw-gl", NULL);
|
||||
|
||||
newstruct = gst_caps_get_structure (newcaps, 0);
|
||||
gst_structure_set_value (newstruct, "width", width_value);
|
||||
gst_structure_set_value (newstruct, "height", height_value);
|
||||
gst_structure_set_value (newstruct, "framerate", framerate_value);
|
||||
if (par_value)
|
||||
gst_structure_set_value (newstruct, "pixel-aspect-ratio", par_value);
|
||||
else
|
||||
gst_structure_set (newstruct, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||
1, 1, NULL);
|
||||
newstruct = gst_caps_get_structure (newcaps, 0);
|
||||
gst_structure_set_value (newstruct, "width", width_value);
|
||||
gst_structure_set_value (newstruct, "height", height_value);
|
||||
gst_structure_set_value (newstruct, "framerate", framerate_value);
|
||||
if (par_value)
|
||||
gst_structure_set_value (newstruct, "pixel-aspect-ratio", par_value);
|
||||
else
|
||||
gst_structure_set (newstruct, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||
1, 1, NULL);
|
||||
|
||||
GST_ERROR ("new caps %" GST_PTR_FORMAT, newcaps);
|
||||
GST_ERROR ("new caps %" GST_PTR_FORMAT, newcaps);
|
||||
|
||||
return newcaps;
|
||||
return newcaps;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||
GstCaps * outcaps)
|
||||
GstCaps* outcaps)
|
||||
{
|
||||
GstGLVideomaker* videomaker;
|
||||
gboolean ret;
|
||||
GstGLVideomaker* videomaker;
|
||||
gboolean ret;
|
||||
|
||||
videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
|
||||
GST_DEBUG ("called with %" GST_PTR_FORMAT, incaps);
|
||||
GST_DEBUG ("called with %" GST_PTR_FORMAT, incaps);
|
||||
|
||||
ret = gst_video_format_parse_caps (outcaps, &videomaker->video_format,
|
||||
&videomaker->width, &videomaker->height);
|
||||
ret = gst_video_format_parse_caps (outcaps, &videomaker->video_format,
|
||||
&videomaker->width, &videomaker->height);
|
||||
|
||||
if (!ret) {
|
||||
GST_ERROR ("bad caps");
|
||||
return FALSE;
|
||||
}
|
||||
if (!ret)
|
||||
{
|
||||
GST_ERROR ("bad caps");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -290,7 +292,7 @@ gst_gl_videomaker_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
|||
GstBuffer* outbuf)
|
||||
{
|
||||
GstGLVideomaker* videomaker = NULL;
|
||||
GstGLBuffer *gl_inbuf = GST_GL_BUFFER (inbuf);
|
||||
GstGLBuffer* gl_inbuf = GST_GL_BUFFER (inbuf);
|
||||
|
||||
videomaker = GST_GL_VIDEOMAKER (trans);
|
||||
|
||||
|
@ -303,8 +305,8 @@ gst_gl_videomaker_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
|||
GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
||||
|
||||
//blocking call
|
||||
gst_gl_display_videoChanged(videomaker->display,
|
||||
videomaker->video_format, GST_BUFFER_DATA (outbuf));
|
||||
gst_gl_display_videoChanged(videomaker->display, videomaker->video_format,
|
||||
gl_inbuf->width, gl_inbuf->height, gl_inbuf->textureGL, GST_BUFFER_DATA (outbuf));
|
||||
|
||||
return GST_FLOW_OK;
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue