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