m4_append([gst_vaapi_version], gst_vaapi_pre_version, [.pre])
])
+# glib version number
+m4_define([glib_major_version], [2])
+m4_define([glib_minor_version], [4])
+m4_define([glib_micro_version], [0])
+m4_define([glib_major_minor_version],
+ [glib_major_version.glib_minor_version])
+m4_define([glib_version],
+ [glib_major_version.glib_minor_version.glib_micro_version])
+
# gst version number
m4_define([gst_major_version], [0])
m4_define([gst_minor_version], [10])
dnl Check for GLib
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
-PKG_CHECK_MODULES([GLIB], [glib-2.0])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= glib_version])
AC_CHECK_LIB([glib-2.0], [g_list_free_full], [
AC_DEFINE([HAVE_G_LIST_FREE_FULL], [1],
[Define to 1 if g_list_free_full() is available.])])
GST_PAD_ALWAYS,
GST_STATIC_CAPS(gst_vaapidecode_src_caps_str));
+static void
+gst_video_context_interface_init(GstVideoContextInterface *iface);
+
#define GstVideoContextClass GstVideoContextInterface
-GST_BOILERPLATE_WITH_INTERFACE(
+G_DEFINE_TYPE_WITH_CODE(
GstVaapiDecode,
gst_vaapidecode,
- GstElement,
GST_TYPE_ELEMENT,
- GstVideoContext,
- GST_TYPE_VIDEO_CONTEXT,
- gst_video_context);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
+ gst_video_context_interface_init));
enum {
PROP_0,
}
static void
-gst_vaapidecode_base_init(gpointer klass)
-{
- GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
- GstPadTemplate *pad_template;
-
- gst_element_class_set_details_simple(
- element_class,
- gst_vaapidecode_details.longname,
- gst_vaapidecode_details.klass,
- gst_vaapidecode_details.description,
- gst_vaapidecode_details.author
- );
-
- /* sink pad */
- pad_template = gst_static_pad_template_get(&gst_vaapidecode_sink_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-
- /* src pad */
- pad_template = gst_static_pad_template_get(&gst_vaapidecode_src_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-}
-
-static void
gst_vaapidecode_finalize(GObject *object)
{
GstVaapiDecode * const decode = GST_VAAPIDECODE(object);
decode->delayed_new_seg = NULL;
}
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ G_OBJECT_CLASS(gst_vaapidecode_parent_class)->finalize(object);
}
static void
break;
}
- ret = GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
+ ret = GST_ELEMENT_CLASS(gst_vaapidecode_parent_class)->change_state(element, transition);
if (ret != GST_STATE_CHANGE_SUCCESS)
return ret;
{
GObjectClass * const object_class = G_OBJECT_CLASS(klass);
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
+ GstPadTemplate *pad_template;
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapidecode,
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
element_class->change_state = gst_vaapidecode_change_state;
+ gst_element_class_set_details_simple(
+ element_class,
+ gst_vaapidecode_details.longname,
+ gst_vaapidecode_details.klass,
+ gst_vaapidecode_details.description,
+ gst_vaapidecode_details.author
+ );
+
+ /* sink pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapidecode_sink_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
+ /* src pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapidecode_src_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
#if USE_FFMPEG
g_object_class_install_property
(object_class,
}
static void
-gst_vaapidecode_init(GstVaapiDecode *decode, GstVaapiDecodeClass *klass)
+gst_vaapidecode_init(GstVaapiDecode *decode)
{
+ GstVaapiDecodeClass *klass = GST_VAAPIDECODE_GET_CLASS(decode);
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
decode->display = NULL;
GstBaseTransformClass parent_class;
};
+static void
+gst_video_context_interface_init(GstVideoContextInterface *iface);
+
#define GstVideoContextClass GstVideoContextInterface
-GST_BOILERPLATE_WITH_INTERFACE(
+G_DEFINE_TYPE_WITH_CODE(
GstVaapiDownload,
gst_vaapidownload,
- GstBaseTransform,
GST_TYPE_BASE_TRANSFORM,
- GstVideoContext,
- GST_TYPE_VIDEO_CONTEXT,
- gst_video_context);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
+ gst_video_context_interface_init));
static gboolean
gst_vaapidownload_start(GstBaseTransform *trans);
}
static void
-gst_vaapidownload_base_init(gpointer klass)
-{
- GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
- GstPadTemplate *pad_template;
-
- gst_element_class_set_details_simple(
- element_class,
- gst_vaapidownload_details.longname,
- gst_vaapidownload_details.klass,
- gst_vaapidownload_details.description,
- gst_vaapidownload_details.author
- );
-
- /* sink pad */
- pad_template = gst_static_pad_template_get(&gst_vaapidownload_sink_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-
- /* src pad */
- pad_template = gst_static_pad_template_get(&gst_vaapidownload_src_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-}
-
-static void
gst_vaapidownload_finalize(GObject *object)
{
gst_vaapidownload_destroy(GST_VAAPIDOWNLOAD(object));
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ G_OBJECT_CLASS(gst_vaapidownload_parent_class)->finalize(object);
}
static void
{
GObjectClass * const object_class = G_OBJECT_CLASS(klass);
GstBaseTransformClass * const trans_class = GST_BASE_TRANSFORM_CLASS(klass);
+ GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
+ GstPadTemplate *pad_template;
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapidownload,
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
trans_class->transform_caps = gst_vaapidownload_transform_caps;
trans_class->transform_size = gst_vaapidownload_transform_size;
trans_class->set_caps = gst_vaapidownload_set_caps;
+
+ gst_element_class_set_details_simple(
+ element_class,
+ gst_vaapidownload_details.longname,
+ gst_vaapidownload_details.klass,
+ gst_vaapidownload_details.description,
+ gst_vaapidownload_details.author
+ );
+
+ /* sink pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapidownload_sink_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
+ /* src pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapidownload_src_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
}
static void
-gst_vaapidownload_init(GstVaapiDownload *download, GstVaapiDownloadClass *klass)
+gst_vaapidownload_init(GstVaapiDownload *download)
{
GstPad *sinkpad, *srcpad;
GST_PAD_ALWAYS,
GST_STATIC_CAPS(gst_vaapipostproc_src_caps_str));
+static void
+gst_video_context_interface_init(GstVideoContextInterface *iface);
+
#define GstVideoContextClass GstVideoContextInterface
-GST_BOILERPLATE_WITH_INTERFACE(
+G_DEFINE_TYPE_WITH_CODE(
GstVaapiPostproc,
gst_vaapipostproc,
- GstElement,
GST_TYPE_ELEMENT,
- GstVideoContext,
- GST_TYPE_VIDEO_CONTEXT,
- gst_video_context);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
+ gst_video_context_interface_init));
enum {
PROP_0,
gst_caps_replace(&postproc->srcpad_caps, NULL);
gst_caps_replace(&postproc->allowed_caps, NULL);
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ G_OBJECT_CLASS(gst_vaapipostproc_parent_class)->finalize(object);
}
static void
break;
}
- ret = GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
+ ret = GST_ELEMENT_CLASS(gst_vaapipostproc_parent_class)->change_state(element, transition);
if (ret != GST_STATE_CHANGE_SUCCESS)
return ret;
{
GObjectClass * const object_class = G_OBJECT_CLASS(klass);
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
+ GstPadTemplate *pad_template;
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapipostproc,
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
element_class->change_state = gst_vaapipostproc_change_state;
+ gst_element_class_set_details_simple(
+ element_class,
+ gst_vaapipostproc_details.longname,
+ gst_vaapipostproc_details.klass,
+ gst_vaapipostproc_details.description,
+ gst_vaapipostproc_details.author
+ );
+
+ /* sink pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapipostproc_sink_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
+ /* src pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapipostproc_src_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
/**
* GstVaapiPostproc:deinterlace-mode:
*
}
static void
-gst_vaapipostproc_base_init(gpointer klass)
-{
- GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
- GstPadTemplate *pad_template;
-
- gst_element_class_set_details_simple(
- element_class,
- gst_vaapipostproc_details.longname,
- gst_vaapipostproc_details.klass,
- gst_vaapipostproc_details.description,
- gst_vaapipostproc_details.author
- );
-
- /* sink pad */
- pad_template = gst_static_pad_template_get(&gst_vaapipostproc_sink_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-
- /* src pad */
- pad_template = gst_static_pad_template_get(&gst_vaapipostproc_src_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-}
-
-static void
-gst_vaapipostproc_init(GstVaapiPostproc *postproc, GstVaapiPostprocClass *klass)
+gst_vaapipostproc_init(GstVaapiPostproc *postproc)
{
+ GstVaapiPostprocClass *klass = GST_VAAPIPOSTPROC_GET_CLASS(postproc);
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
postproc->allowed_caps = NULL;
GST_PAD_ALWAYS,
GST_STATIC_CAPS(GST_VAAPI_SURFACE_CAPS));
-static void gst_vaapisink_iface_init(GType type);
+static void
+gst_vaapisink_implements_iface_init(GstImplementsInterfaceClass *iface);
+
+static void
+gst_vaapisink_video_context_iface_init(GstVideoContextInterface *iface);
-GST_BOILERPLATE_FULL(
+static void
+gst_vaapisink_xoverlay_iface_init(GstXOverlayClass *iface);
+
+G_DEFINE_TYPE_WITH_CODE(
GstVaapiSink,
gst_vaapisink,
- GstVideoSink,
GST_TYPE_VIDEO_SINK,
- gst_vaapisink_iface_init);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
+ gst_vaapisink_implements_iface_init);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
+ gst_vaapisink_video_context_iface_init);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_X_OVERLAY,
+ gst_vaapisink_xoverlay_iface_init));
enum {
PROP_0,
}
static void
-gst_vaapisink_iface_init(GType type)
-{
- const GType g_define_type_id = type;
-
- G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
- gst_vaapisink_implements_iface_init);
- G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
- gst_vaapisink_video_context_iface_init);
- G_IMPLEMENT_INTERFACE(GST_TYPE_X_OVERLAY,
- gst_vaapisink_xoverlay_iface_init);
-}
-
-static void
gst_vaapisink_destroy(GstVaapiSink *sink)
{
if (sink->texture) {
{
gst_vaapisink_destroy(GST_VAAPISINK(object));
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ G_OBJECT_CLASS(gst_vaapisink_parent_class)->finalize(object);
}
static void
}
static void
-gst_vaapisink_base_init(gpointer klass)
-{
- GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
- GstPadTemplate *pad_template;
-
- gst_element_class_set_details_simple(
- element_class,
- gst_vaapisink_details.longname,
- gst_vaapisink_details.klass,
- gst_vaapisink_details.description,
- gst_vaapisink_details.author
- );
-
- pad_template = gst_static_pad_template_get(&gst_vaapisink_sink_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-}
-
-static void
gst_vaapisink_class_init(GstVaapiSinkClass *klass)
{
GObjectClass * const object_class = G_OBJECT_CLASS(klass);
+ GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
GstBaseSinkClass * const basesink_class = GST_BASE_SINK_CLASS(klass);
+ GstPadTemplate *pad_template;
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapisink,
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
basesink_class->render = gst_vaapisink_show_frame;
basesink_class->query = gst_vaapisink_query;
+ gst_element_class_set_details_simple(
+ element_class,
+ gst_vaapisink_details.longname,
+ gst_vaapisink_details.klass,
+ gst_vaapisink_details.description,
+ gst_vaapisink_details.author
+ );
+
+ pad_template = gst_static_pad_template_get(&gst_vaapisink_sink_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
#if USE_VAAPISINK_GLX
g_object_class_install_property
(object_class,
}
static void
-gst_vaapisink_init(GstVaapiSink *sink, GstVaapiSinkClass *klass)
+gst_vaapisink_init(GstVaapiSink *sink)
{
sink->caps = NULL;
sink->display = NULL;
GST_PAD_ALWAYS,
GST_STATIC_CAPS(gst_vaapiupload_vaapi_caps_str));
+static void
+gst_video_context_interface_init(GstVideoContextInterface *iface);
+
#define GstVideoContextClass GstVideoContextInterface
-GST_BOILERPLATE_WITH_INTERFACE(
+G_DEFINE_TYPE_WITH_CODE(
GstVaapiUpload,
gst_vaapiupload,
- GstBaseTransform,
GST_TYPE_BASE_TRANSFORM,
- GstVideoContext,
- GST_TYPE_VIDEO_CONTEXT,
- gst_video_context);
+ G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
+ gst_video_context_interface_init));
/*
* Direct rendering levels (direct-rendering)
}
static void
-gst_vaapiupload_base_init(gpointer klass)
-{
- GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
- GstPadTemplate *pad_template;
-
- gst_element_class_set_details_simple(
- element_class,
- gst_vaapiupload_details.longname,
- gst_vaapiupload_details.klass,
- gst_vaapiupload_details.description,
- gst_vaapiupload_details.author
- );
-
- /* sink pad */
- pad_template = gst_static_pad_template_get(&gst_vaapiupload_sink_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-
- /* src pad */
- pad_template = gst_static_pad_template_get(&gst_vaapiupload_src_factory);
- gst_element_class_add_pad_template(element_class, pad_template);
- gst_object_unref(pad_template);
-}
-
-static void
gst_vaapiupload_finalize(GObject *object)
{
gst_vaapiupload_destroy(GST_VAAPIUPLOAD(object));
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ G_OBJECT_CLASS(gst_vaapiupload_parent_class)->finalize(object);
}
gst_vaapiupload_class_init(GstVaapiUploadClass *klass)
{
GObjectClass * const object_class = G_OBJECT_CLASS(klass);
+ GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
GstBaseTransformClass * const trans_class = GST_BASE_TRANSFORM_CLASS(klass);
+ GstPadTemplate *pad_template;
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapiupload,
GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC);
trans_class->get_unit_size = gst_vaapiupload_get_unit_size;
trans_class->prepare_output_buffer = gst_vaapiupload_prepare_output_buffer;
+ gst_element_class_set_details_simple(
+ element_class,
+ gst_vaapiupload_details.longname,
+ gst_vaapiupload_details.klass,
+ gst_vaapiupload_details.description,
+ gst_vaapiupload_details.author
+ );
+
+ /* sink pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapiupload_sink_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
+ /* src pad */
+ pad_template = gst_static_pad_template_get(&gst_vaapiupload_src_factory);
+ gst_element_class_add_pad_template(element_class, pad_template);
+ gst_object_unref(pad_template);
+
/**
* GstVaapiUpload:direct-rendering:
*
}
static void
-gst_vaapiupload_init(GstVaapiUpload *upload, GstVaapiUploadClass *klass)
+gst_vaapiupload_init(GstVaapiUpload *upload)
{
GstPad *sinkpad, *srcpad;