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 class FileReader : public Reader { |
| 14 public: |
| 15 static ReaderPtr New() { |
| 16 return ReaderPtr(new FileReader()); |
| 17 } |
| 18 |
| 19 ~FileReader() override; |
| 20 |
| 21 // Reader implementation. |
| 22 Result Init(const GURL& gurl) override; |
| 23 |
| 24 int Read(uint8* buffer, int bytes_to_read) override; |
| 25 |
| 26 int64 GetPosition() const override; |
| 27 |
| 28 int64 SetPosition(int64 position) override; |
| 29 |
| 30 int64 GetSize() const override; |
| 31 |
| 32 bool CanSeek() const override; |
| 33 |
| 34 private: |
| 35 FileReader() {} |
| 36 |
| 37 FILE* file_; |
| 38 int64 size_; |
| 39 }; |
| 40 |
| 41 } // namespace media |
| 42 } // namespace mojo |
| 43 |
| 44 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_FILE_READER_H_ |
OLD | NEW |