| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/mediarecorder/MediaRecorder.h" | 5 #include "modules/mediarecorder/MediaRecorder.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
| 9 #include "core/fileapi/Blob.h" | 9 #include "core/fileapi/Blob.h" |
| 10 #include "core/inspector/ConsoleMessage.h" | 10 #include "core/inspector/ConsoleMessage.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ASSERT(m_stream->getTracks().size()); | 146 ASSERT(m_stream->getTracks().size()); |
| 147 | 147 |
| 148 m_recorderHandler = adoptPtr(Platform::current()->createMediaRecorderHandler
()); | 148 m_recorderHandler = adoptPtr(Platform::current()->createMediaRecorderHandler
()); |
| 149 ASSERT(m_recorderHandler); | 149 ASSERT(m_recorderHandler); |
| 150 | 150 |
| 151 if (!m_recorderHandler) { | 151 if (!m_recorderHandler) { |
| 152 exceptionState.throwDOMException(NotSupportedError, "No MediaRecorder ha
ndler can be created."); | 152 exceptionState.throwDOMException(NotSupportedError, "No MediaRecorder ha
ndler can be created."); |
| 153 return; | 153 return; |
| 154 } | 154 } |
| 155 | 155 |
| 156 int32_t audioBitsPerSecond = 0; | 156 AllocateVideoAndAudioBitrates(exceptionState, context, options, stream, &m_a
udioBitsPerSecond, &m_videoBitsPerSecond); |
| 157 int32_t videoBitsPerSecond = 0; | |
| 158 AllocateVideoAndAudioBitrates(exceptionState, context, options, stream, &aud
ioBitsPerSecond, &videoBitsPerSecond); | |
| 159 | 157 |
| 160 const ContentType contentType(m_mimeType); | 158 const ContentType contentType(m_mimeType); |
| 161 if (!m_recorderHandler->initialize(this, stream->descriptor(), contentType.t
ype(), contentType.parameter("codecs"), audioBitsPerSecond, videoBitsPerSecond))
{ | 159 if (!m_recorderHandler->initialize(this, stream->descriptor(), contentType.t
ype(), contentType.parameter("codecs"), m_audioBitsPerSecond, m_videoBitsPerSeco
nd)) { |
| 162 exceptionState.throwDOMException(NotSupportedError, "Failed to initializ
e native MediaRecorder the type provided (" + m_mimeType + ") is not supported."
); | 160 exceptionState.throwDOMException(NotSupportedError, "Failed to initializ
e native MediaRecorder the type provided (" + m_mimeType + ") is not supported."
); |
| 163 return; | 161 return; |
| 164 } | 162 } |
| 165 m_stopped = false; | 163 m_stopped = false; |
| 166 } | 164 } |
| 167 | 165 |
| 168 String MediaRecorder::state() const | 166 String MediaRecorder::state() const |
| 169 { | 167 { |
| 170 return stateToString(m_state); | 168 return stateToString(m_state); |
| 171 } | 169 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 DEFINE_TRACE(MediaRecorder) | 351 DEFINE_TRACE(MediaRecorder) |
| 354 { | 352 { |
| 355 visitor->trace(m_stream); | 353 visitor->trace(m_stream); |
| 356 visitor->trace(m_dispatchScheduledEventRunner); | 354 visitor->trace(m_dispatchScheduledEventRunner); |
| 357 visitor->trace(m_scheduledEvents); | 355 visitor->trace(m_scheduledEvents); |
| 358 RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder>::trace(vi
sitor); | 356 RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder>::trace(vi
sitor); |
| 359 ActiveDOMObject::trace(visitor); | 357 ActiveDOMObject::trace(visitor); |
| 360 } | 358 } |
| 361 | 359 |
| 362 } // namespace blink | 360 } // namespace blink |
| OLD | NEW |