| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "media/base/filter_collection.h" | 10 #include "media/base/filter_collection.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 if (pipeline_) | 124 if (pipeline_) |
| 125 position = (pipeline_->GetCurrentTime()).InMicroseconds() / 1000000.0f; | 125 position = (pipeline_->GetCurrentTime()).InMicroseconds() / 1000000.0f; |
| 126 return position; | 126 return position; |
| 127 } | 127 } |
| 128 | 128 |
| 129 // Set current movie position in seconds. | 129 // Set current movie position in seconds. |
| 130 void Movie::SetPosition(float position) { | 130 void Movie::SetPosition(float position) { |
| 131 int64 us = static_cast<int64>(position * 1000000); | 131 int64 us = static_cast<int64>(position * 1000000); |
| 132 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); | 132 base::TimeDelta time = base::TimeDelta::FromMicroseconds(us); |
| 133 if (pipeline_) | 133 if (pipeline_) |
| 134 pipeline_->Seek(time, NULL); | 134 pipeline_->Seek(time, media::PipelineStatusCB()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 // Set playback pause. | 138 // Set playback pause. |
| 139 void Movie::SetPause(bool pause) { | 139 void Movie::SetPause(bool pause) { |
| 140 enable_pause_ = pause; | 140 enable_pause_ = pause; |
| 141 Play(play_rate_); | 141 Play(play_rate_); |
| 142 } | 142 } |
| 143 | 143 |
| 144 // Get playback pause state. | 144 // Get playback pause state. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 166 enable_dump_yuv_file_ = enable_dump_yuv_file; | 166 enable_dump_yuv_file_ = enable_dump_yuv_file; |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool Movie::GetDumpYuvFileEnable() { | 169 bool Movie::GetDumpYuvFileEnable() { |
| 170 return enable_dump_yuv_file_; | 170 return enable_dump_yuv_file_; |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Teardown. | 173 // Teardown. |
| 174 void Movie::Close() { | 174 void Movie::Close() { |
| 175 if (pipeline_) { | 175 if (pipeline_) { |
| 176 pipeline_->Stop(NULL); | 176 pipeline_->Stop(media::PipelineStatusCB()); |
| 177 pipeline_ = NULL; | 177 pipeline_ = NULL; |
| 178 } | 178 } |
| 179 | 179 |
| 180 message_loop_factory_.reset(); | 180 message_loop_factory_.reset(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace media | 183 } // namespace media |
| OLD | NEW |