Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: content/browser/media/audio_output_stream_impl.cc

Issue 1930393002: Switch stream creation and closing in Chrome audio rendering from IPC to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + tests in progress Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/media/audio_output_stream_impl.h"
6
7 namespace content {
8
9 AudioOutputStreamImpl::AudioOutputStreamImpl(
10 media::mojom::AudioOutputStreamRequest request,
11 int stream_id,
12 int renderer_frame_id,
13 AudioRendererHost* audio_renderer_host)
14 : binding_(this, std::move(request)),
15 stream_id_(stream_id),
16 renderer_frame_id_(renderer_frame_id),
17 audio_renderer_host_(audio_renderer_host) {
18 DCHECK_CURRENTLY_ON(BrowserThread::IO);
19 LOG(ERROR) << "stream_id" << stream_id_;
20 }
21
22 AudioOutputStreamImpl::~AudioOutputStreamImpl() {
23 LOG(ERROR) << "~AudioOutputStreamImpl" << stream_id_;
24 // DCHECK_CURRENTLY_ON(BrowserThread::IO);
25 }
26
27 void AudioOutputStreamImpl::Close() {
28 LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_;
29 DCHECK_CURRENTLY_ON(BrowserThread::IO);
30 audio_renderer_host_->CloseStream(stream_id_);
31 auto a = audio_renderer_host_->get_audio_output_impl(renderer_frame_id_);
32
33 LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_;
34 a->RemoveStream(stream_id_);
35 LOG(ERROR) << "AudioOutputStreamImplClose" << stream_id_;
36 }
37
38 // static
39 AudioOutputStreamImpl* AudioOutputStreamFactory::Factory(
40 media::mojom::AudioOutputStreamRequest request,
41 int stream_id,
42 int renderer_frame_id,
43 AudioRendererHost* audio_renderer_host) {
44 return new AudioOutputStreamImpl(std::move(request), stream_id,
45 renderer_frame_id, audio_renderer_host);
46 }
47
48 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698