OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_MEDIA_FRAMEWORK_PARTS_FILE_READER_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_PARTS_FILE_READER_H_ |
| 7 |
| 8 #include "services/media/framework/parts/reader.h" |
| 9 |
| 10 namespace mojo { |
| 11 namespace media { |
| 12 |
| 13 // Reads raw data from a file. |
| 14 class FileReader : public Reader { |
| 15 public: |
| 16 static ReaderPtr Create() { |
| 17 return ReaderPtr(new FileReader()); |
| 18 } |
| 19 |
| 20 ~FileReader() override; |
| 21 |
| 22 // Reader implementation. |
| 23 Result Init(const GURL& gurl) override; |
| 24 |
| 25 size_t Read(uint8* buffer, int bytes_to_read) override; |
| 26 |
| 27 int64_t GetPosition() const override; |
| 28 |
| 29 int64_t SetPosition(int64 position) override; |
| 30 |
| 31 size_t GetSize() const override; |
| 32 |
| 33 bool CanSeek() const override; |
| 34 |
| 35 private: |
| 36 FileReader() {} |
| 37 |
| 38 FILE* file_; |
| 39 int64 size_; |
| 40 }; |
| 41 |
| 42 } // namespace media |
| 43 } // namespace mojo |
| 44 |
| 45 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_FILE_READER_H_ |
OLD | NEW |