Skip to content

Commit

Permalink
Merge r267934 - [GTK] Build broken with ENABLE_MEDIA_STREAM enabled a…
Browse files Browse the repository at this point in the history
…nd 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:
  • Loading branch information
aperezdc committed Oct 4, 2020
1 parent efcbd20 commit 84ecf51
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 46 deletions.
33 changes: 33 additions & 0 deletions Source/WebCore/ChangeLog
@@ -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-02 Adrian Perez de Castro <aperez@igalia.com>

[GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED
Expand Down
@@ -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>
*
Expand All @@ -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"
Expand Down Expand Up @@ -204,4 +205,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>
*
Expand All @@ -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"
Expand Down Expand Up @@ -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>
*
Expand All @@ -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)))
{
}

Expand Down Expand Up @@ -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>
*
Expand All @@ -21,7 +22,7 @@

#pragma once

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

#include "GStreamerCapturer.h"

Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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>
*
Expand All @@ -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
Expand Down Expand Up @@ -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>
*
Expand All @@ -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>

Expand Down Expand Up @@ -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>
*
Expand All @@ -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 {

Expand Down Expand Up @@ -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>
*
Expand All @@ -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"
Expand Down Expand Up @@ -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>
*
Expand All @@ -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 {
Expand Down Expand Up @@ -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>
*
Expand All @@ -21,7 +22,7 @@

#pragma once

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

#include "GStreamerCapturer.h"

Expand All @@ -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)
Expand Up @@ -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"
Expand Down Expand Up @@ -141,4 +141,4 @@ void MockRealtimeAudioSourceGStreamer::reconfigure()

} // namespace WebCore

#endif // ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#endif // ENABLE(MEDIA_STREAM) && USE(GSTREAMER)
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Up @@ -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"
Expand Down Expand Up @@ -80,4 +80,4 @@ void MockRealtimeVideoSourceGStreamer::updateSampleBuffer()

} // namespace WebCore

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

#pragma once

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

#include "MockRealtimeVideoSource.h"

Expand All @@ -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 84ecf51

Please sign in to comment.