| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 float duration = 0.f; | 112 float duration = 0.f; |
| 113 if (pipeline_.get()) | 113 if (pipeline_.get()) |
| 114 duration = (pipeline_->GetDuration()).InMicroseconds() / 1000000.0f; | 114 duration = (pipeline_->GetDuration()).InMicroseconds() / 1000000.0f; |
| 115 return duration; | 115 return duration; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Get current movie position in seconds. | 118 // Get current movie position in seconds. |
| 119 float Movie::GetPosition() { | 119 float Movie::GetPosition() { |
| 120 float position = 0.f; | 120 float position = 0.f; |
| 121 if (pipeline_.get()) | 121 if (pipeline_.get()) |
| 122 position = (pipeline_->GetInterpolatedTime()).InMicroseconds() / 1000000.0f; | 122 position = (pipeline_->GetTime()).InMicroseconds() / 1000000.0f; |
| 123 return position; | 123 return position; |
| 124 } | 124 } |
| 125 | 125 |
| 126 // Set current movie position in seconds. | 126 // Set current movie position in seconds. |
| 127 void Movie::SetPosition(float position) { | 127 void Movie::SetPosition(float position) { |
| 128 int64 us = static_cast<int64>(position * 1000000); | 128 int64 us = static_cast<int64>(position * 1000000); |
| 129 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); | 129 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); |
| 130 if (pipeline_.get()) | 130 if (pipeline_.get()) |
| 131 pipeline_->Seek(time, NULL); | 131 pipeline_->Seek(time, NULL); |
| 132 } | 132 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 // Teardown. | 194 // Teardown. |
| 195 void Movie::Close() { | 195 void Movie::Close() { |
| 196 if (pipeline_.get()) { | 196 if (pipeline_.get()) { |
| 197 pipeline_->Stop(); | 197 pipeline_->Stop(); |
| 198 pipeline_.reset(); | 198 pipeline_.reset(); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace media | 202 } // namespace media |
| OLD | NEW |