3 * Copyright (c) 2008 Samsung Electronics, Inc.
6 * This software is a confidential and proprietary information
7 * of Samsung Electronics, Inc. ("Confidential Information"). You
8 * shall not disclose such Confidential Information and shall use
9 * it only in accordance with the terms of the license agreement
10 * you entered into with Samsung Electronics.
14 * This file defines the functions of Gstreamer plug-in for submux
17 * @author Deepak Singh (deep.singh@samsung.com)
20 * @brief This plug-in is targeted to be used for ARM MP4ASP decoding.
24 *! ---------------------------------------------------------------------------
25 *! DATE | AUTHOR | COMMENTS
26 *! ---------------------------------------------------------------------------
27 *! 17-Jan-2014 deep.singh@samsung.com created
34 #include <sys/types.h>
40 #include <gst/gsterror.h>
42 #include <gst/app/gstappsrc.h>
43 #include <gst/app/gstappsink.h>
44 #include <gst/base/gstadapter.h>
47 #define GST_TYPE_SUBMUX (gst_submux_get_type())
48 #define GST_SUBMUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SUBMUX,Gstsubmux))
49 #define GST_SUBMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SUBMUX,GstsubmuxClass))
50 #define GST_SUBMUX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_SUBMUX,GstsubmuxClass))
51 #define GST_IS_SUBMUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SUBMUX))
52 #define GST_IS_SUBMUX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SUBMUX))
53 #define GST_SUBMUX_CAST(obj) ((Gstsubmux *)(obj))
56 typedef struct _Gstsubmux Gstsubmux;
57 typedef struct _GstsubmuxClass GstsubmuxClass;
58 typedef struct _GstsubmuxPrivate GstsubmuxPrivate;
59 typedef struct _LanguageStruct GstLangStruct;
60 typedef struct _GstSubMuxStream GstSubmuxStream;
61 typedef struct _GstSubMuxPipe SubMuxPipe;
65 GST_SUB_PARSE_FORMAT_UNKNOWN = 0,
66 GST_SUB_PARSE_FORMAT_MDVDSUB = 1,
67 GST_SUB_PARSE_FORMAT_SUBRIP = 2,
68 GST_SUB_PARSE_FORMAT_MPSUB = 3,
69 GST_SUB_PARSE_FORMAT_SAMI = 4,
70 GST_SUB_PARSE_FORMAT_TMPLAYER = 5,
71 GST_SUB_PARSE_FORMAT_MPL2 = 6,
72 GST_SUB_PARSE_FORMAT_SUBVIEWER = 7,
73 GST_SUB_PARSE_FORMAT_DKS = 8,
74 GST_SUB_PARSE_FORMAT_QTTEXT = 9
78 GST_SUB_PARSE_REGEX_UNKNOWN = 0,
79 GST_SUB_PARSE_REGEX_MDVDSUB = 1,
80 GST_SUB_PARSE_REGEX_SUBRIP = 2,
81 GST_SUB_PARSE_REGEX_DKS = 3,
91 struct _GstSubMuxStream
94 gboolean need_segment;
95 gboolean discont_came;
97 SubMuxPipe pipe_struc;
100 GstClockTime duration;
101 GstClockTime last_ts; /* last timestamp of subtitle present in subtitle file*/
103 GstClockTime seek_ts;
115 GstsubmuxPrivate *priv;
118 guint sinkpads_count;
119 gboolean external_sinkpad;
123 gboolean pipeline_made;
130 gboolean need_segment;
131 GstSubmuxStream muxed_stream;
133 gchar *detected_encoding;
137 GstSeekFlags segment_flags;
140 gboolean langlist_msg_posted;
141 GstBuffer **cur_buf_array;
142 gchar* external_filepath;
145 struct _GstsubmuxPrivate
147 gboolean first_buffer;
148 GstSubMuxFormat parser_type;
150 gboolean is_internal;
155 struct _LanguageStruct
157 gchar *language_code;
162 struct _GstsubmuxClass
164 GstElementClass parent_class;
167 GType gst_submux_get_type (void);