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

Side by Side Diff: media/tools/player_wtl/movie.cc

Issue 10796074: Move VideoRenderer out of Filter heirarchy. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: GetMediaTime Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/media.gyp ('k') | webkit/media/webmediaplayer_impl.h » ('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/tools/player_wtl/movie.h" 5 #include "media/tools/player_wtl/movie.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 float duration = 0.f; 121 float duration = 0.f;
122 if (pipeline_) 122 if (pipeline_)
123 duration = (pipeline_->GetMediaDuration()).InMicroseconds() / 1000000.0f; 123 duration = (pipeline_->GetMediaDuration()).InMicroseconds() / 1000000.0f;
124 return duration; 124 return duration;
125 } 125 }
126 126
127 // Get current movie position in seconds. 127 // Get current movie position in seconds.
128 float Movie::GetPosition() { 128 float Movie::GetPosition() {
129 float position = 0.f; 129 float position = 0.f;
130 if (pipeline_) 130 if (pipeline_)
131 position = (pipeline_->GetCurrentTime()).InMicroseconds() / 1000000.0f; 131 position = (pipeline_->GetMediaTime()).InMicroseconds() / 1000000.0f;
132 return position; 132 return position;
133 } 133 }
134 134
135 // Set current movie position in seconds. 135 // Set current movie position in seconds.
136 void Movie::SetPosition(float position) { 136 void Movie::SetPosition(float position) {
137 int64 us = static_cast<int64>(position * 1000000); 137 int64 us = static_cast<int64>(position * 1000000);
138 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); 138 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us);
139 if (pipeline_) 139 if (pipeline_)
140 pipeline_->Seek(time, media::PipelineStatusCB()); 140 pipeline_->Seek(time, media::PipelineStatusCB());
141 } 141 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void Movie::Close() { 179 void Movie::Close() {
180 if (pipeline_) { 180 if (pipeline_) {
181 pipeline_->Stop(base::Closure()); 181 pipeline_->Stop(base::Closure());
182 pipeline_ = NULL; 182 pipeline_ = NULL;
183 } 183 }
184 184
185 message_loop_factory_.reset(); 185 message_loop_factory_.reset();
186 } 186 }
187 187
188 } // namespace media 188 } // namespace media
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | webkit/media/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698