Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1564)

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/SourceBuffer.h

Issue 1678523003: Implement InitSegmentReceived algorithm in blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-sb-audiotrack
Patch Set: Don't check track ids in tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // ActiveDOMObject interface 109 // ActiveDOMObject interface
110 void suspend() override; 110 void suspend() override;
111 void resume() override; 111 void resume() override;
112 void stop() override; 112 void stop() override;
113 113
114 // EventTarget interface 114 // EventTarget interface
115 ExecutionContext* getExecutionContext() const override; 115 ExecutionContext* getExecutionContext() const override;
116 const AtomicString& interfaceName() const override; 116 const AtomicString& interfaceName() const override;
117 117
118 // WebSourceBufferClient interface 118 // WebSourceBufferClient interface
119 WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVe ctor<MediaTrackInfo>&) override; 119 bool initializationSegmentReceived(const WebVector<MediaTrackInfo>&) overrid e;
120 120
121 DECLARE_VIRTUAL_TRACE(); 121 DECLARE_VIRTUAL_TRACE();
122 122
123 private: 123 private:
124 enum AppendStreamDoneAction { 124 enum AppendStreamDoneAction {
125 NoError, 125 NoError,
126 RunAppendErrorWithNoDecodeError, 126 RunAppendErrorWithNoDecodeError,
127 RunAppendErrorWithDecodeError 127 RunAppendErrorWithDecodeError
128 }; 128 };
129 129
(...skipping 16 matching lines...) Expand all
146 146
147 void removeAsyncPart(); 147 void removeAsyncPart();
148 148
149 void appendStreamInternal(Stream*, ExceptionState&); 149 void appendStreamInternal(Stream*, ExceptionState&);
150 void appendStreamAsyncPart(); 150 void appendStreamAsyncPart();
151 void appendStreamDone(AppendStreamDoneAction); 151 void appendStreamDone(AppendStreamDoneAction);
152 void clearAppendStreamState(); 152 void clearAppendStreamState();
153 153
154 void removeMediaTracks(); 154 void removeMediaTracks();
155 155
156 const TrackDefault* getTrackDefault(const AtomicString& trackType, const Ato micString& byteStreamTrackID) const;
157 AtomicString defaultTrackLabel(const AtomicString& trackType, const AtomicSt ring& byteStreamTrackID) const;
158 AtomicString defaultTrackLanguage(const AtomicString& trackType, const Atomi cString& byteStreamTrackID) const;
159
156 // FileReaderLoaderClient interface 160 // FileReaderLoaderClient interface
157 void didStartLoading() override; 161 void didStartLoading() override;
158 void didReceiveDataForClient(const char* data, unsigned dataLength) override ; 162 void didReceiveDataForClient(const char* data, unsigned dataLength) override ;
159 void didFinishLoading() override; 163 void didFinishLoading() override;
160 void didFail(FileError::ErrorCode) override; 164 void didFail(FileError::ErrorCode) override;
161 165
162 std::unique_ptr<WebSourceBuffer> m_webSourceBuffer; 166 std::unique_ptr<WebSourceBuffer> m_webSourceBuffer;
163 Member<MediaSource> m_source; 167 Member<MediaSource> m_source;
164 Member<TrackDefaultList> m_trackDefaults; 168 Member<TrackDefaultList> m_trackDefaults;
165 Member<GenericEventQueue> m_asyncEventQueue; 169 Member<GenericEventQueue> m_asyncEventQueue;
166 170
167 AtomicString m_mode; 171 AtomicString m_mode;
168 bool m_updating; 172 bool m_updating;
169 double m_timestampOffset; 173 double m_timestampOffset;
170 Member<AudioTrackList> m_audioTracks; 174 Member<AudioTrackList> m_audioTracks;
171 Member<VideoTrackList> m_videoTracks; 175 Member<VideoTrackList> m_videoTracks;
176 bool m_activeTrack = false;
172 double m_appendWindowStart; 177 double m_appendWindowStart;
173 double m_appendWindowEnd; 178 double m_appendWindowEnd;
174 bool m_firstInitializationSegmentReceived; 179 bool m_firstInitializationSegmentReceived;
175 180
176 Vector<unsigned char> m_pendingAppendData; 181 Vector<unsigned char> m_pendingAppendData;
177 size_t m_pendingAppendDataOffset; 182 size_t m_pendingAppendDataOffset;
178 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; 183 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner;
179 184
180 double m_pendingRemoveStart; 185 double m_pendingRemoveStart;
181 double m_pendingRemoveEnd; 186 double m_pendingRemoveEnd;
182 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; 187 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner;
183 188
184 bool m_streamMaxSizeValid; 189 bool m_streamMaxSizeValid;
185 unsigned long long m_streamMaxSize; 190 unsigned long long m_streamMaxSize;
186 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; 191 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner;
187 Member<Stream> m_stream; 192 Member<Stream> m_stream;
188 std::unique_ptr<FileReaderLoader> m_loader; 193 std::unique_ptr<FileReaderLoader> m_loader;
189 }; 194 };
190 195
191 } // namespace blink 196 } // namespace blink
192 197
193 #endif // SourceBuffer_h 198 #endif // SourceBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698