diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2012-07-08 19:23:30 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2012-07-08 19:27:23 +0200 |
commit | 266d1f62c016dbfce26c4b472260915a8759e970 (patch) | |
tree | 44804c2f5a6f08d59cbde7f1dfd28a8fe2412d4f /gst/audiovisualizers | |
parent | ea65e5d501b048453d6816c3557e17d2f7833d65 (diff) |
audiovisualizers: update baseclass from libvisual porting
Diffstat (limited to 'gst/audiovisualizers')
-rw-r--r-- | gst/audiovisualizers/gstbaseaudiovisualizer.c | 19 | ||||
-rw-r--r-- | gst/audiovisualizers/gstbaseaudiovisualizer.h | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gst/audiovisualizers/gstbaseaudiovisualizer.c b/gst/audiovisualizers/gstbaseaudiovisualizer.c index 8ec317140..4ff53d8f3 100644 --- a/gst/audiovisualizers/gstbaseaudiovisualizer.c +++ b/gst/audiovisualizers/gstbaseaudiovisualizer.c @@ -502,8 +502,9 @@ gst_base_audio_visualizer_init (GstBaseAudioVisualizer * scope, scope->fps_d = 1; scope->frame_duration = GST_CLOCK_TIME_NONE; - /* reset the initial audio state */ + /* reset the initial state */ gst_audio_info_init (&scope->ainfo); + gst_video_info_init (&scope->vinfo); g_mutex_init (&scope->config_lock); } @@ -614,20 +615,25 @@ static gboolean gst_base_audio_visualizer_src_setcaps (GstBaseAudioVisualizer * scope, GstCaps * caps) { + GstVideoInfo info; GstBaseAudioVisualizerClass *klass; GstStructure *structure; gboolean res; + if (!gst_video_info_from_caps (&info, caps)) + goto wrong_caps; + structure = gst_caps_get_structure (caps, 0); if (!gst_structure_get_int (structure, "width", &scope->width) || !gst_structure_get_int (structure, "height", &scope->height) || !gst_structure_get_fraction (structure, "framerate", &scope->fps_n, &scope->fps_d)) - goto error; + goto wrong_caps; klass = GST_BASE_AUDIO_VISUALIZER_CLASS (G_OBJECT_GET_CLASS (scope)); - //scope->video_format = format; ?? + scope->vinfo = info; + scope->video_format = info.finfo->format; scope->frame_duration = gst_util_uint64_scale_int (GST_SECOND, scope->fps_d, scope->fps_n); @@ -654,7 +660,7 @@ gst_base_audio_visualizer_src_setcaps (GstBaseAudioVisualizer * scope, return res; /* ERRORS */ -error: +wrong_caps: { GST_DEBUG_OBJECT (scope, "error parsing caps"); return FALSE; @@ -963,6 +969,11 @@ gst_base_audio_visualizer_src_event (GstPad * pad, GstObject * parent, res = gst_pad_push_event (scope->sinkpad, event); break; } + case GST_EVENT_RECONFIGURE: + /* dont't forward */ + gst_event_unref (event); + res = TRUE; + break; default: res = gst_pad_push_event (scope->sinkpad, event); break; diff --git a/gst/audiovisualizers/gstbaseaudiovisualizer.h b/gst/audiovisualizers/gstbaseaudiovisualizer.h index 435c7660a..fe1fa5e78 100644 --- a/gst/audiovisualizers/gstbaseaudiovisualizer.h +++ b/gst/audiovisualizers/gstbaseaudiovisualizer.h @@ -87,6 +87,7 @@ struct _GstBaseAudioVisualizer guint req_spf; /* min samples per frame wanted by the subclass */ /* video state */ + GstVideoInfo vinfo; GstVideoFormat video_format; gint fps_n, fps_d; gint width; |