mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
[103/906] rename glgraphicmaker -> glupload and glvideomaker -> gldownload
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@516 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
parent
7bf48a45ff
commit
459cde2eaa
6 changed files with 170 additions and 170 deletions
|
@ -8,10 +8,10 @@ libgstopengl_la_SOURCES = \
|
|||
gstopengl.c \
|
||||
gstglimagesink.c \
|
||||
gstglimagesink.h \
|
||||
gstglgraphicmaker.c \
|
||||
gstglgraphicmaker.h \
|
||||
gstglvideomaker.c \
|
||||
gstglvideomaker.h \
|
||||
gstglupload.c \
|
||||
gstglupload.h \
|
||||
gstgldownload.c \
|
||||
gstgldownload.h \
|
||||
gstglfiltercube.c \
|
||||
gstglfiltercube.h \
|
||||
gstglfilterapp.c \
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "gstglvideomaker.h"
|
||||
#include "gstgldownload.h"
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_videomaker_debug
|
||||
#define GST_CAT_DEFAULT gst_gl_download_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
static const GstElementDetails element_details =
|
||||
|
@ -33,7 +33,7 @@ static const GstElementDetails element_details =
|
|||
"A from GL to video flow filter",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
|
||||
static GstStaticPadTemplate gst_gl_videomaker_src_pad_template =
|
||||
static GstStaticPadTemplate gst_gl_download_src_pad_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
|
@ -44,7 +44,7 @@ static GstStaticPadTemplate gst_gl_videomaker_src_pad_template =
|
|||
GST_VIDEO_CAPS_YUV ("{ I420, YV12, YUY2, UYVY, AYUV }"))
|
||||
);
|
||||
|
||||
static GstStaticPadTemplate gst_gl_videomaker_sink_pad_template =
|
||||
static GstStaticPadTemplate gst_gl_download_sink_pad_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
|
@ -57,75 +57,75 @@ enum
|
|||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_videomaker_debug, "glvideomaker", 0, "glvideomaker element");
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_download_debug, "gldownload", 0, "gldownload element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLVideomaker, gst_gl_videomaker, GstBaseTransform,
|
||||
GST_BOILERPLATE_FULL (GstGLDownload, gst_gl_download, GstBaseTransform,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_videomaker_set_property (GObject* object, guint prop_id,
|
||||
static void gst_gl_download_set_property (GObject* object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_gl_videomaker_get_property (GObject* object, guint prop_id,
|
||||
static void gst_gl_download_get_property (GObject* object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static void gst_gl_videomaker_reset (GstGLVideomaker* videomaker);
|
||||
static gboolean gst_gl_videomaker_set_caps (GstBaseTransform* bt,
|
||||
static void gst_gl_download_reset (GstGLDownload* download);
|
||||
static gboolean gst_gl_download_set_caps (GstBaseTransform* bt,
|
||||
GstCaps* incaps, GstCaps* outcaps);
|
||||
static GstCaps* gst_gl_videomaker_transform_caps (GstBaseTransform* bt,
|
||||
static GstCaps* gst_gl_download_transform_caps (GstBaseTransform* bt,
|
||||
GstPadDirection direction, GstCaps* caps);
|
||||
static gboolean gst_gl_videomaker_start (GstBaseTransform* bt);
|
||||
static gboolean gst_gl_videomaker_stop (GstBaseTransform* bt);
|
||||
static GstFlowReturn gst_gl_videomaker_transform (GstBaseTransform* trans,
|
||||
static gboolean gst_gl_download_start (GstBaseTransform* bt);
|
||||
static gboolean gst_gl_download_stop (GstBaseTransform* bt);
|
||||
static GstFlowReturn gst_gl_download_transform (GstBaseTransform* trans,
|
||||
GstBuffer* inbuf, GstBuffer* outbuf);
|
||||
static gboolean gst_gl_videomaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
static gboolean gst_gl_download_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
guint* size);
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_base_init (gpointer klass)
|
||||
gst_gl_download_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass* element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
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_static_pad_template_get (&gst_gl_download_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_videomaker_sink_pad_template));
|
||||
gst_static_pad_template_get (&gst_gl_download_sink_pad_template));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_class_init (GstGLVideomakerClass* klass)
|
||||
gst_gl_download_class_init (GstGLDownloadClass* klass)
|
||||
{
|
||||
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->set_property = gst_gl_download_set_property;
|
||||
gobject_class->get_property = gst_gl_download_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_gl_download_transform_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_download_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_download_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_download_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_download_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size =
|
||||
gst_gl_videomaker_get_unit_size;
|
||||
gst_gl_download_get_unit_size;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_init (GstGLVideomaker* videomaker, GstGLVideomakerClass* klass)
|
||||
gst_gl_download_init (GstGLDownload* download, GstGLDownloadClass* klass)
|
||||
{
|
||||
gst_gl_videomaker_reset (videomaker);
|
||||
gst_gl_download_reset (download);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_set_property (GObject* object, guint prop_id,
|
||||
gst_gl_download_set_property (GObject* object, guint prop_id,
|
||||
const GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||
//GstGLDownload *download = GST_GL_DOWNLOAD (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
|
@ -137,10 +137,10 @@ gst_gl_videomaker_set_property (GObject* object, guint prop_id,
|
|||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_get_property (GObject* object, guint prop_id,
|
||||
gst_gl_download_get_property (GObject* object, guint prop_id,
|
||||
GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
//GstGLVideomaker *videomaker = GST_GL_VIDEOMAKER (object);
|
||||
//GstGLDownload *download = GST_GL_DOWNLOAD (object);
|
||||
|
||||
switch (prop_id) {
|
||||
default:
|
||||
|
@ -151,39 +151,39 @@ gst_gl_videomaker_get_property (GObject* object, guint prop_id,
|
|||
|
||||
|
||||
static void
|
||||
gst_gl_videomaker_reset (GstGLVideomaker* videomaker)
|
||||
gst_gl_download_reset (GstGLDownload* download)
|
||||
{
|
||||
if (videomaker->display)
|
||||
if (download->display)
|
||||
{
|
||||
g_object_unref (videomaker->display);
|
||||
videomaker->display = NULL;
|
||||
g_object_unref (download->display);
|
||||
download->display = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_start (GstBaseTransform* bt)
|
||||
gst_gl_download_start (GstBaseTransform* bt)
|
||||
{
|
||||
//GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
//GstGLDownload* download = GST_GL_DOWNLOAD (bt);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_stop (GstBaseTransform* bt)
|
||||
gst_gl_download_stop (GstBaseTransform* bt)
|
||||
{
|
||||
GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
GstGLDownload* download = GST_GL_DOWNLOAD (bt);
|
||||
|
||||
gst_gl_videomaker_reset (videomaker);
|
||||
gst_gl_download_reset (download);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GstCaps*
|
||||
gst_gl_videomaker_transform_caps (GstBaseTransform * bt,
|
||||
gst_gl_download_transform_caps (GstBaseTransform * bt,
|
||||
GstPadDirection direction, GstCaps* caps)
|
||||
{
|
||||
GstGLVideomaker* videomaker;
|
||||
GstGLDownload* download;
|
||||
GstStructure* structure;
|
||||
GstCaps *newcaps, *newothercaps;
|
||||
GstStructure* newstruct;
|
||||
|
@ -192,7 +192,7 @@ gst_gl_videomaker_transform_caps (GstBaseTransform * bt,
|
|||
const GValue* framerate_value;
|
||||
const GValue* par_value;
|
||||
|
||||
videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
download = GST_GL_DOWNLOAD (bt);
|
||||
|
||||
GST_ERROR ("transform caps %" GST_PTR_FORMAT, caps);
|
||||
|
||||
|
@ -236,18 +236,18 @@ gst_gl_videomaker_transform_caps (GstBaseTransform * bt,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||
gst_gl_download_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||
GstCaps* outcaps)
|
||||
{
|
||||
GstGLVideomaker* videomaker;
|
||||
GstGLDownload* download;
|
||||
gboolean ret;
|
||||
|
||||
videomaker = GST_GL_VIDEOMAKER (bt);
|
||||
download = GST_GL_DOWNLOAD (bt);
|
||||
|
||||
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, &download->video_format,
|
||||
&download->width, &download->height);
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
|
@ -259,7 +259,7 @@ gst_gl_videomaker_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_videomaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
gst_gl_download_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
guint* size)
|
||||
{
|
||||
gboolean ret;
|
||||
|
@ -288,27 +288,27 @@ gst_gl_videomaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_gl_videomaker_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
||||
gst_gl_download_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
||||
GstBuffer* outbuf)
|
||||
{
|
||||
GstGLVideomaker* videomaker = NULL;
|
||||
GstGLDownload* download = NULL;
|
||||
GstGLBuffer* gl_inbuf = GST_GL_BUFFER (inbuf);
|
||||
|
||||
videomaker = GST_GL_VIDEOMAKER (trans);
|
||||
download = GST_GL_DOWNLOAD (trans);
|
||||
|
||||
if (videomaker->display == NULL)
|
||||
if (download->display == NULL)
|
||||
{
|
||||
videomaker->display = g_object_ref (gl_inbuf->display);
|
||||
gst_gl_display_initDonwloadFBO (videomaker->display, videomaker->width, videomaker->height);
|
||||
download->display = g_object_ref (gl_inbuf->display);
|
||||
gst_gl_display_initDonwloadFBO (download->display, download->width, download->height);
|
||||
}
|
||||
else
|
||||
g_assert (videomaker->display == gl_inbuf->display);
|
||||
g_assert (download->display == gl_inbuf->display);
|
||||
|
||||
GST_DEBUG ("making video %p size %d",
|
||||
GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
||||
|
||||
//blocking call
|
||||
gst_gl_display_videoChanged(videomaker->display, videomaker->video_format,
|
||||
gst_gl_display_videoChanged(download->display, download->video_format,
|
||||
gl_inbuf->width, gl_inbuf->height, gl_inbuf->textureGL, GST_BUFFER_DATA (outbuf));
|
||||
|
||||
return GST_FLOW_OK;
|
|
@ -18,8 +18,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GST_GLVIDEOMAKER_H_
|
||||
#define _GST_GLVIDEOMAKER_H_
|
||||
#ifndef _GST_GLDOWNLOAD_H_
|
||||
#define _GST_GLDOWNLOAD_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstbasetransform.h>
|
||||
|
@ -29,17 +29,17 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_GL_VIDEOMAKER (gst_gl_videomaker_get_type())
|
||||
#define GST_GL_VIDEOMAKER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_VIDEOMAKER,GstGLVideomaker))
|
||||
#define GST_IS_GL_VIDEOMAKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_VIDEOMAKER))
|
||||
#define GST_GL_VIDEOMAKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_VIDEOMAKER,GstGLVideomakerClass))
|
||||
#define GST_IS_GL_VIDEOMAKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_VIDEOMAKER))
|
||||
#define GST_GL_VIDEOMAKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_VIDEOMAKER,GstGLVideomakerClass))
|
||||
#define GST_TYPE_GL_DOWNLOAD (gst_gl_download_get_type())
|
||||
#define GST_GL_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_DOWNLOAD,GstGLDownload))
|
||||
#define GST_IS_GL_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_DOWNLOAD))
|
||||
#define GST_GL_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_DOWNLOAD,GstGLDownloadClass))
|
||||
#define GST_IS_GL_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_DOWNLOAD))
|
||||
#define GST_GL_DOWNLOAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_DOWNLOAD,GstGLDownloadClass))
|
||||
|
||||
typedef struct _GstGLVideomaker GstGLVideomaker;
|
||||
typedef struct _GstGLVideomakerClass GstGLVideomakerClass;
|
||||
typedef struct _GstGLDownload GstGLDownload;
|
||||
typedef struct _GstGLDownloadClass GstGLDownloadClass;
|
||||
|
||||
struct _GstGLVideomaker
|
||||
struct _GstGLDownload
|
||||
{
|
||||
GstBaseTransform base_transform;
|
||||
|
||||
|
@ -49,13 +49,13 @@ struct _GstGLVideomaker
|
|||
gint height;
|
||||
};
|
||||
|
||||
struct _GstGLVideomakerClass
|
||||
struct _GstGLDownloadClass
|
||||
{
|
||||
GstBaseTransformClass base_transform_class;
|
||||
};
|
||||
|
||||
GType gst_gl_videomaker_get_type (void);
|
||||
GType gst_gl_download_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GST_GLVIDEOMAKER_H_ */
|
||||
#endif /* _GST_GLDOWNLOAD_H_ */
|
|
@ -22,20 +22,20 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "gstglgraphicmaker.h"
|
||||
#include "gstglupload.h"
|
||||
|
||||
|
||||
#define GST_CAT_DEFAULT gst_gl_graphicmaker_debug
|
||||
#define GST_CAT_DEFAULT gst_gl_upload_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
static const GstElementDetails element_details =
|
||||
GST_ELEMENT_DETAILS ("OpenGL graphic maker",
|
||||
GST_ELEMENT_DETAILS ("OpenGL upload",
|
||||
"Filter/Effect",
|
||||
"A from video to GL flow filter",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
|
||||
/* Source pad definition */
|
||||
static GstStaticPadTemplate gst_gl_graphicmaker_src_pad_template =
|
||||
static GstStaticPadTemplate gst_gl_upload_src_pad_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
|
@ -43,7 +43,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
|
|||
);
|
||||
|
||||
/* Source pad definition */
|
||||
static GstStaticPadTemplate gst_gl_graphicmaker_sink_pad_template =
|
||||
static GstStaticPadTemplate gst_gl_upload_sink_pad_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
|
@ -61,78 +61,78 @@ enum
|
|||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_graphicmaker_debug, "glgraphicmaker", 0, "glgraphicmaker element");
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_upload_debug, "glupload", 0, "glupload element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLGraphicmaker, gst_gl_graphicmaker, GstBaseTransform,
|
||||
GST_BOILERPLATE_FULL (GstGLUpload, gst_gl_upload, GstBaseTransform,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_graphicmaker_set_property (GObject* object, guint prop_id,
|
||||
static void gst_gl_upload_set_property (GObject* object, guint prop_id,
|
||||
const GValue* value, GParamSpec* pspec);
|
||||
static void gst_gl_graphicmaker_get_property (GObject* object, guint prop_id,
|
||||
static void gst_gl_upload_get_property (GObject* object, guint prop_id,
|
||||
GValue* value, GParamSpec* pspec);
|
||||
|
||||
static void gst_gl_graphicmaker_reset (GstGLGraphicmaker* graphicmaker);
|
||||
static gboolean gst_gl_graphicmaker_set_caps (GstBaseTransform* bt,
|
||||
static void gst_gl_upload_reset (GstGLUpload* upload);
|
||||
static gboolean gst_gl_upload_set_caps (GstBaseTransform* bt,
|
||||
GstCaps* incaps, GstCaps* outcaps);
|
||||
static GstCaps *gst_gl_graphicmaker_transform_caps (GstBaseTransform* bt,
|
||||
static GstCaps *gst_gl_upload_transform_caps (GstBaseTransform* bt,
|
||||
GstPadDirection direction, GstCaps* caps);
|
||||
static void gst_gl_graphicmaker_fixate_caps (GstBaseTransform* base, GstPadDirection direction,
|
||||
static void gst_gl_upload_fixate_caps (GstBaseTransform* base, GstPadDirection direction,
|
||||
GstCaps* caps, GstCaps* othercaps);
|
||||
static gboolean gst_gl_graphicmaker_start (GstBaseTransform* bt);
|
||||
static gboolean gst_gl_graphicmaker_stop (GstBaseTransform* bt);
|
||||
static GstFlowReturn gst_gl_graphicmaker_prepare_output_buffer (GstBaseTransform* trans,
|
||||
static gboolean gst_gl_upload_start (GstBaseTransform* bt);
|
||||
static gboolean gst_gl_upload_stop (GstBaseTransform* bt);
|
||||
static GstFlowReturn gst_gl_upload_prepare_output_buffer (GstBaseTransform* trans,
|
||||
GstBuffer* input, gint size, GstCaps* caps, GstBuffer** buf);
|
||||
static GstFlowReturn gst_gl_graphicmaker_transform (GstBaseTransform* trans,
|
||||
static GstFlowReturn gst_gl_upload_transform (GstBaseTransform* trans,
|
||||
GstBuffer* inbuf, GstBuffer * outbuf);
|
||||
static gboolean gst_gl_graphicmaker_get_unit_size (GstBaseTransform* trans,
|
||||
static gboolean gst_gl_upload_get_unit_size (GstBaseTransform* trans,
|
||||
GstCaps* caps, guint* size);
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_graphicmaker_base_init (gpointer klass)
|
||||
gst_gl_upload_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details (element_class, &element_details);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_graphicmaker_src_pad_template));
|
||||
gst_static_pad_template_get (&gst_gl_upload_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_graphicmaker_sink_pad_template));
|
||||
gst_static_pad_template_get (&gst_gl_upload_sink_pad_template));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_graphicmaker_class_init (GstGLGraphicmakerClass * klass)
|
||||
gst_gl_upload_class_init (GstGLUploadClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_graphicmaker_set_property;
|
||||
gobject_class->get_property = gst_gl_graphicmaker_get_property;
|
||||
gobject_class->set_property = gst_gl_upload_set_property;
|
||||
gobject_class->get_property = gst_gl_upload_get_property;
|
||||
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
gst_gl_graphicmaker_transform_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->fixate_caps = gst_gl_graphicmaker_fixate_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_graphicmaker_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_graphicmaker_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_graphicmaker_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_graphicmaker_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_graphicmaker_get_unit_size;
|
||||
gst_gl_upload_transform_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->fixate_caps = gst_gl_upload_fixate_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_upload_transform;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_upload_start;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_upload_stop;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_upload_set_caps;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_upload_get_unit_size;
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->prepare_output_buffer =
|
||||
gst_gl_graphicmaker_prepare_output_buffer;
|
||||
gst_gl_upload_prepare_output_buffer;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_graphicmaker_init (GstGLGraphicmaker* graphicmaker, GstGLGraphicmakerClass * klass)
|
||||
gst_gl_upload_init (GstGLUpload* upload, GstGLUploadClass * klass)
|
||||
{
|
||||
gst_gl_graphicmaker_reset (graphicmaker);
|
||||
gst_gl_upload_reset (upload);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_graphicmaker_set_property (GObject* object, guint prop_id,
|
||||
gst_gl_upload_set_property (GObject* object, guint prop_id,
|
||||
const GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
//GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (object);
|
||||
//GstGLUpload* upload = GST_GL_UPLOAD (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
|
@ -143,10 +143,10 @@ gst_gl_graphicmaker_set_property (GObject* object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_graphicmaker_get_property (GObject* object, guint prop_id,
|
||||
gst_gl_upload_get_property (GObject* object, guint prop_id,
|
||||
GValue* value, GParamSpec* pspec)
|
||||
{
|
||||
//GstGLGraphicmaker *graphicmaker = GST_GL_GRAPHICMAKER (object);
|
||||
//GstGLUpload *upload = GST_GL_UPLOAD (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
|
@ -157,38 +157,38 @@ gst_gl_graphicmaker_get_property (GObject* object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_graphicmaker_reset (GstGLGraphicmaker* graphicmaker)
|
||||
gst_gl_upload_reset (GstGLUpload* upload)
|
||||
{
|
||||
if (graphicmaker->display)
|
||||
if (upload->display)
|
||||
{
|
||||
g_object_unref (graphicmaker->display);
|
||||
graphicmaker->display = NULL;
|
||||
g_object_unref (upload->display);
|
||||
upload->display = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_graphicmaker_start (GstBaseTransform* bt)
|
||||
gst_gl_upload_start (GstBaseTransform* bt)
|
||||
{
|
||||
//GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (bt);
|
||||
//GstGLUpload* upload = GST_GL_UPLOAD (bt);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_graphicmaker_stop (GstBaseTransform* bt)
|
||||
gst_gl_upload_stop (GstBaseTransform* bt)
|
||||
{
|
||||
GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (bt);
|
||||
GstGLUpload* upload = GST_GL_UPLOAD (bt);
|
||||
|
||||
gst_gl_graphicmaker_reset (graphicmaker);
|
||||
gst_gl_upload_reset (upload);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GstCaps*
|
||||
gst_gl_graphicmaker_transform_caps (GstBaseTransform* bt,
|
||||
gst_gl_upload_transform_caps (GstBaseTransform* bt,
|
||||
GstPadDirection direction, GstCaps* caps)
|
||||
{
|
||||
//GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (bt);
|
||||
//GstGLUpload* upload = GST_GL_UPLOAD (bt);
|
||||
GstStructure* structure = gst_caps_get_structure (caps, 0);
|
||||
GstCaps* newcaps = NULL;
|
||||
const GValue* framerate_value = NULL;
|
||||
|
@ -231,7 +231,7 @@ gst_gl_graphicmaker_transform_caps (GstBaseTransform* bt,
|
|||
|
||||
/* from gst-plugins-base "videoscale" code */
|
||||
static void
|
||||
gst_gl_graphicmaker_fixate_caps (GstBaseTransform* base, GstPadDirection direction,
|
||||
gst_gl_upload_fixate_caps (GstBaseTransform* base, GstPadDirection direction,
|
||||
GstCaps* caps, GstCaps* othercaps)
|
||||
{
|
||||
GstStructure *ins, *outs;
|
||||
|
@ -371,10 +371,10 @@ gst_gl_graphicmaker_fixate_caps (GstBaseTransform* base, GstPadDirection directi
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_graphicmaker_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||
gst_gl_upload_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
||||
GstCaps* outcaps)
|
||||
{
|
||||
GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (bt);
|
||||
GstGLUpload* upload = GST_GL_UPLOAD (bt);
|
||||
gboolean ret = FALSE;
|
||||
GstVideoFormat video_format = GST_VIDEO_FORMAT_UNKNOWN;
|
||||
static gint glcontext_y = 0;
|
||||
|
@ -382,10 +382,10 @@ gst_gl_graphicmaker_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
|||
GST_DEBUG ("called with %" GST_PTR_FORMAT, incaps);
|
||||
|
||||
ret = gst_video_format_parse_caps (outcaps, &video_format,
|
||||
&graphicmaker->outWidth, &graphicmaker->outHeight);
|
||||
&upload->outWidth, &upload->outHeight);
|
||||
|
||||
ret |= gst_video_format_parse_caps (incaps, &graphicmaker->video_format,
|
||||
&graphicmaker->inWidth, &graphicmaker->inHeight);
|
||||
ret |= gst_video_format_parse_caps (incaps, &upload->video_format,
|
||||
&upload->inWidth, &upload->inHeight);
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
|
@ -393,19 +393,19 @@ gst_gl_graphicmaker_set_caps (GstBaseTransform* bt, GstCaps* incaps,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
graphicmaker->display = gst_gl_display_new ();
|
||||
upload->display = gst_gl_display_new ();
|
||||
|
||||
//init unvisible opengl context
|
||||
gst_gl_display_initGLContext (graphicmaker->display,
|
||||
50, glcontext_y++ * (graphicmaker->inHeight+50) + 50,
|
||||
graphicmaker->inWidth, graphicmaker->inHeight,
|
||||
graphicmaker->inWidth, graphicmaker->inHeight, 0, FALSE);
|
||||
gst_gl_display_initGLContext (upload->display,
|
||||
50, glcontext_y++ * (upload->inHeight+50) + 50,
|
||||
upload->inWidth, upload->inHeight,
|
||||
upload->inWidth, upload->inHeight, 0, FALSE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_graphicmaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
gst_gl_upload_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
||||
guint* size)
|
||||
{
|
||||
gboolean ret;
|
||||
|
@ -435,20 +435,20 @@ gst_gl_graphicmaker_get_unit_size (GstBaseTransform* trans, GstCaps* caps,
|
|||
}
|
||||
|
||||
static GstFlowReturn
|
||||
gst_gl_graphicmaker_prepare_output_buffer (GstBaseTransform* trans,
|
||||
gst_gl_upload_prepare_output_buffer (GstBaseTransform* trans,
|
||||
GstBuffer* input, gint size, GstCaps* caps, GstBuffer** buf)
|
||||
{
|
||||
GstGLGraphicmaker* graphicmaker;
|
||||
GstGLUpload* upload;
|
||||
GstGLBuffer* gl_outbuf;
|
||||
|
||||
graphicmaker = GST_GL_GRAPHICMAKER (trans);
|
||||
upload = GST_GL_UPLOAD (trans);
|
||||
|
||||
//blocking call
|
||||
gl_outbuf = gst_gl_buffer_new_from_video_format (graphicmaker->display,
|
||||
graphicmaker->video_format,
|
||||
graphicmaker->outWidth, graphicmaker->outHeight,
|
||||
graphicmaker->inWidth, graphicmaker->inHeight,
|
||||
graphicmaker->inWidth, graphicmaker->inHeight);
|
||||
gl_outbuf = gst_gl_buffer_new_from_video_format (upload->display,
|
||||
upload->video_format,
|
||||
upload->outWidth, upload->outHeight,
|
||||
upload->inWidth, upload->inHeight,
|
||||
upload->inWidth, upload->inHeight);
|
||||
*buf = GST_BUFFER (gl_outbuf);
|
||||
gst_buffer_set_caps (*buf, caps);
|
||||
|
||||
|
@ -457,19 +457,19 @@ gst_gl_graphicmaker_prepare_output_buffer (GstBaseTransform* trans,
|
|||
|
||||
|
||||
static GstFlowReturn
|
||||
gst_gl_graphicmaker_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
||||
gst_gl_upload_transform (GstBaseTransform* trans, GstBuffer* inbuf,
|
||||
GstBuffer* outbuf)
|
||||
{
|
||||
GstGLGraphicmaker* graphicmaker;
|
||||
GstGLUpload* upload;
|
||||
GstGLBuffer* gl_outbuf = GST_GL_BUFFER (outbuf);
|
||||
|
||||
graphicmaker = GST_GL_GRAPHICMAKER (trans);
|
||||
upload = GST_GL_UPLOAD (trans);
|
||||
|
||||
GST_DEBUG ("making graphic %p size %d",
|
||||
GST_BUFFER_DATA (inbuf), GST_BUFFER_SIZE (inbuf));
|
||||
|
||||
//blocking call
|
||||
gst_gl_display_textureChanged(graphicmaker->display, graphicmaker->video_format,
|
||||
gst_gl_display_textureChanged(upload->display, upload->video_format,
|
||||
gl_outbuf->texture, gl_outbuf->texture_u, gl_outbuf->texture_v,
|
||||
gl_outbuf->width, gl_outbuf->height, GST_BUFFER_DATA (inbuf), &gl_outbuf->textureGL);
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GST_GLGRAPHICMAKER_H_
|
||||
#define _GST_GLGRAPHICMAKER_H_
|
||||
#ifndef _GST_GLUPLOAD_H_
|
||||
#define _GST_GLUPLOAD_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstbasetransform.h>
|
||||
|
@ -29,18 +29,18 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_GL_GRAPHICMAKER (gst_gl_graphicmaker_get_type())
|
||||
#define GST_GL_GRAPHICMAKER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_GRAPHICMAKER,GstGLGraphicmaker))
|
||||
#define GST_IS_GL_GRAPHICMAKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_GRAPHICMAKER))
|
||||
#define GST_GL_GRAPHICMAKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_GRAPHICMAKER,GstGLGraphicmakerClass))
|
||||
#define GST_IS_GL_GRAPHICMAKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_GRAPHICMAKER))
|
||||
#define GST_GL_GRAPHICMAKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_GRAPHICMAKER,GstGLGraphicmakerClass))
|
||||
#define GST_TYPE_GL_UPLOAD (gst_gl_upload_get_type())
|
||||
#define GST_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_UPLOAD,GstGLUpload))
|
||||
#define GST_IS_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_UPLOAD))
|
||||
#define GST_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_UPLOAD,GstGLUploadClass))
|
||||
#define GST_IS_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_UPLOAD))
|
||||
#define GST_GL_UPLOAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_UPLOAD,GstGLUploadClass))
|
||||
|
||||
typedef struct _GstGLGraphicmaker GstGLGraphicmaker;
|
||||
typedef struct _GstGLGraphicmakerClass GstGLGraphicmakerClass;
|
||||
typedef struct _GstGLUpload GstGLUpload;
|
||||
typedef struct _GstGLUploadClass GstGLUploadClass;
|
||||
|
||||
|
||||
struct _GstGLGraphicmaker
|
||||
struct _GstGLUpload
|
||||
{
|
||||
GstBaseTransform base_transform;
|
||||
|
||||
|
@ -55,13 +55,13 @@ struct _GstGLGraphicmaker
|
|||
gint outHeight;
|
||||
};
|
||||
|
||||
struct _GstGLGraphicmakerClass
|
||||
struct _GstGLUploadClass
|
||||
{
|
||||
GstBaseTransformClass base_transform_class;
|
||||
};
|
||||
|
||||
GType gst_gl_graphicmaker_get_type (void);
|
||||
GType gst_gl_upload_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GST_GLGRAPHICMAKER_H_ */
|
||||
#endif /* _GST_GLUPLOAD_H_ */
|
|
@ -23,10 +23,10 @@
|
|||
#endif
|
||||
|
||||
#include "gstgltestsrc.h"
|
||||
#include "gstglgraphicmaker.h"
|
||||
#include "gstglupload.h"
|
||||
#include "gstglfiltercube.h"
|
||||
#include "gstglfilterapp.h"
|
||||
#include "gstglvideomaker.h"
|
||||
#include "gstgldownload.h"
|
||||
#include "gstglimagesink.h"
|
||||
#include "gstglcolorscale.h"
|
||||
|
||||
|
@ -47,8 +47,8 @@ plugin_init (GstPlugin * plugin)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gst_element_register (plugin, "glgraphicmaker",
|
||||
GST_RANK_NONE, GST_TYPE_GL_GRAPHICMAKER)) {
|
||||
if (!gst_element_register (plugin, "glupload",
|
||||
GST_RANK_NONE, GST_TYPE_GL_UPLOAD)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -62,8 +62,8 @@ plugin_init (GstPlugin * plugin)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gst_element_register (plugin, "glvideomaker",
|
||||
GST_RANK_NONE, GST_TYPE_GL_VIDEOMAKER)) {
|
||||
if (!gst_element_register (plugin, "gldownload",
|
||||
GST_RANK_NONE, GST_TYPE_GL_DOWNLOAD)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue