| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifdef _OPENMP | 5 #ifdef _OPENMP |
| 6 #include <omp.h> | 6 #include <omp.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 float duration = 0.f; | 114 float duration = 0.f; |
| 115 if (pipeline_.get()) | 115 if (pipeline_.get()) |
| 116 duration = (pipeline_->GetDuration()).InMicroseconds() / 1000000.0f; | 116 duration = (pipeline_->GetDuration()).InMicroseconds() / 1000000.0f; |
| 117 return duration; | 117 return duration; |
| 118 } | 118 } |
| 119 | 119 |
| 120 // Get current movie position in seconds. | 120 // Get current movie position in seconds. |
| 121 float Movie::GetPosition() { | 121 float Movie::GetPosition() { |
| 122 float position = 0.f; | 122 float position = 0.f; |
| 123 if (pipeline_.get()) | 123 if (pipeline_.get()) |
| 124 position = (pipeline_->GetTime()).InMicroseconds() / 1000000.0f; | 124 position = (pipeline_->GetCurrentTime()).InMicroseconds() / 1000000.0f; |
| 125 return position; | 125 return position; |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Set current movie position in seconds. | 128 // Set current movie position in seconds. |
| 129 void Movie::SetPosition(float position) { | 129 void Movie::SetPosition(float position) { |
| 130 int64 us = static_cast<int64>(position * 1000000); | 130 int64 us = static_cast<int64>(position * 1000000); |
| 131 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); | 131 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); |
| 132 if (pipeline_.get()) | 132 if (pipeline_.get()) |
| 133 pipeline_->Seek(time, NULL); | 133 pipeline_->Seek(time, NULL); |
| 134 } | 134 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void Movie::Close() { | 197 void Movie::Close() { |
| 198 if (pipeline_.get()) { | 198 if (pipeline_.get()) { |
| 199 pipeline_->Stop(NULL); | 199 pipeline_->Stop(NULL); |
| 200 thread_->Stop(); | 200 thread_->Stop(); |
| 201 pipeline_.reset(); | 201 pipeline_.reset(); |
| 202 thread_.reset(); | 202 thread_.reset(); |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace media | 206 } // namespace media |
| OLD | NEW |