| 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 #ifndef MediaRecorder_h | 5 #ifndef MediaRecorder_h |
| 6 #define MediaRecorder_h | 6 #define MediaRecorder_h |
| 7 | 7 |
| 8 #include "core/dom/ActiveDOMObject.h" | 8 #include "core/dom/ActiveDOMObject.h" |
| 9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
| 10 #include "modules/EventTargetModules.h" | 10 #include "modules/EventTargetModules.h" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/mediarecorder/MediaRecorderOptions.h" | 12 #include "modules/mediarecorder/MediaRecorderOptions.h" |
| 13 #include "modules/mediastream/MediaStream.h" | 13 #include "modules/mediastream/MediaStream.h" |
| 14 #include "platform/AsyncMethodRunner.h" | 14 #include "platform/AsyncMethodRunner.h" |
| 15 #include "public/platform/WebMediaRecorderHandler.h" | 15 #include "public/platform/WebMediaRecorderHandler.h" |
| 16 #include "public/platform/WebMediaRecorderHandlerClient.h" | 16 #include "public/platform/WebMediaRecorderHandlerClient.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 class Blob; | 20 class Blob; |
| 21 class BlobData; | 21 class BlobData; |
| 22 class ExceptionState; | 22 class ExceptionState; |
| 23 | 23 |
| 24 class MODULES_EXPORT MediaRecorder final | 24 class MODULES_EXPORT MediaRecorder final |
| 25 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder> | 25 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder> |
| 26 , public WebMediaRecorderHandlerClient | 26 , public WebMediaRecorderHandlerClient |
| 27 , public ActiveDOMObject { | 27 , public ActiveDOMObject { |
| 28 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); | 28 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); |
| 29 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); | 29 USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); |
| 30 DEFINE_WRAPPERTYPEINFO(); | 30 DEFINE_WRAPPERTYPEINFO(); |
| 31 public: | 31 public: |
| 32 enum class State { | 32 enum class State { |
| 33 Inactive = 0, | 33 Inactive = 0, |
| 34 Recording, | 34 Recording, |
| 35 Paused | 35 Paused |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 static MediaRecorder* create(ExecutionContext*, MediaStream*, ExceptionState
&); | 38 static MediaRecorder* create(ExecutionContext*, MediaStream*, ExceptionState
&); |
| 39 static MediaRecorder* create(ExecutionContext*, MediaStream*, const MediaRec
orderOptions&, ExceptionState&); | 39 static MediaRecorder* create(ExecutionContext*, MediaStream*, const MediaRec
orderOptions&, ExceptionState&); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void onError(const WebString& message) override; | 79 void onError(const WebString& message) override; |
| 80 | 80 |
| 81 DECLARE_VIRTUAL_TRACE(); | 81 DECLARE_VIRTUAL_TRACE(); |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 MediaRecorder(ExecutionContext*, MediaStream*, const MediaRecorderOptions&,
ExceptionState&); | 84 MediaRecorder(ExecutionContext*, MediaStream*, const MediaRecorderOptions&,
ExceptionState&); |
| 85 | 85 |
| 86 void createBlobEvent(Blob*); | 86 void createBlobEvent(Blob*); |
| 87 | 87 |
| 88 void stopRecording(); | 88 void stopRecording(); |
| 89 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 89 void scheduleDispatchEvent(RawPtr<Event>); |
| 90 void dispatchScheduledEvent(); | 90 void dispatchScheduledEvent(); |
| 91 | 91 |
| 92 Member<MediaStream> m_stream; | 92 Member<MediaStream> m_stream; |
| 93 size_t m_streamAmountOfTracks; | 93 size_t m_streamAmountOfTracks; |
| 94 String m_mimeType; | 94 String m_mimeType; |
| 95 bool m_stopped; | 95 bool m_stopped; |
| 96 bool m_ignoreMutedMedia; | 96 bool m_ignoreMutedMedia; |
| 97 int m_audioBitsPerSecond; | 97 int m_audioBitsPerSecond; |
| 98 int m_videoBitsPerSecond; | 98 int m_videoBitsPerSecond; |
| 99 | 99 |
| 100 State m_state; | 100 State m_state; |
| 101 | 101 |
| 102 OwnPtr<BlobData> m_blobData; | 102 OwnPtr<BlobData> m_blobData; |
| 103 | 103 |
| 104 OwnPtr<WebMediaRecorderHandler> m_recorderHandler; | 104 OwnPtr<WebMediaRecorderHandler> m_recorderHandler; |
| 105 | 105 |
| 106 Member<AsyncMethodRunner<MediaRecorder>> m_dispatchScheduledEventRunner; | 106 Member<AsyncMethodRunner<MediaRecorder>> m_dispatchScheduledEventRunner; |
| 107 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; | 107 HeapVector<Member<Event>> m_scheduledEvents; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| 111 | 111 |
| 112 #endif // MediaRecorder_h | 112 #endif // MediaRecorder_h |
| OLD | NEW |