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 #ifndef MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_ | 5 #ifndef MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_ |
6 #define MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_ | 6 #define MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "media/filters/ffmpeg_glue.h" | 10 #include "media/filters/ffmpeg_glue.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 | 13 |
14 // Simple FFmpegURLProtocol that reads from a buffer. | 14 // Simple FFmpegURLProtocol that reads from a buffer. |
15 // NOTE: This object does not copy the buffer so the | 15 // NOTE: This object does not copy the buffer so the |
16 // buffer pointer passed into the constructor | 16 // buffer pointer passed into the constructor |
17 // needs to remain valid for the entire lifetime of | 17 // needs to remain valid for the entire lifetime of |
18 // this object. | 18 // this object. |
19 class MEDIA_EXPORT InMemoryUrlProtocol : public FFmpegURLProtocol { | 19 class MEDIA_EXPORT InMemoryUrlProtocol : public FFmpegURLProtocol { |
20 public: | 20 public: |
21 InMemoryUrlProtocol(const uint8* buf, int64 size, bool streaming); | 21 InMemoryUrlProtocol(const uint8* buf, int64 size, bool streaming); |
22 virtual ~InMemoryUrlProtocol(); | 22 virtual ~InMemoryUrlProtocol(); |
23 | 23 |
24 // FFmpegURLProtocol methods. | 24 // FFmpegURLProtocol methods. |
25 virtual int Read(int size, uint8* data) OVERRIDE; | 25 virtual int Read(int size, uint8* data) override; |
26 virtual bool GetPosition(int64* position_out) OVERRIDE; | 26 virtual bool GetPosition(int64* position_out) override; |
27 virtual bool SetPosition(int64 position) OVERRIDE; | 27 virtual bool SetPosition(int64 position) override; |
28 virtual bool GetSize(int64* size_out) OVERRIDE; | 28 virtual bool GetSize(int64* size_out) override; |
29 virtual bool IsStreaming() OVERRIDE; | 29 virtual bool IsStreaming() override; |
30 | 30 |
31 private: | 31 private: |
32 const uint8* data_; | 32 const uint8* data_; |
33 int64 size_; | 33 int64 size_; |
34 int64 position_; | 34 int64 position_; |
35 bool streaming_; | 35 bool streaming_; |
36 | 36 |
37 DISALLOW_IMPLICIT_CONSTRUCTORS(InMemoryUrlProtocol); | 37 DISALLOW_IMPLICIT_CONSTRUCTORS(InMemoryUrlProtocol); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace media | 40 } // namespace media |
41 | 41 |
42 #endif // MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_ | 42 #endif // MEDIA_FILTERS_IN_MEMORY_URL_PROTOCOL_H_ |
OLD | NEW |