2009-10-13 14:48:34 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2009-10-13 14:48:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_SUBTITLE_OVERLAY_H__
|
|
|
|
#define __GST_SUBTITLE_OVERLAY_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define GST_TYPE_SUBTITLE_OVERLAY \
|
|
|
|
(gst_subtitle_overlay_get_type())
|
|
|
|
#define GST_SUBTITLE_OVERLAY(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SUBTITLE_OVERLAY, GstSubtitleOverlay))
|
|
|
|
#define GST_SUBTITLE_OVERLAY_CAST(obj) \
|
|
|
|
((GstSubtitleOverlay *) obj)
|
|
|
|
#define GST_SUBTITLE_OVERLAY_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SUBTITLE_OVERLAY, GstSubtitleOverlayClass))
|
|
|
|
#define GST_IS_SUBTITLE_OVERLAY(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SUBTITLE_OVERLAY))
|
|
|
|
#define GST_IS_SUBTITLE_OVERLAY_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SUBTITLE_OVERLAY))
|
|
|
|
|
|
|
|
#define GST_SUBTITLE_OVERLAY_LOCK(obj) G_STMT_START { \
|
|
|
|
GST_LOG_OBJECT (obj, \
|
|
|
|
"locking from thread %p", \
|
|
|
|
g_thread_self ()); \
|
2012-09-10 00:10:24 +00:00
|
|
|
g_mutex_lock (&GST_SUBTITLE_OVERLAY_CAST(obj)->lock); \
|
2009-10-13 14:48:34 +00:00
|
|
|
GST_LOG_OBJECT (obj, \
|
|
|
|
"locked from thread %p", \
|
|
|
|
g_thread_self ()); \
|
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
#define GST_SUBTITLE_OVERLAY_UNLOCK(obj) G_STMT_START { \
|
|
|
|
GST_LOG_OBJECT (obj, \
|
|
|
|
"unlocking from thread %p", \
|
|
|
|
g_thread_self ()); \
|
2012-09-10 00:10:24 +00:00
|
|
|
g_mutex_unlock (&GST_SUBTITLE_OVERLAY_CAST(obj)->lock); \
|
2009-10-13 14:48:34 +00:00
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
typedef struct _GstSubtitleOverlay GstSubtitleOverlay;
|
|
|
|
typedef struct _GstSubtitleOverlayClass GstSubtitleOverlayClass;
|
|
|
|
|
|
|
|
struct _GstSubtitleOverlay
|
|
|
|
{
|
|
|
|
GstBin parent;
|
|
|
|
|
2009-11-07 20:09:53 +00:00
|
|
|
gboolean silent;
|
2009-10-13 14:48:34 +00:00
|
|
|
gchar *font_desc;
|
2010-02-21 18:52:45 +00:00
|
|
|
gchar *encoding;
|
2018-10-28 14:35:17 +00:00
|
|
|
gint64 subtitle_ts_offset;
|
2009-10-13 14:48:34 +00:00
|
|
|
|
2009-11-07 20:09:53 +00:00
|
|
|
/* < private > */
|
2009-10-13 14:48:34 +00:00
|
|
|
gboolean do_async;
|
|
|
|
|
|
|
|
GstPad *srcpad;
|
2009-11-14 12:21:15 +00:00
|
|
|
gboolean downstream_chain_error;
|
2009-10-13 14:48:34 +00:00
|
|
|
|
|
|
|
GstPad *video_sinkpad;
|
|
|
|
GstPad *video_block_pad;
|
2011-06-01 17:34:54 +00:00
|
|
|
gulong video_block_id;
|
2009-10-13 14:48:34 +00:00
|
|
|
gboolean video_sink_blocked;
|
2009-11-07 10:46:49 +00:00
|
|
|
gint fps_n, fps_d;
|
2009-10-13 14:48:34 +00:00
|
|
|
|
|
|
|
GstPad *subtitle_sinkpad;
|
|
|
|
GstPad *subtitle_block_pad;
|
2011-06-01 17:34:54 +00:00
|
|
|
gulong subtitle_block_id;
|
2009-10-13 14:48:34 +00:00
|
|
|
gboolean subtitle_sink_blocked;
|
|
|
|
gboolean subtitle_flush;
|
2009-11-14 12:21:15 +00:00
|
|
|
gboolean subtitle_error;
|
2009-10-13 14:48:34 +00:00
|
|
|
|
2012-09-10 00:10:24 +00:00
|
|
|
GMutex factories_lock;
|
2009-10-13 14:48:34 +00:00
|
|
|
GList *factories;
|
2009-11-10 17:27:15 +00:00
|
|
|
guint32 factories_cookie;
|
2009-10-13 14:48:34 +00:00
|
|
|
GstCaps *factory_caps;
|
|
|
|
|
2012-09-10 00:10:24 +00:00
|
|
|
GMutex lock;
|
2009-10-13 14:48:34 +00:00
|
|
|
GstCaps *subcaps;
|
|
|
|
|
|
|
|
GstElement *passthrough_identity;
|
|
|
|
|
|
|
|
GstElement *pre_colorspace;
|
|
|
|
GstElement *post_colorspace;
|
|
|
|
|
|
|
|
GstElement *parser;
|
|
|
|
GstElement *overlay;
|
|
|
|
|
|
|
|
GstElement *renderer;
|
2009-11-07 20:09:53 +00:00
|
|
|
|
|
|
|
const gchar *silent_property;
|
|
|
|
gboolean silent_property_invert;
|
2009-10-13 14:48:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstSubtitleOverlayClass
|
|
|
|
{
|
|
|
|
GstBinClass parent;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_subtitle_overlay_get_type (void);
|
|
|
|
|
|
|
|
GstCaps *gst_subtitle_overlay_create_factory_caps (void);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GST_SUBTITLE_OVERLAY_H__ */
|