[393/906] glmosaic: for now it's a cube mosaic

Also use GPtrArray instead of GArray in glmixer.
And add a pipeline to tests/pieplines
This commit is contained in:
Julien Isorce 2009-10-27 15:27:14 +01:00 committed by Tim-Philipp Müller
parent 9e9b114010
commit 8fdf415fb7
2 changed files with 12 additions and 10 deletions

View file

@ -910,7 +910,7 @@ gst_gl_mixer_process_buffers (GstGLMixer * mix, GstBuffer * outbuf)
gst_object_sync_values (G_OBJECT (pad), stream_time); gst_object_sync_values (G_OBJECT (pad), stream_time);
/* put buffer into array */ /* put buffer into array */
g_array_insert_val (mix->array_buffers, array_index, mixcol->buffer); mix->array_buffers->pdata[array_index] = mixcol->buffer;
if (pad == mix->master) { if (pad == mix->master) {
gint64 running_time; gint64 running_time;
@ -1213,6 +1213,7 @@ gst_gl_mixer_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
{ {
GSList *walk = mix->sinkpads; GSList *walk = mix->sinkpads;
gint i = 0;
GstElement *parent = GST_ELEMENT (gst_element_get_parent (mix)); GstElement *parent = GST_ELEMENT (gst_element_get_parent (mix));
GstStructure *structure = GstStructure *structure =
@ -1244,9 +1245,10 @@ gst_gl_mixer_change_state (GstElement * element, GstStateChange transition)
walk = g_slist_next (walk); walk = g_slist_next (walk);
sink_pad->display = gst_gl_display_new (); sink_pad->display = gst_gl_display_new ();
} }
mix->array_buffers = mix->array_buffers = g_ptr_array_sized_new (mix->next_sinkpad);
g_array_sized_new (FALSE, TRUE, sizeof (GstBuffer *), for (i = 0; i < mix->next_sinkpad; ++i) {
mix->next_sinkpad); g_ptr_array_add (mix->array_buffers, NULL);
}
GST_LOG_OBJECT (mix, "starting collectpads"); GST_LOG_OBJECT (mix, "starting collectpads");
gst_collect_pads_start (mix->collect); gst_collect_pads_start (mix->collect);
break; break;
@ -1256,7 +1258,7 @@ gst_gl_mixer_change_state (GstElement * element, GstStateChange transition)
GSList *walk = mix->sinkpads; GSList *walk = mix->sinkpads;
GST_LOG_OBJECT (mix, "stopping collectpads"); GST_LOG_OBJECT (mix, "stopping collectpads");
gst_collect_pads_stop (mix->collect); gst_collect_pads_stop (mix->collect);
g_array_free (mix->array_buffers, TRUE); g_ptr_array_free (mix->array_buffers, TRUE);
while (walk) { while (walk) {
GstGLMixerPad *sink_pad = GST_GL_MIXER_PAD (walk->data); GstGLMixerPad *sink_pad = GST_GL_MIXER_PAD (walk->data);
walk = g_slist_next (walk); walk = g_slist_next (walk);

View file

@ -46,7 +46,7 @@ typedef gboolean (*GstGLMixerSetCaps) (GstGLMixer* mixer,
GstCaps* outcaps); GstCaps* outcaps);
typedef void (*GstGLMixerReset) (GstGLMixer *mixer); typedef void (*GstGLMixerReset) (GstGLMixer *mixer);
typedef gboolean (*GstGLMixerProcessFunc) (GstGLMixer *mix, typedef gboolean (*GstGLMixerProcessFunc) (GstGLMixer *mix,
GArray *buffers, GstBuffer *outbuf); GPtrArray *buffers, GstBuffer *outbuf);
struct _GstGLMixer struct _GstGLMixer
{ {
@ -62,7 +62,7 @@ struct _GstGLMixer
/* sinkpads, a GSList of GstGLMixerPads */ /* sinkpads, a GSList of GstGLMixerPads */
GSList *sinkpads; GSList *sinkpads;
GArray *array_buffers; GPtrArray *array_buffers;
gint numpads; gint numpads;