diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2012-08-17 22:57:10 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2012-08-17 22:57:10 +0200 |
commit | 4132d222cb963c04149a8a4087e9a1fa93903614 (patch) | |
tree | 3c39d905940c0318bdbf1199cee7244c3ca51541 /gst/audiovisualizers/gstwavescope.c | |
parent | 48cf0f3a77628268f2f19f5b9bd2291048254a61 (diff) | |
download | gstreamer-plugins-bad-4132d222cb963c04149a8a4087e9a1fa93903614.tar.gz |
audiovisualizer: sync to change in base and port
Add support for GstVideoMeta and GstVideoFrame. Remove some redundant fields
that are also in GstVideoInfo. Don't disable the shader code, it does not
look broken.
Diffstat (limited to 'gst/audiovisualizers/gstwavescope.c')
-rw-r--r-- | gst/audiovisualizers/gstwavescope.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/gst/audiovisualizers/gstwavescope.c b/gst/audiovisualizers/gstwavescope.c index 72a0814eb..e37d9285e 100644 --- a/gst/audiovisualizers/gstwavescope.c +++ b/gst/audiovisualizers/gstwavescope.c @@ -116,7 +116,7 @@ static void render_color_lines (GstAudioVisualizer * base, guint32 * vdata, static gboolean gst_wave_scope_setup (GstAudioVisualizer * scope); static gboolean gst_wave_scope_render (GstAudioVisualizer * base, - GstBuffer * audio, GstBuffer * video); + GstBuffer * audio, GstVideoFrame * video); #define gst_wave_scope_parent_class parent_class G_DEFINE_TYPE (GstWaveScope, gst_wave_scope, GST_TYPE_AUDIO_VISUALIZER); @@ -240,8 +240,8 @@ render_dots (GstAudioVisualizer * base, guint32 * vdata, gint16 * adata, gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo); guint i, c, s, x, y, oy; gfloat dx, dy; - guint w = base->width; - guint h = base->height; + guint w = GST_VIDEO_INFO_WIDTH (&base->vinfo); + guint h = GST_VIDEO_INFO_HEIGHT (&base->vinfo); /* draw dots */ dx = (gfloat) w / (gfloat) num_samples; @@ -265,8 +265,8 @@ render_lines (GstAudioVisualizer * base, guint32 * vdata, gint16 * adata, gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo); guint i, c, s, x, y, oy; gfloat dx, dy; - guint w = base->width; - guint h = base->height; + guint w = GST_VIDEO_INFO_WIDTH (&base->vinfo); + guint h = GST_VIDEO_INFO_HEIGHT (&base->vinfo); gint x2, y2; /* draw lines */ @@ -310,8 +310,8 @@ render_color_dots (GstAudioVisualizer * base, guint32 * vdata, gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo); guint i, c, s, x, y, oy; gfloat dx, dy; - guint w = base->width; - guint h = base->height, h1 = h - 2; + guint w = GST_VIDEO_INFO_WIDTH (&base->vinfo); + guint h = GST_VIDEO_INFO_HEIGHT (&base->vinfo), h1 = h - 2; gdouble *flt = scope->flt; /* draw dots */ @@ -350,8 +350,8 @@ render_color_lines (GstAudioVisualizer * base, guint32 * vdata, gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo); guint i, c, s, x, y, oy; gfloat dx, dy; - guint w = base->width; - guint h = base->height, h1 = h - 2; + guint w = GST_VIDEO_INFO_WIDTH (&base->vinfo); + guint h = GST_VIDEO_INFO_HEIGHT (&base->vinfo), h1 = h - 2; gdouble *flt = scope->flt; gint x2, y2, y3, y4; @@ -403,21 +403,19 @@ render_color_lines (GstAudioVisualizer * base, guint32 * vdata, static gboolean gst_wave_scope_render (GstAudioVisualizer * base, GstBuffer * audio, - GstBuffer * video) + GstVideoFrame * video) { GstWaveScope *scope = GST_WAVE_SCOPE (base); - GstMapInfo amap, vmap; + GstMapInfo amap; guint num_samples; gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo); gst_buffer_map (audio, &amap, GST_MAP_READ); - gst_buffer_map (video, &vmap, GST_MAP_WRITE); num_samples = amap.size / (channels * sizeof (gint16)); - scope->process (base, (guint32 *) vmap.data, (gint16 *) amap.data, - num_samples); + scope->process (base, (guint32 *) GST_VIDEO_FRAME_PLANE_DATA (video, 0), + (gint16 *) amap.data, num_samples); - gst_buffer_unmap (video, &vmap); gst_buffer_unmap (audio, &amap); return TRUE; |