chromium/third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/breakout_box/media_stream_audio_track_underlying_source.h"

#include "base/task/sequenced_task_runner.h"
#include "media/base/audio_buffer.h"
#include "third_party/blink/renderer/core/streams/readable_stream_transferring_optimizer.h"
#include "third_party/blink/renderer/modules/breakout_box/frame_queue_transferring_optimizer.h"
#include "third_party/blink/renderer/modules/breakout_box/metrics.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_track.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_track.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"

namespace blink {

// Expects all calls to SetFormat() and CopyIntoAudioBuffer() to come from the
// same thread/sequence. This is almost certainly the realtime Audio capture
// thread, from a microphone accessed through getUserMedia(). As such, this
// class is designed to minimize memory allocations.
// This class may be created on a different thread/sequence than it is used.
class AudioBufferPoolImpl
    : public MediaStreamAudioTrackUnderlyingSource::AudioBufferPool {};

MediaStreamAudioTrackUnderlyingSource::MediaStreamAudioTrackUnderlyingSource(
    ScriptState* script_state,
    MediaStreamComponent* track,
    ScriptWrappable* media_stream_track_processor,
    wtf_size_t max_queue_size)
    :{}

bool MediaStreamAudioTrackUnderlyingSource::StartFrameDelivery() {}

void MediaStreamAudioTrackUnderlyingSource::DisconnectFromTrack() {}

void MediaStreamAudioTrackUnderlyingSource::ContextDestroyed() {}

void MediaStreamAudioTrackUnderlyingSource::Trace(Visitor* visitor) const {}

void MediaStreamAudioTrackUnderlyingSource::OnData(
    const media::AudioBus& audio_bus,
    base::TimeTicks estimated_capture_time) {}

void MediaStreamAudioTrackUnderlyingSource::StopFrameDelivery() {}

void MediaStreamAudioTrackUnderlyingSource::OnSetFormat(
    const media::AudioParameters& params) {}

std::unique_ptr<ReadableStreamTransferringOptimizer>
MediaStreamAudioTrackUnderlyingSource::GetTransferringOptimizer() {}

void MediaStreamAudioTrackUnderlyingSource::OnSourceTransferStarted(
    scoped_refptr<base::SequencedTaskRunner> transferred_runner,
    CrossThreadPersistent<TransferredAudioDataQueueUnderlyingSource> source) {}

MediaStreamAudioTrackUnderlyingSource::AudioBufferPool*
MediaStreamAudioTrackUnderlyingSource::GetAudioBufferPoolForTesting() {}

}  // namespace blink