mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 10:42:22 +00:00
[115/906] git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@556 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
parent
a192d39638
commit
908e74de67
2 changed files with 403 additions and 381 deletions
File diff suppressed because it is too large
Load diff
|
@ -97,8 +97,17 @@ typedef void (* GLCB2) ( gpointer* p1, gpointer* p2, gint w, gint h);
|
||||||
struct _GstGLDisplay {
|
struct _GstGLDisplay {
|
||||||
GObject object;
|
GObject object;
|
||||||
|
|
||||||
|
//thread safe
|
||||||
GMutex* mutex;
|
GMutex* mutex;
|
||||||
|
|
||||||
|
//gl context
|
||||||
|
gint glutWinId;
|
||||||
|
gulong winId;
|
||||||
|
GString* title;
|
||||||
|
gint win_xpos;
|
||||||
|
gint win_ypos;
|
||||||
|
gboolean visible;
|
||||||
|
gboolean isAlive;
|
||||||
GQueue* texturePool;
|
GQueue* texturePool;
|
||||||
|
|
||||||
//conditions
|
//conditions
|
||||||
|
@ -117,98 +126,92 @@ struct _GstGLDisplay {
|
||||||
GCond* cond_gen_shader;
|
GCond* cond_gen_shader;
|
||||||
GCond* cond_del_shader;
|
GCond* cond_del_shader;
|
||||||
|
|
||||||
|
//action redisplay
|
||||||
gint glutWinId;
|
GLuint redisplay_texture;
|
||||||
gulong winId;
|
GLuint redisplay_texture_width;
|
||||||
GString* title;
|
GLuint redisplay_texture_height;
|
||||||
gint win_xpos;
|
|
||||||
gint win_ypos;
|
|
||||||
gboolean visible;
|
|
||||||
gboolean isAlive;
|
|
||||||
|
|
||||||
//intput frame buffer object (video -> GL)
|
|
||||||
GLuint fbo;
|
|
||||||
GLuint depthBuffer;
|
|
||||||
GLuint textureFBO;
|
|
||||||
GLuint textureFBOWidth;
|
|
||||||
GLuint textureFBOHeight;
|
|
||||||
GstVideoFormat upload_video_format;
|
|
||||||
|
|
||||||
//filter frame buffer object (GL -> GL)
|
|
||||||
GLuint requestedFBO;
|
|
||||||
GLuint requestedDepthBuffer;
|
|
||||||
GLuint requestedTextureFBOWidth;
|
|
||||||
GLuint requestedTextureFBOHeight;
|
|
||||||
|
|
||||||
GLuint usedFBO;
|
|
||||||
GLuint usedDepthBuffer;
|
|
||||||
GLuint usedTextureFBO;
|
|
||||||
GLuint usedTextureFBOWidth;
|
|
||||||
GLuint usedTextureFBOHeight;
|
|
||||||
GLCB glsceneFBO_cb;
|
|
||||||
GLCB2 glsceneFBO_cb2;
|
|
||||||
gpointer* p1;
|
|
||||||
gpointer* p2;
|
|
||||||
GLuint inputTextureWidth;
|
|
||||||
GLuint inputTextureHeight;
|
|
||||||
GLuint inputTexture;
|
|
||||||
GLuint rejectedFBO;
|
|
||||||
GLuint rejectedDepthBuffer;
|
|
||||||
|
|
||||||
//displayed texture
|
|
||||||
GLuint displayedTexture;
|
|
||||||
GLuint displayedTextureWidth;
|
|
||||||
GLuint displayedTextureHeight;
|
|
||||||
|
|
||||||
|
//action resize
|
||||||
gint resize_width;
|
gint resize_width;
|
||||||
gint resize_height;
|
gint resize_height;
|
||||||
|
|
||||||
GLuint preparedTexture;
|
//action gen and del texture
|
||||||
|
GLuint gen_texture;
|
||||||
GLuint currentTexture;
|
GLuint del_texture;
|
||||||
GLuint currentTexture_u;
|
|
||||||
GLuint currentTexture_v;
|
|
||||||
GLuint currentTextureWidth;
|
|
||||||
GLuint currentTextureHeight;
|
|
||||||
GstVideoFormat currentVideo_format;
|
|
||||||
gpointer currentData;
|
|
||||||
|
|
||||||
GLuint textureTrash;
|
//client callbacks
|
||||||
|
CRCB clientReshapeCallback;
|
||||||
|
CDCB clientDrawCallback;
|
||||||
|
|
||||||
//output frame buffer object (GL -> video)
|
//upload
|
||||||
GLuint videoFBO;
|
GLuint upload_fbo;
|
||||||
GLuint videoDepthBuffer;
|
GLuint upload_depth_buffer;
|
||||||
GLuint videoTexture;
|
GLuint upload_texture;
|
||||||
GLuint videoTexture_u;
|
GLuint upload_width;
|
||||||
GLuint videoTexture_v;
|
GLuint upload_height;
|
||||||
gint outputWidth;
|
GstVideoFormat upload_video_format;
|
||||||
gint outputHeight;
|
|
||||||
GstVideoFormat outputVideo_format;
|
|
||||||
gpointer outputData;
|
|
||||||
GLenum multipleRT[3];
|
|
||||||
|
|
||||||
//recorded texture
|
|
||||||
GLuint recordedTexture;
|
|
||||||
GLuint recordedTextureWidth;
|
|
||||||
GLuint recordedTextureHeight;
|
|
||||||
|
|
||||||
//colorspace conversion method
|
|
||||||
GstGLDisplayConversion colorspace_conversion;
|
GstGLDisplayConversion colorspace_conversion;
|
||||||
|
gint upload_data_with;
|
||||||
|
gint upload_data_height;
|
||||||
|
gpointer upload_data;
|
||||||
|
|
||||||
//from video to texture
|
//filter gen fbo
|
||||||
|
GLuint gen_fbo_width;
|
||||||
|
GLuint gen_fbo_height;
|
||||||
|
GLuint generated_fbo;
|
||||||
|
GLuint generated_depth_buffer;
|
||||||
|
|
||||||
|
//filter use fbo
|
||||||
|
GLuint use_fbo;
|
||||||
|
GLuint use_depth_buffer;
|
||||||
|
GLuint use_fbo_texture;
|
||||||
|
GLuint use_fbo_width;
|
||||||
|
GLuint use_fbo_height;
|
||||||
|
GLCB use_fbo_scene_cb;
|
||||||
|
GLhandleARB use_shader;
|
||||||
|
GLCB2 use_fbo_scene_cb_2;
|
||||||
|
gpointer* p1;
|
||||||
|
gpointer* p2;
|
||||||
|
GLuint input_texture_width;
|
||||||
|
GLuint input_texture_height;
|
||||||
|
GLuint input_texture;
|
||||||
|
|
||||||
|
//filter del fbo
|
||||||
|
GLuint del_fbo;
|
||||||
|
GLuint del_depth_buffer;
|
||||||
|
|
||||||
|
//download
|
||||||
|
GLuint download_fbo;
|
||||||
|
GLuint download_depth_buffer;
|
||||||
|
GLuint download_texture;
|
||||||
|
GLuint download_texture_u;
|
||||||
|
GLuint download_texture_v;
|
||||||
|
gint download_width;
|
||||||
|
gint download_height;
|
||||||
|
GstVideoFormat download_video_format;
|
||||||
|
gpointer download_data;
|
||||||
|
GLenum multipleRT[3];
|
||||||
|
GLuint ouput_texture;
|
||||||
|
GLuint ouput_texture_width;
|
||||||
|
GLuint ouput_texture_height;
|
||||||
|
|
||||||
|
//action gen and del shader
|
||||||
|
gchar* gen_text_shader;
|
||||||
|
GLhandleARB gen_handle_shader;
|
||||||
|
GLhandleARB del_handle_shader;
|
||||||
|
|
||||||
|
//fragement shader upload
|
||||||
gchar* textFProgram_YUY2_UYVY;
|
gchar* textFProgram_YUY2_UYVY;
|
||||||
GLhandleARB GLSLProgram_YUY2;
|
GLhandleARB GLSLProgram_YUY2;
|
||||||
GLhandleARB GLSLProgram_UYVY;
|
GLhandleARB GLSLProgram_UYVY;
|
||||||
|
|
||||||
gchar* textFProgram_I420_YV12;
|
gchar* textFProgram_I420_YV12;
|
||||||
GLhandleARB GLSLProgram_I420_YV12;
|
GLhandleARB GLSLProgram_I420_YV12;
|
||||||
|
|
||||||
gchar* textFProgram_AYUV;
|
gchar* textFProgram_AYUV;
|
||||||
GLhandleARB GLSLProgram_AYUV;
|
GLhandleARB GLSLProgram_AYUV;
|
||||||
|
|
||||||
//from texture to video
|
//fragement shader download
|
||||||
|
|
||||||
gchar* textFProgram_to_YUY2_UYVY;
|
gchar* textFProgram_to_YUY2_UYVY;
|
||||||
GLhandleARB GLSLProgram_to_YUY2;
|
GLhandleARB GLSLProgram_to_YUY2;
|
||||||
GLhandleARB GLSLProgram_to_UYVY;
|
GLhandleARB GLSLProgram_to_UYVY;
|
||||||
|
@ -218,16 +221,6 @@ struct _GstGLDisplay {
|
||||||
|
|
||||||
gchar* textFProgram_to_AYUV;
|
gchar* textFProgram_to_AYUV;
|
||||||
GLhandleARB GLSLProgram_to_AYUV;
|
GLhandleARB GLSLProgram_to_AYUV;
|
||||||
|
|
||||||
//requested shader
|
|
||||||
gchar* requestedTextShader;
|
|
||||||
GLhandleARB requestedHandleShader;
|
|
||||||
GLhandleARB usedHandleShader;
|
|
||||||
GLhandleARB rejectedHandleShader;
|
|
||||||
|
|
||||||
//client callbacks
|
|
||||||
CRCB clientReshapeCallback;
|
|
||||||
CDCB clientDrawCallback;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -257,27 +250,26 @@ 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_do_upload (GstGLDisplay* display, GstVideoFormat video_format,
|
void gst_gl_display_do_upload (GstGLDisplay* display, guint texture,
|
||||||
gint video_width, gint video_height, gpointer data,
|
gint data_width, gint data_height,
|
||||||
guint gl_width, guint gl_height, guint pTexture);
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
void gst_gl_display_init_download (GstGLDisplay* display, GstVideoFormat video_format,
|
void gst_gl_display_init_download (GstGLDisplay* display, GstVideoFormat video_format,
|
||||||
gint width, gint height);
|
gint width, gint height);
|
||||||
void gst_gl_display_do_download (GstGLDisplay* display, GstVideoFormat video_format,
|
void gst_gl_display_do_download (GstGLDisplay* display, GLuint texture,
|
||||||
gint width, gint height, GLuint recordedTexture, gpointer data);
|
gint width, gint height,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
void gst_gl_display_gen_fbo (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_use_fbo (GstGLDisplay* display, gint textureFBOWidth, gint textureFBOheight,
|
void gst_gl_display_use_fbo (GstGLDisplay* display, gint texture_fbo_width, gint texture_fbo_height,
|
||||||
guint fbo, guint depthbuffer, guint textureFBO, GLCB cb,
|
guint fbo, guint depth_buffer, guint texture_fbo, GLCB cb,
|
||||||
guint inputTextureWidth, guint inputTextureHeight, guint inputTexture,
|
guint input_texture_width, guint input_texture_height, guint input_texture,
|
||||||
GLhandleARB handleShader);
|
GLhandleARB shader);
|
||||||
void gst_gl_display_use_fbo_2 (GstGLDisplay* display, gint textureFBOWidth, gint textureFBOheight,
|
void gst_gl_display_use_fbo_2 (GstGLDisplay* display, gint texture_fbo_width, gint texture_fbo_height,
|
||||||
guint fbo, guint depthbuffer, guint textureFBO, GLCB2 cb,
|
guint fbo, guint depth_buffer, guint texture_fbo, GLCB2 cb2,
|
||||||
gpointer* p1, gpointer* p2);
|
gpointer* p1, gpointer* p2);
|
||||||
void gst_gl_display_del_fbo (GstGLDisplay* display, guint fbo,
|
void gst_gl_display_del_fbo (GstGLDisplay* display, guint fbo,
|
||||||
guint depthbuffer);
|
guint depth_buffer);
|
||||||
|
|
||||||
void gst_gl_display_gen_shader (GstGLDisplay* display, gchar* textShader, GLhandleARB* handleShader);
|
void gst_gl_display_gen_shader (GstGLDisplay* display, gchar* textShader, GLhandleARB* handleShader);
|
||||||
void gst_gl_display_del_shader (GstGLDisplay* display, GLhandleARB shader);
|
void gst_gl_display_del_shader (GstGLDisplay* display, GLhandleARB shader);
|
||||||
|
|
Loading…
Reference in a new issue