1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  * Copyright (C) 2004 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
4  * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
5  * Copyright (C) <2015> British Broadcasting Corporation <dash@rd.bbc.co.uk>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include "gstttmlparse.h"
28 #include "gstttmlrender.h"
29 
30 GST_DEBUG_CATEGORY (ttmlparse_debug);
31 GST_DEBUG_CATEGORY (ttmlrender_debug);
32 
33 static gboolean
plugin_init(GstPlugin * plugin)34 plugin_init (GstPlugin * plugin)
35 {
36   guint rank = GST_RANK_NONE;
37 
38   /* We don't want this autoplugged by default yet for now */
39   if (g_getenv ("GST_TTML_AUTOPLUG")) {
40     GST_INFO_OBJECT (plugin, "Registering ttml elements with primary rank.");
41     rank = GST_RANK_PRIMARY;
42   }
43 
44   gst_plugin_add_dependency_simple (plugin, "GST_TTML_AUTOPLUG", NULL, NULL,
45       GST_PLUGIN_DEPENDENCY_FLAG_NONE);
46 
47   if (!gst_element_register (plugin, "ttmlparse", rank, GST_TYPE_TTML_PARSE))
48     return FALSE;
49   if (!gst_element_register (plugin, "ttmlrender", rank, GST_TYPE_TTML_RENDER))
50     return FALSE;
51 
52   GST_DEBUG_CATEGORY_INIT (ttmlparse_debug, "ttmlparse", 0, "TTML parser");
53   GST_DEBUG_CATEGORY_INIT (ttmlrender_debug, "ttmlrender", 0, "TTML renderer");
54 
55   return TRUE;
56 }
57 
58 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
59     GST_VERSION_MINOR,
60     ttmlsubs,
61     "TTML subtitle handling",
62     plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
63