Tizen 2.0 Release
[framework/multimedia/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 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27
28 #include <gst/gst.h>
29
30 #include "gstvaapidownload.h"
31 #include "gstvaapiupload.h"
32 #include "gstvaapidecode.h"
33 #include "gstvaapipostproc.h"
34 #include "gstvaapisink.h"
35
36 #if USE_ENCODERS
37 #include "gstvaapiencode.h"
38 #include "gstvaapiencode_h264.h"
39 #include "gstvaapiencode_h263.h"
40 #include "gstvaapiencode_mpeg4.h"
41
42 /*  encoder plugin register*/
43 static gboolean
44 vaapi_encoder_plugins_init (GstPlugin * plugin)
45 {
46   gboolean ret = TRUE;
47
48   ret &= gst_element_register (plugin, "vaapiencodeh264", GST_RANK_PRIMARY,
49       GST_TYPE_VAAPI_ENCODE_H264);
50   ret &= gst_element_register (plugin, "vaapiencodeh263", GST_RANK_PRIMARY,
51       GST_TYPE_VAAPI_ENCODE_H263);
52   ret &= gst_element_register (plugin, "vaapiencodempeg4", GST_RANK_PRIMARY,
53       GST_TYPE_VAAPI_ENCODE_MPEG4);
54   return ret;
55 }
56 #endif
57
58 static gboolean
59 plugin_init (GstPlugin *plugin)
60 {
61     gst_element_register(plugin, "vaapidownload",
62                          GST_RANK_SECONDARY,
63                          GST_TYPE_VAAPIDOWNLOAD);
64     gst_element_register(plugin, "vaapiupload",
65                          GST_RANK_PRIMARY,
66                          GST_TYPE_VAAPIUPLOAD);
67     gst_element_register(plugin, "vaapidecode",
68                          GST_RANK_PRIMARY,
69                          GST_TYPE_VAAPIDECODE);
70     gst_element_register(plugin, "vaapipostproc",
71                          GST_RANK_PRIMARY,
72                          GST_TYPE_VAAPIPOSTPROC);
73     gst_element_register(plugin, "vaapisink",
74                          GST_RANK_PRIMARY,
75                          GST_TYPE_VAAPISINK);
76 #if USE_ENCODERS
77     return vaapi_encoder_plugins_init(plugin);
78 #endif
79     return TRUE;
80 }
81
82 GST_PLUGIN_DEFINE(
83     GST_VERSION_MAJOR, GST_VERSION_MINOR,
84     "vaapi",
85     "VA-API based elements",
86     plugin_init,
87     PACKAGE_VERSION,
88     "LGPL",
89     PACKAGE,
90     PACKAGE_BUGREPORT);