| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/base/android/media_codec_player.h" | 5 #include "media/base/android/media_codec_player.h" |
| 6 | 6 |
| 7 #include "base/barrier_closure.h" | 7 #include "base/barrier_closure.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 DCHECK(audio_decoder_ && video_decoder_); | 524 DCHECK(audio_decoder_ && video_decoder_); |
| 525 | 525 |
| 526 if (type == DemuxerStream::AUDIO) | 526 if (type == DemuxerStream::AUDIO) |
| 527 return audio_decoder_->IsPrerollingForTests(); | 527 return audio_decoder_->IsPrerollingForTests(); |
| 528 else if (type == DemuxerStream::VIDEO) | 528 else if (type == DemuxerStream::VIDEO) |
| 529 return video_decoder_->IsPrerollingForTests(); | 529 return video_decoder_->IsPrerollingForTests(); |
| 530 else | 530 else |
| 531 return false; | 531 return false; |
| 532 } | 532 } |
| 533 | 533 |
| 534 // http://crbug.com/526755 |
| 535 void MediaCodecPlayer::SetVerboseForTests(bool value) { |
| 536 DCHECK(ui_task_runner_->BelongsToCurrentThread()); |
| 537 |
| 538 if (audio_decoder_) |
| 539 audio_decoder_->SetVerboseForTests(value); |
| 540 if (video_decoder_) |
| 541 video_decoder_->SetVerboseForTests(value); |
| 542 } |
| 543 |
| 534 // Events from Player, called on UI thread | 544 // Events from Player, called on UI thread |
| 535 | 545 |
| 536 void MediaCodecPlayer::OnMediaMetadataChanged(base::TimeDelta duration, | 546 void MediaCodecPlayer::OnMediaMetadataChanged(base::TimeDelta duration, |
| 537 const gfx::Size& video_size) { | 547 const gfx::Size& video_size) { |
| 538 DCHECK(ui_task_runner_->BelongsToCurrentThread()); | 548 DCHECK(ui_task_runner_->BelongsToCurrentThread()); |
| 539 | 549 |
| 540 if (duration != kNoTimestamp()) | 550 if (duration != kNoTimestamp()) |
| 541 metadata_cache_.duration = duration; | 551 metadata_cache_.duration = duration; |
| 542 | 552 |
| 543 if (!video_size.IsEmpty()) | 553 if (!video_size.IsEmpty()) |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 RETURN_STRING(kStateWaitingForSurface); | 1183 RETURN_STRING(kStateWaitingForSurface); |
| 1174 RETURN_STRING(kStateWaitingForSeek); | 1184 RETURN_STRING(kStateWaitingForSeek); |
| 1175 RETURN_STRING(kStateError); | 1185 RETURN_STRING(kStateError); |
| 1176 } | 1186 } |
| 1177 return nullptr; // crash early | 1187 return nullptr; // crash early |
| 1178 } | 1188 } |
| 1179 | 1189 |
| 1180 #undef RETURN_STRING | 1190 #undef RETURN_STRING |
| 1181 | 1191 |
| 1182 } // namespace media | 1192 } // namespace media |
| OLD | NEW |