RemoteAudioSourceProvider.h [plain text]
#pragma once
#if ENABLE(GPU_PROCESS) && ENABLE(WEB_AUDIO) && PLATFORM(COCOA)
#include "GPUProcessConnection.h"
#include <WebCore/MediaPlayerIdentifier.h>
#include <WebCore/WebAudioSourceProviderCocoa.h>
#include <wtf/LoggerHelper.h>
namespace WebKit {
class RemoteAudioSourceProvider final
: public WebCore::WebAudioSourceProviderCocoa
#if !RELEASE_LOG_DISABLED
, protected WTF::LoggerHelper
#endif
{
public:
static Ref<RemoteAudioSourceProvider> create(WebCore::MediaPlayerIdentifier, WTF::LoggerHelper&);
~RemoteAudioSourceProvider();
void audioSamplesAvailable(const WebCore::PlatformAudioData&, const WebCore::AudioStreamDescription&, size_t);
void close();
WebCore::MediaPlayerIdentifier identifier() const { return m_identifier; }
private:
RemoteAudioSourceProvider(WebCore::MediaPlayerIdentifier, WTF::LoggerHelper&);
void hasNewClient(WebCore::AudioSourceProviderClient*) final;
#if !RELEASE_LOG_DISABLED
WTF::LoggerHelper& loggerHelper() final { return *this; }
const Logger& logger() const final { return m_logger.get(); }
const void* logIdentifier() const final { return m_logIdentifier; }
const char* logClassName() const final { return "RemoteAudioSourceProvider"; }
WTFLogChannel& logChannel() const final;
#endif
WebCore::MediaPlayerIdentifier m_identifier;
WeakPtr<GPUProcessConnection> m_gpuProcessConnection;
#if !RELEASE_LOG_DISABLED
Ref<const Logger> m_logger;
const void* m_logIdentifier;
#endif
};
}
#endif // ENABLE(GPU_PROCESS) && ENABLE(WEB_AUDIO) && PLATFORM(COCOA)