1 /* GStreamer 2 * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk> 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 #ifndef __GST_SUBTITLE_OVERLAY_H__ 21 #define __GST_SUBTITLE_OVERLAY_H__ 22 23 #include <gst/gst.h> 24 25 G_BEGIN_DECLS 26 #define GST_TYPE_SUBTITLE_OVERLAY \ 27 (gst_subtitle_overlay_get_type()) 28 #define GST_SUBTITLE_OVERLAY(obj) \ 29 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SUBTITLE_OVERLAY, GstSubtitleOverlay)) 30 #define GST_SUBTITLE_OVERLAY_CAST(obj) \ 31 ((GstSubtitleOverlay *) obj) 32 #define GST_SUBTITLE_OVERLAY_CLASS(klass) \ 33 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SUBTITLE_OVERLAY, GstSubtitleOverlayClass)) 34 #define GST_IS_SUBTITLE_OVERLAY(obj) \ 35 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SUBTITLE_OVERLAY)) 36 #define GST_IS_SUBTITLE_OVERLAY_CLASS(klass) \ 37 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SUBTITLE_OVERLAY)) 38 39 #define GST_SUBTITLE_OVERLAY_LOCK(obj) G_STMT_START { \ 40 GST_LOG_OBJECT (obj, \ 41 "locking from thread %p", \ 42 g_thread_self ()); \ 43 g_mutex_lock (&GST_SUBTITLE_OVERLAY_CAST(obj)->lock); \ 44 GST_LOG_OBJECT (obj, \ 45 "locked from thread %p", \ 46 g_thread_self ()); \ 47 } G_STMT_END 48 49 #define GST_SUBTITLE_OVERLAY_UNLOCK(obj) G_STMT_START { \ 50 GST_LOG_OBJECT (obj, \ 51 "unlocking from thread %p", \ 52 g_thread_self ()); \ 53 g_mutex_unlock (&GST_SUBTITLE_OVERLAY_CAST(obj)->lock); \ 54 } G_STMT_END 55 56 typedef struct _GstSubtitleOverlay GstSubtitleOverlay; 57 typedef struct _GstSubtitleOverlayClass GstSubtitleOverlayClass; 58 59 struct _GstSubtitleOverlay 60 { 61 GstBin parent; 62 63 gboolean silent; 64 gchar *font_desc; 65 gchar *encoding; 66 gint64 subtitle_ts_offset; 67 68 /* < private > */ 69 gboolean do_async; 70 71 GstPad *srcpad; 72 gboolean downstream_chain_error; 73 74 GstPad *video_sinkpad; 75 GstPad *video_block_pad; 76 gulong video_block_id; 77 gboolean video_sink_blocked; 78 gint fps_n, fps_d; 79 80 GstPad *subtitle_sinkpad; 81 GstPad *subtitle_block_pad; 82 gulong subtitle_block_id; 83 gboolean subtitle_sink_blocked; 84 gboolean subtitle_flush; 85 gboolean subtitle_error; 86 87 GMutex factories_lock; 88 GList *factories; 89 guint32 factories_cookie; 90 GstCaps *factory_caps; 91 92 GMutex lock; 93 GstCaps *subcaps; 94 95 GstElement *passthrough_identity; 96 97 GstElement *pre_colorspace; 98 GstElement *post_colorspace; 99 100 GstElement *parser; 101 GstElement *overlay; 102 103 GstElement *renderer; 104 105 const gchar *silent_property; 106 gboolean silent_property_invert; 107 }; 108 109 struct _GstSubtitleOverlayClass 110 { 111 GstBinClass parent; 112 }; 113 114 GType gst_subtitle_overlay_get_type (void); 115 116 GstCaps *gst_subtitle_overlay_create_factory_caps (void); 117 118 G_END_DECLS 119 #endif /* __GST_SUBTITLE_OVERLAY_H__ */ 120