2009-02-05 15:54:01 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 Benjamin Schmitz <vortex@wolpzone.de>
|
2009-11-04 11:50:18 +00:00
|
|
|
* Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2009-02-05 15:54:01 +00:00
|
|
|
*
|
|
|
|
* 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 Free Software
|
2012-11-03 20:38:00 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-02-05 15:54:01 +00:00
|
|
|
*/
|
|
|
|
|
2009-12-07 13:05:22 +00:00
|
|
|
#ifndef __GST_ASS_RENDER_H__
|
|
|
|
#define __GST_ASS_RENDER_H__
|
2009-02-05 15:54:01 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2009-12-07 14:31:41 +00:00
|
|
|
#include <gst/video/video.h>
|
2013-01-17 17:48:12 +00:00
|
|
|
#include <gst/video/video-overlay-composition.h>
|
2009-02-05 15:54:01 +00:00
|
|
|
|
|
|
|
#include <ass/ass.h>
|
|
|
|
#include <ass/ass_types.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2009-08-31 07:11:34 +00:00
|
|
|
#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00907010
|
|
|
|
#define ASS_Library ass_library_t
|
|
|
|
#define ASS_Renderer ass_renderer_t
|
|
|
|
#define ASS_Track ass_track_t
|
|
|
|
#define ASS_Image ass_image_t
|
|
|
|
#endif
|
|
|
|
|
2009-12-07 13:05:22 +00:00
|
|
|
#define GST_TYPE_ASS_RENDER (gst_ass_render_get_type())
|
|
|
|
#define GST_ASS_RENDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ASS_RENDER,GstAssRender))
|
|
|
|
#define GST_ASS_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ASS_RENDER,GstAssRenderClass))
|
2014-01-10 17:38:09 +00:00
|
|
|
#define GST_ASS_RENDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
|
|
GST_TYPE_ASS_RENDER, GstAssRenderClass))
|
2009-12-07 13:05:22 +00:00
|
|
|
#define GST_IS_ASS_RENDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ASS_RENDER))
|
|
|
|
#define GST_IS_ASS_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ASS_RENDER))
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2009-12-07 13:05:22 +00:00
|
|
|
typedef struct _GstAssRender GstAssRender;
|
|
|
|
typedef struct _GstAssRenderClass GstAssRenderClass;
|
|
|
|
|
|
|
|
struct _GstAssRender
|
2009-02-05 15:54:01 +00:00
|
|
|
{
|
|
|
|
GstElement element;
|
|
|
|
|
|
|
|
GstPad *video_sinkpad, *text_sinkpad, *srcpad;
|
|
|
|
|
2009-12-08 13:46:35 +00:00
|
|
|
/* properties */
|
|
|
|
gboolean enable, embeddedfonts;
|
2013-01-21 09:35:49 +00:00
|
|
|
gboolean wait_text;
|
2009-12-08 13:46:35 +00:00
|
|
|
|
|
|
|
/* <private> */
|
2012-05-24 14:11:00 +00:00
|
|
|
GMutex lock;
|
|
|
|
GCond cond;
|
|
|
|
|
2009-02-05 16:42:37 +00:00
|
|
|
GstSegment video_segment;
|
2012-05-24 14:11:00 +00:00
|
|
|
gboolean video_flushing;
|
|
|
|
gboolean video_eos;
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2011-10-06 08:58:32 +00:00
|
|
|
GstVideoInfo info;
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2018-07-18 10:11:17 +00:00
|
|
|
GSList *subtitle_pending;
|
2009-11-04 12:11:44 +00:00
|
|
|
gboolean subtitle_flushing;
|
2012-05-24 14:11:00 +00:00
|
|
|
gboolean subtitle_eos;
|
2009-11-05 15:44:09 +00:00
|
|
|
GstSegment subtitle_segment;
|
2009-11-04 11:50:18 +00:00
|
|
|
|
2012-01-19 10:34:26 +00:00
|
|
|
GMutex ass_mutex;
|
2009-08-31 07:11:34 +00:00
|
|
|
ASS_Library *ass_library;
|
|
|
|
ASS_Renderer *ass_renderer;
|
|
|
|
ASS_Track *ass_track;
|
2015-08-19 15:18:31 +00:00
|
|
|
gint ass_frame_width, ass_frame_height;
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2009-12-08 13:46:35 +00:00
|
|
|
gboolean renderer_init_ok, track_init_ok;
|
2013-01-18 14:25:48 +00:00
|
|
|
gboolean need_process;
|
2013-01-17 17:48:12 +00:00
|
|
|
|
|
|
|
/* overlay stuff */
|
|
|
|
GstVideoOverlayComposition *composition;
|
2015-08-19 15:18:31 +00:00
|
|
|
guint window_width, window_height;
|
2013-01-17 17:48:12 +00:00
|
|
|
gboolean attach_compo_to_buffer;
|
2009-02-05 15:54:01 +00:00
|
|
|
};
|
|
|
|
|
2009-12-07 13:05:22 +00:00
|
|
|
struct _GstAssRenderClass
|
2009-02-05 15:54:01 +00:00
|
|
|
{
|
|
|
|
GstElementClass parent_class;
|
|
|
|
};
|
|
|
|
|
2009-12-07 13:05:22 +00:00
|
|
|
GType gst_ass_render_get_type (void);
|
2009-02-05 15:54:01 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif
|