mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
[075/906] indent
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@451 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
parent
607548be2d
commit
ede863197a
5 changed files with 307 additions and 325 deletions
|
@ -343,7 +343,7 @@ gst_gl_display_finalize (GObject *object)
|
||||||
if (g_hash_table_size (gst_gl_display_map) == 0)
|
if (g_hash_table_size (gst_gl_display_map) == 0)
|
||||||
{
|
{
|
||||||
g_thread_join (gst_gl_display_glutThread);
|
g_thread_join (gst_gl_display_glutThread);
|
||||||
g_print ("Glut thread joined\n");
|
GST_DEBUG ("Glut thread joined");
|
||||||
gst_gl_display_glutThread = NULL;
|
gst_gl_display_glutThread = NULL;
|
||||||
g_async_queue_unref (gst_gl_display_messageQueue);
|
g_async_queue_unref (gst_gl_display_messageQueue);
|
||||||
g_hash_table_unref (gst_gl_display_map);
|
g_hash_table_unref (gst_gl_display_map);
|
||||||
|
@ -370,9 +370,9 @@ gst_gl_display_glutThreadFunc (GstGLDisplay *display)
|
||||||
gst_gl_display_glutCreateWindow (display);
|
gst_gl_display_glutCreateWindow (display);
|
||||||
gst_gl_display_unlock (display);
|
gst_gl_display_unlock (display);
|
||||||
|
|
||||||
g_print ("Glut mainLoop start\n");
|
GST_DEBUG ("Glut mainLoop start");
|
||||||
glutMainLoop ();
|
glutMainLoop ();
|
||||||
g_print ("Glut mainLoop exited\n");
|
GST_DEBUG ("Glut mainLoop exited");
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -405,13 +405,13 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display)
|
||||||
//Init glew
|
//Init glew
|
||||||
err = glewInit();
|
err = glewInit();
|
||||||
if (err != GLEW_OK)
|
if (err != GLEW_OK)
|
||||||
g_print ("Error: %s\n", glewGetErrorString(err));
|
GST_DEBUG ("Error: %s", glewGetErrorString(err));
|
||||||
else
|
else
|
||||||
g_print ("Context %d, Using GLEW %s\n", glutWinId, glewGetString(GLEW_VERSION));
|
GST_DEBUG ("Context %d, Using GLEW %s", glutWinId, glewGetString(GLEW_VERSION));
|
||||||
|
|
||||||
if (GLEW_EXT_framebuffer_object)
|
if (GLEW_EXT_framebuffer_object)
|
||||||
{
|
{
|
||||||
g_print ("Context %d, EXT_framebuffer_object supported: yes\n", glutWinId);
|
GST_DEBUG ("Context %d, EXT_framebuffer_object supported: yes", glutWinId);
|
||||||
|
|
||||||
//-- init intput frame buffer object (video -> GL)
|
//-- init intput frame buffer object (video -> GL)
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_print ("Context %d, EXT_framebuffer_object supported: no\n", glutWinId);
|
GST_DEBUG ("Context %d, EXT_framebuffer_object supported: no", glutWinId);
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,7 +570,7 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display)
|
||||||
{
|
{
|
||||||
gchar program[2048];
|
gchar program[2048];
|
||||||
|
|
||||||
g_print ("Context %d, ARB_fragment_program supported: yes\n", glutWinId);
|
GST_DEBUG ("Context %d, ARB_fragment_program supported: yes", glutWinId);
|
||||||
|
|
||||||
//from video to texture
|
//from video to texture
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_print ("Context %d, ARB_fragment_program supported: no\n", glutWinId);
|
GST_DEBUG ("Context %d, ARB_fragment_program supported: no", glutWinId);
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,11 +611,11 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display)
|
||||||
|
|
||||||
//insert glut context to the map
|
//insert glut context to the map
|
||||||
display->glutWinId = glutWinId;
|
display->glutWinId = glutWinId;
|
||||||
g_hash_table_insert (gst_gl_display_map, GINT_TO_POINTER (glutWinId), display);
|
g_hash_table_insert (gst_gl_display_map, GUINT_TO_POINTER ((guint64)glutWinId), display);
|
||||||
|
|
||||||
//check glut id validity
|
//check glut id validity
|
||||||
g_assert (glutGetWindow() == glutWinId);
|
g_assert (glutGetWindow() == glutWinId);
|
||||||
g_print ("Context %d initialized\n", display->glutWinId);
|
GST_DEBUG ("Context %d initialized", display->glutWinId);
|
||||||
|
|
||||||
//release display constructor
|
//release display constructor
|
||||||
g_cond_signal (display->cond_create);
|
g_cond_signal (display->cond_create);
|
||||||
|
@ -670,8 +670,8 @@ gst_gl_display_glutDestroyWindow (GstGLDisplay *display)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hash_table_remove (gst_gl_display_map, GINT_TO_POINTER (display->glutWinId));
|
g_hash_table_remove (gst_gl_display_map, GINT_TO_POINTER ((guint64)display->glutWinId));
|
||||||
g_print ("glut window destroyed: %d\n", display->glutWinId);
|
GST_DEBUG ("glut window destroyed: %d", display->glutWinId);
|
||||||
|
|
||||||
//if the map is empty, leaveMainloop and join the thread
|
//if the map is empty, leaveMainloop and join the thread
|
||||||
if (g_hash_table_size (gst_gl_display_map) == 0)
|
if (g_hash_table_size (gst_gl_display_map) == 0)
|
||||||
|
@ -782,7 +782,7 @@ gst_gl_display_glut_idle (void)
|
||||||
gst_gl_display_glutDispatchAction (msg);
|
gst_gl_display_glutDispatchAction (msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else g_print ("timeout reached in idle func\n");
|
else GST_DEBUG ("timeout reached in idle func");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -844,7 +844,7 @@ gst_gl_display_checkMsgValidity (GstGLDisplayMsg *msg)
|
||||||
case GST_GL_DISPLAY_ACTION_VIDEO:
|
case GST_GL_DISPLAY_ACTION_VIDEO:
|
||||||
case GST_GL_DISPLAY_ACTION_REDISPLAY:
|
case GST_GL_DISPLAY_ACTION_REDISPLAY:
|
||||||
//msg is out of date if the associated display is not in the map
|
//msg is out of date if the associated display is not in the map
|
||||||
if (!g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER (msg->glutWinId)))
|
if (!g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER ((guint64)msg->glutWinId)))
|
||||||
valid = FALSE;
|
valid = FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1064,7 +1064,7 @@ gst_gl_display_set_windowId (GstGLDisplay* display, gulong winId)
|
||||||
if (g_hash_table_size (gst_gl_display_map) == 0)
|
if (g_hash_table_size (gst_gl_display_map) == 0)
|
||||||
{
|
{
|
||||||
g_thread_join (gst_gl_display_glutThread);
|
g_thread_join (gst_gl_display_glutThread);
|
||||||
g_print ("Glut thread joined when setting winId\n");
|
GST_DEBUG ("Glut thread joined when setting winId");
|
||||||
gst_gl_display_glutThread = NULL;
|
gst_gl_display_glutThread = NULL;
|
||||||
g_async_queue_unref (gst_gl_display_messageQueue);
|
g_async_queue_unref (gst_gl_display_messageQueue);
|
||||||
g_hash_table_unref (gst_gl_display_map);
|
g_hash_table_unref (gst_gl_display_map);
|
||||||
|
@ -1091,7 +1091,7 @@ gst_gl_display_onReshape(gint width, gint height)
|
||||||
|
|
||||||
//retrieve the display associated to the glut context
|
//retrieve the display associated to the glut context
|
||||||
glutWinId = glutGetWindow ();
|
glutWinId = glutGetWindow ();
|
||||||
display = g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER (glutWinId));
|
display = g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER ((guint64)glutWinId));
|
||||||
|
|
||||||
//glutGetWindow return 0 if no windows exists, then g_hash_table_lookup return NULL
|
//glutGetWindow return 0 if no windows exists, then g_hash_table_lookup return NULL
|
||||||
if (display == NULL) return;
|
if (display == NULL) return;
|
||||||
|
@ -1123,7 +1123,7 @@ void gst_gl_display_draw(void)
|
||||||
|
|
||||||
//retrieve the display associated to the glut context
|
//retrieve the display associated to the glut context
|
||||||
glutWinId = glutGetWindow ();
|
glutWinId = glutGetWindow ();
|
||||||
display = g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER (glutWinId));
|
display = g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER ((guint64)glutWinId));
|
||||||
|
|
||||||
//glutGetWindow return 0 if no windows exists, then g_hash_table_lookup return NULL
|
//glutGetWindow return 0 if no windows exists, then g_hash_table_lookup return NULL
|
||||||
if (display == NULL) return;
|
if (display == NULL) return;
|
||||||
|
@ -1200,12 +1200,12 @@ void gst_gl_display_onClose (void)
|
||||||
|
|
||||||
//retrieve the display associated to the glut context
|
//retrieve the display associated to the glut context
|
||||||
glutWinId = glutGetWindow ();
|
glutWinId = glutGetWindow ();
|
||||||
display = g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER (glutWinId));
|
display = g_hash_table_lookup (gst_gl_display_map, GINT_TO_POINTER ((guint64)glutWinId));
|
||||||
|
|
||||||
//glutGetWindow return 0 if no windows exists, then g_hash_table_lookup return NULL
|
//glutGetWindow return 0 if no windows exists, then g_hash_table_lookup return NULL
|
||||||
if (display == NULL) return;
|
if (display == NULL) return;
|
||||||
|
|
||||||
g_print ("on close\n");
|
GST_DEBUG ("on close");
|
||||||
|
|
||||||
gst_gl_display_lock (display);
|
gst_gl_display_lock (display);
|
||||||
display->isAlive = FALSE;
|
display->isAlive = FALSE;
|
||||||
|
@ -1896,7 +1896,7 @@ gst_gl_display_loadGLSLprogram (gchar* textFProgram)
|
||||||
//Print the compilation log
|
//Print the compilation log
|
||||||
glGetObjectParameterivARB (FHandle, GL_OBJECT_COMPILE_STATUS_ARB, &i);
|
glGetObjectParameterivARB (FHandle, GL_OBJECT_COMPILE_STATUS_ARB, &i);
|
||||||
glGetInfoLogARB (FHandle, sizeof(s)/sizeof(char), NULL, s);
|
glGetInfoLogARB (FHandle, sizeof(s)/sizeof(char), NULL, s);
|
||||||
g_print ("Compile Log: %s\n", s);
|
GST_DEBUG ("Compile Log: %s", s);
|
||||||
|
|
||||||
//link the shader
|
//link the shader
|
||||||
glAttachObjectARB (PHandle, FHandle);
|
glAttachObjectARB (PHandle, FHandle);
|
||||||
|
@ -1904,7 +1904,7 @@ gst_gl_display_loadGLSLprogram (gchar* textFProgram)
|
||||||
|
|
||||||
//Print the link log
|
//Print the link log
|
||||||
glGetInfoLogARB (PHandle, sizeof(s)/sizeof(char), NULL, s);
|
glGetInfoLogARB (PHandle, sizeof(s)/sizeof(char), NULL, s);
|
||||||
g_print ("Link Log: %s\n", s);
|
GST_DEBUG ("Link Log: %s", s);
|
||||||
|
|
||||||
return PHandle;
|
return PHandle;
|
||||||
}
|
}
|
||||||
|
@ -1914,7 +1914,6 @@ gst_gl_display_loadGLSLprogram (gchar* textFProgram)
|
||||||
void
|
void
|
||||||
checkFramebufferStatus(void)
|
checkFramebufferStatus(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||||
|
|
||||||
switch(status)
|
switch(status)
|
||||||
|
@ -1923,10 +1922,10 @@ checkFramebufferStatus(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
||||||
g_print("GL_FRAMEBUFFER_UNSUPPORTED_EXT\n");
|
GST_DEBUG("GL_FRAMEBUFFER_UNSUPPORTED_EXT");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_print("General FBO error\n");
|
GST_DEBUG("General FBO error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,19 +270,10 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_glimage_sink_start (GstBaseSink * bsink)
|
gst_glimage_sink_start (GstBaseSink * bsink)
|
||||||
{
|
{
|
||||||
GstGLImageSink *glimage_sink;
|
//GstGLImageSink* glimage_sink = GST_GLIMAGE_SINK (bsink);
|
||||||
|
|
||||||
GST_DEBUG ("start");
|
GST_DEBUG ("start");
|
||||||
|
|
||||||
glimage_sink = GST_GLIMAGE_SINK (bsink);
|
|
||||||
|
|
||||||
/*if (glimage_sink->display && glimage_sink->window_id) {
|
|
||||||
gst_gl_display_set_window (glimage_sink->display, glimage_sink->window_id);
|
|
||||||
gst_gl_display_set_visible (glimage_sink->display, TRUE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
GST_DEBUG ("start done");
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,14 +302,10 @@ gst_glimage_sink_stop (GstBaseSink * bsink)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_glimage_sink_unlock (GstBaseSink * bsink)
|
gst_glimage_sink_unlock (GstBaseSink * bsink)
|
||||||
{
|
{
|
||||||
//GstGLImageSink *glimage_sink;
|
//GstGLImageSink* glimage_sink = GST_GLIMAGE_SINK (bsink);
|
||||||
|
|
||||||
GST_DEBUG ("unlock");
|
GST_DEBUG ("unlock");
|
||||||
|
|
||||||
//glimage_sink = GST_GLIMAGE_SINK (bsink);
|
|
||||||
|
|
||||||
/* FIXME */
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,13 +64,11 @@ struct _GstGLImageSink
|
||||||
|
|
||||||
GstGLDisplay *display;
|
GstGLDisplay *display;
|
||||||
GstGLBuffer *stored_buffer;
|
GstGLBuffer *stored_buffer;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstGLImageSinkClass
|
struct _GstGLImageSinkClass
|
||||||
{
|
{
|
||||||
GstVideoSinkClass video_sink_class;
|
GstVideoSinkClass video_sink_class;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_glimage_sink_get_type(void);
|
GType gst_glimage_sink_get_type(void);
|
||||||
|
|
|
@ -126,7 +126,7 @@ static void
|
||||||
gst_gl_videomaker_set_property (GObject* object, guint prop_id,
|
gst_gl_videomaker_set_property (GObject* object, guint prop_id,
|
||||||
const GValue* value, GParamSpec* pspec)
|
const GValue* value, GParamSpec* pspec)
|
||||||
{
|
{
|
||||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -39,8 +39,6 @@ G_BEGIN_DECLS
|
||||||
typedef struct _GstGLVideomaker GstGLVideomaker;
|
typedef struct _GstGLVideomaker GstGLVideomaker;
|
||||||
typedef struct _GstGLVideomakerClass GstGLVideomakerClass;
|
typedef struct _GstGLVideomakerClass GstGLVideomakerClass;
|
||||||
|
|
||||||
//typedef void (*GstGLVideomakerProcessFunc) (GstGLVideomaker *, guint8 *, guint);
|
|
||||||
|
|
||||||
struct _GstGLVideomaker
|
struct _GstGLVideomaker
|
||||||
{
|
{
|
||||||
GstBaseTransform base_transform;
|
GstBaseTransform base_transform;
|
||||||
|
|
Loading…
Reference in a new issue