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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/DefaultAudioDestinationNode.cpp

Issue 2590823007: Clean up and refactor platform/AudioDestination (Closed)
Patch Set: Addressing feedback 2 Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/audio/AudioDestination.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 m_destination->stop(); 71 m_destination->stop();
72 m_numberOfInputChannels = 0; 72 m_numberOfInputChannels = 0;
73 73
74 AudioHandler::uninitialize(); 74 AudioHandler::uninitialize();
75 } 75 }
76 76
77 void DefaultAudioDestinationHandler::createDestination() { 77 void DefaultAudioDestinationHandler::createDestination() {
78 float hardwareSampleRate = AudioDestination::hardwareSampleRate(); 78 float hardwareSampleRate = AudioDestination::hardwareSampleRate();
79 VLOG(1) << ">>>> hardwareSampleRate = " << hardwareSampleRate; 79 VLOG(1) << ">>>> hardwareSampleRate = " << hardwareSampleRate;
80 80
81 m_destination = AudioDestination::create( 81 m_destination =
82 *this, m_inputDeviceId, m_numberOfInputChannels, channelCount(), 82 AudioDestination::create(*this, channelCount(), hardwareSampleRate,
83 hardwareSampleRate, context()->getSecurityOrigin()); 83 context()->getSecurityOrigin());
84 } 84 }
85 85
86 void DefaultAudioDestinationHandler::startRendering() { 86 void DefaultAudioDestinationHandler::startRendering() {
87 DCHECK(isInitialized()); 87 DCHECK(isInitialized());
88 if (isInitialized()) { 88 if (isInitialized()) {
89 DCHECK(!m_destination->isPlaying()); 89 DCHECK(!m_destination->isPlaying());
90 m_destination->start(); 90 m_destination->start();
91 } 91 }
92 } 92 }
93 93
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 : AudioDestinationNode(context) { 144 : AudioDestinationNode(context) {
145 setHandler(DefaultAudioDestinationHandler::create(*this)); 145 setHandler(DefaultAudioDestinationHandler::create(*this));
146 } 146 }
147 147
148 DefaultAudioDestinationNode* DefaultAudioDestinationNode::create( 148 DefaultAudioDestinationNode* DefaultAudioDestinationNode::create(
149 BaseAudioContext* context) { 149 BaseAudioContext* context) {
150 return new DefaultAudioDestinationNode(*context); 150 return new DefaultAudioDestinationNode(*context);
151 } 151 }
152 152
153 } // namespace blink 153 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/audio/AudioDestination.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698