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

Side by Side Diff: media/filters/pipeline_integration_test.cc

Issue 256583006: Fix possible buffer emission during an abort. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comments. Created 6 years, 7 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/filters/chunk_demuxer_unittest.cc ('k') | media/media.gyp » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/pipeline_integration_test_base.h" 5 #include "media/filters/pipeline_integration_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 scoped_ptr<Demuxer> GetDemuxer() { return owned_chunk_demuxer_.Pass(); } 316 scoped_ptr<Demuxer> GetDemuxer() { return owned_chunk_demuxer_.Pass(); }
317 317
318 void set_need_key_cb(const Demuxer::NeedKeyCB& need_key_cb) { 318 void set_need_key_cb(const Demuxer::NeedKeyCB& need_key_cb) {
319 need_key_cb_ = need_key_cb; 319 need_key_cb_ = need_key_cb;
320 } 320 }
321 321
322 void Seek(base::TimeDelta seek_time, int new_position, int seek_append_size) { 322 void Seek(base::TimeDelta seek_time, int new_position, int seek_append_size) {
323 chunk_demuxer_->StartWaitingForSeek(seek_time); 323 chunk_demuxer_->StartWaitingForSeek(seek_time);
324 324
325 chunk_demuxer_->Abort(kSourceId); 325 // TODO(wolenetz): Test timestamp offset updating once "sequence" append
326 // mode processing is implemented. See http://crbug.com/249422.
327 base::TimeDelta timestamp_offset;
328 chunk_demuxer_->Abort(
329 kSourceId,
330 base::TimeDelta(), kInfiniteDuration(), &timestamp_offset);
wolenetz 2014/05/06 00:58:11 nit: Let's use &last_timestamp_offset_ here and dr
damienv1 2014/05/06 01:21:44 Done.
331 last_timestamp_offset_ = timestamp_offset;
326 332
327 DCHECK_GE(new_position, 0); 333 DCHECK_GE(new_position, 0);
328 DCHECK_LT(new_position, file_data_->data_size()); 334 DCHECK_LT(new_position, file_data_->data_size());
329 current_position_ = new_position; 335 current_position_ = new_position;
330 336
331 AppendData(seek_append_size); 337 AppendData(seek_append_size);
332 } 338 }
333 339
334 void AppendData(int size) { 340 void AppendData(int size) {
335 DCHECK(chunk_demuxer_); 341 DCHECK(chunk_demuxer_);
336 DCHECK_LT(current_position_, file_data_->data_size()); 342 DCHECK_LT(current_position_, file_data_->data_size());
337 DCHECK_LE(current_position_ + size, file_data_->data_size()); 343 DCHECK_LE(current_position_ + size, file_data_->data_size());
338 344
339 // TODO(wolenetz): Test timestamp offset updating once "sequence" append 345 // TODO(wolenetz): Test timestamp offset updating once "sequence" append
340 // mode processing is implemented. See http://crbug.com/249422. 346 // mode processing is implemented. See http://crbug.com/249422.
341 base::TimeDelta timestamp_offset; 347 base::TimeDelta timestamp_offset;
342 chunk_demuxer_->AppendData( 348 chunk_demuxer_->AppendData(
343 kSourceId, file_data_->data() + current_position_, size, 349 kSourceId, file_data_->data() + current_position_, size,
344 base::TimeDelta(), kInfiniteDuration(), &timestamp_offset); 350 base::TimeDelta(), kInfiniteDuration(), &timestamp_offset);
wolenetz 2014/05/06 00:58:11 nit: ditto. Similarly, there are not two AppendDat
damienv1 2014/05/06 01:21:44 Done.
345 current_position_ += size; 351 current_position_ += size;
346 last_timestamp_offset_ = timestamp_offset; 352 last_timestamp_offset_ = timestamp_offset;
347 } 353 }
348 354
349 void AppendAtTime(base::TimeDelta timestamp_offset, 355 void AppendAtTime(base::TimeDelta timestamp_offset,
350 const uint8* pData, 356 const uint8* pData,
351 int size) { 357 int size) {
352 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId)); 358 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId));
353 chunk_demuxer_->AppendData(kSourceId, pData, size, 359 chunk_demuxer_->AppendData(kSourceId, pData, size,
354 base::TimeDelta(), kInfiniteDuration(), 360 base::TimeDelta(), kInfiniteDuration(),
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 Play(); 1280 Play();
1275 ASSERT_TRUE(WaitUntilOnEnded()); 1281 ASSERT_TRUE(WaitUntilOnEnded());
1276 } 1282 }
1277 1283
1278 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, 1284 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag,
1279 // once the new processor has landed. See http://crbug.com/249422. 1285 // once the new processor has landed. See http://crbug.com/249422.
1280 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, 1286 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest,
1281 Values(true)); 1287 Values(true));
1282 1288
1283 } // namespace media 1289 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698