plugins: initial port to GStreamer 1.2.
[platform/upstream/gstreamer-vaapi.git] / gst / vaapi / gstvaapi.c
1 /*
2  *  gstvaapi.c - VA-API element registration
3  *
4  *  Copyright (C) 2011-2012 Intel Corporation
5  *  Copyright (C) 2011 Collabora Ltd.
6  *    Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
7  *
8  *  This library is free software; you can redistribute it and/or
9  *  modify it under the terms of the GNU Lesser General Public License
10  *  as published by the Free Software Foundation; either version 2.1
11  *  of the License, or (at your option) any later version.
12  *
13  *  This library is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  *  Lesser General Public License for more details.
17  *
18  *  You should have received a copy of the GNU Lesser General Public
19  *  License along with this library; if not, write to the Free
20  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  *  Boston, MA 02110-1301 USA
22  */
23
24 #include "gst/vaapi/sysdeps.h"
25 #include <gst/gst.h>
26 #include "gstvaapidownload.h"
27 #include "gstvaapiupload.h"
28 #include "gstvaapidecode.h"
29 #include "gstvaapipostproc.h"
30 #include "gstvaapisink.h"
31
32 #define PLUGIN_NAME     "vaapi"
33 #define PLUGIN_DESC     "VA-API based elements"
34 #define PLUGIN_LICENSE  "LGPL"
35
36 static gboolean
37 plugin_init (GstPlugin *plugin)
38 {
39 #if !GST_CHECK_VERSION(1,0,0)
40     gst_element_register(plugin, "vaapidownload",
41                          GST_RANK_SECONDARY,
42                          GST_TYPE_VAAPIDOWNLOAD);
43     gst_element_register(plugin, "vaapiupload",
44                          GST_RANK_PRIMARY,
45                          GST_TYPE_VAAPIUPLOAD);
46 #endif
47     gst_element_register(plugin, "vaapidecode",
48                          GST_RANK_PRIMARY,
49                          GST_TYPE_VAAPIDECODE);
50 #if !GST_CHECK_VERSION(1,1,0)
51     gst_element_register(plugin, "vaapipostproc",
52                          GST_RANK_PRIMARY,
53                          GST_TYPE_VAAPIPOSTPROC);
54 #endif
55     gst_element_register(plugin, "vaapisink",
56                          GST_RANK_PRIMARY,
57                          GST_TYPE_VAAPISINK);
58     return TRUE;
59 }
60
61 #if GST_CHECK_VERSION(1,0,0)
62 /* XXX: use PLUGIN_NAME when GST_PLUGIN_DEFINE is fixed to use
63    G_STRINGIFY() for name argument, instead of plain #name */
64 GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR,
65                   vaapi, PLUGIN_DESC, plugin_init,
66                   PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT)
67 #else
68 GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR,
69                   PLUGIN_NAME, PLUGIN_DESC, plugin_init,
70                   PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT)
71 #endif