| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // ActiveDOMObject interface | 104 // ActiveDOMObject interface |
| 105 void suspend() override; | 105 void suspend() override; |
| 106 void resume() override; | 106 void resume() override; |
| 107 void stop() override; | 107 void stop() override; |
| 108 | 108 |
| 109 // EventTarget interface | 109 // EventTarget interface |
| 110 ExecutionContext* getExecutionContext() const override; | 110 ExecutionContext* getExecutionContext() const override; |
| 111 const AtomicString& interfaceName() const override; | 111 const AtomicString& interfaceName() const override; |
| 112 | 112 |
| 113 // WebSourceBufferClient interface | 113 // WebSourceBufferClient interface |
| 114 WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVe
ctor<MediaTrackInfo>&) override; | 114 bool initializationSegmentReceived(const WebVector<MediaTrackInfo>&) overrid
e; |
| 115 | 115 |
| 116 DECLARE_VIRTUAL_TRACE(); | 116 DECLARE_VIRTUAL_TRACE(); |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 enum AppendStreamDoneAction { | 119 enum AppendStreamDoneAction { |
| 120 NoError, | 120 NoError, |
| 121 RunAppendErrorWithNoDecodeError, | 121 RunAppendErrorWithNoDecodeError, |
| 122 RunAppendErrorWithDecodeError | 122 RunAppendErrorWithDecodeError |
| 123 }; | 123 }; |
| 124 | 124 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 141 | 141 |
| 142 void removeAsyncPart(); | 142 void removeAsyncPart(); |
| 143 | 143 |
| 144 void appendStreamInternal(Stream*, ExceptionState&); | 144 void appendStreamInternal(Stream*, ExceptionState&); |
| 145 void appendStreamAsyncPart(); | 145 void appendStreamAsyncPart(); |
| 146 void appendStreamDone(AppendStreamDoneAction); | 146 void appendStreamDone(AppendStreamDoneAction); |
| 147 void clearAppendStreamState(); | 147 void clearAppendStreamState(); |
| 148 | 148 |
| 149 void removeMediaTracks(); | 149 void removeMediaTracks(); |
| 150 | 150 |
| 151 const TrackDefault* getTrackDefault(const AtomicString& trackType, const Ato
micString& byteStreamTrackID) const; |
| 152 AtomicString defaultTrackLabel(const AtomicString& trackType, const AtomicSt
ring& byteStreamTrackID) const; |
| 153 AtomicString defaultTrackLanguage(const AtomicString& trackType, const Atomi
cString& byteStreamTrackID) const; |
| 154 |
| 151 // FileReaderLoaderClient interface | 155 // FileReaderLoaderClient interface |
| 152 void didStartLoading() override; | 156 void didStartLoading() override; |
| 153 void didReceiveDataForClient(const char* data, unsigned dataLength) override
; | 157 void didReceiveDataForClient(const char* data, unsigned dataLength) override
; |
| 154 void didFinishLoading() override; | 158 void didFinishLoading() override; |
| 155 void didFail(FileError::ErrorCode) override; | 159 void didFail(FileError::ErrorCode) override; |
| 156 | 160 |
| 157 std::unique_ptr<WebSourceBuffer> m_webSourceBuffer; | 161 std::unique_ptr<WebSourceBuffer> m_webSourceBuffer; |
| 158 Member<MediaSource> m_source; | 162 Member<MediaSource> m_source; |
| 159 Member<TrackDefaultList> m_trackDefaults; | 163 Member<TrackDefaultList> m_trackDefaults; |
| 160 Member<GenericEventQueue> m_asyncEventQueue; | 164 Member<GenericEventQueue> m_asyncEventQueue; |
| 161 | 165 |
| 162 AtomicString m_mode; | 166 AtomicString m_mode; |
| 163 bool m_updating; | 167 bool m_updating; |
| 164 double m_timestampOffset; | 168 double m_timestampOffset; |
| 165 Member<AudioTrackList> m_audioTracks; | 169 Member<AudioTrackList> m_audioTracks; |
| 166 Member<VideoTrackList> m_videoTracks; | 170 Member<VideoTrackList> m_videoTracks; |
| 171 bool m_activeTrack = false; |
| 167 double m_appendWindowStart; | 172 double m_appendWindowStart; |
| 168 double m_appendWindowEnd; | 173 double m_appendWindowEnd; |
| 169 bool m_firstInitializationSegmentReceived; | 174 bool m_firstInitializationSegmentReceived; |
| 170 | 175 |
| 171 Vector<unsigned char> m_pendingAppendData; | 176 Vector<unsigned char> m_pendingAppendData; |
| 172 size_t m_pendingAppendDataOffset; | 177 size_t m_pendingAppendDataOffset; |
| 173 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; | 178 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; |
| 174 | 179 |
| 175 double m_pendingRemoveStart; | 180 double m_pendingRemoveStart; |
| 176 double m_pendingRemoveEnd; | 181 double m_pendingRemoveEnd; |
| 177 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; | 182 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; |
| 178 | 183 |
| 179 bool m_streamMaxSizeValid; | 184 bool m_streamMaxSizeValid; |
| 180 unsigned long long m_streamMaxSize; | 185 unsigned long long m_streamMaxSize; |
| 181 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; | 186 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; |
| 182 Member<Stream> m_stream; | 187 Member<Stream> m_stream; |
| 183 std::unique_ptr<FileReaderLoader> m_loader; | 188 std::unique_ptr<FileReaderLoader> m_loader; |
| 184 }; | 189 }; |
| 185 | 190 |
| 186 } // namespace blink | 191 } // namespace blink |
| 187 | 192 |
| 188 #endif // SourceBuffer_h | 193 #endif // SourceBuffer_h |
| OLD | NEW |