Commit 8af7381d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

ext/cairo/: Port cairo textoverlay plugin to 0.9. Add 'shaded-background'...

ext/cairo/: Port cairo textoverlay plugin to 0.9. Add 'shaded-background' property and redo position. Doesn't handle ...

Original commit message from CVS:
* ext/cairo/Makefile.am:
* ext/cairo/gstcairo.c: (plugin_init):
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_base_init),
(gst_text_overlay_class_init), (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_font_init),
(gst_text_overlay_set_property), (gst_text_overlay_render_text),
(gst_text_overlay_getcaps), (gst_text_overlay_setcaps),
(gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_shade_y),
(gst_text_overlay_blit_1), (gst_text_overlay_blit_sub2x2),
(gst_text_overlay_push_frame), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* ext/cairo/gsttextoverlay.h:
Port cairo textoverlay plugin to 0.9. Add 'shaded-background'
property and redo position. Doesn't handle upstream renegotiation
yet though.
parent fb1c3904
2005-11-07 Tim-Philipp Müller <tim at centricular dot net>
* ext/cairo/Makefile.am:
* ext/cairo/gstcairo.c: (plugin_init):
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_base_init),
(gst_text_overlay_class_init), (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_font_init),
(gst_text_overlay_set_property), (gst_text_overlay_render_text),
(gst_text_overlay_getcaps), (gst_text_overlay_setcaps),
(gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_shade_y),
(gst_text_overlay_blit_1), (gst_text_overlay_blit_sub2x2),
(gst_text_overlay_push_frame), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* ext/cairo/gsttextoverlay.h:
Port cairo textoverlay plugin to 0.9. Add 'shaded-background'
property and redo position. Doesn't handle upstream renegotiation
yet though.
2005-11-07 Tim-Philipp Müller <tim at centricular dot net>
* gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream),
......
......@@ -3,15 +3,17 @@ plugin_LTLIBRARIES = libgstcairo.la
noinst_HEADERS = gsttimeoverlay.h gsttextoverlay.h
libgstcairo_la_SOURCES = \
gstcairo.c \
gsttimeoverlay.c \
gstcairo.c
# gsttextoverlay.c
gsttextoverlay.c
libgstcairo_la_CFLAGS = \
-I$(top_srcdir)/gst/videofilter \
$(GST_CFLAGS) $(CAIRO_CFLAGS)
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) $(CAIRO_CFLAGS)
libgstcairo_la_LIBADD = \
$(top_builddir)/gst/videofilter/libgstvideofilter-$(GST_MAJORMINOR).la \
$(GST_BASE_LIBS) \
$(GST_LIBS) $(CAIRO_LIBS) -lm
libgstcairo_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -22,7 +22,6 @@
#include "config.h"
#endif
/*#define DEBUG_ENABLED */
#include <gsttimeoverlay.h>
#include <gsttextoverlay.h>
#include <string.h>
......@@ -33,10 +32,8 @@ GST_DEBUG_CATEGORY (cairo_debug);
static gboolean
plugin_init (GstPlugin * plugin)
{
#if 0
gst_element_register (plugin, "cairotextoverlay", GST_RANK_NONE,
GST_TYPE_TEXTOVERLAY);
#endif
GST_TYPE_TEXT_OVERLAY);
gst_element_register (plugin, "cairotimeoverlay", GST_RANK_NONE,
GST_TYPE_TIMEOVERLAY);
......
This diff is collapsed.
#ifndef __GST_TEXTOVERLAY_H__
#define __GST_TEXTOVERLAY_H__
#ifndef __GST_TEXT_OVERLAY_H__
#define __GST_TEXT_OVERLAY_H__
#include <gst/gst.h>
#include <cairo.h>
#include <gst/base/gstcollectpads.h>
G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN (cairo_debug);
#define GST_CAT_DEFAULT cairo_debug
#define GST_TYPE_TEXTOVERLAY (gst_textoverlay_get_type())
#define GST_TEXTOVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\
GST_TYPE_TEXTOVERLAY, GstTextOverlay))
#define GST_TEXTOVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\
#define GST_TYPE_TEXT_OVERLAY (gst_text_overlay_get_type())
#define GST_TEXT_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\
GST_TYPE_TEXT_OVERLAY, GstTextOverlay))
#define GST_TEXT_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\
GST_TYPE_ULAW, GstTextOverlay))
#define GST_TEXTOVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
GST_TYPE_TEXTOVERLAY, GstTextOverlayClass))
#define GST_IS_TEXTOVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
GST_TYPE_TEXTOVERLAY))
#define GST_IS_TEXTOVERLAY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),\
GST_TYPE_TEXTOVERLAY))
#define GST_TEXT_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
GST_TYPE_TEXT_OVERLAY, GstTextOverlayClass))
#define GST_IS_TEXT_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
GST_TYPE_TEXT_OVERLAY))
#define GST_IS_TEXT_OVERLAY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),\
GST_TYPE_TEXT_OVERLAY))
typedef struct _GstTextOverlay GstTextOverlay;
typedef struct _GstTextOverlayClass GstTextOverlayClass;
......@@ -47,36 +44,44 @@ struct _GstTextOverlay {
GstPad *video_sinkpad;
GstPad *text_sinkpad;
GstPad *srcpad;
GstCollectPads *collect;
GstCollectData *video_collect_data;
GstCollectData *text_collect_data;
gint width;
gint height;
gdouble framerate;
GstTextOverlayVAlign valign;
GstTextOverlayHAlign halign;
gint x0;
gint y0;
gint xpad;
gint ypad;
gint deltax;
gint deltay;
gchar *default_text;
gboolean want_shading;
cairo_t *cr;
guchar *text_fill_image;
guchar *text_outline_image;
int text_height;
guchar *text_fill_image;
guchar *text_outline_image;
gint font_height;
gint text_x0, text_x1; /* start/end x position of text */
gint text_dy;
GstBuffer *current_buffer;
GstBuffer *next_buffer;
gboolean need_render;
gchar *font;
int slant;
int weight;
double scale;
gchar *font;
gint slant;
gint weight;
gdouble scale;
};
struct _GstTextOverlayClass {
GstElementClass parent_class;
GstElementClass parent_class;
};
GType gst_textoverlay_get_type(void) G_GNUC_CONST;
GType gst_text_overlay_get_type (void);
G_END_DECLS
#endif /* __GST_TEXTOVERLAY_H */
#endif /* __GST_TEXT_OVERLAY_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment