| OLD | NEW |
| 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/filters/file_data_source.h" | 5 #include "media/filters/file_data_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 force_streaming_(false), | 22 force_streaming_(false), |
| 23 bytes_read_(0) { | 23 bytes_read_(0) { |
| 24 file_.Initialize(std::move(file)); | 24 file_.Initialize(std::move(file)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool FileDataSource::Initialize(const base::FilePath& file_path) { | 27 bool FileDataSource::Initialize(const base::FilePath& file_path) { |
| 28 DCHECK(!file_.IsValid()); | 28 DCHECK(!file_.IsValid()); |
| 29 return file_.Initialize(file_path); | 29 return file_.Initialize(file_path); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void FileDataSource::Stop() { | 32 void FileDataSource::Stop() {} |
| 33 } | 33 |
| 34 void FileDataSource::Abort() {} |
| 34 | 35 |
| 35 void FileDataSource::Read(int64_t position, | 36 void FileDataSource::Read(int64_t position, |
| 36 int size, | 37 int size, |
| 37 uint8_t* data, | 38 uint8_t* data, |
| 38 const DataSource::ReadCB& read_cb) { | 39 const DataSource::ReadCB& read_cb) { |
| 39 if (force_read_errors_ || !file_.IsValid()) { | 40 if (force_read_errors_ || !file_.IsValid()) { |
| 40 read_cb.Run(kReadError); | 41 read_cb.Run(kReadError); |
| 41 return; | 42 return; |
| 42 } | 43 } |
| 43 | 44 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 64 | 65 |
| 65 bool FileDataSource::IsStreaming() { | 66 bool FileDataSource::IsStreaming() { |
| 66 return force_streaming_; | 67 return force_streaming_; |
| 67 } | 68 } |
| 68 | 69 |
| 69 void FileDataSource::SetBitrate(int bitrate) {} | 70 void FileDataSource::SetBitrate(int bitrate) {} |
| 70 | 71 |
| 71 FileDataSource::~FileDataSource() {} | 72 FileDataSource::~FileDataSource() {} |
| 72 | 73 |
| 73 } // namespace media | 74 } // namespace media |
| OLD | NEW |