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
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
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>
|
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))
|
|
|
|
#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;
|
2009-12-07 14:31:41 +00:00
|
|
|
typedef void (*GstAssRenderBlitFunction) (GstAssRender *render, ASS_Image *ass_image, GstBuffer *buffer);
|
2009-12-07 13:05:22 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/* <private> */
|
2009-02-05 16:42:37 +00:00
|
|
|
GstSegment video_segment;
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2009-12-07 14:31:41 +00:00
|
|
|
GstVideoFormat format;
|
2009-02-05 15:54:01 +00:00
|
|
|
gint width, height;
|
2009-12-08 13:06:23 +00:00
|
|
|
gint fps_n, fps_d;
|
2009-12-07 14:31:41 +00:00
|
|
|
GstAssRenderBlitFunction blit;
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2009-11-04 11:50:18 +00:00
|
|
|
GMutex *subtitle_mutex;
|
|
|
|
GCond *subtitle_cond;
|
|
|
|
GstBuffer *subtitle_pending;
|
2009-11-04 12:11:44 +00:00
|
|
|
gboolean subtitle_flushing;
|
2009-11-05 15:44:09 +00:00
|
|
|
GstSegment subtitle_segment;
|
2009-11-04 11:50:18 +00:00
|
|
|
|
2010-02-23 17:16:48 +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;
|
2009-02-05 15:54:01 +00:00
|
|
|
|
2009-12-08 13:46:35 +00:00
|
|
|
gboolean renderer_init_ok, track_init_ok;
|
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
|