return found_element;
}
+static gboolean __need_to_skip_hw_video_decoder_klass(const gchar *klass)
+{
+ gchar **zerocopy_node_names = NULL;
+ gboolean found = false;
+
+ if (g_strcmp0(klass, "Codec/Decoder/Video/Hardware") == 0) {
+ if (!ms_ini_get_boolean("general:use zerocopy", DEFAULT_USE_ZEROCOPY)) {
+ ms_debug("Skipping [%s] because use zerocopy is false", MEDIASTREAMER_DECODEBIN_TYPE_DECODER);
+ return TRUE;
+ }
+ ms_ini_read_list("general:zerocopy node names", &zerocopy_node_names);
+ found = (zerocopy_node_names && g_strv_contains((const gchar * const *)zerocopy_node_names, MEDIASTREAMER_DECODEBIN_TYPE_DECODER));
+ g_strfreev(zerocopy_node_names);
+ if (!found) {
+ ms_debug("Skipping [%s] which is not specified in zerocopy node names", MEDIASTREAMER_DECODEBIN_TYPE_DECODER);
+ return TRUE;
+ }
+ ms_debug("[%s] can be used", MEDIASTREAMER_DECODEBIN_TYPE_DECODER);
+ }
+
+ return FALSE;
+}
+
static gint __decodebin_autoplug_select_cb(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer data)
{
/* NOTE : GstAutoplugSelectResult is defined in gstplay-enum.h but not exposed */
}
}
- if (g_strcmp0(klass, "Codec/Decoder/Video/Hardware") == 0) {
- gchar **zerocopy_node_names = NULL;
- gboolean found = false;
- if (!ms_ini_get_boolean("general:use zerocopy", DEFAULT_USE_ZEROCOPY)) {
- ms_debug("Skipping [%s] because use zerocopy is false", factory_name);
- return GST_AUTOPLUG_SELECT_SKIP;
- }
- ms_ini_read_list("general:zerocopy node names", &zerocopy_node_names);
- found = (zerocopy_node_names && g_strv_contains((const gchar * const *)zerocopy_node_names, MEDIASTREAMER_DECODEBIN_TYPE_DECODER));
- g_strfreev(zerocopy_node_names);
- if (!found) {
- ms_debug("Skipping [%s] which is not specified in zerocopy node names", factory_name);
- return GST_AUTOPLUG_SELECT_SKIP;
- }
- ms_debug("[%s] can be used", factory_name);
+ if (__need_to_skip_hw_video_decoder_klass(klass)) {
+ ms_debug("Skipping [%s]", factory_name);
+ return GST_AUTOPLUG_SELECT_SKIP;
}
if (ms_streamer->ini.resource_required_elem_names) {
}
}
+ if (__need_to_skip_hw_video_decoder_klass(factory_klass)) {
+ ms_debug("Skipping [%s]", GST_OBJECT_NAME(factory));
+ return FALSE;
+ }
+
ms_info("[INFO] Found compatible factory [%s] for klass [%s]",
GST_OBJECT_NAME(factory), factory_klass);
return TRUE;