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

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

Issue 2076673005: MSE: Plumb ChunkDemuxer appendData failures into append Error algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 WebVector<WebMediaPlayer::TrackId> initializationSegmentReceived(const WebVe ctor<MediaTrackInfo>&) override;
115 115
116 DECLARE_VIRTUAL_TRACE(); 116 DECLARE_VIRTUAL_TRACE();
117 117
118 private: 118 private:
119 enum AppendStreamDoneAction {
120 NoError,
121 RunAppendErrorWithNoDecodeError,
122 RunAppendErrorWithDecodeError
123 };
124
125 enum AppendError {
126 NoDecodeError,
127 DecodeError
128 };
129
119 SourceBuffer(std::unique_ptr<WebSourceBuffer>, MediaSource*, GenericEventQue ue*); 130 SourceBuffer(std::unique_ptr<WebSourceBuffer>, MediaSource*, GenericEventQue ue*);
120 void dispose(); 131 void dispose();
121 132
122 bool isRemoved() const; 133 bool isRemoved() const;
123 void scheduleEvent(const AtomicString& eventName); 134 void scheduleEvent(const AtomicString& eventName);
124 135
125 bool prepareAppend(size_t newDataSize, ExceptionState&); 136 bool prepareAppend(size_t newDataSize, ExceptionState&);
126 bool evictCodedFrames(size_t newDataSize); 137 bool evictCodedFrames(size_t newDataSize);
127 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&); 138 void appendBufferInternal(const unsigned char*, unsigned, ExceptionState&);
128 void appendBufferAsyncPart(); 139 void appendBufferAsyncPart();
129 void appendError(bool decodeError); 140 void appendError(AppendError);
130 141
131 void removeAsyncPart(); 142 void removeAsyncPart();
132 143
133 void appendStreamInternal(Stream*, ExceptionState&); 144 void appendStreamInternal(Stream*, ExceptionState&);
134 void appendStreamAsyncPart(); 145 void appendStreamAsyncPart();
135 void appendStreamDone(bool success); 146 void appendStreamDone(AppendStreamDoneAction);
136 void clearAppendStreamState(); 147 void clearAppendStreamState();
137 148
138 void removeMediaTracks(); 149 void removeMediaTracks();
139 150
140 // FileReaderLoaderClient interface 151 // FileReaderLoaderClient interface
141 void didStartLoading() override; 152 void didStartLoading() override;
142 void didReceiveDataForClient(const char* data, unsigned dataLength) override ; 153 void didReceiveDataForClient(const char* data, unsigned dataLength) override ;
143 void didFinishLoading() override; 154 void didFinishLoading() override;
144 void didFail(FileError::ErrorCode) override; 155 void didFail(FileError::ErrorCode) override;
145 156
(...skipping 22 matching lines...) Expand all
168 bool m_streamMaxSizeValid; 179 bool m_streamMaxSizeValid;
169 unsigned long long m_streamMaxSize; 180 unsigned long long m_streamMaxSize;
170 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner; 181 Member<AsyncMethodRunner<SourceBuffer>> m_appendStreamAsyncPartRunner;
171 Member<Stream> m_stream; 182 Member<Stream> m_stream;
172 std::unique_ptr<FileReaderLoader> m_loader; 183 std::unique_ptr<FileReaderLoader> m_loader;
173 }; 184 };
174 185
175 } // namespace blink 186 } // namespace blink
176 187
177 #endif // SourceBuffer_h 188 #endif // SourceBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698