dffb3f07b4c39a96dcfe6983ccfcb555b770118d
[platform/upstream/gst-plugins-good.git] / sys / v4l2 / gstv4l2.c
1 /* G-Streamer Video4linux2 video-capture plugin
2  * Copyright (C) 2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include <gst/gst.h>
25
26 #include "gst/gst-i18n-plugin.h"
27
28 #include "gstv4l2element.h"
29 #include "gstv4l2src.h"
30
31 static gboolean
32 plugin_init (GstPlugin *plugin)
33 {
34   /* actually, we can survive without it, but I'll create
35    * that handling later on. */
36   if (!gst_library_load ("xwindowlistener"))
37     return FALSE;
38
39   if (!gst_element_register (plugin, "v4l2element",
40                              GST_RANK_NONE, GST_TYPE_V4L2ELEMENT) ||
41       !gst_element_register (plugin, "v4l2src",
42                              GST_RANK_NONE, GST_TYPE_V4L2SRC))
43     return FALSE;
44
45 #ifdef ENABLE_NLS
46   setlocale (LC_ALL, "");
47   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
48 #endif /* ENABLE_NLS */
49
50   return TRUE;
51 }
52
53 GST_PLUGIN_DEFINE (
54   GST_VERSION_MAJOR,
55   GST_VERSION_MINOR,
56   "video4linux2",
57   "elements for Video 4 Linux 2",
58   plugin_init,
59   VERSION,
60   GST_LICENSE,
61   GST_PACKAGE,
62   GST_ORIGIN
63 )