)
;;
+;; Accelerate common GstBin iterate loop
+;;
+
+(define-function iterate_bin_all
+ (c-name "iterate_bin_all")
+ (return-type "none")
+ (parameters
+ '("GstBin*" "bin")
+ )
+)
+
+(define-function add_iterate_bin
+ (c-name "add_iterate_bin")
+ (return-type "guint")
+ (parameters
+ '("GstBin*" "bin")
+ )
+)
+
+(define-function remove_iterate_bin
+ (c-name "remove_iterate_bin")
+ (return-type "none")
+ (parameters
+ '("guint" "id")
+ )
+)
+
+;;
;; HACK
;;
* Author: David I. Lehn <dlehn@users.sourceforge.net>
*/
+#include "pygobject.h"
#include <gst/gst.h>
#include "gstreamer-fixes.h"
+
+void iterate_bin_all(GstBin *bin) {
+ g_return_if_fail(bin != NULL);
+ g_return_if_fail(GST_IS_BIN(bin));
+
+ pyg_unblock_threads();
+ while (gst_bin_iterate(bin));
+ pyg_block_threads();
+}
+
+static gboolean iterate_bin(gpointer data) {
+ GstBin *bin;
+
+ bin = GST_BIN(data);
+ return gst_bin_iterate(bin);
+}
+
+static void iterate_bin_destroy(gpointer data) {
+ GstBin *bin;
+
+ bin = GST_BIN(data);
+ gst_object_unref(GST_OBJECT(bin));
+}
+
+guint add_iterate_bin(GstBin *bin) {
+ g_return_val_if_fail(bin != NULL, FALSE);
+ g_return_val_if_fail(GST_IS_BIN(bin), FALSE);
+
+ gst_object_ref(GST_OBJECT(bin));
+ return g_idle_add_full(
+ G_PRIORITY_DEFAULT_IDLE,
+ iterate_bin,
+ bin,
+ iterate_bin_destroy);
+}
+
+void remove_iterate_bin(guint id) {
+ g_source_remove(id);
+}
#include <gst/gstqueue.h>
#include <gst/gsttypefind.h>
-/* 0.4.1 headers had typo: s/gst/get/ */
-#define GST_TYPE_CAPS (_gst_caps_type)
-#define GST_TYPE_PROPS (_gst_props_type)
+void iterate_bin_all(GstBin *bin);
+guint add_iterate_bin(GstBin *bin);
+void remove_iterate_bin(guint id);
)
;;
+;; Accelerate common GstBin iterate loop
+;;
+
+(define-function iterate_bin_all
+ (c-name "iterate_bin_all")
+ (return-type "none")
+ (parameters
+ '("GstBin*" "bin")
+ )
+)
+
+(define-function add_iterate_bin
+ (c-name "add_iterate_bin")
+ (return-type "guint")
+ (parameters
+ '("GstBin*" "bin")
+ )
+)
+
+(define-function remove_iterate_bin
+ (c-name "remove_iterate_bin")
+ (return-type "none")
+ (parameters
+ '("guint" "id")
+ )
+)
+
+;;
;; HACK
;;
* Author: David I. Lehn <dlehn@users.sourceforge.net>
*/
+#include "pygobject.h"
#include <gst/gst.h>
#include "gstreamer-fixes.h"
+
+void iterate_bin_all(GstBin *bin) {
+ g_return_if_fail(bin != NULL);
+ g_return_if_fail(GST_IS_BIN(bin));
+
+ pyg_unblock_threads();
+ while (gst_bin_iterate(bin));
+ pyg_block_threads();
+}
+
+static gboolean iterate_bin(gpointer data) {
+ GstBin *bin;
+
+ bin = GST_BIN(data);
+ return gst_bin_iterate(bin);
+}
+
+static void iterate_bin_destroy(gpointer data) {
+ GstBin *bin;
+
+ bin = GST_BIN(data);
+ gst_object_unref(GST_OBJECT(bin));
+}
+
+guint add_iterate_bin(GstBin *bin) {
+ g_return_val_if_fail(bin != NULL, FALSE);
+ g_return_val_if_fail(GST_IS_BIN(bin), FALSE);
+
+ gst_object_ref(GST_OBJECT(bin));
+ return g_idle_add_full(
+ G_PRIORITY_DEFAULT_IDLE,
+ iterate_bin,
+ bin,
+ iterate_bin_destroy);
+}
+
+void remove_iterate_bin(guint id) {
+ g_source_remove(id);
+}
#include <gst/gstqueue.h>
#include <gst/gsttypefind.h>
-/* 0.4.1 headers had typo: s/gst/get/ */
-#define GST_TYPE_CAPS (_gst_caps_type)
-#define GST_TYPE_PROPS (_gst_props_type)
+void iterate_bin_all(GstBin *bin);
+guint add_iterate_bin(GstBin *bin);
+void remove_iterate_bin(guint id);