gstv4l2.c 2.58 KB
Newer Older
Edgard Lima's avatar
Edgard Lima committed
1 2 3
/* GStreamer
 *
 * Copyright (C) 2001-2002 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 5 6
 *               2006 Edgard Lima <edgard.lima@indt.org.br>
 *
 * gstv4l2.c: plugin for v4l2 elements
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

Benjamin Otte's avatar
Benjamin Otte committed
28 29
#include "gst/gst-i18n-plugin.h"

Edgard Lima's avatar
Edgard Lima committed
30 31
#include <gst/gst.h>

32
#include "gstv4l2object.h"
33
#include "gstv4l2src.h"
Rob Clark's avatar
Rob Clark committed
34
#include "gstv4l2sink.h"
35
#include "gstv4l2radio.h"
Edgard Lima's avatar
Edgard Lima committed
36 37 38 39
/* #include "gstv4l2jpegsrc.h" */
/* #include "gstv4l2mjpegsrc.h" */
/* #include "gstv4l2mjpegsink.h" */

40 41
/* used in v4l2_calls.c and v4l2src_calls.c */
GST_DEBUG_CATEGORY (v4l2_debug);
42
GST_DEBUG_CATEGORY (GST_CAT_PERFORMANCE);
43

44
static gboolean
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
45
plugin_init (GstPlugin * plugin)
46
{
Edgard Lima's avatar
Edgard Lima committed
47
  GST_DEBUG_CATEGORY_INIT (v4l2_debug, "v4l2", 0, "V4L2 API calls");
48
  GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
Edgard Lima's avatar
Edgard Lima committed
49

50
  if (!gst_element_register (plugin, "v4l2src", GST_RANK_PRIMARY,
Rob Clark's avatar
Rob Clark committed
51
          GST_TYPE_V4L2SRC) ||
52
      !gst_element_register (plugin, "v4l2sink", GST_RANK_NONE,
Rob Clark's avatar
Rob Clark committed
53
          GST_TYPE_V4L2SINK) ||
54 55
      !gst_element_register (plugin, "v4l2radio", GST_RANK_NONE,
          GST_TYPE_V4L2RADIO) ||
Rob Clark's avatar
Rob Clark committed
56 57 58 59 60 61 62
      /*       !gst_element_register (plugin, "v4l2jpegsrc", */
      /*           GST_RANK_NONE, GST_TYPE_V4L2JPEGSRC) || */
      /*       !gst_element_register (plugin, "v4l2mjpegsrc", */
      /*           GST_RANK_NONE, GST_TYPE_V4L2MJPEGSRC) || */
      /*       !gst_element_register (plugin, "v4l2mjpegsink", */
      /*           GST_RANK_NONE, GST_TYPE_V4L2MJPEGSINK)) */
      FALSE)
63 64
    return FALSE;

65 66 67
#ifdef ENABLE_NLS
  setlocale (LC_ALL, "");
  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
68
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
69 70
#endif /* ENABLE_NLS */

71 72 73
  return TRUE;
}

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
74 75
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
    GST_VERSION_MINOR,
76
    video4linux2,
Edgard Lima's avatar
Edgard Lima committed
77
    "elements for Video 4 Linux",
78
    plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)