};
#define GST_SOURCE_GROUP_GET_LOCK(group) (((GstSourceGroup*)(group))->lock)
-#define GST_SOURCE_GROUP_GET_COND(group) (((GstSourceGroup*)(group))->cond)
#define GST_SOURCE_GROUP_LOCK(group) (g_mutex_lock (GST_SOURCE_GROUP_GET_LOCK(group)))
#define GST_SOURCE_GROUP_UNLOCK(group) (g_mutex_unlock (GST_SOURCE_GROUP_GET_LOCK(group)))
-#define GST_SOURCE_GROUP_WAIT(group) (g_cond_wait \
- (GST_SOURCE_GROUP_GET_COND (group),GST_SOURCE_GROUP_GET_LOCK(group)))
-#define GST_SOURCE_GROUP_BROADCAST(group) (g_cond_broadcast \
- (GST_SOURCE_GROUP_GET_COND (group)))
/* a structure to hold the objects for decoding a uri and the subtitle uri
*/
GstPlayBin *playbin;
GMutex *lock;
- GCond *cond;
gboolean valid; /* the group has valid info to start playback */
gboolean active; /* the group is active */
GstSourceGroup *curr_group; /* pointer to the currently playing group */
GstSourceGroup *next_group; /* pointer to the next group */
- gboolean about_to_finish; /* the about-to-finish signal is emitted */
-
/* properties */
guint connection_speed; /* connection speed in bits/sec (0 = unknown) */
gint current_video; /* the currently selected stream */
group->audio_channels = g_ptr_array_new ();
group->text_channels = g_ptr_array_new ();
group->lock = g_mutex_new ();
- group->cond = g_cond_new ();
/* init selectors */
group->playbin = playbin;
group->selector[0].media = "audio/x-raw-";
g_ptr_array_free (group->audio_channels, TRUE);
g_ptr_array_free (group->text_channels, TRUE);
g_mutex_free (group->lock);
- g_cond_free (group->cond);
}
static void
} else {
GST_LOG_OBJECT (playbin, "have more pending groups");
configure = FALSE;
- /* check if there are more decodebins to wait for */
- while (group->pending) {
- GST_DEBUG_OBJECT (playbin, "%d pending in group %p, waiting",
- group->pending, group);
-
- GST_PLAY_BIN_SHUTDOWN_UNLOCK (playbin);
-
- /* FIXME, unlock when shutting down */
- GST_SOURCE_GROUP_WAIT (group);
-
- GST_PLAY_BIN_SHUTDOWN_LOCK (playbin, shutdown2);
- }
}
GST_SOURCE_GROUP_UNLOCK (group);
NULL);
}
}
- GST_DEBUG_OBJECT (playbin, "signal other decodebins");
- GST_SOURCE_GROUP_BROADCAST (group);
GST_SOURCE_GROUP_UNLOCK (group);
}
return;
-shutdown2:
- {
- GST_SOURCE_GROUP_UNLOCK (group);
- goto shutdown;
- }
shutdown:
{
GST_DEBUG ("ignoring, we are shutting down");
GST_DEBUG_OBJECT (playbin, "about to finish in group %p", group);
- /* mark us as sending out the about-to-finish signal. When the app sets a URI
- * when this signal is emitted, we're marking it as next-uri */
- playbin->about_to_finish = TRUE;
-
/* after this call, we should have a next group to activate or we EOS */
g_signal_emit (G_OBJECT (playbin),
gst_play_bin_signals[SIGNAL_ABOUT_TO_FINISH], 0, NULL);
- playbin->about_to_finish = FALSE;
-
- /* now activate the next group. If the app did not set a next-uri, this will
+ /* now activate the next group. If the app did not set a uri, this will
* fail and we can do EOS */
setup_next_source (playbin);
}
playbin = group->playbin;
- GST_OBJECT_LOCK (playbin);
g_object_get (group->uridecodebin, "source", &source, NULL);
+
+ GST_OBJECT_LOCK (playbin);
if (playbin->source)
gst_object_unref (playbin->source);
playbin->source = source;