GENERATE_DOT(webrtc, "%s", GST_ELEMENT_NAME(decodebin));
}
+static bool __is_factory_name_for_hw(gchar *factory_name)
+{
+ RET_VAL_IF(factory_name == NULL, FALSE, "factory_name is NULL");
+
+ /* more can be added later on */
+ if (g_str_has_prefix(factory_name, "sprd") ||
+ g_str_has_prefix(factory_name, "omx")) {
+ LOG_DEBUG("factory_name[%s]", factory_name);
+ return true;
+ }
+
+ return false;
+}
+
static int __decodebin_autoplug_select_cb(GstElement *decodebin, GstPad *pad, GstCaps *caps, GstElementFactory *factory, gpointer user_data)
{
/* NOTE : Similar enum is defined with GstAutoplugSelectResult in gstplay-enum.h but not exposed */
LOG_INFO("factory [name:%s, klass:%s]", factory_name, klass);
- if (g_strrstr(klass, "Decoder/Audio/Hardware")) {
+ if (g_strrstr(klass, "Decoder/Audio/Hardware") ||
+ (g_strrstr(klass, "Decoder/Audio") && __is_factory_name_for_hw(factory_name))) {
str_arr = webrtc->ini.rendering_sink.a_hw_decoder_elements;
if (str_arr == NULL || !g_strv_contains((const gchar * const *)str_arr, factory_name)) {
LOG_DEBUG("this audio hw decoder element[%s] is not specified in ini file, skip it", factory_name);
return GST_AUTOPLUG_SELECT_SKIP;
}
- } else if (g_strrstr(klass, "Decoder/Video/Hardware")) {
+ } else if (g_strrstr(klass, "Decoder/Video/Hardware") ||
+ (g_strrstr(klass, "Decoder/Video") && __is_factory_name_for_hw(factory_name))) {
str_arr = webrtc->ini.rendering_sink.v_hw_decoder_elements;
if (str_arr == NULL || !g_strv_contains((const gchar * const *)str_arr, factory_name)) {
LOG_DEBUG("this video hw decoder element[%s] is not specified in ini file, skip it", factory_name);