1 /* 2 * Copyright (c) 2008 Benjamin Schmitz <vortex@wolpzone.de> 3 * Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk> 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 License 7 * as published by the Free Software Foundation; either version 2 8 * 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 13 * GNU Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef __GST_ASS_RENDER_H__ 21 #define __GST_ASS_RENDER_H__ 22 23 #include <gst/gst.h> 24 #include <gst/video/video.h> 25 #include <gst/video/video-overlay-composition.h> 26 27 #include <ass/ass.h> 28 #include <ass/ass_types.h> 29 30 G_BEGIN_DECLS 31 32 #if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00907010 33 #define ASS_Library ass_library_t 34 #define ASS_Renderer ass_renderer_t 35 #define ASS_Track ass_track_t 36 #define ASS_Image ass_image_t 37 #endif 38 39 #define GST_TYPE_ASS_RENDER (gst_ass_render_get_type()) 40 #define GST_ASS_RENDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ASS_RENDER,GstAssRender)) 41 #define GST_ASS_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ASS_RENDER,GstAssRenderClass)) 42 #define GST_ASS_RENDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ 43 GST_TYPE_ASS_RENDER, GstAssRenderClass)) 44 #define GST_IS_ASS_RENDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ASS_RENDER)) 45 #define GST_IS_ASS_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ASS_RENDER)) 46 47 typedef struct _GstAssRender GstAssRender; 48 typedef struct _GstAssRenderClass GstAssRenderClass; 49 50 struct _GstAssRender 51 { 52 GstElement element; 53 54 GstPad *video_sinkpad, *text_sinkpad, *srcpad; 55 56 /* properties */ 57 gboolean enable, embeddedfonts; 58 gboolean wait_text; 59 60 /* <private> */ 61 GMutex lock; 62 GCond cond; 63 64 GstSegment video_segment; 65 gboolean video_flushing; 66 gboolean video_eos; 67 68 GstVideoInfo info; 69 70 GSList *subtitle_pending; 71 gboolean subtitle_flushing; 72 gboolean subtitle_eos; 73 GstSegment subtitle_segment; 74 75 GMutex ass_mutex; 76 ASS_Library *ass_library; 77 ASS_Renderer *ass_renderer; 78 ASS_Track *ass_track; 79 gint ass_frame_width, ass_frame_height; 80 81 gboolean renderer_init_ok, track_init_ok; 82 gboolean need_process; 83 84 /* overlay stuff */ 85 GstVideoOverlayComposition *composition; 86 guint window_width, window_height; 87 gboolean attach_compo_to_buffer; 88 }; 89 90 struct _GstAssRenderClass 91 { 92 GstElementClass parent_class; 93 }; 94 95 GType gst_ass_render_get_type (void); 96 97 G_END_DECLS 98 99 #endif 100