| OLD | NEW |
| 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 22 matching lines...) Expand all Loading... |
| 33 #include "platform/Logging.h" | 33 #include "platform/Logging.h" |
| 34 #include "platform/graphics/media/MediaPlayer.h" | 34 #include "platform/graphics/media/MediaPlayer.h" |
| 35 #include "wtf/Locker.h" | 35 #include "wtf/Locker.h" |
| 36 | 36 |
| 37 // These are somewhat arbitrary limits, but we need to do some kind of sanity-ch
ecking. | 37 // These are somewhat arbitrary limits, but we need to do some kind of sanity-ch
ecking. |
| 38 const unsigned minSampleRate = 8000; | 38 const unsigned minSampleRate = 8000; |
| 39 const unsigned maxSampleRate = 192000; | 39 const unsigned maxSampleRate = 192000; |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 PassRefPtr<MediaElementAudioSourceNode> MediaElementAudioSourceNode::create(Audi
oContext* context, HTMLMediaElement* mediaElement) | 43 PassRefPtrWillBeRawPtr<MediaElementAudioSourceNode> MediaElementAudioSourceNode:
:create(AudioContext* context, HTMLMediaElement* mediaElement) |
| 44 { | 44 { |
| 45 return adoptRef(new MediaElementAudioSourceNode(context, mediaElement)); | 45 return adoptRefWillBeNoop(new MediaElementAudioSourceNode(context, mediaElem
ent)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 MediaElementAudioSourceNode::MediaElementAudioSourceNode(AudioContext* context,
HTMLMediaElement* mediaElement) | 48 MediaElementAudioSourceNode::MediaElementAudioSourceNode(AudioContext* context,
HTMLMediaElement* mediaElement) |
| 49 : AudioSourceNode(context, context->sampleRate()) | 49 : AudioSourceNode(context, context->sampleRate()) |
| 50 , m_mediaElement(mediaElement) | 50 , m_mediaElement(mediaElement) |
| 51 , m_sourceNumberOfChannels(0) | 51 , m_sourceNumberOfChannels(0) |
| 52 , m_sourceSampleRate(0) | 52 , m_sourceSampleRate(0) |
| 53 { | 53 { |
| 54 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
| 55 // Default to stereo. This could change depending on what the media element
.src is set to. | 55 // Default to stereo. This could change depending on what the media element
.src is set to. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 void MediaElementAudioSourceNode::unlock() | 144 void MediaElementAudioSourceNode::unlock() |
| 145 { | 145 { |
| 146 m_processLock.unlock(); | 146 m_processLock.unlock(); |
| 147 deref(); | 147 deref(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace WebCore | 150 } // namespace WebCore |
| 151 | 151 |
| 152 #endif // ENABLE(WEB_AUDIO) | 152 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |