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

Side by Side Diff: Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp

Issue 14188039: MediaStream API: Remove LocalMediaStream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 13 matching lines...) Expand all
24 24
25 #include "config.h" 25 #include "config.h"
26 26
27 #if ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM) 27 #if ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM)
28 28
29 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" 29 #include "modules/webaudio/MediaStreamAudioDestinationNode.h"
30 30
31 #include "core/platform/UUID.h" 31 #include "core/platform/UUID.h"
32 #include "core/platform/mediastream/MediaStreamCenter.h" 32 #include "core/platform/mediastream/MediaStreamCenter.h"
33 #include "core/platform/mediastream/RTCPeerConnectionHandler.h" 33 #include "core/platform/mediastream/RTCPeerConnectionHandler.h"
34 #include "modules/mediastream/LocalMediaStream.h" 34 #include "modules/mediastream/MediaStream.h"
35 #include "modules/webaudio/AudioContext.h" 35 #include "modules/webaudio/AudioContext.h"
36 #include "modules/webaudio/AudioNodeInput.h" 36 #include "modules/webaudio/AudioNodeInput.h"
37 #include "wtf/Locker.h" 37 #include "wtf/Locker.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 PassRefPtr<MediaStreamAudioDestinationNode> MediaStreamAudioDestinationNode::cre ate(AudioContext* context, size_t numberOfChannels) 41 PassRefPtr<MediaStreamAudioDestinationNode> MediaStreamAudioDestinationNode::cre ate(AudioContext* context, size_t numberOfChannels)
42 { 42 {
43 return adoptRef(new MediaStreamAudioDestinationNode(context, numberOfChannel s)); 43 return adoptRef(new MediaStreamAudioDestinationNode(context, numberOfChannel s));
44 } 44 }
45 45
46 MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* c ontext, size_t numberOfChannels) 46 MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* c ontext, size_t numberOfChannels)
47 : AudioBasicInspectorNode(context, context->sampleRate()) 47 : AudioBasicInspectorNode(context, context->sampleRate())
48 , m_mixBus(numberOfChannels, ProcessingSizeInFrames) 48 , m_mixBus(numberOfChannels, ProcessingSizeInFrames)
49 { 49 {
50 setNodeType(NodeTypeMediaStreamAudioDestination); 50 setNodeType(NodeTypeMediaStreamAudioDestination);
51 51
52 m_source = MediaStreamSource::create(ASCIILiteral("WebAudio-") + createCanon icalUUIDString(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode ", MediaStreamSource::ReadyStateLive, true); 52 m_source = MediaStreamSource::create(ASCIILiteral("WebAudio-") + createCanon icalUUIDString(), MediaStreamSource::TypeAudio, "MediaStreamAudioDestinationNode ", MediaStreamSource::ReadyStateLive, true);
53 MediaStreamSourceVector audioSources; 53 MediaStreamSourceVector audioSources;
54 audioSources.append(m_source); 54 audioSources.append(m_source);
55 MediaStreamSourceVector videoSources; 55 MediaStreamSourceVector videoSources;
56 m_stream = LocalMediaStream::create(context->scriptExecutionContext(), audio Sources, videoSources); 56 m_stream = MediaStream::create(context->scriptExecutionContext(), MediaStrea mDescriptor::create(audioSources, videoSources));
57 MediaStreamCenter::instance().didCreateMediaStream(m_stream->descriptor()); 57 MediaStreamCenter::instance().didCreateMediaStream(m_stream->descriptor());
58 58
59 m_source->setAudioFormat(numberOfChannels, context->sampleRate()); 59 m_source->setAudioFormat(numberOfChannels, context->sampleRate());
60 60
61 initialize(); 61 initialize();
62 } 62 }
63 63
64 MediaStreamSource* MediaStreamAudioDestinationNode::mediaStreamSource() 64 MediaStreamSource* MediaStreamAudioDestinationNode::mediaStreamSource()
65 { 65 {
66 return m_source.get(); 66 return m_source.get();
(...skipping 10 matching lines...) Expand all
77 m_source->consumeAudio(&m_mixBus, numberOfFrames); 77 m_source->consumeAudio(&m_mixBus, numberOfFrames);
78 } 78 }
79 79
80 void MediaStreamAudioDestinationNode::reset() 80 void MediaStreamAudioDestinationNode::reset()
81 { 81 {
82 } 82 }
83 83
84 } // namespace WebCore 84 } // namespace WebCore
85 85
86 #endif // ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM) 86 #endif // ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698