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

Side by Side Diff: content/renderer/media/android/media_source_delegate.cc

Issue 1552733002: Convert Pass()→std::move() in //content (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 11 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 // 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 "content/renderer/media/android/media_source_delegate.h" 5 #include "content/renderer/media/android/media_source_delegate.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <utility>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
12 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
13 #include "content/renderer/media/android/renderer_demuxer_android.h" 14 #include "content/renderer/media/android/renderer_demuxer_android.h"
14 #include "media/base/android/demuxer_stream_player_params.h" 15 #include "media/base/android/demuxer_stream_player_params.h"
15 #include "media/base/bind_to_current_loop.h" 16 #include "media/base/bind_to_current_loop.h"
16 #include "media/base/demuxer_stream.h" 17 #include "media/base/demuxer_stream.h"
17 #include "media/base/media_log.h" 18 #include "media/base/media_log.h"
18 #include "media/base/timestamp_constants.h" 19 #include "media/base/timestamp_constants.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 DVLOG(1) << __FUNCTION__ << "(" << type << ") : " << demuxer_client_id_; 336 DVLOG(1) << __FUNCTION__ << "(" << type << ") : " << demuxer_client_id_;
336 if (IsSeeking()) 337 if (IsSeeking())
337 return; // Drop the request during seeking. 338 return; // Drop the request during seeking.
338 339
339 DCHECK(type == DemuxerStream::AUDIO || type == DemuxerStream::VIDEO); 340 DCHECK(type == DemuxerStream::AUDIO || type == DemuxerStream::VIDEO);
340 // The access unit size should have been initialized properly at this stage. 341 // The access unit size should have been initialized properly at this stage.
341 DCHECK_GT(access_unit_size_, 0u); 342 DCHECK_GT(access_unit_size_, 0u);
342 scoped_ptr<DemuxerData> data(new DemuxerData()); 343 scoped_ptr<DemuxerData> data(new DemuxerData());
343 data->type = type; 344 data->type = type;
344 data->access_units.resize(access_unit_size_); 345 data->access_units.resize(access_unit_size_);
345 ReadFromDemuxerStream(type, data.Pass(), 0); 346 ReadFromDemuxerStream(type, std::move(data), 0);
346 } 347 }
347 348
348 void MediaSourceDelegate::ReadFromDemuxerStream(media::DemuxerStream::Type type, 349 void MediaSourceDelegate::ReadFromDemuxerStream(media::DemuxerStream::Type type,
349 scoped_ptr<DemuxerData> data, 350 scoped_ptr<DemuxerData> data,
350 size_t index) { 351 size_t index) {
351 DCHECK(media_task_runner_->BelongsToCurrentThread()); 352 DCHECK(media_task_runner_->BelongsToCurrentThread());
352 // DemuxerStream::Read() always returns the read callback asynchronously. 353 // DemuxerStream::Read() always returns the read callback asynchronously.
353 DemuxerStream* stream = 354 DemuxerStream* stream =
354 (type == DemuxerStream::AUDIO) ? audio_stream_ : video_stream_; 355 (type == DemuxerStream::AUDIO) ? audio_stream_ : video_stream_;
355 stream->Read(base::Bind( 356 stream->Read(base::Bind(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 data->access_units[index].key_id = std::vector<char>( 443 data->access_units[index].key_id = std::vector<char>(
443 buffer->decrypt_config()->key_id().begin(), 444 buffer->decrypt_config()->key_id().begin(),
444 buffer->decrypt_config()->key_id().end()); 445 buffer->decrypt_config()->key_id().end());
445 data->access_units[index].iv = std::vector<char>( 446 data->access_units[index].iv = std::vector<char>(
446 buffer->decrypt_config()->iv().begin(), 447 buffer->decrypt_config()->iv().begin(),
447 buffer->decrypt_config()->iv().end()); 448 buffer->decrypt_config()->iv().end());
448 data->access_units[index].subsamples = 449 data->access_units[index].subsamples =
449 buffer->decrypt_config()->subsamples(); 450 buffer->decrypt_config()->subsamples();
450 } 451 }
451 if (++index < data->access_units.size()) { 452 if (++index < data->access_units.size()) {
452 ReadFromDemuxerStream(type, data.Pass(), index); 453 ReadFromDemuxerStream(type, std::move(data), index);
453 return; 454 return;
454 } 455 }
455 break; 456 break;
456 457
457 default: 458 default:
458 NOTREACHED(); 459 NOTREACHED();
459 } 460 }
460 461
461 if (!IsSeeking() && demuxer_client_) 462 if (!IsSeeking() && demuxer_client_)
462 demuxer_client_->ReadFromDemuxerAck(demuxer_client_id_, *data); 463 demuxer_client_->ReadFromDemuxerAck(demuxer_client_id_, *data);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 configs->video_codec = config.codec(); 750 configs->video_codec = config.codec();
750 configs->video_size = config.natural_size(); 751 configs->video_size = config.natural_size();
751 configs->is_video_encrypted = config.is_encrypted(); 752 configs->is_video_encrypted = config.is_encrypted();
752 configs->video_extra_data = config.extra_data(); 753 configs->video_extra_data = config.extra_data();
753 return true; 754 return true;
754 } 755 }
755 return false; 756 return false;
756 } 757 }
757 758
758 } // namespace content 759 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/android/media_info_loader.cc ('k') | content/shell/browser/shell_mojo_test_utils_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698