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 25 matching lines...) Expand all Loading... |
36 #include "modules/EventTargetModules.h" | 36 #include "modules/EventTargetModules.h" |
37 #include "modules/mediasource/TrackDefaultList.h" | 37 #include "modules/mediasource/TrackDefaultList.h" |
38 #include "platform/AsyncMethodRunner.h" | 38 #include "platform/AsyncMethodRunner.h" |
39 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
40 #include "public/platform/WebSourceBufferClient.h" | 40 #include "public/platform/WebSourceBufferClient.h" |
41 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
42 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
| 46 class AudioTrackList; |
46 class DOMArrayBuffer; | 47 class DOMArrayBuffer; |
47 class DOMArrayBufferView; | 48 class DOMArrayBufferView; |
48 class ExceptionState; | 49 class ExceptionState; |
49 class FileReaderLoader; | 50 class FileReaderLoader; |
50 class GenericEventQueue; | 51 class GenericEventQueue; |
51 class MediaSource; | 52 class MediaSource; |
52 class Stream; | 53 class Stream; |
53 class TimeRanges; | 54 class TimeRanges; |
54 class TrackBase; | 55 class TrackBase; |
| 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 ActiveDOMObject | 61 , public ActiveDOMObject |
60 , public FileReaderLoaderClient | 62 , public FileReaderLoaderClient |
61 , public WebSourceBufferClient { | 63 , public WebSourceBufferClient { |
62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); | 64 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); |
63 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); | 65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); |
64 DEFINE_WRAPPERTYPEINFO(); | 66 DEFINE_WRAPPERTYPEINFO(); |
(...skipping 17 matching lines...) Expand all Loading... |
82 void appendStream(Stream*, unsigned long long maxSize, ExceptionState&); | 84 void appendStream(Stream*, unsigned long long maxSize, ExceptionState&); |
83 void abort(ExceptionState&); | 85 void abort(ExceptionState&); |
84 void remove(double start, double end, ExceptionState&); | 86 void remove(double start, double end, ExceptionState&); |
85 double appendWindowStart() const; | 87 double appendWindowStart() const; |
86 void setAppendWindowStart(double, ExceptionState&); | 88 void setAppendWindowStart(double, ExceptionState&); |
87 double appendWindowEnd() const; | 89 double appendWindowEnd() const; |
88 void setAppendWindowEnd(double, ExceptionState&); | 90 void setAppendWindowEnd(double, ExceptionState&); |
89 TrackDefaultList* trackDefaults() const { return m_trackDefaults.get(); } | 91 TrackDefaultList* trackDefaults() const { return m_trackDefaults.get(); } |
90 void setTrackDefaults(TrackDefaultList*, ExceptionState&); | 92 void setTrackDefaults(TrackDefaultList*, ExceptionState&); |
91 | 93 |
| 94 AudioTrackList& audioTracks(); |
| 95 VideoTrackList& videoTracks(); |
| 96 |
92 void abortIfUpdating(); | 97 void abortIfUpdating(); |
93 void removedFromMediaSource(); | 98 void removedFromMediaSource(); |
94 | 99 |
95 // ActiveDOMObject interface | 100 // ActiveDOMObject interface |
96 bool hasPendingActivity() const override; | 101 bool hasPendingActivity() const override; |
97 void suspend() override; | 102 void suspend() override; |
98 void resume() override; | 103 void resume() override; |
99 void stop() override; | 104 void stop() override; |
100 | 105 |
101 // EventTarget interface | 106 // EventTarget interface |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 146 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
142 | 147 |
143 // The |m_pendingTracks| collection holds media track objects returned by | 148 // The |m_pendingTracks| collection holds media track objects returned by |
144 // createMediaTrack method but not yet reported to the | 149 // createMediaTrack method but not yet reported to the |
145 // initializationSegmentReceived. This is necessary to prevent media track | 150 // initializationSegmentReceived. This is necessary to prevent media track |
146 // objects from being GC-collected before the init segment algorithm is run. | 151 // objects from being GC-collected before the init segment algorithm is run. |
147 HeapVector<Member<TrackBase>> m_pendingTracks; | 152 HeapVector<Member<TrackBase>> m_pendingTracks; |
148 | 153 |
149 HeapVector<WebMediaPlayer::TrackId> m_audioTrackIds; | 154 HeapVector<WebMediaPlayer::TrackId> m_audioTrackIds; |
150 HeapVector<WebMediaPlayer::TrackId> m_videoTrackIds; | 155 HeapVector<WebMediaPlayer::TrackId> m_videoTrackIds; |
| 156 Member<AudioTrackList> m_audioTracks; |
| 157 Member<VideoTrackList> m_videoTracks; |
151 | 158 |
152 AtomicString m_mode; | 159 AtomicString m_mode; |
153 bool m_updating; | 160 bool m_updating; |
154 double m_timestampOffset; | 161 double m_timestampOffset; |
155 double m_appendWindowStart; | 162 double m_appendWindowStart; |
156 double m_appendWindowEnd; | 163 double m_appendWindowEnd; |
157 bool m_firstInitializationSegmentReceived; | 164 bool m_firstInitializationSegmentReceived; |
158 | 165 |
159 Vector<unsigned char> m_pendingAppendData; | 166 Vector<unsigned char> m_pendingAppendData; |
160 size_t m_pendingAppendDataOffset; | 167 size_t m_pendingAppendDataOffset; |
161 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; | 168 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; |
162 | 169 |
163 double m_pendingRemoveStart; | 170 double m_pendingRemoveStart; |
164 double m_pendingRemoveEnd; | 171 double m_pendingRemoveEnd; |
165 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; | 172 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; |
166 | 173 |
167 bool m_streamMaxSizeValid; | 174 bool m_streamMaxSizeValid; |
168 unsigned long long m_streamMaxSize; | 175 unsigned long long m_streamMaxSize; |
169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; | 176 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; |
170 Member<Stream> m_stream; | 177 Member<Stream> m_stream; |
171 OwnPtr<FileReaderLoader> m_loader; | 178 OwnPtr<FileReaderLoader> m_loader; |
172 }; | 179 }; |
173 | 180 |
174 } // namespace blink | 181 } // namespace blink |
175 | 182 |
176 #endif // SourceBuffer_h | 183 #endif // SourceBuffer_h |
OLD | NEW |