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

Unified Diff: media/base/android/media_codec_player.cc

Issue 2158923004: Convert media constants to constexpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: media/base/android/media_codec_player.cc
diff --git a/media/base/android/media_codec_player.cc b/media/base/android/media_codec_player.cc
index 44391d6a61daa8051283eff791ba03849f166a80..0e318d888cbf9f1448332d9a1b97f30e8283a81b 100644
--- a/media/base/android/media_codec_player.cc
+++ b/media/base/android/media_codec_player.cc
@@ -53,7 +53,7 @@ MediaCodecPlayer::MediaCodecPlayer(
state_(kStatePaused),
interpolator_(&default_tick_clock_),
pending_start_(false),
- pending_seek_(kNoTimestamp()),
+ pending_seek_(kNoTimestamp),
cdm_registration_id_(0),
key_is_required_(false),
key_is_added_(false),
@@ -358,8 +358,8 @@ void MediaCodecPlayer::Release() {
key_is_added_ = false;
base::TimeDelta pending_seek_time = GetPendingSeek();
- if (pending_seek_time != kNoTimestamp()) {
- SetPendingSeek(kNoTimestamp());
+ if (pending_seek_time != kNoTimestamp) {
+ SetPendingSeek(kNoTimestamp);
SetState(kStateWaitingForSeek);
RequestDemuxerSeek(pending_seek_time);
}
@@ -516,7 +516,7 @@ void MediaCodecPlayer::OnDemuxerSeekDone(
DVLOG(1) << __FUNCTION__ << " actual_time:" << actual_browser_seek_time;
DCHECK(seek_info_.get());
- DCHECK(seek_info_->seek_time != kNoTimestamp());
+ DCHECK(seek_info_->seek_time != kNoTimestamp);
// A browser seek must not jump into the past. Ideally, it seeks to the
// requested time, but it might jump into the future.
@@ -551,9 +551,9 @@ void MediaCodecPlayer::OnDemuxerSeekDone(
DCHECK_EQ(kStateWaitingForSeek, state_);
base::TimeDelta pending_seek_time = GetPendingSeek();
- if (pending_seek_time != kNoTimestamp()) {
+ if (pending_seek_time != kNoTimestamp) {
// Keep kStateWaitingForSeek
- SetPendingSeek(kNoTimestamp());
+ SetPendingSeek(kNoTimestamp);
RequestDemuxerSeek(pending_seek_time);
return;
}
@@ -642,7 +642,7 @@ void MediaCodecPlayer::OnMediaMetadataChanged(base::TimeDelta duration,
const gfx::Size& video_size) {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
- if (duration != kNoTimestamp())
+ if (duration != kNoTimestamp)
metadata_cache_.duration = duration;
if (!video_size.IsEmpty())
@@ -814,9 +814,9 @@ void MediaCodecPlayer::OnStopDone(DemuxerStream::Type type) {
switch (state_) {
case kStateStopping: {
base::TimeDelta seek_time = GetPendingSeek();
- if (seek_time != kNoTimestamp()) {
+ if (seek_time != kNoTimestamp) {
SetState(kStateWaitingForSeek);
- SetPendingSeek(kNoTimestamp());
+ SetPendingSeek(kNoTimestamp);
RequestDemuxerSeek(seek_time);
} else if (HasPendingStart()) {
SetPendingStart(false);
@@ -942,7 +942,7 @@ void MediaCodecPlayer::OnVideoResolutionChanged(const gfx::Size& size) {
// Update cache and notify manager on UI thread
ui_task_runner_->PostTask(
- FROM_HERE, base::Bind(metadata_changed_cb_, kNoTimestamp(), size));
+ FROM_HERE, base::Bind(metadata_changed_cb_, kNoTimestamp, size));
}
// Callbacks from MediaDrmBridge.

Powered by Google App Engine
This is Rietveld 408576698