Skip to content
Permalink
Browse files
[GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RT…
…C_DISABLED

https://bugs.webkit.org/show_bug.cgi?id=217128

Remove USE(LIBWEBRTC) guards from media stream code, as it does not actually
depend on libwebrtc and can be built by itself. This allows using e.g. live
audio recording inputs with WebAudio.

Reviewed by Philippe Normand.

No new tests needed.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
* platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
* platform/mediastream/gstreamer/GStreamerCapturer.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp:
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
* platform/mock/MockRealtimeAudioSource.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:


Canonical link: https://commits.webkit.org/230045@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aperezdc committed Oct 3, 2020
1 parent cc0b20d commit 3b1fe5f05b709352a1b94bc8ab7367bf9dda1faf
Showing 19 changed files with 89 additions and 46 deletions.
@@ -1,3 +1,36 @@
2020-10-03 Adrian Perez de Castro <aperez@igalia.com>

[GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED
https://bugs.webkit.org/show_bug.cgi?id=217128

Remove USE(LIBWEBRTC) guards from media stream code, as it does not actually
depend on libwebrtc and can be built by itself. This allows using e.g. live
audio recording inputs with WebAudio.

Reviewed by Philippe Normand.

No new tests needed.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
* platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
* platform/mediastream/gstreamer/GStreamerCapturer.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h:
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp:
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
* platform/mock/MockRealtimeAudioSource.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:

2020-10-03 Zalan Bujtas <zalan@apple.com>

[LFC][IFC][Soft hyphen] Mark the last run on the line when hyphenation is required.
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,7 +22,7 @@

#include "config.h"

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "GStreamerAudioCaptureSource.h"

#include "GStreamerAudioData.h"
@@ -207,4 +208,4 @@ const RealtimeMediaSourceSettings& GStreamerAudioCaptureSource::settings()

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,7 +22,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "CaptureDevice.h"
#include "GStreamerAudioCapturer.h"
#include "GStreamerCaptureDevice.h"
@@ -63,4 +64,4 @@ class GStreamerAudioCaptureSource : public RealtimeMediaSource {

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,22 +22,30 @@

#include "config.h"

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "GStreamerAudioCapturer.h"

#if USE(LIBWEBRTC)
#include "LibWebRTCAudioFormat.h"
#endif

#include <gst/app/gstappsink.h>

namespace WebCore {

#if USE(LIBWEBRTC)
static constexpr size_t AudioCaptureSampleRate = LibWebRTCAudioFormat::sampleRate;
#else
static constexpr size_t AudioCaptureSampleRate = 48000;
#endif

GStreamerAudioCapturer::GStreamerAudioCapturer(GStreamerCaptureDevice device)
: GStreamerCapturer(device, adoptGRef(gst_caps_new_simple("audio/x-raw", "rate", G_TYPE_INT, LibWebRTCAudioFormat::sampleRate, nullptr)))
: GStreamerCapturer(device, adoptGRef(gst_caps_new_simple("audio/x-raw", "rate", G_TYPE_INT, AudioCaptureSampleRate, nullptr)))
{
}

GStreamerAudioCapturer::GStreamerAudioCapturer()
: GStreamerCapturer("appsrc", adoptGRef(gst_caps_new_simple("audio/x-raw", "rate", G_TYPE_INT, LibWebRTCAudioFormat::sampleRate, nullptr)))
: GStreamerCapturer("appsrc", adoptGRef(gst_caps_new_simple("audio/x-raw", "rate", G_TYPE_INT, AudioCaptureSampleRate, nullptr)))
{
}

@@ -71,4 +80,4 @@ bool GStreamerAudioCapturer::setSampleRate(int sampleRate)

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,7 +22,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

#include "GStreamerCapturer.h"

@@ -40,4 +41,4 @@ class GStreamerAudioCapturer final : public GStreamerCapturer {

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2018 Igalia S.L. All rights reserved.
* Copyright (C) 2018, 2020 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

#include "AudioStreamDescription.h"
#include "GStreamerCommon.h"
@@ -103,4 +103,4 @@ class GStreamerAudioStreamDescription final: public AudioStreamDescription {

} // WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,13 +22,12 @@

#include "config.h"

#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "GStreamerCapturer.h"

#include <gst/app/gstappsink.h>
#include <gst/app/gstappsrc.h>
#include <mutex>
#include <webrtc/api/media_stream_interface.h>

GST_DEBUG_CATEGORY(webkit_capturer_debug);
#define GST_CAT_DEFAULT webkit_capturer_debug
@@ -184,4 +184,4 @@ void GStreamerCapturer::stop()

} // namespace WebCore

#endif // ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,11 +22,10 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

#include "GStreamerCaptureDevice.h"
#include "GStreamerCommon.h"
#include "LibWebRTCMacros.h"

#include <gst/gst.h>

@@ -70,4 +70,4 @@ class GStreamerCapturer {

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,20 +22,13 @@

#include "config.h"

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "GStreamerVideoCaptureSource.h"

#include "GStreamerCaptureDeviceManager.h"
#include "MediaSampleGStreamer.h"

#include <gst/app/gstappsink.h>
#include <webrtc/api/media_stream_interface.h>
#include <webrtc/api/peer_connection_interface.h>
#include <webrtc/media/base/video_common.h>
// #include <webrtc/media/engine/video_capturer.h>
// #include <webrtc/media/engine/video_capturer_factory.h>
#include <webrtc/modules/video_capture/video_capture_factory.h>
#include <webrtc/modules/video_capture/video_capture_defines.h>

namespace WebCore {

@@ -292,4 +286,4 @@ void GStreamerVideoCaptureSource::generatePresets()

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,7 +22,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "CaptureDevice.h"
#include "GStreamerVideoCapturer.h"
#include "RealtimeVideoCaptureSource.h"
@@ -67,4 +68,4 @@ class GStreamerVideoCaptureSource : public RealtimeVideoCaptureSource {

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,7 +22,7 @@

#include "config.h"

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "GStreamerVideoCapturer.h"

namespace WebCore {
@@ -99,4 +100,4 @@ bool GStreamerVideoCapturer::setFrameRate(double frameRate)

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Metrological Group B.V.
* Copyright (C) 2020 Igalia S.L.
* Author: Thibault Saunier <tsaunier@igalia.com>
* Author: Alejandro G. Castro <alex@igalia.com>
*
@@ -21,7 +22,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

#include "GStreamerCapturer.h"

@@ -43,4 +44,4 @@ class GStreamerVideoCapturer final : public GStreamerCapturer {
};

} // namespace WebCore
#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -22,7 +22,7 @@

#include "config.h"

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "MockRealtimeAudioSourceGStreamer.h"

#include "MockRealtimeMediaSourceCenter.h"
@@ -141,4 +141,4 @@ void MockRealtimeAudioSourceGStreamer::reconfigure()

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -22,7 +22,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

#include "GStreamerAudioData.h"
#include "GStreamerAudioStreamDescription.h"
@@ -54,4 +54,4 @@ class MockRealtimeAudioSourceGStreamer final : public MockRealtimeAudioSource {

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -22,7 +22,7 @@

#include "config.h"

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
#include "MockRealtimeVideoSourceGStreamer.h"

#include "MediaSampleGStreamer.h"
@@ -80,4 +80,4 @@ void MockRealtimeVideoSourceGStreamer::updateSampleBuffer()

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
@@ -22,7 +22,7 @@

#pragma once

#if ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

#include "MockRealtimeVideoSource.h"

@@ -44,4 +44,4 @@ class MockRealtimeVideoSourceGStreamer final : public MockRealtimeVideoSource {

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)

0 comments on commit 3b1fe5f

Please sign in to comment.