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

Side by Side Diff: media/base/android/media_source_player.cc

Issue 16092013: Use base::MessageLoop in more files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again, sigh Created 7 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 | Annotate | Revision Log
« no previous file with comments | « extensions/common/one_shot_event_unittest.cc ('k') | net/proxy/proxy_resolver_v8_tracing.cc » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/base/android/media_source_player.h" 5 #include "media/base/android/media_source_player.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 default: 110 default:
111 DCHECK_LE(0, outputBufferIndex); 111 DCHECK_LE(0, outputBufferIndex);
112 if (size == 0 && end_of_stream) 112 if (size == 0 && end_of_stream)
113 break; 113 break;
114 base::TimeDelta time_to_render; 114 base::TimeDelta time_to_render;
115 if (!start_wallclock_time.is_null()) { 115 if (!start_wallclock_time.is_null()) {
116 time_to_render = presentation_timestamp - (base::Time::Now() - 116 time_to_render = presentation_timestamp - (base::Time::Now() -
117 start_wallclock_time + start_presentation_timestamp); 117 start_wallclock_time + start_presentation_timestamp);
118 } 118 }
119 if (time_to_render >= base::TimeDelta()) { 119 if (time_to_render >= base::TimeDelta()) {
120 MessageLoop::current()->PostDelayedTask( 120 base::MessageLoop::current()->PostDelayedTask(
121 FROM_HERE, 121 FROM_HERE,
122 base::Bind(&MediaDecoderJob::ReleaseOutputBuffer, 122 base::Bind(&MediaDecoderJob::ReleaseOutputBuffer,
123 weak_this_.GetWeakPtr(), outputBufferIndex, size, 123 weak_this_.GetWeakPtr(), outputBufferIndex, size,
124 presentation_timestamp, end_of_stream, callback), 124 presentation_timestamp, end_of_stream, callback),
125 time_to_render); 125 time_to_render);
126 } else { 126 } else {
127 // TODO(qinmin): The codec is lagging behind, need to recalculate the 127 // TODO(qinmin): The codec is lagging behind, need to recalculate the
128 // |start_presentation_timestamp_| and |start_wallclock_time_|. 128 // |start_presentation_timestamp_| and |start_wallclock_time_|.
129 DVLOG(1) << (is_audio_ ? "audio " : "video ") 129 DVLOG(1) << (is_audio_ ? "audio " : "video ")
130 << "codec is lagging behind :" << time_to_render.InMicroseconds(); 130 << "codec is lagging behind :" << time_to_render.InMicroseconds();
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 528
529 bool MediaSourcePlayer::HasVideo() { 529 bool MediaSourcePlayer::HasVideo() {
530 return kUnknownVideoCodec != video_codec_; 530 return kUnknownVideoCodec != video_codec_;
531 } 531 }
532 532
533 bool MediaSourcePlayer::HasAudio() { 533 bool MediaSourcePlayer::HasAudio() {
534 return kUnknownAudioCodec != audio_codec_; 534 return kUnknownAudioCodec != audio_codec_;
535 } 535 }
536 536
537 } // namespace media 537 } // namespace media
OLDNEW
« no previous file with comments | « extensions/common/one_shot_event_unittest.cc ('k') | net/proxy/proxy_resolver_v8_tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698