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.
This commit is contained in:
parent
fb1c3904f7
commit
8af7381d5c
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
|||||||
|
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>
|
2005-11-07 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream),
|
* gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream),
|
||||||
|
@ -3,15 +3,17 @@ plugin_LTLIBRARIES = libgstcairo.la
|
|||||||
noinst_HEADERS = gsttimeoverlay.h gsttextoverlay.h
|
noinst_HEADERS = gsttimeoverlay.h gsttextoverlay.h
|
||||||
|
|
||||||
libgstcairo_la_SOURCES = \
|
libgstcairo_la_SOURCES = \
|
||||||
|
gstcairo.c \
|
||||||
gsttimeoverlay.c \
|
gsttimeoverlay.c \
|
||||||
gstcairo.c
|
gsttextoverlay.c
|
||||||
|
|
||||||
# gsttextoverlay.c
|
|
||||||
|
|
||||||
libgstcairo_la_CFLAGS = \
|
libgstcairo_la_CFLAGS = \
|
||||||
-I$(top_srcdir)/gst/videofilter \
|
-I$(top_srcdir)/gst/videofilter \
|
||||||
$(GST_CFLAGS) $(CAIRO_CFLAGS)
|
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||||
|
$(GST_BASE_CFLAGS) \
|
||||||
|
$(GST_CFLAGS) $(CAIRO_CFLAGS)
|
||||||
libgstcairo_la_LIBADD = \
|
libgstcairo_la_LIBADD = \
|
||||||
$(top_builddir)/gst/videofilter/libgstvideofilter-$(GST_MAJORMINOR).la \
|
$(top_builddir)/gst/videofilter/libgstvideofilter-$(GST_MAJORMINOR).la \
|
||||||
|
$(GST_BASE_LIBS) \
|
||||||
$(GST_LIBS) $(CAIRO_LIBS) -lm
|
$(GST_LIBS) $(CAIRO_LIBS) -lm
|
||||||
libgstcairo_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstcairo_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*#define DEBUG_ENABLED */
|
|
||||||
#include <gsttimeoverlay.h>
|
#include <gsttimeoverlay.h>
|
||||||
#include <gsttextoverlay.h>
|
#include <gsttextoverlay.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -33,10 +32,8 @@ GST_DEBUG_CATEGORY (cairo_debug);
|
|||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
gst_element_register (plugin, "cairotextoverlay", GST_RANK_NONE,
|
gst_element_register (plugin, "cairotextoverlay", GST_RANK_NONE,
|
||||||
GST_TYPE_TEXTOVERLAY);
|
GST_TYPE_TEXT_OVERLAY);
|
||||||
#endif
|
|
||||||
gst_element_register (plugin, "cairotimeoverlay", GST_RANK_NONE,
|
gst_element_register (plugin, "cairotimeoverlay", GST_RANK_NONE,
|
||||||
GST_TYPE_TIMEOVERLAY);
|
GST_TYPE_TIMEOVERLAY);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,26 +1,23 @@
|
|||||||
|
|
||||||
#ifndef __GST_TEXTOVERLAY_H__
|
#ifndef __GST_TEXT_OVERLAY_H__
|
||||||
#define __GST_TEXTOVERLAY_H__
|
#define __GST_TEXT_OVERLAY_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <cairo.h>
|
#include <gst/base/gstcollectpads.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (cairo_debug);
|
#define GST_TYPE_TEXT_OVERLAY (gst_text_overlay_get_type())
|
||||||
#define GST_CAT_DEFAULT cairo_debug
|
#define GST_TEXT_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\
|
||||||
|
GST_TYPE_TEXT_OVERLAY, GstTextOverlay))
|
||||||
#define GST_TYPE_TEXTOVERLAY (gst_textoverlay_get_type())
|
#define GST_TEXT_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\
|
||||||
#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),\
|
|
||||||
GST_TYPE_ULAW, GstTextOverlay))
|
GST_TYPE_ULAW, GstTextOverlay))
|
||||||
#define GST_TEXTOVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
|
#define GST_TEXT_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
|
||||||
GST_TYPE_TEXTOVERLAY, GstTextOverlayClass))
|
GST_TYPE_TEXT_OVERLAY, GstTextOverlayClass))
|
||||||
#define GST_IS_TEXTOVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
|
#define GST_IS_TEXT_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
|
||||||
GST_TYPE_TEXTOVERLAY))
|
GST_TYPE_TEXT_OVERLAY))
|
||||||
#define GST_IS_TEXTOVERLAY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),\
|
#define GST_IS_TEXT_OVERLAY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),\
|
||||||
GST_TYPE_TEXTOVERLAY))
|
GST_TYPE_TEXT_OVERLAY))
|
||||||
|
|
||||||
typedef struct _GstTextOverlay GstTextOverlay;
|
typedef struct _GstTextOverlay GstTextOverlay;
|
||||||
typedef struct _GstTextOverlayClass GstTextOverlayClass;
|
typedef struct _GstTextOverlayClass GstTextOverlayClass;
|
||||||
@ -47,36 +44,44 @@ struct _GstTextOverlay {
|
|||||||
GstPad *video_sinkpad;
|
GstPad *video_sinkpad;
|
||||||
GstPad *text_sinkpad;
|
GstPad *text_sinkpad;
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
|
|
||||||
|
GstCollectPads *collect;
|
||||||
|
GstCollectData *video_collect_data;
|
||||||
|
GstCollectData *text_collect_data;
|
||||||
|
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
|
gdouble framerate;
|
||||||
|
|
||||||
GstTextOverlayVAlign valign;
|
GstTextOverlayVAlign valign;
|
||||||
GstTextOverlayHAlign halign;
|
GstTextOverlayHAlign halign;
|
||||||
gint x0;
|
gint xpad;
|
||||||
gint y0;
|
gint ypad;
|
||||||
|
gint deltax;
|
||||||
|
gint deltay;
|
||||||
gchar *default_text;
|
gchar *default_text;
|
||||||
|
gboolean want_shading;
|
||||||
|
|
||||||
cairo_t *cr;
|
guchar *text_fill_image;
|
||||||
guchar *text_fill_image;
|
guchar *text_outline_image;
|
||||||
guchar *text_outline_image;
|
gint font_height;
|
||||||
int text_height;
|
gint text_x0, text_x1; /* start/end x position of text */
|
||||||
|
gint text_dy;
|
||||||
|
|
||||||
GstBuffer *current_buffer;
|
|
||||||
GstBuffer *next_buffer;
|
|
||||||
gboolean need_render;
|
gboolean need_render;
|
||||||
|
|
||||||
gchar *font;
|
gchar *font;
|
||||||
int slant;
|
gint slant;
|
||||||
int weight;
|
gint weight;
|
||||||
double scale;
|
gdouble scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstTextOverlayClass {
|
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
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_TEXTOVERLAY_H */
|
#endif /* __GST_TEXT_OVERLAY_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user