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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class DOMArrayBuffer; | 46 class DOMArrayBuffer; |
47 class DOMArrayBufferView; | 47 class DOMArrayBufferView; |
48 class ExceptionState; | 48 class ExceptionState; |
49 class FileReaderLoader; | 49 class FileReaderLoader; |
50 class GenericEventQueue; | 50 class GenericEventQueue; |
51 class MediaSource; | 51 class MediaSource; |
52 class Stream; | 52 class Stream; |
53 class TimeRanges; | 53 class TimeRanges; |
54 class TrackBase; | |
54 class WebSourceBuffer; | 55 class WebSourceBuffer; |
55 | 56 |
56 class SourceBuffer final | 57 class SourceBuffer final |
57 : public RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer> | 58 : public RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer> |
58 , public ActiveDOMObject | 59 , public ActiveDOMObject |
59 , public FileReaderLoaderClient | 60 , public FileReaderLoaderClient |
60 , public WebSourceBufferClient { | 61 , public WebSourceBufferClient { |
61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); | 62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SourceBuffer); |
62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); | 63 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); |
63 DEFINE_WRAPPERTYPEINFO(); | 64 DEFINE_WRAPPERTYPEINFO(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 bool hasPendingActivity() const override; | 96 bool hasPendingActivity() const override; |
96 void suspend() override; | 97 void suspend() override; |
97 void resume() override; | 98 void resume() override; |
98 void stop() override; | 99 void stop() override; |
99 | 100 |
100 // EventTarget interface | 101 // EventTarget interface |
101 ExecutionContext* getExecutionContext() const override; | 102 ExecutionContext* getExecutionContext() const override; |
102 const AtomicString& interfaceName() const override; | 103 const AtomicString& interfaceName() const override; |
103 | 104 |
104 // WebSourceBufferClient interface | 105 // WebSourceBufferClient interface |
105 void initializationSegmentReceived() override; | 106 WebMediaPlayer::TrackId createMediaTrack(WebMediaPlayer::TrackType, WebStrin g, WebString, WebString, WebString) override; |
philipj_slow
2016/03/24 05:56:00
The arguments should be named when not redundant w
servolk
2016/03/29 01:26:33
Done.
| |
107 void initializationSegmentReceived(const WebVector<WebMediaPlayer::TrackId>& ) override; | |
106 | 108 |
107 // Oilpan: eagerly release owned m_webSourceBuffer | 109 // Oilpan: eagerly release owned m_webSourceBuffer |
108 EAGERLY_FINALIZE(); | 110 EAGERLY_FINALIZE(); |
109 DECLARE_VIRTUAL_TRACE(); | 111 DECLARE_VIRTUAL_TRACE(); |
110 | 112 |
111 private: | 113 private: |
112 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); | 114 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); |
113 | 115 |
114 bool isRemoved() const; | 116 bool isRemoved() const; |
115 void scheduleEvent(const AtomicString& eventName); | 117 void scheduleEvent(const AtomicString& eventName); |
(...skipping 15 matching lines...) Expand all Loading... | |
131 void didStartLoading() override; | 133 void didStartLoading() override; |
132 void didReceiveDataForClient(const char* data, unsigned dataLength) override ; | 134 void didReceiveDataForClient(const char* data, unsigned dataLength) override ; |
133 void didFinishLoading() override; | 135 void didFinishLoading() override; |
134 void didFail(FileError::ErrorCode) override; | 136 void didFail(FileError::ErrorCode) override; |
135 | 137 |
136 OwnPtr<WebSourceBuffer> m_webSourceBuffer; | 138 OwnPtr<WebSourceBuffer> m_webSourceBuffer; |
137 Member<MediaSource> m_source; | 139 Member<MediaSource> m_source; |
138 Member<TrackDefaultList> m_trackDefaults; | 140 Member<TrackDefaultList> m_trackDefaults; |
139 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 141 RawPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
140 | 142 |
143 // The |m_pendingTracks| collection holds media track objects returned by | |
144 // createMediaTrack method but not yet reported to the | |
145 // initializationSegmentReceived. This is necessary to prevent media track | |
146 // objects from being GC-collected before the init segment algorithm is run. | |
147 HeapVector<Member<TrackBase>> m_pendingTracks; | |
148 | |
149 HeapVector<WebMediaPlayer::TrackId> m_audioTrackIds; | |
philipj_slow
2016/03/24 05:56:00
I think these can be plain Vector<>, WebMediaPlaye
servolk
2016/03/29 01:26:33
Actually, I've just removed those in the latest pa
| |
150 HeapVector<WebMediaPlayer::TrackId> m_videoTrackIds; | |
151 // TODO(servolk): Add track id collection for text tracks as well. | |
152 | |
141 AtomicString m_mode; | 153 AtomicString m_mode; |
142 bool m_updating; | 154 bool m_updating; |
143 double m_timestampOffset; | 155 double m_timestampOffset; |
144 double m_appendWindowStart; | 156 double m_appendWindowStart; |
145 double m_appendWindowEnd; | 157 double m_appendWindowEnd; |
146 bool m_firstInitializationSegmentReceived; | 158 bool m_firstInitializationSegmentReceived; |
147 | 159 |
148 Vector<unsigned char> m_pendingAppendData; | 160 Vector<unsigned char> m_pendingAppendData; |
149 size_t m_pendingAppendDataOffset; | 161 size_t m_pendingAppendDataOffset; |
150 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; | 162 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; |
151 | 163 |
152 double m_pendingRemoveStart; | 164 double m_pendingRemoveStart; |
153 double m_pendingRemoveEnd; | 165 double m_pendingRemoveEnd; |
154 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; | 166 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; |
155 | 167 |
156 bool m_streamMaxSizeValid; | 168 bool m_streamMaxSizeValid; |
157 unsigned long long m_streamMaxSize; | 169 unsigned long long m_streamMaxSize; |
158 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; | 170 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; |
159 Member<Stream> m_stream; | 171 Member<Stream> m_stream; |
160 OwnPtr<FileReaderLoader> m_loader; | 172 OwnPtr<FileReaderLoader> m_loader; |
161 }; | 173 }; |
162 | 174 |
163 } // namespace blink | 175 } // namespace blink |
164 | 176 |
165 #endif // SourceBuffer_h | 177 #endif // SourceBuffer_h |
OLD | NEW |