2 * Copyright (c) 2008 Benjamin Schmitz <vortex@wolpzone.de>
3 * Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
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.
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.
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.
20 #ifndef __GST_ASS_RENDER_H__
21 #define __GST_ASS_RENDER_H__
24 #include <gst/video/video.h>
25 #include <gst/video/video-overlay-composition.h>
28 #include <ass/ass_types.h>
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
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))
47 typedef struct _GstAssRender GstAssRender;
48 typedef struct _GstAssRenderClass GstAssRenderClass;
54 GstPad *video_sinkpad, *text_sinkpad, *srcpad;
57 gboolean enable, embeddedfonts;
64 GstSegment video_segment;
65 gboolean video_flushing;
70 GSList *subtitle_pending;
71 gboolean subtitle_flushing;
72 gboolean subtitle_eos;
73 GstSegment subtitle_segment;
76 ASS_Library *ass_library;
77 ASS_Renderer *ass_renderer;
79 gint ass_frame_width, ass_frame_height;
81 gboolean renderer_init_ok, track_init_ok;
82 gboolean need_process;
85 GstVideoOverlayComposition *composition;
86 guint window_width, window_height;
87 gboolean attach_compo_to_buffer;
90 struct _GstAssRenderClass
92 GstElementClass parent_class;
95 GType gst_ass_render_get_type (void);