OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "modules/EventTargetModules.h" | 37 #include "modules/EventTargetModules.h" |
38 #include "modules/mediasource/TrackDefaultList.h" | 38 #include "modules/mediasource/TrackDefaultList.h" |
39 #include "platform/AsyncMethodRunner.h" | 39 #include "platform/AsyncMethodRunner.h" |
40 #include "platform/weborigin/KURL.h" | 40 #include "platform/weborigin/KURL.h" |
41 #include "public/platform/WebSourceBufferClient.h" | 41 #include "public/platform/WebSourceBufferClient.h" |
42 #include "wtf/RefCounted.h" | 42 #include "wtf/RefCounted.h" |
43 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
| 47 class AudioTrackList; |
47 class DOMArrayBuffer; | 48 class DOMArrayBuffer; |
48 class DOMArrayBufferView; | 49 class DOMArrayBufferView; |
49 class ExceptionState; | 50 class ExceptionState; |
50 class FileReaderLoader; | 51 class FileReaderLoader; |
51 class GenericEventQueue; | 52 class GenericEventQueue; |
52 class MediaSource; | 53 class MediaSource; |
53 class Stream; | 54 class Stream; |
54 class TimeRanges; | 55 class TimeRanges; |
| 56 class VideoTrackList; |
55 class WebSourceBuffer; | 57 class WebSourceBuffer; |
56 | 58 |
57 class SourceBuffer final | 59 class SourceBuffer final |
58 : public RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer> | 60 : public RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer> |
59 , public ActiveScriptWrappable | 61 , public ActiveScriptWrappable |
60 , public ActiveDOMObject | 62 , public ActiveDOMObject |
61 , public FileReaderLoaderClient | 63 , public FileReaderLoaderClient |
62 , public WebSourceBufferClient { | 64 , public WebSourceBufferClient { |
63 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); | 65 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); |
64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); | 66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); |
(...skipping 18 matching lines...) Expand all Loading... |
83 void appendStream(Stream*, unsigned long long maxSize, ExceptionState&); | 85 void appendStream(Stream*, unsigned long long maxSize, ExceptionState&); |
84 void abort(ExceptionState&); | 86 void abort(ExceptionState&); |
85 void remove(double start, double end, ExceptionState&); | 87 void remove(double start, double end, ExceptionState&); |
86 double appendWindowStart() const; | 88 double appendWindowStart() const; |
87 void setAppendWindowStart(double, ExceptionState&); | 89 void setAppendWindowStart(double, ExceptionState&); |
88 double appendWindowEnd() const; | 90 double appendWindowEnd() const; |
89 void setAppendWindowEnd(double, ExceptionState&); | 91 void setAppendWindowEnd(double, ExceptionState&); |
90 TrackDefaultList* trackDefaults() const { return m_trackDefaults.get(); } | 92 TrackDefaultList* trackDefaults() const { return m_trackDefaults.get(); } |
91 void setTrackDefaults(TrackDefaultList*, ExceptionState&); | 93 void setTrackDefaults(TrackDefaultList*, ExceptionState&); |
92 | 94 |
| 95 AudioTrackList& audioTracks(); |
| 96 VideoTrackList& videoTracks(); |
| 97 |
93 void abortIfUpdating(); | 98 void abortIfUpdating(); |
94 void removedFromMediaSource(); | 99 void removedFromMediaSource(); |
95 | 100 |
96 // ActiveScriptWrappable | 101 // ActiveScriptWrappable |
97 bool hasPendingActivity() const final; | 102 bool hasPendingActivity() const final; |
98 | 103 |
99 // ActiveDOMObject interface | 104 // ActiveDOMObject interface |
100 void suspend() override; | 105 void suspend() override; |
101 void resume() override; | 106 void resume() override; |
102 void stop() override; | 107 void stop() override; |
103 | 108 |
104 // EventTarget interface | 109 // EventTarget interface |
105 ExecutionContext* getExecutionContext() const override; | 110 ExecutionContext* getExecutionContext() const override; |
106 const AtomicString& interfaceName() const override; | 111 const AtomicString& interfaceName() const override; |
107 | 112 |
108 // WebSourceBufferClient interface | 113 // WebSourceBufferClient interface |
109 void initializationSegmentReceived() override; | 114 std::vector<WebMediaPlayer::TrackId> initializationSegmentReceived(const std
::vector<MediaTrackInfo>&) override; |
110 | 115 |
111 // Oilpan: eagerly release owned m_webSourceBuffer | 116 // Oilpan: eagerly release owned m_webSourceBuffer |
112 EAGERLY_FINALIZE(); | 117 EAGERLY_FINALIZE(); |
113 DECLARE_VIRTUAL_TRACE(); | 118 DECLARE_VIRTUAL_TRACE(); |
114 | 119 |
115 private: | 120 private: |
116 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); | 121 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); |
117 | 122 |
118 bool isRemoved() const; | 123 bool isRemoved() const; |
119 void scheduleEvent(const AtomicString& eventName); | 124 void scheduleEvent(const AtomicString& eventName); |
(...skipping 18 matching lines...) Expand all Loading... |
138 void didFail(FileError::ErrorCode) override; | 143 void didFail(FileError::ErrorCode) override; |
139 | 144 |
140 OwnPtr<WebSourceBuffer> m_webSourceBuffer; | 145 OwnPtr<WebSourceBuffer> m_webSourceBuffer; |
141 Member<MediaSource> m_source; | 146 Member<MediaSource> m_source; |
142 Member<TrackDefaultList> m_trackDefaults; | 147 Member<TrackDefaultList> m_trackDefaults; |
143 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 148 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
144 | 149 |
145 AtomicString m_mode; | 150 AtomicString m_mode; |
146 bool m_updating; | 151 bool m_updating; |
147 double m_timestampOffset; | 152 double m_timestampOffset; |
| 153 Member<AudioTrackList> m_audioTracks; |
| 154 Member<VideoTrackList> m_videoTracks; |
148 double m_appendWindowStart; | 155 double m_appendWindowStart; |
149 double m_appendWindowEnd; | 156 double m_appendWindowEnd; |
150 bool m_firstInitializationSegmentReceived; | 157 bool m_firstInitializationSegmentReceived; |
151 | 158 |
152 Vector<unsigned char> m_pendingAppendData; | 159 Vector<unsigned char> m_pendingAppendData; |
153 size_t m_pendingAppendDataOffset; | 160 size_t m_pendingAppendDataOffset; |
154 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; | 161 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; |
155 | 162 |
156 double m_pendingRemoveStart; | 163 double m_pendingRemoveStart; |
157 double m_pendingRemoveEnd; | 164 double m_pendingRemoveEnd; |
158 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; | 165 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; |
159 | 166 |
160 bool m_streamMaxSizeValid; | 167 bool m_streamMaxSizeValid; |
161 unsigned long long m_streamMaxSize; | 168 unsigned long long m_streamMaxSize; |
162 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; | 169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; |
163 Member<Stream> m_stream; | 170 Member<Stream> m_stream; |
164 OwnPtr<FileReaderLoader> m_loader; | 171 OwnPtr<FileReaderLoader> m_loader; |
165 }; | 172 }; |
166 | 173 |
167 } // namespace blink | 174 } // namespace blink |
168 | 175 |
169 #endif // SourceBuffer_h | 176 #endif // SourceBuffer_h |
OLD | NEW |