gstreamer/gst-libs/gst/gl/gstglbuffer.h
Julien Isorce 76fa1292f8 [069/906] add gstreamer license
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@435 93df14bb-0f41-7a43-8087-d3e2a2f0e464
2014-03-15 18:36:19 +01:00

74 lines
2.2 KiB
C

/*
* GStreamer
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _GST_GL_BUFFER_H_
#define _GST_GL_BUFFER_H_
#include <gst/gst.h>
#include <gst/video/video.h>
#include "gstgldisplay.h"
typedef struct _GstGLBuffer GstGLBuffer;
#define GST_TYPE_GL_BUFFER (gst_gl_buffer_get_type())
#define GST_IS_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BUFFER))
#define GST_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_BUFFER, GstGLBuffer))
struct _GstGLBuffer {
GstBuffer buffer;
GstGLDisplay *display;
GstVideoFormat video_format;
GLuint texture;
GLuint texture_u;
GLuint texture_v;
gint width;
gint height;
};
GType gst_gl_buffer_get_type (void);
#define gst_gl_buffer_ref(x) ((GstGLBuffer *)(gst_buffer_ref((GstBuffer *)(x))))
#define gst_gl_buffer_unref(x) (gst_buffer_unref((GstBuffer *)(x)))
GstGLBuffer* gst_gl_buffer_new_from_video_format (GstGLDisplay* display, GstVideoFormat format,
gint context_width, gint context_height,
gint width, gint height);
gint gst_gl_buffer_format_get_size (GstVideoFormat format, gint width, gint height);
gboolean gst_gl_buffer_format_parse_caps (GstCaps* caps, GstVideoFormat* format,
gint* width, gint* height);
#define GST_GL_VIDEO_CAPS \
"video/x-raw-gl," \
"width=(int)[1,1920]," \
"height=(int)[1,1080]," \
"pixel-aspect-ratio=(fraction)1/1," \
"framerate=(fraction)[0/1,100/1]"
#endif