...
 
Commits (8)
  • Ronald S. Bultje's avatar
    ext/: Try to fix seeking problems in OGM files, especially those containing... · de06067c
    Ronald S. Bultje authored
    ext/: Try to fix seeking problems in OGM files, especially those containing non-continuous data streams (a.o. #171777).
    
    Original commit message from CVS:
    * ext/ogg/gstoggdemux.c: (gst_ogg_demux_push), (gst_ogg_sync),
    (gst_ogg_pad_push):
    * ext/ogg/gstogmparse.c: (gst_ogm_parse_init),
    (gst_ogm_parse_kick_event), (gst_ogm_parse_chain):
    * ext/pango/gsttextoverlay.c: (gst_textoverlay_event),
    (gst_textoverlay_loop):
    Try to fix seeking problems in OGM files, especially those
    containing non-continuous data streams (a.o. #171777).
    de06067c
  • Ronald S. Bultje's avatar
    ext/pango/gsttextoverlay.c: Don't crop off bottom (fixes #172845 minus a pixel at the left in · a69f435f
    Ronald S. Bultje authored
    Original commit message from CVS:
    * ext/pango/gsttextoverlay.c: (render_text),
    (gst_text_overlay_blit_yuv420):
    Don't crop off bottom (fixes #172845 minus a pixel at the left in
    Ubuntu...?).
    * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_init),
    (gst_asf_demux_process_chunk), (gst_asf_demux_change_state),
    (gst_asf_demux_add_audio_stream), (gst_asf_demux_add_video_stream),
    (gst_asf_demux_setup_pad):
    * gst/asfdemux/gstasfdemux.h:
    Frame rate estimation (#168406).
    a69f435f
  • Ronald S. Bultje's avatar
    ext/pango/gsttextoverlay.c: Fix offset bug (#172845). · 8f5846b9
    Ronald S. Bultje authored
    Original commit message from CVS:
    * ext/pango/gsttextoverlay.c: (render_text):
    Fix offset bug (#172845).
    8f5846b9
  • Ronald S. Bultje's avatar
    ext/pango/gsttextoverlay.*: Handle EOS better (#302220). · 40327aec
    Ronald S. Bultje authored
    Original commit message from CVS:
    * ext/pango/gsttextoverlay.c: (gst_textoverlay_event),
    (gst_textoverlay_loop), (gst_textoverlay_change_state),
    (gst_textoverlay_init):
    * ext/pango/gsttextoverlay.h:
    Handle EOS better (#302220).
    40327aec
  • Tim-Philipp Müller's avatar
    ex/: Even more gcc-4.0 fixes. · 9b7ca34e
    Tim-Philipp Müller authored
    Original commit message from CVS:
    * examples/seeking/cdplayer.c: (update_scale):
    * examples/seeking/playbin.c: (update_scale):
    * examples/seeking/seek.c: (update_scale):
    * examples/seeking/spider_seek.c: (update_scale):
    * ext/aalib/gstaasink.c: (gst_aasink_scale), (gst_aasink_chain):
    * ext/alsa/gstalsa.c: (gst_alsa_get_format), (gst_alsa_get_caps):
    * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_get_option):
    * ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event),
    (gst_alsa_sink_mmap):
    * ext/alsa/gstalsasrc.c: (gst_alsa_src_mmap):
    * ext/audiofile/gstafsink.c: (gst_afsink_open_file):
    * ext/cairo/gsttextoverlay.c: (gst_textoverlay_render_text),
    (gst_textoverlay_loop):
    * ext/cairo/gsttimeoverlay.c: (gst_timeoverlay_planar411):
    * ext/cdparanoia/gstcdparanoia.c: (get_musicbrainz_discid):
    * ext/dv/gstdvdec.c: (gst_dvdec_handle_sink_event):
    * ext/dvdread/dvdreadsrc.c: (dvdnavsrc_make_clut_change_event):
    * ext/flac/gstflacdec.c: (gst_flacdec_update_metadata):
    * ext/flac/gstflactag.c: (gst_flac_tag_chain):
    * ext/gnomevfs/gstgnomevfssrc.c:
    (gst_gnomevfssrc_get_icy_metadata):
    * ext/jpeg/gstsmokedec.c: (gst_smokedec_chain):
    * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_chain):
    * ext/jpeg/smokecodec.c: (find_best_size):
    * ext/lame/gstlame.c: (add_one_tag), (gst_lame_chain):
    * ext/mad/gstid3tag.c: (mad_id3_parse_latin1_string),
    (mad_id3_parse_comment_frame), (gst_mad_id3_to_tag_list),
    (gst_id3_tag_handle_event):
    * ext/mad/gstmad.c: (gst_mad_handle_event), (gst_mad_chain):
    * ext/mpeg2dec/gstmpeg2dec.c:
    * ext/musicbrainz/gsttrm.c: (gst_musicbrainz_sinkconnect),
    (gst_musicbrainz_chain):
    * ext/ogg/gstoggmux.c: (gst_ogg_mux_next_buffer):
    * ext/pango/gsttextoverlay.c: (gst_textoverlay_loop):
    * ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_chain):
    * ext/spc/gstspc.c: (spc_setup):
    * ext/speex/gstspeexdec.c: (speex_dec_src_event),
    (speex_dec_event), (speex_dec_chain):
    * ext/speex/gstspeexenc.c: (gst_speexenc_chain):
    * ext/theora/theoradec.c: (theora_dec_src_query),
    (theora_dec_src_event), (theora_dec_event), (theora_dec_chain):
    * ext/theora/theoraenc.c: (theora_enc_chain):
    * ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
    (vorbis_dec_event), (vorbis_dec_chain):
    * ext/vorbis/vorbisenc.c: (gst_vorbisenc_chain):
    * ext/wavpack/unpack.c: (init_wv_bitstream), (init_wvc_bitstream),
    (init_wvx_bitstream):
    Even more gcc-4.0 fixes.
    9b7ca34e
  • Jan Schmidt's avatar
    configure.ac: Add imagemixer/dvdsubdec. · e997c35f
    Jan Schmidt authored
    Original commit message from CVS:
    * configure.ac:
    Add imagemixer/dvdsubdec.
    * ext/dvdnav/dvdnavsrc.c: (dvdnav_build_titlelang_event):
    For menu subpicture streams, set a name too, so dvddemux picks
    it up and can still validly emit no-more-pads.
    * ext/dvdnav/gst-dvd-2:
    Example.
    * ext/pango/Makefile.am:
    * ext/pango/gsttextoverlay.c: (plugin_init):
    * ext/pango/gsttextrender.c: (gst_text_render_get_type),
    (gst_text_render_base_init), (gst_text_render_class_init),
    (resize_bitmap), (render_text), (gst_text_render_link),
    (gst_text_render_fixate), (gst_text_overlay_blit_yuv420),
    (gst_text_render_chain), (gst_text_render_finalize),
    (gst_text_render_init), (gst_text_render_set_property),
    (gst_text_render_get_property):
    * ext/pango/gsttextrender.h:
    Chain-based text-rendering element (#306555).
    * gst/dvdsubdec/Makefile.am:
    * gst/dvdsubdec/dvdsubdec.c: (gst_dvdsubdec_get_type),
    (gst_dvdsubdec_base_init), (gst_dvdsubdec_class_init),
    (gst_dvdsubdec_init), (gst_dvdsubdec_finalize),
    (gst_dvdsubdec_getcaps_video), (gst_dvdsubdec_link_video),
    (gst_dvdsubdec_src_event), (dvdsubdec_get_event_delay),
    (gst_dvdsubdec_parse_subpic), (gst_get_nibble),
    (gst_setup_palette), (gst_get_rle_code), (gst_draw_rle_line),
    (gst_dvdsubdec_merge_title), (gst_send_empty_fill),
    (gst_send_subtitle_frame), (dvdsubdec_advance_time),
    (gst_dvdsubdec_handle_subtitle), (gst_dvdsubdec_handle_dvd_event),
    (plugin_init):
    Chain-based DVD subtitle decoder element (#301312), based
    on patch by Jan Schmidt <thaytan@mad.scientist.com>.
    * gst/ffmpegcolorspace/gstffmpegcodecmap.c:
    (gst_ffmpeg_pixfmt_to_caps), (gst_ffmpeg_caps_to_pixfmt):
    * gst/ffmpegcolorspace/imgconvert.c:
    * gst/ffmpegcolorspace/imgconvert_template.h:
    Conserve alpha channel for BGRA32->AYUV, fix BGRA/BGRX
    masks (#308638).
    * gst/imagemixer/Makefile.am:
    * gst/imagemixer/README:
    * gst/imagemixer/blend.c:
    * gst/imagemixer/blend.h:
    * gst/imagemixer/mixer.c: (gst_image_mixer_base_init),
    (gst_image_mixer_class_init), (gst_image_mixer_init),
    (gst_image_mixer_request_pad), (gst_image_mixer_release_pad),
    (gst_image_mixer_fixate), (gst_image_mixer_get_caps),
    (gst_image_mixer_set_caps), (gst_image_mixer_read_a),
    (gst_image_mixer_read_y), (gst_image_mixer_read_u_v),
    (gst_image_mixer_do_mix_i420), (gst_image_mixer_do_mix_yuy2),
    (gst_image_mixer_do_mix_x444), (gst_image_mixer_do_mix_y444),
    (gst_image_mixer_do_mix_ayuv), (gst_image_mixer_do_mix),
    (is_past_end), (gst_image_mixer_blend_subpicture),
    (gst_image_mixer_src_event), (gst_image_mixer_handle_sink_event),
    (cb_compare), (gst_image_mixer_loop),
    (gst_image_mixer_change_state):
    * gst/imagemixer/mixer.h:
    * gst/imagemixer/mixerpad.c:
    (gst_image_mixer_pad_v_align_get_type),
    (gst_image_mixer_pad_h_align_get_type),
    (gst_image_mixer_pad_set_property),
    (gst_image_mixer_pad_get_property),
    (gst_image_mixer_pad_class_init), (gst_image_mixer_pad_init):
    * gst/imagemixer/mixerpad.h:
    * gst/imagemixer/plugin.c: (plugin_init):
    Image-mixing element, in the style of the pango textrendering
    element, but image- instead of text-based, including all cool
    stuff like seeking, overlays, picture-in-picture, DVD subtitle
    support, text subtitle support and everything. Can do negative
    z-orders for inverted overlay (force to AYUV in that case) so
    it can be used for chroma-keying software, too (#166783).
    * gst/imagemixer/test-dvd-subtitle.sh:
    Example.
    * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_init),
    (gst_dvd_demux_handle_dvd_event), (gst_dvd_demux_handle_discont),
    (gst_dvd_demux_send_subbuffer), (gst_dvd_demux_reset),
    (gst_dvd_demux_change_state):
    * gst/mpegstream/gstdvddemux.h:
    * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_reset):
    Implement no-more-pads if the source knows the amount of pads,
    which dvd sources known from the IFO files.
    * gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init),
    (group_is_muted), (gen_preroll_element), (probe_triggered),
    (has_subtitle_ancestor), (new_decoded_pad),
    (gst_play_base_bin_set_property), (gst_play_base_bin_get_property):
    * gst/playback/gstplaybasebin.h:
    Implement subpicture pad support.
    * gst/playback/gstplaybin.c: (gen_video_element),
    (gen_subtitle_element), (gen_audio_element), (remove_sinks),
    (add_sink), (setup_sinks):
    Changes so we support subtitles in a more generic way and thus
    support DVD subtitles and menus in addition to text subtitles.
    * gst/playback/gststreaminfo.c: (gst_stream_type_get_type):
    * gst/playback/gststreaminfo.h:
    Subpicture type.
    * gst/playback/gststreamselector.c: (gst_stream_selector_chain):
    Event handling.
    * gst/videomixer/videomixer.c: (gst_videomixer_fill_queues),
    (gst_videomixer_update_queues):
    Do EOS correctly for endless streams on mainpad, while other
    pads are infinite (e.g. single picture; #309179).
    e997c35f
  • Arwed von Merkatz Merkatz's avatar
    Rename and cleanup bitmap->ayuv conversion. · 0ee77057
    Arwed von Merkatz Merkatz authored
    Original commit message from CVS:
    Rename and cleanup bitmap->ayuv conversion.
    0ee77057
  • Thomas Vander Stichele's avatar
    make gst_videofilter_setup public make videoflip invoke the base _setup method... · 8a83cab6
    Thomas Vander Stichele authored
    make gst_videofilter_setup public make videoflip invoke the base _setup method properly, but only if it's been inited...
    
    Original commit message from CVS:
    make gst_videofilter_setup public
    make videoflip invoke the base _setup method properly,
    but only if it's been inited before
    this handles all cases where properties are set at the start
    or while running to change the method of flipping
    8a83cab6
common @ 694de4db
Subproject commit b2638c100721f67b280c3b43b21f1ce1c9b5e316
Subproject commit 694de4dbf4827f372321f0634643a254d7edd986
......@@ -4,14 +4,14 @@
plugin_LTLIBRARIES = libgsttimeoverlay.la libgsttextoverlay.la
noinst_HEADERS = gsttimeoverlay.h gsttextoverlay.h
noinst_HEADERS = gsttimeoverlay.h gsttextoverlay.h gsttextrender.h
libgsttimeoverlay_la_SOURCES = gsttimeoverlay.c
libgsttimeoverlay_la_CFLAGS = $(GST_CFLAGS) $(PANGO_CFLAGS) -I$(top_srcdir)/gst/videofilter
libgsttimeoverlay_la_LIBADD =
libgsttimeoverlay_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(PANGO_LIBS) -lm
libgsttextoverlay_la_SOURCES = gsttextoverlay.c
libgsttextoverlay_la_SOURCES = gsttextoverlay.c gsttextrender.c
libgsttextoverlay_la_CFLAGS = $(GST_CFLAGS) $(PANGO_CFLAGS)
libgsttextoverlay_la_LIBADD =
libgsttextoverlay_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(PANGO_LIBS)
......@@ -22,9 +22,10 @@
#include <config.h>
#endif
#include <gst/gst.h>
#include "gsttextrender.h"
#include "gsttextoverlay.h"
GST_DEBUG_CATEGORY_STATIC (pango_debug);
GST_DEBUG_CATEGORY (pango_debug);
#define GST_CAT_DEFAULT pango_debug
static GstElementDetails textoverlay_details = {
......@@ -217,7 +218,7 @@ render_text (GstTextOverlay * overlay)
pango_layout_get_pixel_extents (overlay->layout, &ink_rect, &logical_rect);
resize_bitmap (overlay, ink_rect.width, ink_rect.height + ink_rect.y);
pango_ft2_render_layout (&overlay->bitmap, overlay->layout, 0, 0);
pango_ft2_render_layout (&overlay->bitmap, overlay->layout, -ink_rect.x, 0);
overlay->baseline_y = ink_rect.y;
}
......@@ -295,6 +296,16 @@ gst_textoverlay_event (GstPad * pad, GstEvent * event)
GST_PAD_IS_LINKED (overlay->text_sinkpad)) {
gst_event_ref (event);
gst_pad_send_event (GST_PAD_PEER (overlay->text_sinkpad), event);
if (overlay->next_data) {
gst_data_unref (overlay->next_data);
overlay->next_data = NULL;
}
if (overlay->current_data) {
gst_data_unref (overlay->current_data);
overlay->current_data = NULL;
}
overlay->need_render = TRUE;
overlay->text_eos = FALSE;
}
return gst_pad_send_event (GST_PAD_PEER (overlay->video_sinkpad), event);
......@@ -309,7 +320,7 @@ gst_text_overlay_blit_yuv420 (GstTextOverlay * overlay, FT_Bitmap * bitmap,
int rowinc, bit_rowinc, uv_rowinc;
guchar *p, *bitp, *u_p;
int video_width = overlay->width, video_height = overlay->height;
int bitmap_x0 = x0 < 1 ? -(x0 - 1) : 1; /* 1 pixel border */
int bitmap_x0 = 0; //x0 < 1 ? -(x0 - 1) : 1; /* 1 pixel border */
int bitmap_y0 = y0 < 1 ? -(y0 - 1) : 1; /* 1 pixel border */
int bitmap_width = bitmap->width - bitmap_x0;
int bitmap_height = bitmap->rows - bitmap_y0;
......@@ -331,7 +342,7 @@ gst_text_overlay_blit_yuv420 (GstTextOverlay * overlay, FT_Bitmap * bitmap,
x1 = x0 + bitmap_x0;
p = pixbuf + video_width * y1 + x1;
bitp = bitmap->buffer + bitmap->pitch * bitmap_y0 + bitmap_x0;
for (y = bitmap_y0; y < bitmap_height; y++) {
for (y = bitmap_y0; y < bitmap_y0 + bitmap_height; y++) {
int n;
for (n = bitmap_width; n > 0; --n) {
......@@ -360,7 +371,7 @@ gst_text_overlay_blit_yuv420 (GstTextOverlay * overlay, FT_Bitmap * bitmap,
skip_y = 0;
skip_x = 0;
for (; y < bitmap_height; y++) {
for (; y < bitmap_y0 + bitmap_height; y++) {
int n;
x1 = x0 + bitmap_x0;
......@@ -471,22 +482,25 @@ gst_textoverlay_loop (GstElement * element)
GstEvent *event = GST_EVENT (video_frame);
GstEventType type = GST_EVENT_TYPE (event);
gst_pad_event_default (overlay->video_sinkpad, event);
GST_DEBUG ("Received event of type %d", type);
if (type == GST_EVENT_INTERRUPT)
if (type == GST_EVENT_INTERRUPT) {
gst_event_unref (event);
return;
else if (type == GST_EVENT_EOS) {
/* EOS text stream */
GstData *data = NULL;
do {
if (data)
gst_data_unref (data);
data = gst_pad_pull (overlay->text_sinkpad);
} while (!GST_IS_EVENT (data) ||
GST_EVENT_TYPE (data) == GST_EVENT_EOS);
gst_data_unref (data);
}
gst_pad_event_default (overlay->video_sinkpad, event);
if (type == GST_EVENT_EOS) {
if (!overlay->text_eos) {
/* EOS text stream */
GstData *data = NULL;
do {
if (data)
gst_data_unref (data);
data = gst_pad_pull (overlay->text_sinkpad);
} while (!GST_IS_EVENT (data) ||
GST_EVENT_TYPE (data) == GST_EVENT_EOS);
gst_data_unref (data);
}
return;
}
video_frame = NULL;
......@@ -512,7 +526,7 @@ gst_textoverlay_loop (GstElement * element)
GST_DEBUG ("attempting to pull text data");
/* read all text buffers until we get one "in the future" */
if (!GST_PAD_IS_USABLE (overlay->text_sinkpad)) {
if (!GST_PAD_IS_USABLE (overlay->text_sinkpad) || overlay->text_eos) {
break;
}
do {
......@@ -522,15 +536,19 @@ gst_textoverlay_loop (GstElement * element)
GstEvent *event = GST_EVENT (overlay->next_data);
GstEventType type = GST_EVENT_TYPE (event);
GST_DEBUG ("Received text data event of type %d", type);
overlay->next_data = NULL;
gst_event_unref (event);
if (type == GST_EVENT_EOS)
if (type == GST_EVENT_EOS) {
overlay->text_eos = TRUE;
break;
else if (type == GST_EVENT_INTERRUPT)
} else if (type == GST_EVENT_INTERRUPT)
return;
overlay->next_data = NULL;
}
} while (!overlay->next_data);
if (!overlay->next_data)
break;
if (PAST_END (overlay->next_data, now)) {
GST_DEBUG ("Received %s is past end (%" GST_TIME_FORMAT " + %"
GST_TIME_FORMAT " < %" GST_TIME_FORMAT ")",
......@@ -574,7 +592,7 @@ gst_textoverlay_loop (GstElement * element)
GST_BUFFER_DATA (overlay->current_data));
/* somehow pango barfs over "\0" buffers... */
pango_layout_set_markup (overlay->layout,
GST_BUFFER_DATA (overlay->current_data), size);
(gchar *) GST_BUFFER_DATA (overlay->current_data), size);
} else {
GST_DEBUG ("Filler - no data");
pango_layout_set_markup (overlay->layout, "", 0);
......@@ -619,12 +637,11 @@ gst_textoverlay_change_state (GstElement * element)
case GST_STATE_PLAYING_TO_PAUSED:
break;
case GST_STATE_PAUSED_TO_READY:
overlay->text_eos = FALSE;
break;
}
parent_class->change_state (element);
return GST_STATE_SUCCESS;
return parent_class->change_state (element);
}
static void
......@@ -692,6 +709,7 @@ gst_textoverlay_init (GstTextOverlay * overlay)
overlay->default_text = g_strdup ("");
overlay->need_render = TRUE;
overlay->text_eos = FALSE;
gst_element_set_loop_function (GST_ELEMENT (overlay), gst_textoverlay_loop);
......@@ -793,7 +811,9 @@ static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "textoverlay", GST_RANK_NONE,
GST_TYPE_TEXTOVERLAY))
GST_TYPE_TEXTOVERLAY) ||
!gst_element_register (plugin, "textrender", GST_RANK_NONE,
GST_TYPE_TEXT_RENDER))
return FALSE;
/*texttestsrc_plugin_init(module, plugin); */
......
......@@ -43,6 +43,7 @@ struct _GstTextOverlay {
GstPad *video_sinkpad;
GstPad *text_sinkpad;
gboolean text_eos;
GstPad *srcpad;
gint width;
gint height;
......
This diff is collapsed.
/* -*- Mode: C; c-file-style: "stroustrup" -*- */
#ifndef __GST_TEXT_RENDER_H__
#define __GST_TEXT_RENDER_H__
#include <gst/gst.h>
#include <pango/pangoft2.h>
G_BEGIN_DECLS
#define GST_TYPE_TEXT_RENDER (gst_text_render_get_type())
#define GST_TEXT_RENDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\
GST_TYPE_TEXT_RENDER, GstTextRender))
#define GST_TEXT_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),\
GST_TYPE_ULAW, GstTextRender))
#define GST_TEXT_RENDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
GST_TYPE_TEXT_RENDER, GstTextRenderClass))
#define GST_IS_TEXT_RENDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),\
GST_TYPE_TEXT_RENDER))
#define GST_IS_TEXT_RENDER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),\
GST_TYPE_TEXT_RENDER))
typedef struct _GstTextRender GstTextRender;
typedef struct _GstTextRenderClass GstTextRenderClass;
struct _GstTextRender {
GstElement element;
GstPad *sinkpad, *srcpad;
gint width;
gint height;
PangoLayout *layout;
FT_Bitmap bitmap;
gint bitmap_buffer_size;
gint baseline_y;
};
struct _GstTextRenderClass {
GstElementClass parent_class;
PangoContext *pango_context;
};
GType gst_text_render_get_type(void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GST_TEXT_RENDER_H */
......@@ -26,7 +26,8 @@
/*#define DEBUG_ENABLED */
#include "gstvideofilter.h"
GST_DEBUG_CATEGORY_STATIC (gst_videofilter_debug);
#define GST_CAT_DEFAULT gst_videofilter_debug
/* GstVideofilter signals and args */
enum
......@@ -53,7 +54,6 @@ static void gst_videofilter_get_property (GObject * object, guint prop_id,
static void gst_videofilter_chain (GstPad * pad, GstData * _data);
GstCaps *gst_videofilter_class_get_capslist (GstVideofilterClass * klass);
static void gst_videofilter_setup (GstVideofilter * videofilter);
static GstElementClass *parent_class = NULL;
......@@ -173,14 +173,11 @@ gst_videofilter_getcaps (GstPad * pad)
GstVideofilter *videofilter;
GstVideofilterClass *klass;
//GstCaps *caps;
GstCaps *othercaps;
GstPad *otherpad;
//int i;
GST_DEBUG ("gst_videofilter_getcaps");
videofilter = GST_VIDEOFILTER (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (videofilter, "gst_videofilter_getcaps");
klass = GST_VIDEOFILTER_CLASS (G_OBJECT_GET_CLASS (videofilter));
......@@ -231,8 +228,8 @@ gst_videofilter_link (GstPad * pad, const GstCaps * caps)
GstPadLinkReturn lret;
GstPad *otherpad;
GST_DEBUG ("gst_videofilter_src_link");
videofilter = GST_VIDEOFILTER (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (videofilter, "gst_videofilter_src_link");
otherpad = (pad == videofilter->srcpad) ? videofilter->sinkpad :
videofilter->srcpad;
......@@ -254,7 +251,7 @@ gst_videofilter_link (GstPad * pad, const GstCaps * caps)
if (GST_PAD_LINK_FAILED (lret))
return lret;
GST_DEBUG ("width %d height %d", width, height);
GST_DEBUG_OBJECT (videofilter, "width %d height %d", width, height);
#if 0
if (pad == videofilter->srcpad) {
......@@ -282,7 +279,7 @@ gst_videofilter_init (GTypeInstance * instance, gpointer g_class)
GstVideofilter *videofilter = GST_VIDEOFILTER (instance);
GstPadTemplate *pad_template;
GST_DEBUG ("gst_videofilter_init");
GST_DEBUG_OBJECT (videofilter, "gst_videofilter_init");
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (g_class), "sink");
......@@ -313,13 +310,13 @@ gst_videofilter_chain (GstPad * pad, GstData * _data)
gulong size;
GstBuffer *outbuf;
GST_DEBUG ("gst_videofilter_chain");
videofilter = GST_VIDEOFILTER (gst_pad_get_parent (pad));
GST_LOG_OBJECT (videofilter, "gst_videofilter_chain");
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (buf != NULL);
videofilter = GST_VIDEOFILTER (gst_pad_get_parent (pad));
//g_return_if_fail (videofilter->inited);
data = GST_BUFFER_DATA (buf);
......@@ -330,11 +327,11 @@ gst_videofilter_chain (GstPad * pad, GstData * _data)
return;
}
GST_DEBUG ("gst_videofilter_chain: got buffer of %ld bytes in '%s'", size,
GST_LOG_OBJECT (videofilter, "got buffer of %ld bytes in '%s'", size,
GST_OBJECT_NAME (videofilter));
GST_DEBUG
("size=%ld from=%dx%d to=%dx%d fromsize=%ld (should be %d) tosize=%d",
GST_LOG_OBJECT (videofilter,
"size=%ld from=%dx%d to=%dx%d fromsize=%ld (should be %d) tosize=%d",
size, videofilter->from_width, videofilter->from_height,
videofilter->to_width, videofilter->to_height, size,
videofilter->from_buf_size, videofilter->to_buf_size);
......@@ -342,17 +339,18 @@ gst_videofilter_chain (GstPad * pad, GstData * _data)
g_return_if_fail (size >= videofilter->from_buf_size);
if (size > videofilter->from_buf_size) {
GST_INFO ("buffer size %ld larger than expected (%d)",
GST_INFO_OBJECT (videofilter, "buffer size %ld larger than expected (%d)",
size, videofilter->from_buf_size);
}
outbuf = gst_pad_alloc_buffer (videofilter->srcpad, GST_BUFFER_OFFSET_NONE,
videofilter->to_buf_size);
g_return_if_fail (GST_BUFFER_DATA (outbuf));
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
g_return_if_fail (videofilter->format);
GST_DEBUG ("format %s", videofilter->format->fourcc);
GST_LOG_OBJECT (videofilter, "format %s", videofilter->format->fourcc);
videofilter->in_buf = buf;
videofilter->out_buf = outbuf;
......@@ -360,7 +358,7 @@ gst_videofilter_chain (GstPad * pad, GstData * _data)
videofilter->format->filter_func (videofilter, GST_BUFFER_DATA (outbuf),
data);
GST_DEBUG ("gst_videofilter_chain: pushing buffer of %d bytes in '%s'",
GST_LOG_OBJECT (videofilter, "pushing buffer of %d bytes in '%s'",
GST_BUFFER_SIZE (outbuf), GST_OBJECT_NAME (videofilter));
gst_pad_push (videofilter->srcpad, GST_DATA (outbuf));
......@@ -372,13 +370,13 @@ static void
gst_videofilter_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstVideofilter *src;
GstVideofilter *videofilter;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_VIDEOFILTER (object));
src = GST_VIDEOFILTER (object);
videofilter = GST_VIDEOFILTER (object);
GST_DEBUG ("gst_videofilter_set_property");
GST_DEBUG_OBJECT (videofilter, "gst_videofilter_set_property");
switch (prop_id) {
default:
break;
......@@ -389,11 +387,11 @@ static void
gst_videofilter_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstVideofilter *src;
GstVideofilter *videofilter;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_VIDEOFILTER (object));
src = GST_VIDEOFILTER (object);
videofilter = GST_VIDEOFILTER (object);
switch (prop_id) {
default:
......@@ -447,14 +445,17 @@ gst_videofilter_set_output_size (GstVideofilter * videofilter,
}
}
static void
void
gst_videofilter_setup (GstVideofilter * videofilter)
{
GstVideofilterClass *klass;
GST_DEBUG_OBJECT (videofilter, "setup");
klass = GST_VIDEOFILTER_CLASS (G_OBJECT_GET_CLASS (videofilter));
if (klass->setup) {
GST_DEBUG_OBJECT (videofilter, "calling class setup method");
klass->setup (videofilter);
}
......@@ -478,6 +479,8 @@ gst_videofilter_setup (GstVideofilter * videofilter)
(videofilter->to_width * videofilter->to_height *
videofilter->format->bpp) / 8;
GST_DEBUG_OBJECT (videofilter, "from_buf_size %d to_buf_size %d",
videofilter->from_buf_size, videofilter->to_buf_size);
videofilter->inited = TRUE;
}
......@@ -564,6 +567,8 @@ gst_videofilter_class_add_pad_templates (GstVideofilterClass *
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (gst_videofilter_debug, "videofilter", 0,
"videofilter");
return TRUE;
}
......
......@@ -97,6 +97,7 @@ void gst_videofilter_set_output_size(GstVideofilter *videofilter,
GstVideofilterFormat *gst_videofilter_find_format_by_structure (GstVideofilter *filter,
const GstStructure *structure);
GstCaps *gst_videofilter_class_get_capslist(GstVideofilterClass *videofilterclass);
void gst_videofilter_setup (GstVideofilter * videofilter);
void gst_videofilter_class_add_format(GstVideofilterClass *videofilterclass,
GstVideofilterFormat *format);
......