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

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: Extend tests Created 4 years, 6 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // ActiveDOMObject interface 103 // ActiveDOMObject interface
104 void suspend() override; 104 void suspend() override;
105 void resume() override; 105 void resume() override;
106 void stop() override; 106 void stop() override;
107 107
108 // EventTarget interface 108 // EventTarget interface
109 ExecutionContext* getExecutionContext() const override; 109 ExecutionContext* getExecutionContext() const override;
110 const AtomicString& interfaceName() const override; 110 const AtomicString& interfaceName() const override;
111 111
112 // WebSourceBufferClient interface 112 // WebSourceBufferClient interface
113 WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVe ctor<MediaTrackInfo>&) override; 113 bool initializationSegmentReceived(const WebVector<MediaTrackInfo>&) overrid e;
114 114
115 DECLARE_VIRTUAL_TRACE(); 115 DECLARE_VIRTUAL_TRACE();
116 116
117 private: 117 private:
118 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*); 118 SourceBuffer(PassOwnPtr<WebSourceBuffer>, MediaSource*, GenericEventQueue*);
119 void dispose(); 119 void dispose();
120 120
121 bool isRemoved() const; 121 bool isRemoved() const;
122 void scheduleEvent(const AtomicString& eventName); 122 void scheduleEvent(const AtomicString& eventName);
123 123
124 bool prepareAppend(size_t newDataSize, ExceptionState&); 124 bool prepareAppend(size_t newDataSize, ExceptionState&);
125 bool evictCodedFrames(size_t newDataSize); 125 bool evictCodedFrames(size_t newDataSize);
126 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); 126 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&);
127 void appendBufferAsyncPart(); 127 void appendBufferAsyncPart();
128 void appendError(bool decodeError); 128 void appendError(bool decodeError);
129 129
130 void removeAsyncPart(); 130 void removeAsyncPart();
131 131
132 void appendStreamInternal(Stream*, ExceptionState&); 132 void appendStreamInternal(Stream*, ExceptionState&);
133 void appendStreamAsyncPart(); 133 void appendStreamAsyncPart();
134 void appendStreamDone(bool success); 134 void appendStreamDone(bool success);
135 void clearAppendStreamState(); 135 void clearAppendStreamState();
136 136
137 void removeMediaTracks(); 137 void removeMediaTracks();
138 138
139 const TrackDefault* getTrackDefault(const AtomicString& trackType, const Ato micString& byteStreamTrackID) const;
140 AtomicString defaultTrackLabel(const AtomicString& trackType, const AtomicSt ring& byteStreamTrackID) const;
141 AtomicString defaultTrackLanguage(const AtomicString& trackType, const Atomi cString& byteStreamTrackID) const;
142
139 // FileReaderLoaderClient interface 143 // FileReaderLoaderClient interface
140 void didStartLoading() override; 144 void didStartLoading() override;
141 void didReceiveDataForClient(const char* data, unsigned dataLength) override ; 145 void didReceiveDataForClient(const char* data, unsigned dataLength) override ;
142 void didFinishLoading() override; 146 void didFinishLoading() override;
143 void didFail(FileError::ErrorCode) override; 147 void didFail(FileError::ErrorCode) override;
144 148
145 OwnPtr<WebSourceBuffer> m_webSourceBuffer; 149 OwnPtr<WebSourceBuffer> m_webSourceBuffer;
146 Member<MediaSource> m_source; 150 Member<MediaSource> m_source;
147 Member<TrackDefaultList> m_trackDefaults; 151 Member<TrackDefaultList> m_trackDefaults;
148 Member<GenericEventQueue> m_asyncEventQueue; 152 Member<GenericEventQueue> m_asyncEventQueue;
149 153
150 AtomicString m_mode; 154 AtomicString m_mode;
151 bool m_updating; 155 bool m_updating;
152 double m_timestampOffset; 156 double m_timestampOffset;
153 Member<AudioTrackList> m_audioTracks; 157 Member<AudioTrackList> m_audioTracks;
154 Member<VideoTrackList> m_videoTracks; 158 Member<VideoTrackList> m_videoTracks;
159 bool m_activeTrack = false;
155 double m_appendWindowStart; 160 double m_appendWindowStart;
156 double m_appendWindowEnd; 161 double m_appendWindowEnd;
157 bool m_firstInitializationSegmentReceived; 162 bool m_firstInitializationSegmentReceived;
158 163
159 Vector<unsigned char> m_pendingAppendData; 164 Vector<unsigned char> m_pendingAppendData;
160 size_t m_pendingAppendDataOffset; 165 size_t m_pendingAppendDataOffset;
161 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner; 166 Member<AsyncMethodRunner<SourceBuffer>> m_appendBufferAsyncPartRunner;
162 167
163 double m_pendingRemoveStart; 168 double m_pendingRemoveStart;
164 double m_pendingRemoveEnd; 169 double m_pendingRemoveEnd;
165 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner; 170 Member<AsyncMethodRunner<SourceBuffer>> m_removeAsyncPartRunner;
166 171
167 bool m_streamMaxSizeValid; 172 bool m_streamMaxSizeValid;
168 unsigned long long m_streamMaxSize; 173 unsigned long long m_streamMaxSize;
169 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; 174 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner;
170 Member<Stream> m_stream; 175 Member<Stream> m_stream;
171 OwnPtr<FileReaderLoader> m_loader; 176 OwnPtr<FileReaderLoader> m_loader;
172 }; 177 };
173 178
174 } // namespace blink 179 } // namespace blink
175 180
176 #endif // SourceBuffer_h 181 #endif // SourceBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698