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; |
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; | |
wolenetz
2016/03/23 19:34:13
nit: are these going to be used for anything in th
servolk
2016/03/24 01:31:56
These are used for implementing a primitive 'init
wolenetz
2016/03/24 01:57:43
Acknowledged.
| |
150 HeapVector<WebMediaPlayer::TrackId> m_videoTrackIds; | |
151 | |
wolenetz
2016/03/23 19:34:13
nit: add TODO for textTracks?
servolk
2016/03/24 01:31:56
Done.
| |
141 AtomicString m_mode; | 152 AtomicString m_mode; |
142 bool m_updating; | 153 bool m_updating; |
143 double m_timestampOffset; | 154 double m_timestampOffset; |
144 double m_appendWindowStart; | 155 double m_appendWindowStart; |
145 double m_appendWindowEnd; | 156 double m_appendWindowEnd; |
146 bool m_firstInitializationSegmentReceived; | 157 bool m_firstInitializationSegmentReceived; |
147 | 158 |
148 Vector<unsigned char> m_pendingAppendData; | 159 Vector<unsigned char> m_pendingAppendData; |
149 size_t m_pendingAppendDataOffset; | 160 size_t m_pendingAppendDataOffset; |
150 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; | 161 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; |
151 | 162 |
152 double m_pendingRemoveStart; | 163 double m_pendingRemoveStart; |
153 double m_pendingRemoveEnd; | 164 double m_pendingRemoveEnd; |
154 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; | 165 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; |
155 | 166 |
156 bool m_streamMaxSizeValid; | 167 bool m_streamMaxSizeValid; |
157 unsigned long long m_streamMaxSize; | 168 unsigned long long m_streamMaxSize; |
158 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; | 169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; |
159 Member<Stream> m_stream; | 170 Member<Stream> m_stream; |
160 OwnPtr<FileReaderLoader> m_loader; | 171 OwnPtr<FileReaderLoader> m_loader; |
161 }; | 172 }; |
162 | 173 |
163 } // namespace blink | 174 } // namespace blink |
164 | 175 |
165 #endif // SourceBuffer_h | 176 #endif // SourceBuffer_h |
OLD | NEW |