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