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/mediastream/MediaStream.h" | 12 #include "modules/mediastream/MediaStream.h" |
13 #include "platform/AsyncMethodRunner.h" | 13 #include "platform/AsyncMethodRunner.h" |
14 #include "public/platform/WebMediaRecorderHandler.h" | 14 #include "public/platform/WebMediaRecorderHandler.h" |
15 #include "public/platform/WebMediaRecorderHandlerClient.h" | 15 #include "public/platform/WebMediaRecorderHandlerClient.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class BlobData; | |
20 class ExceptionState; | 19 class ExceptionState; |
21 | 20 |
22 class MODULES_EXPORT MediaRecorder final | 21 class MODULES_EXPORT MediaRecorder final |
23 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder> | 22 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder> |
24 , public WebMediaRecorderHandlerClient | 23 , public WebMediaRecorderHandlerClient |
25 , public ActiveDOMObject { | 24 , public ActiveDOMObject { |
26 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); | 25 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaRecorder); |
27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); | 26 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); |
28 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
29 public: | 28 public: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 virtual void writeData(const char* data, size_t length, bool lastInSlice) ov
erride; | 73 virtual void writeData(const char* data, size_t length, bool lastInSlice) ov
erride; |
75 virtual void failOutOfMemory(const WebString& message) override; | 74 virtual void failOutOfMemory(const WebString& message) override; |
76 virtual void failIllegalStreamModification(const WebString& message) overrid
e; | 75 virtual void failIllegalStreamModification(const WebString& message) overrid
e; |
77 virtual void failOtherRecordingError(const WebString& message) override; | 76 virtual void failOtherRecordingError(const WebString& message) override; |
78 | 77 |
79 DECLARE_VIRTUAL_TRACE(); | 78 DECLARE_VIRTUAL_TRACE(); |
80 | 79 |
81 private: | 80 private: |
82 MediaRecorder(ExecutionContext*, MediaStream*, const String& mimeType, Excep
tionState&); | 81 MediaRecorder(ExecutionContext*, MediaStream*, const String& mimeType, Excep
tionState&); |
83 | 82 |
84 void createBlobEvent(PassOwnPtr<BlobData> blobData); | 83 void createBlobEvent(const char* data, size_t length); |
85 | 84 |
86 void stopRecording(); | 85 void stopRecording(); |
87 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 86 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
88 void dispatchScheduledEvent(); | 87 void dispatchScheduledEvent(); |
89 | 88 |
90 Member<MediaStream> m_stream; | 89 Member<MediaStream> m_stream; |
91 String m_mimeType; | 90 String m_mimeType; |
92 bool m_stopped; | 91 bool m_stopped; |
93 bool m_ignoreMutedMedia; | 92 bool m_ignoreMutedMedia; |
94 | 93 |
95 State m_state; | 94 State m_state; |
96 | 95 |
97 OwnPtr<WebMediaRecorderHandler> m_recorderHandler; | 96 OwnPtr<WebMediaRecorderHandler> m_recorderHandler; |
98 | 97 |
99 AsyncMethodRunner<MediaRecorder> m_dispatchScheduledEventRunner; | 98 AsyncMethodRunner<MediaRecorder> m_dispatchScheduledEventRunner; |
100 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; | 99 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; |
101 }; | 100 }; |
102 | 101 |
103 } // namespace blink | 102 } // namespace blink |
104 | 103 |
105 #endif // MediaRecorder_h | 104 #endif // MediaRecorder_h |
OLD | NEW |