}
//client reshape callback
-static void reshapeCallback (GLuint width, GLuint height, gpointer data)
+static gboolean reshapeCallback (void *gl_sink, GLuint width, GLuint height, gpointer data)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, (gfloat)width/(gfloat)height, 0.1, 100);
glMatrixMode(GL_MODELVIEW);
+
+ return TRUE;
}
//client draw callback
-static gboolean drawCallback (GLuint texture, GLuint width, GLuint height, gpointer data)
+static gboolean drawCallback (void * gl_sink, GLuint texture, GLuint width, GLuint height, gpointer data)
{
static GLfloat xrot = 0;
static GLfloat yrot = 0;
/* configure elements */
g_object_set(G_OBJECT(videosrc), "num-buffers", 400, NULL);
- g_object_set(G_OBJECT(glimagesink), "client-reshape-callback", reshapeCallback, NULL);
- g_object_set(G_OBJECT(glimagesink), "client-draw-callback", drawCallback, NULL);
- g_object_set(G_OBJECT(glimagesink), "client-data", NULL, NULL);
+ g_signal_connect(G_OBJECT(glimagesink), "client-reshape", G_CALLBACK (reshapeCallback), NULL);
+ g_signal_connect(G_OBJECT(glimagesink), "client-draw", G_CALLBACK (drawCallback), NULL);
/* add elements */
gst_bin_add_many (GST_BIN (pipeline), videosrc, glimagesink, NULL);
//client reshape callback
-static void reshapeCallback (GLuint width, GLuint height)
+static gboolean reshapeCallback (void * gl_sink, GLuint width, GLuint height, gpointer data)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, (gfloat)width/(gfloat)height, 0.1, 100);
glMatrixMode(GL_MODELVIEW);
+
+ return TRUE;
}
//client draw callback
-static gboolean drawCallback (GLuint texture, GLuint width, GLuint height)
+static gboolean drawCallback (void * gl_sink, GLuint texture, GLuint width, GLuint height, gpointer data)
{
static GLfloat xrot = 0;
static GLfloat yrot = 0;
g_object_set(G_OBJECT(videosrc), "location", video_location.c_str(), NULL);
g_signal_connect(identity, "handoff", G_CALLBACK(identityCallback), textoverlay) ;
g_object_set(G_OBJECT(textoverlay), "font_desc", "Ahafoni CLM Bold 30", NULL);
- g_object_set(G_OBJECT(glimagesink), "client-reshape-callback", reshapeCallback, NULL);
- g_object_set(G_OBJECT(glimagesink), "client-draw-callback", drawCallback, NULL);
+ g_signal_connect(G_OBJECT(glimagesink), "client-reshape", G_CALLBACK (reshapeCallback), NULL);
+ g_signal_connect(G_OBJECT(glimagesink), "client-draw", G_CALLBACK (drawCallback), NULL);
/* add elements */
gst_bin_add_many (GST_BIN (pipeline), videosrc, decodebin, identity,
#endif
#include <gst/gst.h>
+#include <gst/gl/gl.h>
+
#include <iostream>
#include <sstream>
#include <string>
//client reshape callback
-static void reshapeCallback (GLuint width, GLuint height)
+static gboolean reshapeCallback (void *gl_sink, GLuint width, GLuint height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, (gfloat)width/(gfloat)height, 0.1, 100);
glMatrixMode(GL_MODELVIEW);
+
+ return TRUE;
}
//client draw callback
-static gboolean drawCallback (GLuint texture, GLuint width, GLuint height)
+static gboolean drawCallback (void * gl_sink, GLuint texture, GLuint width, GLuint height)
{
static GLfloat xrot = 0;
static GLfloat yrot = 0;
g_object_set(G_OBJECT(videosrc), "num-buffers", 1000, NULL);
g_object_set(G_OBJECT(videosrc), "location", video_location.c_str(), NULL);
g_object_set(G_OBJECT(textoverlay), "font_desc", "Ahafoni CLM Bold 30", NULL);
- g_object_set(G_OBJECT(glimagesink0), "client-reshape-callback", reshapeCallback, NULL);
- g_object_set(G_OBJECT(glimagesink0), "client-draw-callback", drawCallback, NULL);
+ g_signal_connect(G_OBJECT(glimagesink0), "client-reshape", G_CALLBACK (reshapeCallback), NULL);
+ g_signal_connect(G_OBJECT(glimagesink0), "client-draw", G_CALLBACK (drawCallback), NULL);
/* add elements */
gst_bin_add_many (GST_BIN (pipeline), videosrc, decodebin, videoconvert, textoverlay, tee,
g_object_set(G_OBJECT(videosrc), "num-buffers", 800, NULL);
g_object_set(G_OBJECT(videosrc), "location", m_videoLocation.toAscii().data(), NULL);
- g_object_set(G_OBJECT(m_glimagesink), "client-reshape-callback", reshapeCallback, NULL);
- g_object_set(G_OBJECT(m_glimagesink), "client-draw-callback", drawCallback, NULL);
+ g_signal_connect(G_OBJECT(m_glimagesink), "client-reshape", G_CALLBACK (reshapeCallback), NULL);
+ g_signal_connect(G_OBJECT(m_glimagesink), "client-draw", G_CALLBACK (drawCallback), NULL);
gst_bin_add_many (GST_BIN (m_pipeline), videosrc, decodebin, m_glimagesink, NULL);
float Pipeline::m_zrot = 0;
//client reshape callback
-void Pipeline::reshapeCallback (uint width, uint height)
+gboolean Pipeline::reshapeCallback (void *sink, guint width, guint height, gpointer data)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, (gfloat)width/(gfloat)height, 0.1, 100);
- glMatrixMode(GL_MODELVIEW);
+ glMatrixMode(GL_MODELVIEW);
+
+ return TRUE;
}
//client draw callback
-gboolean Pipeline::drawCallback (uint texture, uint width, uint height)
+gboolean Pipeline::drawCallback (void *sink, uint texture, uint width, uint height, gpointer data)
{
static GTimeVal current_time;
static glong last_sec = current_time.tv_sec;
void doExpose() const;
void doRotate();
- static void reshapeCallback (uint width, uint height);
- static gboolean drawCallback (uint texture, uint width, uint height);
+ static gboolean reshapeCallback (void *sink, guint width, guint height, gpointer data);
+ static gboolean drawCallback (void *sink, guint texture, guint width, guint height, gpointer data);
static gboolean bus_call (GstBus *bus, GstMessage *msg, Pipeline* p);
static void cb_new_pad (GstElement* decodebin, GstPad* pad, gboolean last, Pipeline* p);
static gboolean cb_expose (gpointer data);
//-----------------------------------------------------------------------
//client reshape callback
-void Pipeline::reshapeCallback (uint width, uint height)
+gboolean Pipeline::reshapeCallback (void *sink, guint width, guint height, gpointer data)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, (gfloat)width/(gfloat)height, 0.1, 100);
- glMatrixMode(GL_MODELVIEW);
+ glMatrixMode(GL_MODELVIEW);
+
+ return TRUE;
}
//client draw callback
-gboolean Pipeline::drawCallback (uint texture, uint width, uint height)
+gboolean Pipeline::drawCallback (void *sink, guint texture, guint width, guint height, gpointer data)
{
static GLfloat xrot = 0;
static GLfloat yrot = 0;
WId winId() const { return m_winId; }
void doExpose() const;
- static void reshapeCallback (uint width, uint height);
- static gboolean drawCallback (uint texture, uint width, uint height);
+ static gboolean reshapeCallback (void *sink, guint width, guint height, gpointer data);
+ static gboolean drawCallback (void *sink, guint texture, guint width, guint height, gpointer data);
static gboolean bus_call (GstBus *bus, GstMessage *msg, Pipeline* p);
static void cb_new_pad (GstElement* decodebin, GstPad* pad, gboolean last, Pipeline* p);
static gboolean cb_expose (gpointer data);