| Index: content/browser/media/audio_output_stream_impl.cc
|
| diff --git a/content/browser/media/audio_output_stream_impl.cc b/content/browser/media/audio_output_stream_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9c4dd7c7bdf49004d1c81cce617c89fc60d3731f
|
| --- /dev/null
|
| +++ b/content/browser/media/audio_output_stream_impl.cc
|
| @@ -0,0 +1,48 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/media/audio_output_stream_impl.h"
|
| +
|
| +namespace content {
|
| +
|
| +AudioOutputStreamImpl::AudioOutputStreamImpl(
|
| + media::mojom::AudioOutputStreamRequest request,
|
| + int stream_id,
|
| + int renderer_frame_id,
|
| + AudioRendererHost* audio_renderer_host)
|
| + : binding_(this, std::move(request)),
|
| + stream_id_(stream_id),
|
| + renderer_frame_id_(renderer_frame_id),
|
| + audio_renderer_host_(audio_renderer_host) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| + LOG(ERROR) << "stream_id" << stream_id_;
|
| +}
|
| +
|
| +AudioOutputStreamImpl::~AudioOutputStreamImpl() {
|
| + LOG(ERROR) << "~AudioOutputStreamImpl" << stream_id_;
|
| + // DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| +}
|
| +
|
| +void AudioOutputStreamImpl::Close() {
|
| + LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_;
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| + audio_renderer_host_->CloseStream(stream_id_);
|
| + auto a = audio_renderer_host_->get_audio_output_impl(renderer_frame_id_);
|
| +
|
| + LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_;
|
| + a->RemoveStream(stream_id_);
|
| + LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_;
|
| +}
|
| +
|
| +// static
|
| +AudioOutputStreamImpl* AudioOutputStreamFactory::Factory(
|
| + media::mojom::AudioOutputStreamRequest request,
|
| + int stream_id,
|
| + int renderer_frame_id,
|
| + AudioRendererHost* audio_renderer_host) {
|
| + return new AudioOutputStreamImpl(std::move(request), stream_id,
|
| + renderer_frame_id, audio_renderer_host);
|
| +}
|
| +
|
| +} // namespace content
|
|
|