{
GstBinClass class;
- gint (*select_stream) (GstDecodebin3 * dbin,
- GstStreamCollection * collection, GstStream * stream);
+ gint (*select_stream) (GstDecodebin3 * dbin,
+ GstStreamCollection * collection, GstStream * stream);
+
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+ gboolean (*request_resource) (GstDecodebin3 * dbin,
+ GstStreamCollection * collection, GstStream * stream);
+#endif
};
/* Input of decodebin, controls input pad and parsebin */
{
SIGNAL_SELECT_STREAM,
SIGNAL_ABOUT_TO_FINISH,
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+ SIGNAL_REQUEST_RESOURCE,
+#endif
LAST_SIGNAL
};
static guint gst_decodebin3_signals[LAST_SIGNAL] = { 0 };
const GValue * value, GParamSpec * pspec);
static void gst_decodebin3_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+static gboolean gst_decodebin3_request_resource (GstElement * element,
+ GstStreamCollection * collection, GstStream * stream);
+#endif
static gboolean parsebin_autoplug_continue_cb (GstElement *
parsebin, GstPad * pad, GstCaps * caps, GstDecodebin3 * dbin);
/* FIXME: Really make all the parser stuff a self-contained helper object */
#include "gstdecodebin3-parse.c"
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+static gboolean gst_decodebin3_request_resource (GstElement * element,
+ GstStreamCollection * collection, GstStream * stream)
+{
+ /* do not consider the resource limit */
+ return TRUE;
+}
+
+static gboolean
+_gst_boolean_accumulator (GSignalInvocationHint * ihint,
+ GValue * return_accu, const GValue * handler_return, gpointer dummy)
+{
+ gboolean myboolean;
+
+ myboolean = g_value_get_boolean (handler_return);
+ if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
+ g_value_set_boolean (return_accu, myboolean);
+
+ return myboolean;
+}
+#endif
+
static gboolean
_gst_int_accumulator (GSignalInvocationHint * ihint,
GValue * return_accu, const GValue * handler_return, gpointer dummy)
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
0, G_TYPE_NONE);
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+ gst_decodebin3_signals[SIGNAL_REQUEST_RESOURCE] =
+ g_signal_new ("request-resource", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDecodebin3Class, request_resource),
+ _gst_boolean_accumulator, NULL, g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN, 2, GST_TYPE_STREAM_COLLECTION, GST_TYPE_STREAM);
+#endif
element_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_decodebin3_request_new_pad);
bin_klass->handle_message = gst_decodebin3_handle_message;
klass->select_stream = gst_decodebin3_select_stream;
+
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+ klass->request_resource = gst_decodebin3_request_resource;
+#endif
}
static void
g_mutex_unlock (&dbin->factories_lock);
if (res) {
+#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+ if (gst_element_factory_list_is_type (res->data,
+ GST_ELEMENT_FACTORY_TYPE_HARDWARE)) {
+ gboolean result = FALSE;
+ g_signal_emit (G_OBJECT (dbin),
+ gst_decodebin3_signals[SIGNAL_REQUEST_RESOURCE], 0, dbin->collection, stream,
+ &result);
+ if (!result) {
+ GST_WARNING_OBJECT (dbin, "Failed to get HW resource.");
+ gst_plugin_feature_list_free (res);
+ gst_caps_unref (caps);
+ return NULL;
+ }
+ }
+#endif
element =
gst_element_factory_create ((GstElementFactory *) res->data, NULL);
GST_DEBUG ("Created element '%s'", GST_ELEMENT_NAME (element));