mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 21:51:09 +00:00
[114/906] git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@555 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
parent
37a0568858
commit
5acf54ccf9
12 changed files with 988 additions and 925 deletions
|
@ -29,8 +29,8 @@ static GObjectClass* gst_gl_buffer_parent_class;
|
||||||
static void
|
static void
|
||||||
gst_gl_buffer_finalize (GstGLBuffer* buffer)
|
gst_gl_buffer_finalize (GstGLBuffer* buffer)
|
||||||
{
|
{
|
||||||
//wait clear textures end, blocking call
|
//blocking call, put the texture in the pool
|
||||||
gst_gl_display_clearTexture (buffer->display, buffer->texture);
|
gst_gl_display_del_texture (buffer->display, buffer->texture);
|
||||||
|
|
||||||
g_object_unref (buffer->display);
|
g_object_unref (buffer->display);
|
||||||
|
|
||||||
|
@ -99,8 +99,8 @@ gst_gl_buffer_new (GstGLDisplay* display,
|
||||||
//the one attached to the upload FBO
|
//the one attached to the upload FBO
|
||||||
GST_BUFFER_SIZE (gl_buffer) = gst_gl_buffer_get_size (gl_width, gl_height);
|
GST_BUFFER_SIZE (gl_buffer) = gst_gl_buffer_get_size (gl_width, gl_height);
|
||||||
|
|
||||||
//blocking call, request a texture and attach it to the upload FBO
|
//blocking call, generate a texture using the pool
|
||||||
gst_gl_display_prepare_texture (gl_buffer->display, &gl_buffer->texture) ;
|
gst_gl_display_gen_texture (gl_buffer->display, &gl_buffer->texture) ;
|
||||||
|
|
||||||
return gl_buffer;
|
return gl_buffer;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -41,7 +41,7 @@
|
||||||
typedef struct _GstGLDisplay GstGLDisplay;
|
typedef struct _GstGLDisplay GstGLDisplay;
|
||||||
typedef struct _GstGLDisplayClass GstGLDisplayClass;
|
typedef struct _GstGLDisplayClass GstGLDisplayClass;
|
||||||
|
|
||||||
//Color space conversion metthod
|
//Color space conversion method
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GST_GL_DISPLAY_CONVERSION_GLSL, //ARB_fragment_shade
|
GST_GL_DISPLAY_CONVERSION_GLSL, //ARB_fragment_shade
|
||||||
GST_GL_DISPLAY_CONVERSION_MATRIX, //ARB_imaging
|
GST_GL_DISPLAY_CONVERSION_MATRIX, //ARB_imaging
|
||||||
|
@ -51,23 +51,23 @@ typedef enum {
|
||||||
|
|
||||||
//Message type
|
//Message type
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GST_GL_DISPLAY_ACTION_CREATE,
|
GST_GL_DISPLAY_ACTION_CREATE_CONTEXT,
|
||||||
GST_GL_DISPLAY_ACTION_DESTROY,
|
GST_GL_DISPLAY_ACTION_DESTROY_CONTEXT,
|
||||||
GST_GL_DISPLAY_ACTION_VISIBLE,
|
GST_GL_DISPLAY_ACTION_VISIBLE_CONTEXT,
|
||||||
GST_GL_DISPLAY_ACTION_RESHAPE,
|
GST_GL_DISPLAY_ACTION_RESIZE_CONTEXT,
|
||||||
|
GST_GL_DISPLAY_ACTION_REDISPLAY_CONTEXT,
|
||||||
|
GST_GL_DISPLAY_ACTION_GEN_TEXTURE,
|
||||||
|
GST_GL_DISPLAY_ACTION_DEL_TEXTURE,
|
||||||
GST_GL_DISPLAY_ACTION_INIT_UPLOAD,
|
GST_GL_DISPLAY_ACTION_INIT_UPLOAD,
|
||||||
GST_GL_DISPLAY_ACTION_PREPARE,
|
GST_GL_DISPLAY_ACTION_DO_UPLOAD,
|
||||||
GST_GL_DISPLAY_ACTION_CHANGE,
|
|
||||||
GST_GL_DISPLAY_ACTION_CLEAR,
|
|
||||||
GST_GL_DISPLAY_ACTION_VIDEO,
|
|
||||||
GST_GL_DISPLAY_ACTION_REDISPLAY,
|
|
||||||
GST_GL_DISPLAY_ACTION_GENFBO,
|
|
||||||
GST_GL_DISPLAY_ACTION_DELFBO,
|
|
||||||
GST_GL_DISPLAY_ACTION_USEFBO,
|
|
||||||
GST_GL_DISPLAY_ACTION_USEFBO2,
|
|
||||||
GST_GL_DISPLAY_ACTION_INIT_DOWNLOAD,
|
GST_GL_DISPLAY_ACTION_INIT_DOWNLOAD,
|
||||||
GST_GL_DISPLAY_ACTION_GENSHADER,
|
GST_GL_DISPLAY_ACTION_DO_DOWNLOAD,
|
||||||
GST_GL_DISPLAY_ACTION_DELSHADER
|
GST_GL_DISPLAY_ACTION_GEN_FBO,
|
||||||
|
GST_GL_DISPLAY_ACTION_USE_FBO,
|
||||||
|
GST_GL_DISPLAY_ACTION_USE_FBO2,
|
||||||
|
GST_GL_DISPLAY_ACTION_DEL_FBO,
|
||||||
|
GST_GL_DISPLAY_ACTION_GEN_SHADER,
|
||||||
|
GST_GL_DISPLAY_ACTION_DEL_SHADER
|
||||||
|
|
||||||
} GstGLDisplayAction;
|
} GstGLDisplayAction;
|
||||||
|
|
||||||
|
@ -101,21 +101,23 @@ struct _GstGLDisplay {
|
||||||
|
|
||||||
GQueue* texturePool;
|
GQueue* texturePool;
|
||||||
|
|
||||||
|
//conditions
|
||||||
|
GCond* cond_create_context;
|
||||||
|
GCond* cond_destroy_context;
|
||||||
|
GCond* cond_gen_texture;
|
||||||
|
GCond* cond_del_texture;
|
||||||
GCond* cond_init_upload;
|
GCond* cond_init_upload;
|
||||||
GCond* cond_make;
|
GCond* cond_do_upload;
|
||||||
GCond* cond_fill;
|
|
||||||
GCond* cond_clear;
|
|
||||||
GCond* cond_video;
|
|
||||||
GCond* cond_generateFBO;
|
|
||||||
GCond* cond_useFBO;
|
|
||||||
GCond* cond_useFBO2;
|
|
||||||
GCond* cond_destroyFBO;
|
|
||||||
GCond* cond_init_download;
|
GCond* cond_init_download;
|
||||||
GCond* cond_initShader;
|
GCond* cond_do_download;
|
||||||
GCond* cond_destroyShader;
|
GCond* cond_gen_fbo;
|
||||||
|
GCond* cond_use_fbo;
|
||||||
|
GCond* cond_use_fbo_2;
|
||||||
|
GCond* cond_del_fbo;
|
||||||
|
GCond* cond_gen_shader;
|
||||||
|
GCond* cond_del_shader;
|
||||||
|
|
||||||
|
|
||||||
GCond* cond_create;
|
|
||||||
GCond* cond_destroy;
|
|
||||||
gint glutWinId;
|
gint glutWinId;
|
||||||
gulong winId;
|
gulong winId;
|
||||||
GString* title;
|
GString* title;
|
||||||
|
@ -239,42 +241,49 @@ GType gst_gl_display_get_type (void);
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
//-------------------- Public declarations ------------------
|
//-------------------- Public declarations ------------------
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
GstGLDisplay *gst_gl_display_new (void);
|
GstGLDisplay* gst_gl_display_new (void);
|
||||||
void gst_gl_display_init_gl_context (GstGLDisplay* display,
|
|
||||||
|
void gst_gl_display_create_context (GstGLDisplay* display,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
GLint width, GLint height,
|
GLint width, GLint height,
|
||||||
gulong winId,
|
gulong winId,
|
||||||
gboolean visible);
|
gboolean visible);
|
||||||
void gst_gl_display_setClientReshapeCallback (GstGLDisplay* display, CRCB cb);
|
void gst_gl_display_set_visible_context (GstGLDisplay* display, gboolean visible);
|
||||||
void gst_gl_display_setClientDrawCallback (GstGLDisplay* display, CDCB cb);
|
void gst_gl_display_resize_context (GstGLDisplay* display, gint width, gint height);
|
||||||
void gst_gl_display_setVisibleWindow (GstGLDisplay* display, gboolean visible);
|
gboolean gst_gl_display_redisplay (GstGLDisplay* display, GLuint texture, gint width, gint height);
|
||||||
void gst_gl_display_resizeWindow (GstGLDisplay* display, gint width, gint height);
|
|
||||||
|
void gst_gl_display_gen_texture (GstGLDisplay* display, guint* pTexture);
|
||||||
|
void gst_gl_display_del_texture (GstGLDisplay* display, guint texture);
|
||||||
|
|
||||||
void gst_gl_display_init_upload (GstGLDisplay* display, GstVideoFormat video_format,
|
void gst_gl_display_init_upload (GstGLDisplay* display, GstVideoFormat video_format,
|
||||||
guint gl_width, guint gl_height);
|
guint gl_width, guint gl_height);
|
||||||
void gst_gl_display_prepare_texture (GstGLDisplay* display, guint* pTexture);
|
|
||||||
void gst_gl_display_do_upload (GstGLDisplay* display, GstVideoFormat video_format,
|
void gst_gl_display_do_upload (GstGLDisplay* display, GstVideoFormat video_format,
|
||||||
gint video_width, gint video_height, gpointer data,
|
gint video_width, gint video_height, gpointer data,
|
||||||
guint gl_width, guint gl_height, guint pTexture);
|
guint gl_width, guint gl_height, guint pTexture);
|
||||||
void gst_gl_display_clearTexture (GstGLDisplay* display, guint texture);
|
|
||||||
|
|
||||||
void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format,
|
|
||||||
|
void gst_gl_display_init_download (GstGLDisplay* display, GstVideoFormat video_format,
|
||||||
|
gint width, gint height);
|
||||||
|
void gst_gl_display_do_download (GstGLDisplay* display, GstVideoFormat video_format,
|
||||||
gint width, gint height, GLuint recordedTexture, gpointer data);
|
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,
|
void gst_gl_display_gen_fbo (GstGLDisplay* display, gint width, gint height,
|
||||||
guint* fbo, guint* depthbuffer);
|
guint* fbo, guint* depthbuffer);
|
||||||
void gst_gl_display_useFBO (GstGLDisplay* display, gint textureFBOWidth, gint textureFBOheight,
|
void gst_gl_display_use_fbo (GstGLDisplay* display, gint textureFBOWidth, gint textureFBOheight,
|
||||||
guint fbo, guint depthbuffer, guint textureFBO, GLCB cb,
|
guint fbo, guint depthbuffer, guint textureFBO, GLCB cb,
|
||||||
guint inputTextureWidth, guint inputTextureHeight, guint inputTexture,
|
guint inputTextureWidth, guint inputTextureHeight, guint inputTexture,
|
||||||
GLhandleARB handleShader);
|
GLhandleARB handleShader);
|
||||||
void gst_gl_display_useFBO2 (GstGLDisplay* display, gint textureFBOWidth, gint textureFBOheight,
|
void gst_gl_display_use_fbo_2 (GstGLDisplay* display, gint textureFBOWidth, gint textureFBOheight,
|
||||||
guint fbo, guint depthbuffer, guint textureFBO, GLCB2 cb,
|
guint fbo, guint depthbuffer, guint textureFBO, GLCB2 cb,
|
||||||
gpointer* p1, gpointer* p2);
|
gpointer* p1, gpointer* p2);
|
||||||
void gst_gl_display_rejectFBO (GstGLDisplay* display, guint fbo,
|
void gst_gl_display_del_fbo (GstGLDisplay* display, guint fbo,
|
||||||
guint depthbuffer);
|
guint depthbuffer);
|
||||||
void gst_gl_display_init_download (GstGLDisplay* display, GstVideoFormat video_format,
|
|
||||||
gint width, gint height);
|
void gst_gl_display_gen_shader (GstGLDisplay* display, gchar* textShader, GLhandleARB* handleShader);
|
||||||
void gst_gl_display_initShader (GstGLDisplay* display, gchar* textShader, GLhandleARB* handleShader);
|
void gst_gl_display_del_shader (GstGLDisplay* display, GLhandleARB shader);
|
||||||
void gst_gl_display_destroyShader (GstGLDisplay* display, GLhandleARB shader);
|
|
||||||
void gst_gl_display_set_windowId (GstGLDisplay* display, gulong winId);
|
void gst_gl_display_set_window_id (GstGLDisplay* display, gulong winId);
|
||||||
|
void gst_gl_display_set_client_reshape_callback (GstGLDisplay* display, CRCB cb);
|
||||||
|
void gst_gl_display_set_client_draw_callback (GstGLDisplay* display, CDCB cb);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -156,7 +156,7 @@ gst_gl_filter_reset (GstGLFilter* filter)
|
||||||
if (filter->display)
|
if (filter->display)
|
||||||
{
|
{
|
||||||
//blocking call, delete the FBO
|
//blocking call, delete the FBO
|
||||||
gst_gl_display_rejectFBO (filter->display, filter->fbo,
|
gst_gl_display_del_fbo (filter->display, filter->fbo,
|
||||||
filter->depthbuffer);
|
filter->depthbuffer);
|
||||||
g_object_unref (filter->display);
|
g_object_unref (filter->display);
|
||||||
filter->display = NULL;
|
filter->display = NULL;
|
||||||
|
@ -247,7 +247,7 @@ gst_gl_filter_prepare_output_buffer (GstBaseTransform* trans,
|
||||||
filter->display = g_object_ref (gl_inbuf->display);
|
filter->display = g_object_ref (gl_inbuf->display);
|
||||||
|
|
||||||
//blocking call, generate a FBO
|
//blocking call, generate a FBO
|
||||||
gst_gl_display_requestFBO (filter->display, filter->width, filter->height,
|
gst_gl_display_gen_fbo (filter->display, filter->width, filter->height,
|
||||||
&filter->fbo, &filter->depthbuffer);
|
&filter->fbo, &filter->depthbuffer);
|
||||||
|
|
||||||
if (filter_class->onInitFBO)
|
if (filter_class->onInitFBO)
|
||||||
|
|
|
@ -389,7 +389,7 @@ gst_gl_colorscale_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||||
colorscale->display = gst_gl_display_new ();
|
colorscale->display = gst_gl_display_new ();
|
||||||
|
|
||||||
//init unvisible opengl context
|
//init unvisible opengl context
|
||||||
gst_gl_display_init_gl_context (colorscale->display,
|
gst_gl_display_create_context (colorscale->display,
|
||||||
50, y_pos++ * (colorscale->output_video_height+50) + 50,
|
50, y_pos++ * (colorscale->output_video_height+50) + 50,
|
||||||
colorscale->output_video_width, colorscale->output_video_height,
|
colorscale->output_video_width, colorscale->output_video_height,
|
||||||
0, FALSE);
|
0, FALSE);
|
||||||
|
@ -455,7 +455,7 @@ gst_gl_colorscale_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
||||||
GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
||||||
|
|
||||||
//blocking call
|
//blocking call
|
||||||
gst_gl_display_videoChanged(colorscale->display, colorscale->output_video_format,
|
gst_gl_display_do_download(colorscale->display, colorscale->output_video_format,
|
||||||
gl_temp_buffer->width, gl_temp_buffer->height, gl_temp_buffer->texture,
|
gl_temp_buffer->width, gl_temp_buffer->height, gl_temp_buffer->texture,
|
||||||
GST_BUFFER_DATA (outbuf));
|
GST_BUFFER_DATA (outbuf));
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,7 @@ gst_gl_download_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
||||||
GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
||||||
|
|
||||||
//blocking call
|
//blocking call
|
||||||
gst_gl_display_videoChanged(download->display, download->video_format,
|
gst_gl_display_do_download(download->display, download->video_format,
|
||||||
gl_inbuf->width, gl_inbuf->height, gl_inbuf->texture, GST_BUFFER_DATA (outbuf));
|
gl_inbuf->width, gl_inbuf->height, gl_inbuf->texture, GST_BUFFER_DATA (outbuf));
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
|
@ -152,7 +152,7 @@ gst_gl_filter_app_filter (GstGLFilter* filter, GstGLBuffer* inbuf,
|
||||||
if (app_filter->clientDrawCallback)
|
if (app_filter->clientDrawCallback)
|
||||||
{
|
{
|
||||||
//blocking call, use a FBO
|
//blocking call, use a FBO
|
||||||
gst_gl_display_useFBO (filter->display, filter->width, filter->height,
|
gst_gl_display_use_fbo (filter->display, filter->width, filter->height,
|
||||||
filter->fbo, filter->depthbuffer, outbuf->texture, app_filter->clientDrawCallback,
|
filter->fbo, filter->depthbuffer, outbuf->texture, app_filter->clientDrawCallback,
|
||||||
inbuf->width, inbuf->height, inbuf->texture, 0);
|
inbuf->width, inbuf->height, inbuf->texture, 0);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ gst_gl_filter_app_filter (GstGLFilter* filter, GstGLBuffer* inbuf,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//blocking call, use a FBO
|
//blocking call, use a FBO
|
||||||
gst_gl_display_useFBO (filter->display, filter->width, filter->height,
|
gst_gl_display_use_fbo (filter->display, filter->width, filter->height,
|
||||||
filter->fbo, filter->depthbuffer, outbuf->texture, gst_gl_filter_app_callback,
|
filter->fbo, filter->depthbuffer, outbuf->texture, gst_gl_filter_app_callback,
|
||||||
inbuf->width, inbuf->height, inbuf->texture, 0);
|
inbuf->width, inbuf->height, inbuf->texture, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ gst_gl_filter_cube_filter (GstGLFilter* filter, GstGLBuffer* inbuf,
|
||||||
//GstGLFilterCube* cube_filter = GST_GL_FILTER_CUBE(filter);
|
//GstGLFilterCube* cube_filter = GST_GL_FILTER_CUBE(filter);
|
||||||
|
|
||||||
//blocking call, use a FBO
|
//blocking call, use a FBO
|
||||||
gst_gl_display_useFBO (filter->display, filter->width, filter->height,
|
gst_gl_display_use_fbo (filter->display, filter->width, filter->height,
|
||||||
filter->fbo, filter->depthbuffer, outbuf->texture, gst_gl_filter_cube_callback,
|
filter->fbo, filter->depthbuffer, outbuf->texture, gst_gl_filter_cube_callback,
|
||||||
inbuf->width, inbuf->height, inbuf->texture, 0);
|
inbuf->width, inbuf->height, inbuf->texture, 0);
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ gst_gl_filter_edge_reset (GstGLFilter* filter)
|
||||||
GstGLFilterEdge* edge_filter = GST_GL_FILTER_EDGE(filter);
|
GstGLFilterEdge* edge_filter = GST_GL_FILTER_EDGE(filter);
|
||||||
|
|
||||||
//blocking call, wait the opengl thread has destroyed the shader program
|
//blocking call, wait the opengl thread has destroyed the shader program
|
||||||
gst_gl_display_destroyShader (filter->display, edge_filter->handleShader);
|
gst_gl_display_del_shader (filter->display, edge_filter->handleShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -159,7 +159,7 @@ gst_gl_filter_edge_init_shader (GstGLFilter* filter)
|
||||||
GstGLFilterEdge* edge_filter = GST_GL_FILTER_EDGE(filter);
|
GstGLFilterEdge* edge_filter = GST_GL_FILTER_EDGE(filter);
|
||||||
|
|
||||||
//blocking call, wait the opengl thread has compiled the shader program
|
//blocking call, wait the opengl thread has compiled the shader program
|
||||||
gst_gl_display_initShader (filter->display, edge_filter->textShader, &edge_filter->handleShader);
|
gst_gl_display_gen_shader (filter->display, edge_filter->textShader, &edge_filter->handleShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -169,7 +169,7 @@ gst_gl_filter_edge_filter (GstGLFilter* filter, GstGLBuffer* inbuf,
|
||||||
GstGLFilterEdge* edge_filter = GST_GL_FILTER_EDGE(filter);
|
GstGLFilterEdge* edge_filter = GST_GL_FILTER_EDGE(filter);
|
||||||
|
|
||||||
//blocking call, generate a FBO
|
//blocking call, generate a FBO
|
||||||
gst_gl_display_useFBO (filter->display, filter->width, filter->height,
|
gst_gl_display_use_fbo (filter->display, filter->width, filter->height,
|
||||||
filter->fbo, filter->depthbuffer, outbuf->texture, gst_gl_filter_edge_callback,
|
filter->fbo, filter->depthbuffer, outbuf->texture, gst_gl_filter_edge_callback,
|
||||||
inbuf->width, inbuf->height, inbuf->texture, edge_filter->handleShader);
|
inbuf->width, inbuf->height, inbuf->texture, edge_filter->handleShader);
|
||||||
|
|
||||||
|
|
|
@ -323,7 +323,7 @@ gst_glimage_sink_stop (GstBaseSink* bsink)
|
||||||
}
|
}
|
||||||
if (glimage_sink->display)
|
if (glimage_sink->display)
|
||||||
{
|
{
|
||||||
gst_gl_display_setVisibleWindow (glimage_sink->display, FALSE);
|
gst_gl_display_set_visible_context (glimage_sink->display, FALSE);
|
||||||
g_object_unref (glimage_sink->display);
|
g_object_unref (glimage_sink->display);
|
||||||
glimage_sink->display = NULL;
|
glimage_sink->display = NULL;
|
||||||
}
|
}
|
||||||
|
@ -436,17 +436,17 @@ gst_glimage_sink_render (GstBaseSink* bsink, GstBuffer* buf)
|
||||||
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (glimage_sink));
|
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (glimage_sink));
|
||||||
|
|
||||||
if (glimage_sink->window_id)
|
if (glimage_sink->window_id)
|
||||||
gst_gl_display_set_windowId (glimage_sink->display, glimage_sink->window_id);
|
gst_gl_display_set_window_id (glimage_sink->display, glimage_sink->window_id);
|
||||||
|
|
||||||
gst_gl_display_setClientReshapeCallback (glimage_sink->display,
|
gst_gl_display_set_client_reshape_callback (glimage_sink->display,
|
||||||
glimage_sink->clientReshapeCallback);
|
glimage_sink->clientReshapeCallback);
|
||||||
|
|
||||||
gst_gl_display_setClientDrawCallback (glimage_sink->display,
|
gst_gl_display_set_client_draw_callback (glimage_sink->display,
|
||||||
glimage_sink->clientDrawCallback);
|
glimage_sink->clientDrawCallback);
|
||||||
|
|
||||||
gst_gl_display_resizeWindow (glimage_sink->display, glimage_sink->width, glimage_sink->height);
|
gst_gl_display_resize_context (glimage_sink->display, glimage_sink->width, glimage_sink->height);
|
||||||
|
|
||||||
gst_gl_display_setVisibleWindow (glimage_sink->display, TRUE);
|
gst_gl_display_set_visible_context (glimage_sink->display, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//is not gl
|
//is not gl
|
||||||
|
@ -467,7 +467,7 @@ gst_glimage_sink_render (GstBaseSink* bsink, GstBuffer* buf)
|
||||||
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (glimage_sink));
|
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (glimage_sink));
|
||||||
|
|
||||||
//init opengl context
|
//init opengl context
|
||||||
gst_gl_display_init_gl_context (glimage_sink->display,
|
gst_gl_display_create_context (glimage_sink->display,
|
||||||
50, y_pos++ * (glimage_sink->height+50) + 50,
|
50, y_pos++ * (glimage_sink->height+50) + 50,
|
||||||
glimage_sink->width, glimage_sink->height,
|
glimage_sink->width, glimage_sink->height,
|
||||||
glimage_sink->window_id, TRUE);
|
glimage_sink->window_id, TRUE);
|
||||||
|
@ -476,10 +476,10 @@ gst_glimage_sink_render (GstBaseSink* bsink, GstBuffer* buf)
|
||||||
gst_gl_display_init_upload (glimage_sink->display, glimage_sink->format,
|
gst_gl_display_init_upload (glimage_sink->display, glimage_sink->format,
|
||||||
glimage_sink->width, glimage_sink->height);
|
glimage_sink->width, glimage_sink->height);
|
||||||
|
|
||||||
gst_gl_display_setClientReshapeCallback (glimage_sink->display,
|
gst_gl_display_set_client_reshape_callback (glimage_sink->display,
|
||||||
glimage_sink->clientReshapeCallback);
|
glimage_sink->clientReshapeCallback);
|
||||||
|
|
||||||
gst_gl_display_setClientDrawCallback (glimage_sink->display,
|
gst_gl_display_set_client_draw_callback (glimage_sink->display,
|
||||||
glimage_sink->clientDrawCallback);
|
glimage_sink->clientDrawCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ gst_glimage_sink_render (GstBaseSink* bsink, GstBuffer* buf)
|
||||||
glimage_sink->stored_buffer = gl_buffer;
|
glimage_sink->stored_buffer = gl_buffer;
|
||||||
|
|
||||||
//redisplay opengl scene
|
//redisplay opengl scene
|
||||||
isAlive = gst_gl_display_postRedisplay (glimage_sink->display,
|
isAlive = gst_gl_display_redisplay (glimage_sink->display,
|
||||||
gl_buffer->texture, gl_buffer->width, gl_buffer->height);
|
gl_buffer->texture, gl_buffer->width, gl_buffer->height);
|
||||||
|
|
||||||
if (isAlive)
|
if (isAlive)
|
||||||
|
@ -557,7 +557,7 @@ gst_glimage_sink_expose (GstXOverlay* overlay)
|
||||||
|
|
||||||
//redisplay opengl scene
|
//redisplay opengl scene
|
||||||
if (glimage_sink->display)
|
if (glimage_sink->display)
|
||||||
gst_gl_display_postRedisplay (glimage_sink->display, 0, 0, 0);
|
gst_gl_display_redisplay (glimage_sink->display, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -363,11 +363,11 @@ gst_gl_test_src_setcaps (GstBaseSrc* bsrc, GstCaps* caps)
|
||||||
|
|
||||||
gltestsrc->display = gst_gl_display_new ();
|
gltestsrc->display = gst_gl_display_new ();
|
||||||
|
|
||||||
gst_gl_display_init_gl_context (gltestsrc->display,
|
gst_gl_display_create_context (gltestsrc->display,
|
||||||
50, y_pos++ * (gltestsrc->height+50) + 50,
|
50, y_pos++ * (gltestsrc->height+50) + 50,
|
||||||
gltestsrc->width, gltestsrc->height, 0, FALSE);
|
gltestsrc->width, gltestsrc->height, 0, FALSE);
|
||||||
|
|
||||||
gst_gl_display_requestFBO (gltestsrc->display, gltestsrc->width, gltestsrc->height,
|
gst_gl_display_gen_fbo (gltestsrc->display, gltestsrc->width, gltestsrc->height,
|
||||||
&gltestsrc->fbo, &gltestsrc->depthbuffer);
|
&gltestsrc->fbo, &gltestsrc->depthbuffer);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
@ -557,7 +557,7 @@ gst_gl_test_src_create (GstPushSrc* psrc, GstBuffer** buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
//blocking call, generate a FBO
|
//blocking call, generate a FBO
|
||||||
gst_gl_display_useFBO2 (src->display, src->width, src->height,
|
gst_gl_display_use_fbo_2 (src->display, src->width, src->height,
|
||||||
src->fbo, src->depthbuffer, outbuf->texture, (GLCB2)src->make_image,
|
src->fbo, src->depthbuffer, outbuf->texture, (GLCB2)src->make_image,
|
||||||
(gpointer*)src, (gpointer*)outbuf);
|
(gpointer*)src, (gpointer*)outbuf);
|
||||||
|
|
||||||
|
@ -625,7 +625,7 @@ gst_gl_test_src_stop (GstBaseSrc* basesrc)
|
||||||
if (src->display)
|
if (src->display)
|
||||||
{
|
{
|
||||||
//blocking call, delete the FBO
|
//blocking call, delete the FBO
|
||||||
gst_gl_display_rejectFBO (src->display, src->fbo,
|
gst_gl_display_del_fbo (src->display, src->fbo,
|
||||||
src->depthbuffer);
|
src->depthbuffer);
|
||||||
g_object_unref (src->display);
|
g_object_unref (src->display);
|
||||||
src->display = NULL;
|
src->display = NULL;
|
||||||
|
|
|
@ -397,7 +397,7 @@ gst_gl_upload_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||||
upload->display = gst_gl_display_new ();
|
upload->display = gst_gl_display_new ();
|
||||||
|
|
||||||
//init unvisible opengl context
|
//init unvisible opengl context
|
||||||
gst_gl_display_init_gl_context (upload->display,
|
gst_gl_display_create_context (upload->display,
|
||||||
50, y_pos++ * (upload->gl_height+50) + 50,
|
50, y_pos++ * (upload->gl_height+50) + 50,
|
||||||
upload->gl_width, upload->gl_height, 0, FALSE);
|
upload->gl_width, upload->gl_height, 0, FALSE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue