1 /* Copyright (C) <2018> Philippe Normand <philn@igalia.com>
2 * Copyright (C) <2018> Žan Doberšek <zdobersek@igalia.com>
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., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include "gstwpevideosrc.h"
27 #include "gstwpesrcbin.h"
28 #include "gstwpe.h"
29
30 static gchar *extension_path = NULL;
31
32 GST_DEBUG_CATEGORY (wpe_video_src_debug);
33 GST_DEBUG_CATEGORY (wpe_view_debug);
34 GST_DEBUG_CATEGORY (wpe_src_debug);
35
gst_wpe_get_devenv_extension_path(void)36 const gchar *gst_wpe_get_devenv_extension_path (void)
37 {
38 return extension_path;
39 }
40
41 static gboolean
plugin_init(GstPlugin * plugin)42 plugin_init (GstPlugin * plugin)
43 {
44 gboolean result;
45 gchar *dirname = g_path_get_dirname (gst_plugin_get_filename (plugin));
46
47 GST_DEBUG_CATEGORY_INIT (wpe_video_src_debug, "wpevideosrc", 0, "WPE Video Source");
48 GST_DEBUG_CATEGORY_INIT (wpe_view_debug, "wpeview", 0, "WPE Threaded View");
49 GST_DEBUG_CATEGORY_INIT (wpe_src_debug, "wpesrc", 0, "WPE Source");
50
51 extension_path = g_build_filename (dirname, "wpe-extension", NULL);
52 g_free (dirname);
53 result = gst_element_register (plugin, "wpevideosrc", GST_RANK_NONE,
54 GST_TYPE_WPE_VIDEO_SRC);
55 result &= gst_element_register(plugin, "wpesrc", GST_RANK_NONE, GST_TYPE_WPE_SRC);
56 return result;
57 }
58
59 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
60 wpe, "WPE src plugin", plugin_init, VERSION, GST_LICENSE, PACKAGE,
61 GST_PACKAGE_ORIGIN)
62