diff --git a/media/server/gstplayer/source/GstCapabilities.cpp b/media/server/gstplayer/source/GstCapabilities.cpp index 5d80463c6..3a6827519 100644 --- a/media/server/gstplayer/source/GstCapabilities.cpp +++ b/media/server/gstplayer/source/GstCapabilities.cpp @@ -225,6 +225,15 @@ std::vector GstCapabilities::getSupportedProperties(MediaSourceType for (GList *iter = factories; iter != nullptr && !propertiesToLookFor.empty(); iter = iter->next) { GstElementFactory *factory = GST_ELEMENT_FACTORY(iter->data); + + // WORKAROUND: initialising element "rtkv1sink" causes that another playback's video goes black + // we don't need to scan this element, so ignore it + if (std::string{GST_OBJECT_NAME(GST_OBJECT(factory))} == "rtkv1sink") + { + RIALTO_SERVER_LOG_DEBUG("Ignoring rtkv1sink element"); + continue; + } + GstElement *elementObj{nullptr}; // We instantiate an object because fetching the class, even after gstPluginFeatureLoad, diff --git a/rialto.supp b/rialto.supp index ca698cf85..627fb7d1d 100644 --- a/rialto.supp +++ b/rialto.supp @@ -142,3 +142,12 @@ fun:*protobuf*FileOptions*_InternalParse* ... } +{ + ignore_g_option_context_parse_definitly_lost + Memcheck:Leak + match-leak-kinds: definite + ... + fun:gst_update_registry + ... + fun:g_option_context_parse +} diff --git a/tests/unittests/media/server/gstplayer/genericPlayer/GstCapabilitiesTest.cpp b/tests/unittests/media/server/gstplayer/genericPlayer/GstCapabilitiesTest.cpp index de516c746..2ce089051 100644 --- a/tests/unittests/media/server/gstplayer/genericPlayer/GstCapabilitiesTest.cpp +++ b/tests/unittests/media/server/gstplayer/genericPlayer/GstCapabilitiesTest.cpp @@ -359,6 +359,35 @@ TEST_F(GstCapabilitiesTest, getSupportedPropertiesWithPropertiesSupported) m_listOfFactories = nullptr; } +TEST_F(GstCapabilitiesTest, getSupportedPropertiesForBlacklistedFactories) +{ + createSutWithNoDecoderAndNoSink(); + + // the code needs a real factory, so take the factory that exist on system and change its name + GstElementFactory *elementFactory = gst_element_factory_find("fakesrc"); + GST_OBJECT(elementFactory)->name = "rtkv1sink"; + + GList *listOfFactories = nullptr; + listOfFactories = g_list_append(listOfFactories, elementFactory); + EXPECT_CALL(*m_gstWrapperMock, gstElementFactoryListGetElements(kExpectedFactoryListType, GST_RANK_NONE)) + .WillOnce(Return(listOfFactories)); + EXPECT_CALL(*m_gstWrapperMock, gstPluginFeatureListFree(listOfFactories)).Times(1); + + // element will never be created from blacklisted factory list + EXPECT_CALL(*m_gstWrapperMock, gstElementFactoryCreate(_, nullptr)).Times(0); + + std::vector kParamNames{"test-name-123", "test2"}; + std::vector supportedProperties{m_sut->getSupportedProperties(MediaSourceType::VIDEO, kParamNames)}; + + EXPECT_TRUE(supportedProperties.empty()); + + gst_plugin_feature_list_free(listOfFactories); + listOfFactories = nullptr; + + // it changes name of global element factory, so it should be restored + GST_OBJECT(elementFactory)->name = "fakesrc"; +} + TEST_F(GstCapabilitiesTest, getSupportedPropertiesWithAudioFadeProperty) { expectGetSupportedPropertiesCommon();