vdpau: rename all files and objects from Vdpau to Vdp

This commit is contained in:
Carl-Anton Ingmarsson 2009-04-13 22:19:20 +02:00 committed by Jan Schmidt
parent d2efd275a4
commit 48143abdab
14 changed files with 289 additions and 294 deletions

View file

@ -1,14 +1,14 @@
plugin_LTLIBRARIES = libgstvdpau.la plugin_LTLIBRARIES = libgstvdpau.la
libgstvdpau_la_SOURCES = \ libgstvdpau_la_SOURCES = \
gstvdpaudevice.c \ gstvdpdevice.c \
gstvdpaudecoder.c \ gstvdpdecoder.c \
gstvdpaumpegdecoder.c \ gstvdpmpegdecoder.c \
mpegutil.c \ mpegutil.c \
gstvdpauvideoyuv.c \ gstvdpvideoyuv.c \
gstvdpauvideobuffer.c \ gstvdpvideobuffer.c \
gstvdpau.c \ gstvdp.c \
gstvdpauyuvvideo.c gstvdpyuvvideo.c
libgstvdpau_la_CFLAGS = $(GST_CFLAGS) $(X11_CFLAGS) -Ivdpau libgstvdpau_la_CFLAGS = $(GST_CFLAGS) $(X11_CFLAGS) -Ivdpau
libgstvdpau_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \ libgstvdpau_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \
@ -17,12 +17,12 @@ libgstvdpau_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstvdpau_la_LIBTOOLFLAGS = --tag=disable-static libgstvdpau_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = \ noinst_HEADERS = \
gstvdpaudevice.h \ gstvdpdevice.h \
gstvdpaudecoder.h \ gstvdpdecoder.h \
gstvdpaumpegdecoder.h \ gstvdpmpegdecoder.h \
mpegutil.h \ mpegutil.h \
gstvdpauvideoyuv.h \ gstvdpvideoyuv.h \
gstvdpauvideobuffer.h \ gstvdpvideobuffer.h \
gstvdpauyuvvideo.h gstvdpyuvvideo.h

View file

@ -5,9 +5,9 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstvdpaumpegdecoder.h" #include "gstvdpmpegdecoder.h"
#include "gstvdpauvideoyuv.h" #include "gstvdpvideoyuv.h"
#include "gstvdpauyuvvideo.h" #include "gstvdpyuvvideo.h"
static gboolean static gboolean
vdpau_init (GstPlugin * vdpaumpegdecoder) vdpau_init (GstPlugin * vdpaumpegdecoder)

View file

@ -25,10 +25,10 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstvdpaudecoder.h" #include "gstvdpdecoder.h"
GST_DEBUG_CATEGORY_STATIC (gst_vdpau_decoder_debug); GST_DEBUG_CATEGORY_STATIC (gst_vdp_decoder_debug);
#define GST_CAT_DEFAULT gst_vdpau_decoder_debug #define GST_CAT_DEFAULT gst_vdp_decoder_debug
/* Filter signals and args */ /* Filter signals and args */
enum enum
@ -50,20 +50,20 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("video/vdpau-video, " "chroma-type = (int) 0")); GST_STATIC_CAPS ("video/vdpau-video, " "chroma-type = (int) 0"));
#define DEBUG_INIT(bla) \ #define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_vdpau_decoder_debug, "vdpaudecoder", 0, "vdpaudecoder base class"); GST_DEBUG_CATEGORY_INIT (gst_vdp_decoder_debug, "vdpaudecoder", 0, "vdpaudecoder base class");
GST_BOILERPLATE_FULL (GstVdpauDecoder, gst_vdpau_decoder, GstElement, GST_BOILERPLATE_FULL (GstVdpDecoder, gst_vdp_decoder, GstElement,
GST_TYPE_ELEMENT, DEBUG_INIT); GST_TYPE_ELEMENT, DEBUG_INIT);
static void gst_vdpau_decoder_finalize (GObject * object); static void gst_vdp_decoder_finalize (GObject * object);
static void gst_vdpau_decoder_set_property (GObject * object, guint prop_id, static void gst_vdp_decoder_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_vdpau_decoder_get_property (GObject * object, guint prop_id, static void gst_vdp_decoder_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
GstFlowReturn GstFlowReturn
gst_vdpau_decoder_push_video_buffer (GstVdpauDecoder * dec, gst_vdp_decoder_push_video_buffer (GstVdpDecoder * dec,
GstVdpauVideoBuffer * buffer) GstVdpVideoBuffer * buffer)
{ {
GST_BUFFER_TIMESTAMP (buffer) = GST_BUFFER_TIMESTAMP (buffer) =
gst_util_uint64_scale_int (GST_SECOND * dec->frame_nr, gst_util_uint64_scale_int (GST_SECOND * dec->frame_nr,
@ -80,15 +80,15 @@ gst_vdpau_decoder_push_video_buffer (GstVdpauDecoder * dec,
} }
static GstStateChangeReturn static GstStateChangeReturn
gst_vdpau_decoder_change_state (GstElement * element, GstStateChange transition) gst_vdp_decoder_change_state (GstElement * element, GstStateChange transition)
{ {
GstVdpauDecoder *dec; GstVdpDecoder *dec;
dec = GST_VDPAU_DECODER (element); dec = GST_VDPAU_DECODER (element);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
dec->device = gst_vdpau_get_device (dec->display_name); dec->device = gst_vdp_get_device (dec->display_name);
break; break;
case GST_STATE_CHANGE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
g_object_unref (dec->device); g_object_unref (dec->device);
@ -102,10 +102,10 @@ gst_vdpau_decoder_change_state (GstElement * element, GstStateChange transition)
} }
static gboolean static gboolean
gst_vdpau_decoder_sink_set_caps (GstPad * pad, GstCaps * caps) gst_vdp_decoder_sink_set_caps (GstPad * pad, GstCaps * caps)
{ {
GstVdpauDecoder *dec = GST_VDPAU_DECODER (GST_OBJECT_PARENT (pad)); GstVdpDecoder *dec = GST_VDPAU_DECODER (GST_OBJECT_PARENT (pad));
GstVdpauDecoderClass *dec_class = GST_VDPAU_DECODER_GET_CLASS (dec); GstVdpDecoderClass *dec_class = GST_VDPAU_DECODER_GET_CLASS (dec);
GstCaps *src_caps, *new_caps; GstCaps *src_caps, *new_caps;
GstStructure *structure; GstStructure *structure;
@ -161,7 +161,7 @@ gst_vdpau_decoder_sink_set_caps (GstPad * pad, GstCaps * caps)
/* GObject vmethod implementations */ /* GObject vmethod implementations */
static void static void
gst_vdpau_decoder_base_init (gpointer klass) gst_vdp_decoder_base_init (gpointer klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
@ -177,7 +177,7 @@ gst_vdpau_decoder_base_init (gpointer klass)
/* initialize the vdpaudecoder's class */ /* initialize the vdpaudecoder's class */
static void static void
gst_vdpau_decoder_class_init (GstVdpauDecoderClass * klass) gst_vdp_decoder_class_init (GstVdpDecoderClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -185,9 +185,9 @@ gst_vdpau_decoder_class_init (GstVdpauDecoderClass * klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gobject_class->finalize = gst_vdpau_decoder_finalize; gobject_class->finalize = gst_vdp_decoder_finalize;
gobject_class->set_property = gst_vdpau_decoder_set_property; gobject_class->set_property = gst_vdp_decoder_set_property;
gobject_class->get_property = gst_vdpau_decoder_get_property; gobject_class->get_property = gst_vdp_decoder_get_property;
g_object_class_install_property (gobject_class, PROP_DISPLAY, g_object_class_install_property (gobject_class, PROP_DISPLAY,
g_param_spec_string ("display", "Display", "X Display name", g_param_spec_string ("display", "Display", "X Display name",
@ -197,11 +197,11 @@ gst_vdpau_decoder_class_init (GstVdpauDecoderClass * klass)
g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?", g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
FALSE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); FALSE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
gstelement_class->change_state = gst_vdpau_decoder_change_state; gstelement_class->change_state = gst_vdp_decoder_change_state;
} }
static void static void
gst_vdpau_decoder_init (GstVdpauDecoder * dec, GstVdpauDecoderClass * klass) gst_vdp_decoder_init (GstVdpDecoder * dec, GstVdpDecoderClass * klass)
{ {
dec->display_name = NULL; dec->display_name = NULL;
dec->device = NULL; dec->device = NULL;
@ -219,15 +219,15 @@ gst_vdpau_decoder_init (GstVdpauDecoder * dec, GstVdpauDecoderClass * klass)
dec->sink = gst_pad_new_from_template (gst_element_class_get_pad_template dec->sink = gst_pad_new_from_template (gst_element_class_get_pad_template
(GST_ELEMENT_CLASS (klass), "sink"), "sink"); (GST_ELEMENT_CLASS (klass), "sink"), "sink");
gst_pad_set_setcaps_function (dec->sink, gst_vdpau_decoder_sink_set_caps); gst_pad_set_setcaps_function (dec->sink, gst_vdp_decoder_sink_set_caps);
gst_element_add_pad (GST_ELEMENT (dec), dec->sink); gst_element_add_pad (GST_ELEMENT (dec), dec->sink);
gst_pad_set_active (dec->sink, TRUE); gst_pad_set_active (dec->sink, TRUE);
} }
static void static void
gst_vdpau_decoder_finalize (GObject * object) gst_vdp_decoder_finalize (GObject * object)
{ {
GstVdpauDecoder *dec = (GstVdpauDecoder *) object; GstVdpDecoder *dec = (GstVdpDecoder *) object;
if (dec->device) if (dec->device)
g_object_unref (dec->device); g_object_unref (dec->device);
@ -236,10 +236,10 @@ gst_vdpau_decoder_finalize (GObject * object)
} }
static void static void
gst_vdpau_decoder_set_property (GObject * object, guint prop_id, gst_vdp_decoder_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstVdpauDecoder *dec = GST_VDPAU_DECODER (object); GstVdpDecoder *dec = GST_VDPAU_DECODER (object);
switch (prop_id) { switch (prop_id) {
case PROP_DISPLAY: case PROP_DISPLAY:
@ -256,10 +256,10 @@ gst_vdpau_decoder_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_vdpau_decoder_get_property (GObject * object, guint prop_id, gst_vdp_decoder_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GstVdpauDecoder *dec = GST_VDPAU_DECODER (object); GstVdpDecoder *dec = GST_VDPAU_DECODER (object);
switch (prop_id) { switch (prop_id) {
case PROP_DISPLAY: case PROP_DISPLAY:

View file

@ -23,27 +23,27 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstvdpaudevice.h" #include "gstvdpdevice.h"
#include "gstvdpauvideobuffer.h" #include "gstvdpvideobuffer.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VDPAU_DECODER (gst_vdpau_decoder_get_type()) #define GST_TYPE_VDPAU_DECODER (gst_vdp_decoder_get_type())
#define GST_VDPAU_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_DECODER,GstVdpauDecoder)) #define GST_VDPAU_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_DECODER,GstVdpDecoder))
#define GST_VDPAU_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_DECODER,GstVdpauDecoderClass)) #define GST_VDPAU_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_DECODER,GstVdpDecoderClass))
#define GST_VDPAU_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_DECODER, GstVdpauDecoderClass)) #define GST_VDPAU_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_DECODER, GstVdpDecoderClass))
#define GST_IS_VDPAU_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_DECODER)) #define GST_IS_VDPAU_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_DECODER))
#define GST_IS_VDPAU_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_DECODER)) #define GST_IS_VDPAU_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_DECODER))
typedef struct _GstVdpauDecoder GstVdpauDecoder; typedef struct _GstVdpDecoder GstVdpDecoder;
typedef struct _GstVdpauDecoderClass GstVdpauDecoderClass; typedef struct _GstVdpDecoderClass GstVdpDecoderClass;
typedef struct _VdpauFunctions VdpauFunctions; typedef struct _VdpauFunctions VdpauFunctions;
struct _GstVdpauDecoder { struct _GstVdpDecoder {
GstElement element; GstElement element;
gchar *display_name; gchar *display_name;
GstVdpauDevice *device; GstVdpDevice *device;
GstPad *src; GstPad *src;
GstPad *sink; GstPad *sink;
@ -57,17 +57,17 @@ struct _GstVdpauDecoder {
gboolean silent; gboolean silent;
}; };
struct _GstVdpauDecoderClass { struct _GstVdpDecoderClass {
GstElementClass parent_class; GstElementClass parent_class;
gboolean (*set_caps) (GstVdpauDecoder *dec, GstCaps *caps); gboolean (*set_caps) (GstVdpDecoder *dec, GstCaps *caps);
}; };
GType gst_vdpau_decoder_get_type (void); GType gst_vdp_decoder_get_type (void);
gboolean gst_vdpau_decoder_push_video_buffer (GstVdpauDecoder * dec, gboolean gst_vdp_decoder_push_video_buffer (GstVdpDecoder * dec,
GstVdpauVideoBuffer *buffer); GstVdpVideoBuffer *buffer);
VdpVideoSurface gst_vdpau_decoder_create_video_surface (GstVdpauDecoder *dec); VdpVideoSurface gst_vdp_decoder_create_video_surface (GstVdpDecoder *dec);
G_END_DECLS G_END_DECLS

View file

@ -21,10 +21,10 @@
#include <vdpau/vdpau_x11.h> #include <vdpau/vdpau_x11.h>
#include <gst/gst.h> #include <gst/gst.h>
#include "gstvdpaudevice.h" #include "gstvdpdevice.h"
GST_DEBUG_CATEGORY_STATIC (gst_vdpau_device_debug); GST_DEBUG_CATEGORY_STATIC (gst_vdp_device_debug);
#define GST_CAT_DEFAULT gst_vdpau_device_debug #define GST_CAT_DEFAULT gst_vdp_device_debug
enum enum
{ {
@ -34,10 +34,10 @@ enum
G_DEFINE_TYPE (GstVdpauDevice, gst_vdpau_device, G_TYPE_OBJECT); G_DEFINE_TYPE (GstVdpDevice, gst_vdp_device, G_TYPE_OBJECT);
static void static void
gst_vdpau_device_init (GstVdpauDevice * device) gst_vdp_device_init (GstVdpDevice * device)
{ {
device->display_name = NULL; device->display_name = NULL;
device->display = NULL; device->display = NULL;
@ -45,21 +45,21 @@ gst_vdpau_device_init (GstVdpauDevice * device)
} }
static void static void
gst_vdpau_device_finalize (GObject * object) gst_vdp_device_finalize (GObject * object)
{ {
GstVdpauDevice *device = (GstVdpauDevice *) object; GstVdpDevice *device = (GstVdpDevice *) object;
device->vdp_device_destroy (device->device); device->vdp_device_destroy (device->device);
g_free (device->display_name); g_free (device->display_name);
G_OBJECT_CLASS (gst_vdpau_device_parent_class)->finalize (object); G_OBJECT_CLASS (gst_vdp_device_parent_class)->finalize (object);
} }
static void static void
gst_vdpau_device_constructed (GObject * object) gst_vdp_device_constructed (GObject * object)
{ {
GstVdpauDevice *device = (GstVdpauDevice *) object; GstVdpDevice *device = (GstVdpDevice *) object;
gint screen; gint screen;
VdpStatus status; VdpStatus status;
gint i; gint i;
@ -147,14 +147,14 @@ error:
} }
static void static void
gst_vdpau_device_set_property (GObject * object, guint prop_id, gst_vdp_device_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstVdpauDevice *device; GstVdpDevice *device;
g_return_if_fail (GST_IS_VDPAU_DEVICE (object)); g_return_if_fail (GST_IS_VDPAU_DEVICE (object));
device = (GstVdpauDevice *) object; device = (GstVdpDevice *) object;
switch (prop_id) { switch (prop_id) {
case PROP_DISPLAY: case PROP_DISPLAY:
@ -167,14 +167,14 @@ gst_vdpau_device_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_vdpau_device_get_property (GObject * object, guint prop_id, GValue * value, gst_vdp_device_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec) GParamSpec * pspec)
{ {
GstVdpauDevice *device; GstVdpDevice *device;
g_return_if_fail (GST_IS_VDPAU_DEVICE (object)); g_return_if_fail (GST_IS_VDPAU_DEVICE (object));
device = (GstVdpauDevice *) object; device = (GstVdpDevice *) object;
switch (prop_id) { switch (prop_id) {
case PROP_DISPLAY: case PROP_DISPLAY:
@ -187,14 +187,14 @@ gst_vdpau_device_get_property (GObject * object, guint prop_id, GValue * value,
} }
static void static void
gst_vdpau_device_class_init (GstVdpauDeviceClass * klass) gst_vdp_device_class_init (GstVdpDeviceClass * klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = gst_vdpau_device_constructed; object_class->constructed = gst_vdp_device_constructed;
object_class->finalize = gst_vdpau_device_finalize; object_class->finalize = gst_vdp_device_finalize;
object_class->get_property = gst_vdpau_device_get_property; object_class->get_property = gst_vdp_device_get_property;
object_class->set_property = gst_vdpau_device_set_property; object_class->set_property = gst_vdp_device_set_property;
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
@ -204,14 +204,14 @@ gst_vdpau_device_class_init (GstVdpauDeviceClass * klass)
"X Display Name", "X Display Name",
"", G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); "", G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
GST_DEBUG_CATEGORY_INIT (gst_vdpau_device_debug, "vdpaudevice", GST_DEBUG_CATEGORY_INIT (gst_vdp_device_debug, "vdpaudevice",
0, "vdpaudevice"); 0, "vdpaudevice");
} }
GstVdpauDevice * GstVdpDevice *
gst_vdpau_device_new (const gchar * display_name) gst_vdp_device_new (const gchar * display_name)
{ {
GstVdpauDevice *device; GstVdpDevice *device;
device = g_object_new (GST_TYPE_VDPAU_DEVICE, "display", display_name); device = g_object_new (GST_TYPE_VDPAU_DEVICE, "display", display_name);
@ -240,12 +240,12 @@ create_devices_hash (gpointer data)
return g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); return g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
} }
GstVdpauDevice * GstVdpDevice *
gst_vdpau_get_device (const gchar * display_name) gst_vdp_get_device (const gchar * display_name)
{ {
static GOnce my_once = G_ONCE_INIT; static GOnce my_once = G_ONCE_INIT;
GHashTable *devices_hash; GHashTable *devices_hash;
GstVdpauDevice *device; GstVdpDevice *device;
g_once (&my_once, create_devices_hash, NULL); g_once (&my_once, create_devices_hash, NULL);
devices_hash = my_once.retval; devices_hash = my_once.retval;
@ -256,7 +256,7 @@ gst_vdpau_get_device (const gchar * display_name)
device = g_hash_table_lookup (devices_hash, ""); device = g_hash_table_lookup (devices_hash, "");
if (!device) { if (!device) {
device = gst_vdpau_device_new (display_name); device = gst_vdp_device_new (display_name);
g_object_weak_ref (G_OBJECT (device), device_destroyed_cb, devices_hash); g_object_weak_ref (G_OBJECT (device), device_destroyed_cb, devices_hash);
if (display_name) if (display_name)
g_hash_table_insert (devices_hash, g_strdup (display_name), device); g_hash_table_insert (devices_hash, g_strdup (display_name), device);

View file

@ -28,22 +28,22 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VDPAU_DEVICE (gst_vdpau_device_get_type ()) #define GST_TYPE_VDPAU_DEVICE (gst_vdp_device_get_type ())
#define GST_VDPAU_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VDPAU_DEVICE, GstVdpauDevice)) #define GST_VDPAU_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VDPAU_DEVICE, GstVdpDevice))
#define GST_VDPAU_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VDPAU_DEVICE, GstVdpauDeviceClass)) #define GST_VDPAU_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VDPAU_DEVICE, GstVdpDeviceClass))
#define GST_IS_VDPAU_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VDPAU_DEVICE)) #define GST_IS_VDPAU_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VDPAU_DEVICE))
#define GST_IS_VDPAU_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VDPAU_DEVICE)) #define GST_IS_VDPAU_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VDPAU_DEVICE))
#define GST_VDPAU_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_DEVICE, GstVdpauDeviceClass)) #define GST_VDPAU_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_DEVICE, GstVdpDeviceClass))
typedef struct _GstVdpauDeviceClass GstVdpauDeviceClass; typedef struct _GstVdpDeviceClass GstVdpDeviceClass;
typedef struct _GstVdpauDevice GstVdpauDevice; typedef struct _GstVdpDevice GstVdpDevice;
struct _GstVdpauDeviceClass struct _GstVdpDeviceClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
}; };
struct _GstVdpauDevice struct _GstVdpDevice
{ {
GObject object; GObject object;
@ -121,11 +121,11 @@ static const VdpauFormats formats[N_FORMATS] = {
} }
}; };
GType gst_vdpau_device_get_type (void) G_GNUC_CONST; GType gst_vdp_device_get_type (void) G_GNUC_CONST;
GstVdpauDevice *gst_vdpau_device_new (const gchar *display_name); GstVdpDevice *gst_vdp_device_new (const gchar *display_name);
GstVdpauDevice *gst_vdpau_get_device (const gchar *display_name); GstVdpDevice *gst_vdp_get_device (const gchar *display_name);
G_END_DECLS G_END_DECLS

View file

@ -39,10 +39,10 @@
#include <string.h> #include <string.h>
#include "mpegutil.h" #include "mpegutil.h"
#include "gstvdpaumpegdecoder.h" #include "gstvdpmpegdecoder.h"
GST_DEBUG_CATEGORY_STATIC (gst_vdpau_mpeg_decoder_debug); GST_DEBUG_CATEGORY_STATIC (gst_vdp_mpeg_decoder_debug);
#define GST_CAT_DEFAULT gst_vdpau_mpeg_decoder_debug #define GST_CAT_DEFAULT gst_vdp_mpeg_decoder_debug
/* Filter signals and args */ /* Filter signals and args */
enum enum
@ -68,27 +68,27 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
); );
#define DEBUG_INIT(bla) \ #define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_vdpau_mpeg_decoder_debug, "vdpaumpegdecoder", 0, "VDPAU powered mpeg decoder"); GST_DEBUG_CATEGORY_INIT (gst_vdp_mpeg_decoder_debug, "vdpaumpegdecoder", 0, "VDPAU powered mpeg decoder");
GST_BOILERPLATE_FULL (GstVdpauMpegDecoder, gst_vdpau_mpeg_decoder, GST_BOILERPLATE_FULL (GstVdpMpegDecoder, gst_vdp_mpeg_decoder,
GstVdpauDecoder, GST_TYPE_VDPAU_DECODER, DEBUG_INIT); GstVdpDecoder, GST_TYPE_VDPAU_DECODER, DEBUG_INIT);
static void gst_vdpau_mpeg_decoder_finalize (GObject * object); static void gst_vdp_mpeg_decoder_finalize (GObject * object);
static void gst_vdpau_mpeg_decoder_set_property (GObject * object, static void gst_vdp_mpeg_decoder_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_vdpau_mpeg_decoder_get_property (GObject * object, static void gst_vdp_mpeg_decoder_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); guint prop_id, GValue * value, GParamSpec * pspec);
static gboolean static gboolean
gst_vdpau_mpeg_decoder_set_caps (GstVdpauDecoder * dec, GstCaps * caps) gst_vdp_mpeg_decoder_set_caps (GstVdpDecoder * dec, GstCaps * caps)
{ {
GstVdpauMpegDecoder *mpeg_dec; GstVdpMpegDecoder *mpeg_dec;
GstStructure *structure; GstStructure *structure;
const GValue *value; const GValue *value;
GstBuffer *codec_data; GstBuffer *codec_data;
MPEGSeqHdr hdr = { 0, }; MPEGSeqHdr hdr = { 0, };
VdpDecoderProfile profile; VdpDecoderProfile profile;
GstVdpauDevice *device; GstVdpDevice *device;
VdpStatus status; VdpStatus status;
mpeg_dec = GST_VDPAU_MPEG_DECODER (dec); mpeg_dec = GST_VDPAU_MPEG_DECODER (dec);
@ -132,13 +132,13 @@ gst_vdpau_mpeg_decoder_set_caps (GstVdpauDecoder * dec, GstCaps * caps)
} }
static GstFlowReturn static GstFlowReturn
gst_vdpau_mpeg_decoder_decode (GstVdpauMpegDecoder * mpeg_dec) gst_vdp_mpeg_decoder_decode (GstVdpMpegDecoder * mpeg_dec)
{ {
GstVdpauDecoder *dec; GstVdpDecoder *dec;
GstBuffer *buffer; GstBuffer *buffer;
GstVdpauVideoBuffer *outbuf; GstVdpVideoBuffer *outbuf;
VdpVideoSurface surface; VdpVideoSurface surface;
GstVdpauDevice *device; GstVdpDevice *device;
VdpBitstreamBuffer vbit[1]; VdpBitstreamBuffer vbit[1];
VdpStatus status; VdpStatus status;
GstFlowReturn ret; GstFlowReturn ret;
@ -148,7 +148,7 @@ gst_vdpau_mpeg_decoder_decode (GstVdpauMpegDecoder * mpeg_dec)
buffer = gst_adapter_take_buffer (mpeg_dec->adapter, buffer = gst_adapter_take_buffer (mpeg_dec->adapter,
gst_adapter_available (mpeg_dec->adapter)); gst_adapter_available (mpeg_dec->adapter));
outbuf = gst_vdpau_video_buffer_new (dec->device, VDP_CHROMA_TYPE_420, outbuf = gst_vdp_video_buffer_new (dec->device, VDP_CHROMA_TYPE_420,
dec->width, dec->height); dec->width, dec->height);
surface = outbuf->surface; surface = outbuf->surface;
@ -181,7 +181,7 @@ gst_vdpau_mpeg_decoder_decode (GstVdpauMpegDecoder * mpeg_dec)
gst_buffer_ref (GST_BUFFER (outbuf)); gst_buffer_ref (GST_BUFFER (outbuf));
ret = gst_vdpau_decoder_push_video_buffer (GST_VDPAU_DECODER (mpeg_dec), ret = gst_vdp_decoder_push_video_buffer (GST_VDPAU_DECODER (mpeg_dec),
outbuf); outbuf);
if (mpeg_dec->vdp_info.forward_reference != VDP_INVALID_HANDLE) if (mpeg_dec->vdp_info.forward_reference != VDP_INVALID_HANDLE)
@ -194,10 +194,10 @@ gst_vdpau_mpeg_decoder_decode (GstVdpauMpegDecoder * mpeg_dec)
} }
static gboolean static gboolean
gst_vdpau_mpeg_decoder_parse_picture_coding (GstVdpauMpegDecoder * mpeg_dec, gst_vdp_mpeg_decoder_parse_picture_coding (GstVdpMpegDecoder * mpeg_dec,
guint8 * data, guint8 * end) guint8 * data, guint8 * end)
{ {
GstVdpauDecoder *dec; GstVdpDecoder *dec;
MPEGPictureExt pic_ext; MPEGPictureExt pic_ext;
VdpPictureInfoMPEG1Or2 *info; VdpPictureInfoMPEG1Or2 *info;
@ -223,10 +223,10 @@ gst_vdpau_mpeg_decoder_parse_picture_coding (GstVdpauMpegDecoder * mpeg_dec,
} }
static gboolean static gboolean
gst_vdpau_mpeg_decoder_parse_sequence (GstVdpauMpegDecoder * mpeg_dec, gst_vdp_mpeg_decoder_parse_sequence (GstVdpMpegDecoder * mpeg_dec,
guint8 * data, guint8 * end) guint8 * data, guint8 * end)
{ {
GstVdpauDecoder *dec; GstVdpDecoder *dec;
MPEGSeqHdr hdr; MPEGSeqHdr hdr;
dec = GST_VDPAU_DECODER (mpeg_dec); dec = GST_VDPAU_DECODER (mpeg_dec);
@ -243,10 +243,10 @@ gst_vdpau_mpeg_decoder_parse_sequence (GstVdpauMpegDecoder * mpeg_dec,
} }
static gboolean static gboolean
gst_vdpau_mpeg_decoder_parse_picture (GstVdpauMpegDecoder * mpeg_dec, gst_vdp_mpeg_decoder_parse_picture (GstVdpMpegDecoder * mpeg_dec,
guint8 * data, guint8 * end) guint8 * data, guint8 * end)
{ {
GstVdpauDecoder *dec; GstVdpDecoder *dec;
MPEGPictureHdr pic_hdr; MPEGPictureHdr pic_hdr;
dec = GST_VDPAU_DECODER (mpeg_dec); dec = GST_VDPAU_DECODER (mpeg_dec);
@ -278,7 +278,7 @@ gst_vdpau_mpeg_decoder_parse_picture (GstVdpauMpegDecoder * mpeg_dec,
} }
static gboolean static gboolean
gst_vdpau_mpeg_decoder_parse_gop (GstVdpauMpegDecoder * mpeg_dec, guint8 * data, gst_vdp_mpeg_decoder_parse_gop (GstVdpMpegDecoder * mpeg_dec, guint8 * data,
guint8 * end) guint8 * end)
{ {
MPEGPictureGOP gop; MPEGPictureGOP gop;
@ -290,7 +290,7 @@ gst_vdpau_mpeg_decoder_parse_gop (GstVdpauMpegDecoder * mpeg_dec, guint8 * data,
} }
static gboolean static gboolean
gst_vdpau_mpeg_decoder_parse_quant_matrix (GstVdpauMpegDecoder * mpeg_dec, gst_vdp_mpeg_decoder_parse_quant_matrix (GstVdpMpegDecoder * mpeg_dec,
guint8 * data, guint8 * end) guint8 * data, guint8 * end)
{ {
MPEGQuantMatrix qm; MPEGQuantMatrix qm;
@ -306,9 +306,9 @@ gst_vdpau_mpeg_decoder_parse_quant_matrix (GstVdpauMpegDecoder * mpeg_dec,
} }
static GstFlowReturn static GstFlowReturn
gst_vdpau_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
{ {
GstVdpauMpegDecoder *mpeg_dec; GstVdpMpegDecoder *mpeg_dec;
guint8 *data, *end; guint8 *data, *end;
guint32 sync_word = 0xffffffff; guint32 sync_word = 0xffffffff;
@ -345,22 +345,21 @@ gst_vdpau_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
case MPEG_PACKET_PICTURE: case MPEG_PACKET_PICTURE:
GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_PICTURE"); GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_PICTURE");
if (mpeg_dec->vdp_info.slice_count > 0 && mpeg_dec->want_slice) { if (mpeg_dec->vdp_info.slice_count > 0 && mpeg_dec->want_slice) {
if (gst_vdpau_mpeg_decoder_decode (mpeg_dec) != GST_FLOW_OK) if (gst_vdp_mpeg_decoder_decode (mpeg_dec) != GST_FLOW_OK)
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
gst_vdpau_mpeg_decoder_parse_picture (mpeg_dec, packet_start, gst_vdp_mpeg_decoder_parse_picture (mpeg_dec, packet_start, packet_end);
packet_end);
break; break;
case MPEG_PACKET_SEQUENCE: case MPEG_PACKET_SEQUENCE:
GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_SEQUENCE"); GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_SEQUENCE");
gst_vdpau_mpeg_decoder_parse_sequence (mpeg_dec, packet_start, gst_vdp_mpeg_decoder_parse_sequence (mpeg_dec, packet_start,
packet_end); packet_end);
break; break;
case MPEG_PACKET_EXTENSION: case MPEG_PACKET_EXTENSION:
GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_EXTENSION"); GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_EXTENSION");
switch (read_bits (data + 1, 0, 4)) { switch (read_bits (data + 1, 0, 4)) {
case MPEG_PACKET_EXT_PICTURE_CODING: case MPEG_PACKET_EXT_PICTURE_CODING:
gst_vdpau_mpeg_decoder_parse_picture_coding (mpeg_dec, packet_start, gst_vdp_mpeg_decoder_parse_picture_coding (mpeg_dec, packet_start,
packet_end); packet_end);
break; break;
default: default:
@ -369,12 +368,12 @@ gst_vdpau_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
break; break;
case MPEG_PACKET_EXT_QUANT_MATRIX: case MPEG_PACKET_EXT_QUANT_MATRIX:
GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_EXT_QUANT_MATRIX"); GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_EXT_QUANT_MATRIX");
gst_vdpau_mpeg_decoder_parse_quant_matrix (mpeg_dec, packet_start, gst_vdp_mpeg_decoder_parse_quant_matrix (mpeg_dec, packet_start,
packet_end); packet_end);
break; break;
case MPEG_PACKET_GOP: case MPEG_PACKET_GOP:
GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_GOP"); GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_GOP");
gst_vdpau_mpeg_decoder_parse_gop (mpeg_dec, packet_start, packet_end); gst_vdp_mpeg_decoder_parse_gop (mpeg_dec, packet_start, packet_end);
break; break;
default: default:
break; break;
@ -387,7 +386,7 @@ gst_vdpau_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer)
/* GObject vmethod implementations */ /* GObject vmethod implementations */
static void static void
gst_vdpau_mpeg_decoder_base_init (gpointer gclass) gst_vdp_mpeg_decoder_base_init (gpointer gclass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
@ -403,25 +402,25 @@ gst_vdpau_mpeg_decoder_base_init (gpointer gclass)
/* initialize the vdpaumpegdecoder's class */ /* initialize the vdpaumpegdecoder's class */
static void static void
gst_vdpau_mpeg_decoder_class_init (GstVdpauMpegDecoderClass * klass) gst_vdp_mpeg_decoder_class_init (GstVdpMpegDecoderClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstVdpauDecoderClass *vdpaudec_class; GstVdpDecoderClass *vdpaudec_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
vdpaudec_class = (GstVdpauDecoderClass *) klass; vdpaudec_class = (GstVdpDecoderClass *) klass;
gobject_class->finalize = gst_vdpau_mpeg_decoder_finalize; gobject_class->finalize = gst_vdp_mpeg_decoder_finalize;
gobject_class->set_property = gst_vdpau_mpeg_decoder_set_property; gobject_class->set_property = gst_vdp_mpeg_decoder_set_property;
gobject_class->get_property = gst_vdpau_mpeg_decoder_get_property; gobject_class->get_property = gst_vdp_mpeg_decoder_get_property;
vdpaudec_class->set_caps = gst_vdpau_mpeg_decoder_set_caps; vdpaudec_class->set_caps = gst_vdp_mpeg_decoder_set_caps;
} }
static void static void
gst_vdpau_mpeg_decoder_init_info (VdpPictureInfoMPEG1Or2 * vdp_info) gst_vdp_mpeg_decoder_init_info (VdpPictureInfoMPEG1Or2 * vdp_info)
{ {
vdp_info->forward_reference = VDP_INVALID_HANDLE; vdp_info->forward_reference = VDP_INVALID_HANDLE;
vdp_info->backward_reference = VDP_INVALID_HANDLE; vdp_info->backward_reference = VDP_INVALID_HANDLE;
@ -434,33 +433,33 @@ gst_vdpau_mpeg_decoder_init_info (VdpPictureInfoMPEG1Or2 * vdp_info)
} }
static void static void
gst_vdpau_mpeg_decoder_init (GstVdpauMpegDecoder * mpeg_dec, gst_vdp_mpeg_decoder_init (GstVdpMpegDecoder * mpeg_dec,
GstVdpauMpegDecoderClass * gclass) GstVdpMpegDecoderClass * gclass)
{ {
GstVdpauDecoder *dec; GstVdpDecoder *dec;
dec = GST_VDPAU_DECODER (mpeg_dec); dec = GST_VDPAU_DECODER (mpeg_dec);
mpeg_dec->decoder = VDP_INVALID_HANDLE; mpeg_dec->decoder = VDP_INVALID_HANDLE;
gst_vdpau_mpeg_decoder_init_info (&mpeg_dec->vdp_info); gst_vdp_mpeg_decoder_init_info (&mpeg_dec->vdp_info);
mpeg_dec->adapter = gst_adapter_new (); mpeg_dec->adapter = gst_adapter_new ();
mpeg_dec->want_slice = FALSE; mpeg_dec->want_slice = FALSE;
gst_pad_set_chain_function (dec->sink, gst_vdpau_mpeg_decoder_chain); gst_pad_set_chain_function (dec->sink, gst_vdp_mpeg_decoder_chain);
} }
static void static void
gst_vdpau_mpeg_decoder_finalize (GObject * object) gst_vdp_mpeg_decoder_finalize (GObject * object)
{ {
GstVdpauMpegDecoder *mpeg_dec = (GstVdpauMpegDecoder *) object; GstVdpMpegDecoder *mpeg_dec = (GstVdpMpegDecoder *) object;
g_object_unref (mpeg_dec->adapter); g_object_unref (mpeg_dec->adapter);
} }
static void static void
gst_vdpau_mpeg_decoder_set_property (GObject * object, guint prop_id, gst_vdp_mpeg_decoder_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
switch (prop_id) { switch (prop_id) {
@ -471,7 +470,7 @@ gst_vdpau_mpeg_decoder_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_vdpau_mpeg_decoder_get_property (GObject * object, guint prop_id, gst_vdp_mpeg_decoder_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
switch (prop_id) { switch (prop_id) {

View file

@ -24,22 +24,22 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstadapter.h> #include <gst/base/gstadapter.h>
#include "gstvdpaudecoder.h" #include "gstvdpdecoder.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VDPAU_MPEG_DECODER (gst_vdpau_mpeg_decoder_get_type()) #define GST_TYPE_VDPAU_MPEG_DECODER (gst_vdp_mpeg_decoder_get_type())
#define GST_VDPAU_MPEG_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_MPEG_DECODER,GstVdpauMpegDecoder)) #define GST_VDPAU_MPEG_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_MPEG_DECODER,GstVdpMpegDecoder))
#define GST_VDPAU_MPEG_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_MPEG_DECODER,GstVdpauMpegDecoderClass)) #define GST_VDPAU_MPEG_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_MPEG_DECODER,GstVdpMpegDecoderClass))
#define GST_IS_VDPAU_MPEG_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_MPEG_DECODER)) #define GST_IS_VDPAU_MPEG_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_MPEG_DECODER))
#define GST_IS_VDPAU_MPEG_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_MPEG_DECODER)) #define GST_IS_VDPAU_MPEG_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_MPEG_DECODER))
typedef struct _GstVdpauMpegDecoder GstVdpauMpegDecoder; typedef struct _GstVdpMpegDecoder GstVdpMpegDecoder;
typedef struct _GstVdpauMpegDecoderClass GstVdpauMpegDecoderClass; typedef struct _GstVdpMpegDecoderClass GstVdpMpegDecoderClass;
struct _GstVdpauMpegDecoder struct _GstVdpMpegDecoder
{ {
GstVdpauDecoder dec; GstVdpDecoder dec;
gint version; gint version;
@ -53,12 +53,12 @@ struct _GstVdpauMpegDecoder
gint slices; gint slices;
}; };
struct _GstVdpauMpegDecoderClass struct _GstVdpMpegDecoderClass
{ {
GstVdpauDecoderClass parent_class; GstVdpDecoderClass parent_class;
}; };
GType gst_vdpau_mpeg_decoder_get_type (void); GType gst_vdp_mpeg_decoder_get_type (void);
G_END_DECLS G_END_DECLS

View file

@ -22,14 +22,14 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gstvdpauvideobuffer.h" #include "gstvdpvideobuffer.h"
static GObjectClass *gst_vdpau_video_buffer_parent_class; static GObjectClass *gst_vdp_video_buffer_parent_class;
static void static void
gst_vdpau_video_buffer_finalize (GstVdpauVideoBuffer * buffer) gst_vdp_video_buffer_finalize (GstVdpVideoBuffer * buffer)
{ {
GstVdpauDevice *device = buffer->device; GstVdpDevice *device = buffer->device;
VdpStatus status; VdpStatus status;
status = device->vdp_video_surface_destroy (buffer->surface); status = device->vdp_video_surface_destroy (buffer->surface);
@ -40,59 +40,59 @@ gst_vdpau_video_buffer_finalize (GstVdpauVideoBuffer * buffer)
g_object_unref (buffer->device); g_object_unref (buffer->device);
GST_MINI_OBJECT_CLASS (gst_vdpau_video_buffer_parent_class)->finalize GST_MINI_OBJECT_CLASS (gst_vdp_video_buffer_parent_class)->finalize
(GST_MINI_OBJECT (buffer)); (GST_MINI_OBJECT (buffer));
} }
static void static void
gst_vdpau_video_buffer_init (GstVdpauVideoBuffer * buffer, gpointer g_class) gst_vdp_video_buffer_init (GstVdpVideoBuffer * buffer, gpointer g_class)
{ {
buffer->device = NULL; buffer->device = NULL;
buffer->surface = VDP_INVALID_HANDLE; buffer->surface = VDP_INVALID_HANDLE;
} }
static void static void
gst_vdpau_video_buffer_class_init (gpointer g_class, gpointer class_data) gst_vdp_video_buffer_class_init (gpointer g_class, gpointer class_data)
{ {
GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class); GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
gst_vdpau_video_buffer_parent_class = g_type_class_peek_parent (g_class); gst_vdp_video_buffer_parent_class = g_type_class_peek_parent (g_class);
mini_object_class->finalize = (GstMiniObjectFinalizeFunction) mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
gst_vdpau_video_buffer_finalize; gst_vdp_video_buffer_finalize;
} }
GType GType
gst_vdpau_video_buffer_get_type (void) gst_vdp_video_buffer_get_type (void)
{ {
static GType _gst_vdpau_video_buffer_type; static GType _gst_vdp_video_buffer_type;
if (G_UNLIKELY (_gst_vdpau_video_buffer_type == 0)) { if (G_UNLIKELY (_gst_vdp_video_buffer_type == 0)) {
static const GTypeInfo info = { static const GTypeInfo info = {
sizeof (GstBufferClass), sizeof (GstBufferClass),
NULL, NULL,
NULL, NULL,
gst_vdpau_video_buffer_class_init, gst_vdp_video_buffer_class_init,
NULL, NULL,
NULL, NULL,
sizeof (GstVdpauVideoBuffer), sizeof (GstVdpVideoBuffer),
0, 0,
(GInstanceInitFunc) gst_vdpau_video_buffer_init, (GInstanceInitFunc) gst_vdp_video_buffer_init,
NULL NULL
}; };
_gst_vdpau_video_buffer_type = g_type_register_static (GST_TYPE_BUFFER, _gst_vdp_video_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
"GstVdpauVideoBuffer", &info, 0); "GstVdpVideoBuffer", &info, 0);
} }
return _gst_vdpau_video_buffer_type; return _gst_vdp_video_buffer_type;
} }
GstVdpauVideoBuffer * GstVdpVideoBuffer *
gst_vdpau_video_buffer_new (GstVdpauDevice * device, VdpChromaType chroma_type, gst_vdp_video_buffer_new (GstVdpDevice * device, VdpChromaType chroma_type,
gint width, gint height) gint width, gint height)
{ {
GstVdpauVideoBuffer *buffer; GstVdpVideoBuffer *buffer;
VdpStatus status; VdpStatus status;
VdpVideoSurface surface; VdpVideoSurface surface;
@ -105,7 +105,7 @@ gst_vdpau_video_buffer_new (GstVdpauDevice * device, VdpChromaType chroma_type,
} }
buffer = buffer =
(GstVdpauVideoBuffer *) gst_mini_object_new (GST_TYPE_VDPAU_VIDEO_BUFFER); (GstVdpVideoBuffer *) gst_mini_object_new (GST_TYPE_VDPAU_VIDEO_BUFFER);
buffer->device = g_object_ref (device); buffer->device = g_object_ref (device);
buffer->surface = surface; buffer->surface = surface;

View file

@ -24,27 +24,27 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstvdpaudevice.h" #include "gstvdpdevice.h"
#include "gstvdpauvideobuffer.h" #include "gstvdpvideobuffer.h"
typedef struct _GstVdpauVideoBuffer GstVdpauVideoBuffer; typedef struct _GstVdpVideoBuffer GstVdpVideoBuffer;
#define GST_TYPE_VDPAU_VIDEO_BUFFER (gst_vdpau_video_buffer_get_type()) #define GST_TYPE_VDPAU_VIDEO_BUFFER (gst_vdp_video_buffer_get_type())
#define GST_IS_VDPAU_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VDPAU_VIDEO_BUFFER)) #define GST_IS_VDPAU_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VDPAU_VIDEO_BUFFER))
#define GST_VDPAU_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VDPAU_VIDEO_BUFFER, GstVdpauVideoBuffer)) #define GST_VDPAU_VIDEO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VDPAU_VIDEO_BUFFER, GstVdpVideoBuffer))
struct _GstVdpauVideoBuffer { struct _GstVdpVideoBuffer {
GstBuffer buffer; GstBuffer buffer;
GstVdpauDevice *device; GstVdpDevice *device;
VdpVideoSurface surface; VdpVideoSurface surface;
}; };
GType gst_vdpau_video_buffer_get_type (void); GType gst_vdp_video_buffer_get_type (void);
GstVdpauVideoBuffer* gst_vdpau_video_buffer_new (GstVdpauDevice * device, VdpChromaType chroma_type, gint width, gint height); GstVdpVideoBuffer* gst_vdp_video_buffer_new (GstVdpDevice * device, VdpChromaType chroma_type, gint width, gint height);
#define GST_VDPAU_VIDEO_CAPS \ #define GST_VDPAU_VIDEO_CAPS \
"video/vdpau-video, " \ "video/vdpau-video, " \

View file

@ -25,11 +25,11 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstvdpauvideobuffer.h" #include "gstvdpvideobuffer.h"
#include "gstvdpauvideoyuv.h" #include "gstvdpvideoyuv.h"
GST_DEBUG_CATEGORY_STATIC (gst_vdpau_video_yuv_debug); GST_DEBUG_CATEGORY_STATIC (gst_vdp_video_yuv_debug);
#define GST_CAT_DEFAULT gst_vdpau_video_yuv_debug #define GST_CAT_DEFAULT gst_vdp_video_yuv_debug
/* Filter signals and args */ /* Filter signals and args */
enum enum
@ -56,22 +56,22 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
"width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]")); "width = (int) [ 1, MAX ], " "height = (int) [ 1, MAX ]"));
#define DEBUG_INIT(bla) \ #define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_vdpau_video_yuv_debug, "vdpauvideoyuv", 0, "VDPAU VdpSurface to YUV"); GST_DEBUG_CATEGORY_INIT (gst_vdp_video_yuv_debug, "vdpauvideoyuv", 0, "VDPAU VdpSurface to YUV");
GST_BOILERPLATE_FULL (GstVdpauVideoYUV, gst_vdpau_video_yuv, GstElement, GST_BOILERPLATE_FULL (GstVdpVideoYUV, gst_vdp_video_yuv, GstElement,
GST_TYPE_ELEMENT, DEBUG_INIT); GST_TYPE_ELEMENT, DEBUG_INIT);
static void gst_vdpau_video_yuv_finalize (GObject * object); static void gst_vdp_video_yuv_finalize (GObject * object);
static void gst_vdpau_video_yuv_set_property (GObject * object, guint prop_id, static void gst_vdp_video_yuv_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_vdpau_video_yuv_get_property (GObject * object, guint prop_id, static void gst_vdp_video_yuv_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
GstFlowReturn GstFlowReturn
gst_vdpau_video_yuv_chain (GstPad * pad, GstBuffer * buffer) gst_vdp_video_yuv_chain (GstPad * pad, GstBuffer * buffer)
{ {
GstVdpauVideoYUV *video_yuv; GstVdpVideoYUV *video_yuv;
GstVdpauDevice *device; GstVdpDevice *device;
VdpVideoSurface surface; VdpVideoSurface surface;
GstBuffer *outbuf = NULL; GstBuffer *outbuf = NULL;
@ -223,8 +223,8 @@ error:
} }
static GstCaps * static GstCaps *
gst_vdpau_video_yuv_get_caps (GstVdpauVideoYUV * video_yuv, gst_vdp_video_yuv_get_caps (GstVdpVideoYUV * video_yuv,
GstVdpauDevice * device, gint chroma_type, gint width, gint height, GstVdpDevice * device, gint chroma_type, gint width, gint height,
gint framerate_numerator, gint framerate_denominator, gint par_numerator, gint framerate_numerator, gint framerate_denominator, gint par_numerator,
gint par_denominator) gint par_denominator)
{ {
@ -274,14 +274,14 @@ gst_vdpau_video_yuv_get_caps (GstVdpauVideoYUV * video_yuv,
} }
static gboolean static gboolean
gst_vdpau_video_yuv_sink_set_caps (GstPad * pad, GstCaps * caps) gst_vdp_video_yuv_sink_set_caps (GstPad * pad, GstCaps * caps)
{ {
GstVdpauVideoYUV *video_yuv = GST_VDPAU_VIDEO_YUV (GST_OBJECT_PARENT (pad)); GstVdpVideoYUV *video_yuv = GST_VDPAU_VIDEO_YUV (GST_OBJECT_PARENT (pad));
GstCaps *src_caps, *new_caps; GstCaps *src_caps, *new_caps;
GstStructure *structure; GstStructure *structure;
const GValue *value; const GValue *value;
GstVdpauDevice *device; GstVdpDevice *device;
gint chroma_type; gint chroma_type;
gint width, height; gint width, height;
gint framerate_numerator, framerate_denominator; gint framerate_numerator, framerate_denominator;
@ -302,7 +302,7 @@ gst_vdpau_video_yuv_sink_set_caps (GstPad * pad, GstCaps * caps)
&par_numerator, &par_denominator); &par_numerator, &par_denominator);
src_caps = src_caps =
gst_vdpau_video_yuv_get_caps (video_yuv, device, chroma_type, width, gst_vdp_video_yuv_get_caps (video_yuv, device, chroma_type, width,
height, framerate_numerator, framerate_denominator, par_numerator, height, framerate_numerator, framerate_denominator, par_numerator,
par_denominator); par_denominator);
if (G_UNLIKELY (!src_caps)) if (G_UNLIKELY (!src_caps))
@ -340,9 +340,9 @@ gst_vdpau_video_yuv_sink_set_caps (GstPad * pad, GstCaps * caps)
} }
static GstCaps * static GstCaps *
gst_vdpau_video_yuv_src_getcaps (GstPad * pad) gst_vdp_video_yuv_src_getcaps (GstPad * pad)
{ {
GstVdpauVideoYUV *video_yuv; GstVdpVideoYUV *video_yuv;
video_yuv = GST_VDPAU_VIDEO_YUV (GST_OBJECT_PARENT (pad)); video_yuv = GST_VDPAU_VIDEO_YUV (GST_OBJECT_PARENT (pad));
@ -358,7 +358,7 @@ gst_vdpau_video_yuv_src_getcaps (GstPad * pad)
/* GObject vmethod implementations */ /* GObject vmethod implementations */
static void static void
gst_vdpau_video_yuv_base_init (gpointer klass) gst_vdp_video_yuv_base_init (gpointer klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
@ -375,7 +375,7 @@ gst_vdpau_video_yuv_base_init (gpointer klass)
} }
static void static void
gst_vdpau_video_yuv_class_init (GstVdpauVideoYUVClass * klass) gst_vdp_video_yuv_class_init (GstVdpVideoYUVClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -383,14 +383,13 @@ gst_vdpau_video_yuv_class_init (GstVdpauVideoYUVClass * klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gobject_class->finalize = gst_vdpau_video_yuv_finalize; gobject_class->finalize = gst_vdp_video_yuv_finalize;
gobject_class->set_property = gst_vdpau_video_yuv_set_property; gobject_class->set_property = gst_vdp_video_yuv_set_property;
gobject_class->get_property = gst_vdpau_video_yuv_get_property; gobject_class->get_property = gst_vdp_video_yuv_get_property;
} }
static void static void
gst_vdpau_video_yuv_init (GstVdpauVideoYUV * video_yuv, gst_vdp_video_yuv_init (GstVdpVideoYUV * video_yuv, GstVdpVideoYUVClass * klass)
GstVdpauVideoYUVClass * klass)
{ {
video_yuv->src_caps = NULL; video_yuv->src_caps = NULL;
@ -402,29 +401,28 @@ gst_vdpau_video_yuv_init (GstVdpauVideoYUV * video_yuv,
video_yuv->par_denominator = 1; video_yuv->par_denominator = 1;
video_yuv->src = gst_pad_new_from_static_template (&src_template, "src"); video_yuv->src = gst_pad_new_from_static_template (&src_template, "src");
gst_pad_set_getcaps_function (video_yuv->src, gst_pad_set_getcaps_function (video_yuv->src, gst_vdp_video_yuv_src_getcaps);
gst_vdpau_video_yuv_src_getcaps);
gst_element_add_pad (GST_ELEMENT (video_yuv), video_yuv->src); gst_element_add_pad (GST_ELEMENT (video_yuv), video_yuv->src);
video_yuv->sink = gst_pad_new_from_static_template (&sink_template, "sink"); video_yuv->sink = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_setcaps_function (video_yuv->sink, gst_pad_set_setcaps_function (video_yuv->sink,
gst_vdpau_video_yuv_sink_set_caps); gst_vdp_video_yuv_sink_set_caps);
gst_pad_set_chain_function (video_yuv->sink, gst_vdpau_video_yuv_chain); gst_pad_set_chain_function (video_yuv->sink, gst_vdp_video_yuv_chain);
gst_element_add_pad (GST_ELEMENT (video_yuv), video_yuv->sink); gst_element_add_pad (GST_ELEMENT (video_yuv), video_yuv->sink);
gst_pad_set_active (video_yuv->sink, TRUE); gst_pad_set_active (video_yuv->sink, TRUE);
} }
static void static void
gst_vdpau_video_yuv_finalize (GObject * object) gst_vdp_video_yuv_finalize (GObject * object)
{ {
GstVdpauVideoYUV *video_yuv = (GstVdpauVideoYUV *) object; GstVdpVideoYUV *video_yuv = (GstVdpVideoYUV *) object;
if (video_yuv->src_caps) if (video_yuv->src_caps)
gst_caps_unref (video_yuv->src_caps); gst_caps_unref (video_yuv->src_caps);
} }
static void static void
gst_vdpau_video_yuv_set_property (GObject * object, guint prop_id, gst_vdp_video_yuv_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
switch (prop_id) { switch (prop_id) {
@ -435,7 +433,7 @@ gst_vdpau_video_yuv_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_vdpau_video_yuv_get_property (GObject * object, guint prop_id, gst_vdp_video_yuv_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
switch (prop_id) { switch (prop_id) {

View file

@ -23,21 +23,21 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstvdpaudevice.h" #include "gstvdpdevice.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VDPAU_VIDEO_YUV (gst_vdpau_video_yuv_get_type()) #define GST_TYPE_VDPAU_VIDEO_YUV (gst_vdp_video_yuv_get_type())
#define GST_VDPAU_VIDEO_YUV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_VIDEO_YUV,GstVdpauVideoYUV)) #define GST_VDPAU_VIDEO_YUV(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_VIDEO_YUV,GstVdpVideoYUV))
#define GST_VDPAU_VIDEO_YUV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_VIDEO_YUV,GstVdpauVideoYUVClass)) #define GST_VDPAU_VIDEO_YUV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_VIDEO_YUV,GstVdpVideoYUVClass))
#define GST_VDPAU_VIDEO_YUV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_VIDEO_YUV, GstVdpauVideoYUVClass)) #define GST_VDPAU_VIDEO_YUV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_VIDEO_YUV, GstVdpVideoYUVClass))
#define GST_IS_VDPAU_VIDEO_YUV(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_VIDEO_YUV)) #define GST_IS_VDPAU_VIDEO_YUV(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_VIDEO_YUV))
#define GST_IS_VDPAU_VIDEO_YUV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_VIDEO_YUV)) #define GST_IS_VDPAU_VIDEO_YUV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_VIDEO_YUV))
typedef struct _GstVdpauVideoYUV GstVdpauVideoYUV; typedef struct _GstVdpVideoYUV GstVdpVideoYUV;
typedef struct _GstVdpauVideoYUVClass GstVdpauVideoYUVClass; typedef struct _GstVdpVideoYUVClass GstVdpVideoYUVClass;
struct _GstVdpauVideoYUV { struct _GstVdpVideoYUV {
GstElement element; GstElement element;
GstPad *src, *sink; GstPad *src, *sink;
@ -49,11 +49,11 @@ struct _GstVdpauVideoYUV {
guint format; guint format;
}; };
struct _GstVdpauVideoYUVClass { struct _GstVdpVideoYUVClass {
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_vdpau_video_yuv_get_type (void); GType gst_vdp_video_yuv_get_type (void);
G_END_DECLS G_END_DECLS

View file

@ -25,11 +25,11 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstvdpauvideobuffer.h" #include "gstvdpvideobuffer.h"
#include "gstvdpauyuvvideo.h" #include "gstvdpyuvvideo.h"
GST_DEBUG_CATEGORY_STATIC (gst_vdpau_yuv_video_debug); GST_DEBUG_CATEGORY_STATIC (gst_vdp_yuv_video_debug);
#define GST_CAT_DEFAULT gst_vdpau_yuv_video_debug #define GST_CAT_DEFAULT gst_vdp_yuv_video_debug
/* Filter signals and args */ /* Filter signals and args */
enum enum
@ -57,22 +57,22 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS (GST_VDPAU_VIDEO_CAPS)); GST_STATIC_CAPS (GST_VDPAU_VIDEO_CAPS));
#define DEBUG_INIT(bla) \ #define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_vdpau_yuv_video_debug, "vdpauvideoyuv", 0, "YUV to VDPAU video surface"); GST_DEBUG_CATEGORY_INIT (gst_vdp_yuv_video_debug, "vdpauvideoyuv", 0, "YUV to VDPAU video surface");
GST_BOILERPLATE_FULL (GstVdpauYUVVideo, gst_vdpau_yuv_video, GstElement, GST_BOILERPLATE_FULL (GstVdpYUVVideo, gst_vdp_yuv_video, GstElement,
GST_TYPE_ELEMENT, DEBUG_INIT); GST_TYPE_ELEMENT, DEBUG_INIT);
static void gst_vdpau_yuv_video_finalize (GObject * object); static void gst_vdp_yuv_video_finalize (GObject * object);
static void gst_vdpau_yuv_video_set_property (GObject * object, guint prop_id, static void gst_vdp_yuv_video_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_vdpau_yuv_video_get_property (GObject * object, guint prop_id, static void gst_vdp_yuv_video_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
GstFlowReturn GstFlowReturn
gst_vdpau_yuv_video_chain (GstPad * pad, GstBuffer * buffer) gst_vdp_yuv_video_chain (GstPad * pad, GstBuffer * buffer)
{ {
GstVdpauYUVVideo *yuv_video; GstVdpYUVVideo *yuv_video;
GstVdpauDevice *device; GstVdpDevice *device;
VdpVideoSurface surface; VdpVideoSurface surface;
GstBuffer *outbuf = NULL; GstBuffer *outbuf = NULL;
@ -80,7 +80,7 @@ gst_vdpau_yuv_video_chain (GstPad * pad, GstBuffer * buffer)
device = yuv_video->device; device = yuv_video->device;
outbuf = outbuf =
GST_BUFFER (gst_vdpau_video_buffer_new (device, yuv_video->chroma_type, GST_BUFFER (gst_vdp_video_buffer_new (device, yuv_video->chroma_type,
yuv_video->width, yuv_video->height)); yuv_video->width, yuv_video->height));
surface = GST_VDPAU_VIDEO_BUFFER (outbuf)->surface; surface = GST_VDPAU_VIDEO_BUFFER (outbuf)->surface;
@ -196,9 +196,9 @@ error:
} }
static GstCaps * static GstCaps *
gst_vdpau_yuv_video_get_caps (GstVdpauYUVVideo * yuv_video) gst_vdp_yuv_video_get_caps (GstVdpYUVVideo * yuv_video)
{ {
GstVdpauDevice *device; GstVdpDevice *device;
GstCaps *caps; GstCaps *caps;
gint i; gint i;
@ -265,9 +265,9 @@ error:
} }
static gboolean static gboolean
gst_vdpau_yuv_video_sink_setcaps (GstPad * pad, GstCaps * caps) gst_vdp_yuv_video_sink_setcaps (GstPad * pad, GstCaps * caps)
{ {
GstVdpauYUVVideo *yuv_video = GST_VDPAU_YUV_VIDEO (GST_OBJECT_PARENT (pad)); GstVdpYUVVideo *yuv_video = GST_VDPAU_YUV_VIDEO (GST_OBJECT_PARENT (pad));
GstStructure *structure; GstStructure *structure;
guint32 fourcc; guint32 fourcc;
@ -333,9 +333,9 @@ gst_vdpau_yuv_video_sink_setcaps (GstPad * pad, GstCaps * caps)
} }
static GstCaps * static GstCaps *
gst_vdpau_yuv_video_sink_getcaps (GstPad * pad) gst_vdp_yuv_video_sink_getcaps (GstPad * pad)
{ {
GstVdpauYUVVideo *yuv_video; GstVdpYUVVideo *yuv_video;
yuv_video = GST_VDPAU_YUV_VIDEO (GST_OBJECT_PARENT (pad)); yuv_video = GST_VDPAU_YUV_VIDEO (GST_OBJECT_PARENT (pad));
@ -346,18 +346,17 @@ gst_vdpau_yuv_video_sink_getcaps (GstPad * pad)
} }
static GstStateChangeReturn static GstStateChangeReturn
gst_vdpau_yuv_video_change_state (GstElement * element, gst_vdp_yuv_video_change_state (GstElement * element, GstStateChange transition)
GstStateChange transition)
{ {
GstVdpauYUVVideo *yuv_video; GstVdpYUVVideo *yuv_video;
yuv_video = GST_VDPAU_YUV_VIDEO (element); yuv_video = GST_VDPAU_YUV_VIDEO (element);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
yuv_video->device = gst_vdpau_get_device (yuv_video->display); yuv_video->device = gst_vdp_get_device (yuv_video->display);
if (!yuv_video->sink_caps) if (!yuv_video->sink_caps)
yuv_video->sink_caps = gst_vdpau_yuv_video_get_caps (yuv_video); yuv_video->sink_caps = gst_vdp_yuv_video_get_caps (yuv_video);
break; break;
case GST_STATE_CHANGE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
g_object_unref (yuv_video->device); g_object_unref (yuv_video->device);
@ -373,7 +372,7 @@ gst_vdpau_yuv_video_change_state (GstElement * element,
/* GObject vmethod implementations */ /* GObject vmethod implementations */
static void static void
gst_vdpau_yuv_video_base_init (gpointer klass) gst_vdp_yuv_video_base_init (gpointer klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
@ -390,7 +389,7 @@ gst_vdpau_yuv_video_base_init (gpointer klass)
} }
static void static void
gst_vdpau_yuv_video_class_init (GstVdpauYUVVideoClass * klass) gst_vdp_yuv_video_class_init (GstVdpYUVVideoClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
@ -398,20 +397,19 @@ gst_vdpau_yuv_video_class_init (GstVdpauYUVVideoClass * klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gobject_class->finalize = gst_vdpau_yuv_video_finalize; gobject_class->finalize = gst_vdp_yuv_video_finalize;
gobject_class->set_property = gst_vdpau_yuv_video_set_property; gobject_class->set_property = gst_vdp_yuv_video_set_property;
gobject_class->get_property = gst_vdpau_yuv_video_get_property; gobject_class->get_property = gst_vdp_yuv_video_get_property;
g_object_class_install_property (gobject_class, PROP_DISPLAY, g_object_class_install_property (gobject_class, PROP_DISPLAY,
g_param_spec_string ("display", "Display", "X Display name", g_param_spec_string ("display", "Display", "X Display name",
NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
gstelement_class->change_state = gst_vdpau_yuv_video_change_state; gstelement_class->change_state = gst_vdp_yuv_video_change_state;
} }
static void static void
gst_vdpau_yuv_video_init (GstVdpauYUVVideo * yuv_video, gst_vdp_yuv_video_init (GstVdpYUVVideo * yuv_video, GstVdpYUVVideoClass * klass)
GstVdpauYUVVideoClass * klass)
{ {
yuv_video->sink_caps = NULL; yuv_video->sink_caps = NULL;
@ -428,27 +426,27 @@ gst_vdpau_yuv_video_init (GstVdpauYUVVideo * yuv_video,
yuv_video->sink = gst_pad_new_from_static_template (&sink_template, "sink"); yuv_video->sink = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_getcaps_function (yuv_video->sink, gst_pad_set_getcaps_function (yuv_video->sink,
gst_vdpau_yuv_video_sink_getcaps); gst_vdp_yuv_video_sink_getcaps);
gst_pad_set_setcaps_function (yuv_video->sink, gst_pad_set_setcaps_function (yuv_video->sink,
gst_vdpau_yuv_video_sink_setcaps); gst_vdp_yuv_video_sink_setcaps);
gst_pad_set_chain_function (yuv_video->sink, gst_vdpau_yuv_video_chain); gst_pad_set_chain_function (yuv_video->sink, gst_vdp_yuv_video_chain);
gst_element_add_pad (GST_ELEMENT (yuv_video), yuv_video->sink); gst_element_add_pad (GST_ELEMENT (yuv_video), yuv_video->sink);
gst_pad_set_active (yuv_video->sink, TRUE); gst_pad_set_active (yuv_video->sink, TRUE);
} }
static void static void
gst_vdpau_yuv_video_finalize (GObject * object) gst_vdp_yuv_video_finalize (GObject * object)
{ {
GstVdpauYUVVideo *yuv_video = (GstVdpauYUVVideo *) object; GstVdpYUVVideo *yuv_video = (GstVdpYUVVideo *) object;
g_free (yuv_video->display); g_free (yuv_video->display);
} }
static void static void
gst_vdpau_yuv_video_set_property (GObject * object, guint prop_id, gst_vdp_yuv_video_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstVdpauYUVVideo *yuv_video = GST_VDPAU_YUV_VIDEO (object); GstVdpYUVVideo *yuv_video = GST_VDPAU_YUV_VIDEO (object);
switch (prop_id) { switch (prop_id) {
case PROP_DISPLAY: case PROP_DISPLAY:
@ -462,10 +460,10 @@ gst_vdpau_yuv_video_set_property (GObject * object, guint prop_id,
} }
static void static void
gst_vdpau_yuv_video_get_property (GObject * object, guint prop_id, gst_vdp_yuv_video_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GstVdpauYUVVideo *yuv_video = GST_VDPAU_YUV_VIDEO (object); GstVdpYUVVideo *yuv_video = GST_VDPAU_YUV_VIDEO (object);
switch (prop_id) { switch (prop_id) {
case PROP_DISPLAY: case PROP_DISPLAY:

View file

@ -23,39 +23,39 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstvdpaudevice.h" #include "gstvdpdevice.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VDPAU_YUV_VIDEO (gst_vdpau_yuv_video_get_type()) #define GST_TYPE_VDPAU_YUV_VIDEO (gst_vdp_yuv_video_get_type())
#define GST_VDPAU_YUV_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_YUV_VIDEO,GstVdpauYUVVideo)) #define GST_VDPAU_YUV_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VDPAU_YUV_VIDEO,GstVdpYUVVideo))
#define GST_VDPAU_YUV_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_YUV_VIDEO,GstVdpauYUVVideoClass)) #define GST_VDPAU_YUV_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VDPAU_YUV_VIDEO,GstVdpYUVVideoClass))
#define GST_VDPAU_YUV_VIDEO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_YUV_VIDEO, GstVdpauYUVVideoClass)) #define GST_VDPAU_YUV_VIDEO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VDPAU_YUV_VIDEO, GstVdpYUVVideoClass))
#define GST_IS_VDPAU_YUV_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_YUV_VIDEO)) #define GST_IS_VDPAU_YUV_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VDPAU_YUV_VIDEO))
#define GST_IS_VDPAU_YUV_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_YUV_VIDEO)) #define GST_IS_VDPAU_YUV_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VDPAU_YUV_VIDEO))
typedef struct _GstVdpauYUVVideo GstVdpauYUVVideo; typedef struct _GstVdpYUVVideo GstVdpYUVVideo;
typedef struct _GstVdpauYUVVideoClass GstVdpauYUVVideoClass; typedef struct _GstVdpYUVVideoClass GstVdpYUVVideoClass;
struct _GstVdpauYUVVideo { struct _GstVdpYUVVideo {
GstElement element; GstElement element;
GstPad *src, *sink; GstPad *src, *sink;
GstCaps *sink_caps; GstCaps *sink_caps;
gchar *display; gchar *display;
GstVdpauDevice *device; GstVdpDevice *device;
guint32 format; guint32 format;
gint chroma_type; gint chroma_type;
gint width, height; gint width, height;
}; };
struct _GstVdpauYUVVideoClass { struct _GstVdpYUVVideoClass {
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_vdpau_yuv_video_get_type (void); GType gst_vdp_yuv_video_get_type (void);
G_END_DECLS G_END_DECLS