Bug 244003 - [GStreamer][MediaStream] Leverage GStreamerCapturer on mock sources
Summary: [GStreamer][MediaStream] Leverage GStreamerCapturer on mock sources
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks: GstWebRTC
  Show dependency treegraph
 
Reported: 2022-08-16 11:48 PDT by Philippe Normand
Modified: 2023-06-17 07:31 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2022-08-16 11:48:08 PDT
That would allow us to have the non-mock code path tested. Currently mock sources use a separate path, which is not great.
Comment 1 Philippe Normand 2023-06-14 09:01:53 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14957
Comment 2 EWS 2023-06-16 10:13:58 PDT
Committed 265250@main (79141ab69a81): <https://commits.webkit.org/265250@main>

Reviewed commits have been landed. Closing PR #14957 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-06-16 10:14:23 PDT
<rdar://problem/110906642>
Comment 4 Michael Catanzaro 2023-06-17 07:06:27 PDT
So I can't build anymore:

[26/131] Linking CXX executable bin/TestWebKitAPI/TestWebCore
FAILED: bin/TestWebKitAPI/TestWebCore 
: && /usr/lib64/ccache/clang++ -fdiagnostics-color=always -fcolor-diagnostics -Wextra -Wall -pipe -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -g -O0 -fno-strict-aliasing -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -L/home/mcatanzaro/Projects/GNOME/install/lib -Wl,--disable-new-dtags @CMakeFiles/TestWebCore.rsp -o bin/TestWebKitAPI/TestWebCore  && :
/usr/bin/ld: Source/WebCore/CMakeFiles/WebCore.dir/./__/__/WebCore/DerivedSources/unified-sources/UnifiedSource-3c72abbe-62.cpp.o: in function `operator()':
/home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:117: undefined reference to `webkit_mock_device_provider_get_type()'
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

[27/131] Linking CXX shared library lib/libwebkitgtk-6.0.so.4.2.1
FAILED: lib/libwebkitgtk-6.0.so.4.2.1 
: && /usr/lib64/ccache/clang++ -fPIC -fdiagnostics-color=always -fcolor-diagnostics -Wextra -Wall -pipe -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -g -O0 -fno-strict-aliasing -fno-exceptions -fno-rtti -O2 -g -DNDEBUG  -Wl,--no-undefined -L/home/mcatanzaro/Projects/GNOME/install/lib -Wl,--disable-new-dtags -shared -Wl,-soname,libwebkitgtk-6.0.so.4 -o lib/libwebkitgtk-6.0.so.4.2.1 @CMakeFiles/WebKit.rsp  && :
/usr/bin/ld: Source/WebCore/CMakeFiles/WebCore.dir/./__/__/WebCore/DerivedSources/unified-sources/UnifiedSource-3c72abbe-62.cpp.o: in function `operator()':
/home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:117: undefined reference to `webkit_mock_device_provider_get_type()'
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

I thought that adding WEBCORE_EXPORT to the declaration of webkit_mock_device_provider_get_type() in GStreamerMockDeviceProvider.h would work. But that made no difference.
Comment 5 Philippe Normand 2023-06-17 07:21:58 PDT
Are you disabling GSTREAMER_WEBRTC or using other custom cmake options?
Comment 6 Philippe Normand 2023-06-17 07:22:50 PDT
(In reply to Philippe Normand from comment #5)
> Are you disabling GSTREAMER_WEBRTC or using other custom cmake options?

I'm asking because i've just noticed the ifdefs don't match between the provider .h and .cpp files.
Comment 7 Michael Catanzaro 2023-06-17 07:31:05 PDT
(In reply to Philippe Normand from comment #5)
> Are you disabling GSTREAMER_WEBRTC or using other custom cmake options?

No, but GSTREAMER_WEBRTC is disabled by default and I have not enabled it. I missed that the preprocessor guards were messed up. Thanks.