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

Side by Side Diff: media/blink/websourcebuffer_impl.cc

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
« no previous file with comments | « media/blink/websourcebuffer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/websourcebuffer_impl.h" 5 #include "media/blink/websourcebuffer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 93
94 bool WebSourceBufferImpl::evictCodedFrames(double currentPlaybackTime, 94 bool WebSourceBufferImpl::evictCodedFrames(double currentPlaybackTime,
95 size_t newDataSize) { 95 size_t newDataSize) {
96 return demuxer_->EvictCodedFrames( 96 return demuxer_->EvictCodedFrames(
97 id_, 97 id_,
98 base::TimeDelta::FromSecondsD(currentPlaybackTime), 98 base::TimeDelta::FromSecondsD(currentPlaybackTime),
99 newDataSize); 99 newDataSize);
100 } 100 }
101 101
102 void WebSourceBufferImpl::append( 102 bool WebSourceBufferImpl::append(const unsigned char* data,
103 const unsigned char* data, 103 unsigned length,
104 unsigned length, 104 double* timestamp_offset) {
105 double* timestamp_offset) {
106 base::TimeDelta old_offset = timestamp_offset_; 105 base::TimeDelta old_offset = timestamp_offset_;
107 demuxer_->AppendData(id_, data, length, append_window_start_, 106 bool success = demuxer_->AppendData(id_, data, length, append_window_start_,
108 append_window_end_, &timestamp_offset_); 107 append_window_end_, &timestamp_offset_);
109 108
110 // Coded frame processing may update the timestamp offset. If the caller 109 // Coded frame processing may update the timestamp offset. If the caller
111 // provides a non-NULL |timestamp_offset| and frame processing changes the 110 // provides a non-NULL |timestamp_offset| and frame processing changes the
112 // timestamp offset, report the new offset to the caller. Do not update the 111 // timestamp offset, report the new offset to the caller. Do not update the
113 // caller's offset otherwise, to preserve any pre-existing value that may have 112 // caller's offset otherwise, to preserve any pre-existing value that may have
114 // more than microsecond precision. 113 // more than microsecond precision.
115 if (timestamp_offset && old_offset != timestamp_offset_) 114 if (timestamp_offset && old_offset != timestamp_offset_)
116 *timestamp_offset = timestamp_offset_.InSecondsF(); 115 *timestamp_offset = timestamp_offset_.InSecondsF();
116
117 return success;
117 } 118 }
118 119
119 void WebSourceBufferImpl::resetParserState() { 120 void WebSourceBufferImpl::resetParserState() {
120 demuxer_->ResetParserState(id_, 121 demuxer_->ResetParserState(id_,
121 append_window_start_, append_window_end_, 122 append_window_start_, append_window_end_,
122 &timestamp_offset_); 123 &timestamp_offset_);
123 124
124 // TODO(wolenetz): resetParserState should be able to modify the caller 125 // TODO(wolenetz): resetParserState should be able to modify the caller
125 // timestamp offset (just like WebSourceBufferImpl::append). 126 // timestamp offset (just like WebSourceBufferImpl::append).
126 // See http://crbug.com/370229 for further details. 127 // See http://crbug.com/370229 for further details.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 trackInfo.kind = blink::WebString::fromUTF8(track->kind()); 188 trackInfo.kind = blink::WebString::fromUTF8(track->kind());
188 trackInfo.label = blink::WebString::fromUTF8(track->label()); 189 trackInfo.label = blink::WebString::fromUTF8(track->label());
189 trackInfo.language = blink::WebString::fromUTF8(track->language()); 190 trackInfo.language = blink::WebString::fromUTF8(track->language());
190 trackInfoVector.push_back(trackInfo); 191 trackInfoVector.push_back(trackInfo);
191 } 192 }
192 193
193 client_->initializationSegmentReceived(trackInfoVector); 194 client_->initializationSegmentReceived(trackInfoVector);
194 } 195 }
195 196
196 } // namespace media 197 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/websourcebuffer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698