hlsdemux: Enable support for external subtitles
[platform/upstream/gstreamer.git] / ext / closedcaption / gstclosedcaption.c
1 /*
2  * GStreamer
3  * Copyright (C) 2018 Edward Hervey <edward@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21
22 #ifdef HAVE_CONFIG_H
23 #  include <config.h>
24 #endif
25
26 #include <gst/gst.h>
27
28 #include "gstcccombiner.h"
29 #include "gstccconverter.h"
30 #include "gstccextractor.h"
31 #include "gstline21dec.h"
32 #include "gstceaccoverlay.h"
33 #include "gstline21enc.h"
34
35 static gboolean
36 closedcaption_init (GstPlugin * plugin)
37 {
38   gboolean ret;
39
40   ret = gst_element_register (plugin, "cccombiner", GST_RANK_NONE,
41       GST_TYPE_CCCOMBINER);
42
43   ret &= gst_element_register (plugin, "ccconverter", GST_RANK_NONE,
44       GST_TYPE_CCCONVERTER);
45
46   ret &= gst_element_register (plugin, "ccextractor", GST_RANK_NONE,
47       GST_TYPE_CCEXTRACTOR);
48
49   ret &= gst_element_register (plugin, "line21decoder", GST_RANK_NONE,
50       GST_TYPE_LINE21DECODER);
51
52   ret &= gst_element_register (plugin, "cc708overlay", GST_RANK_PRIMARY,
53       GST_TYPE_CEA_CC_OVERLAY);
54
55   ret &= gst_element_register (plugin, "line21encoder", GST_RANK_NONE,
56       GST_TYPE_LINE21ENCODER);
57
58   return ret;
59 }
60
61 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
62     GST_VERSION_MINOR,
63     closedcaption,
64     "Closed Caption elements",
65     closedcaption_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)