OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_FILTERS_BUFFER_URL_PROTOCOL_H_ | |
6 #define MEDIA_FILTERS_BUFFER_URL_PROTOCOL_H_ | |
7 | |
8 #include "media/filters/ffmpeg_glue.h" | |
9 | |
10 #include "base/basictypes.h" | |
11 | |
12 namespace media { | |
13 | |
14 // Simple FFmpegURLProtocol that reads from a buffer. | |
15 // NOTE: This object does not copy the buffer so the | |
16 // buffer pointer passed into the constructor | |
17 // needs to remain valid for the entire lifetime of | |
18 // this object. | |
19 class BufferUrlProtocol : public FFmpegURLProtocol { | |
scherkus (not reviewing)
2011/06/23 18:50:18
I had a feeling this code looked oddly familiar...
acolwell GONE FROM CHROMIUM
2011/06/23 22:42:17
Done.
| |
20 public: | |
21 BufferUrlProtocol(const uint8* buf, int size, bool streaming); | |
22 virtual ~BufferUrlProtocol(); | |
23 | |
24 // FFmpegURLProtocol methods. | |
25 virtual int Read(int size, uint8* data); | |
26 virtual bool GetPosition(int64* position_out); | |
27 virtual bool SetPosition(int64 position); | |
28 virtual bool GetSize(int64* size_out); | |
29 virtual bool IsStreaming(); | |
30 | |
31 private: | |
32 const uint8* buf_; | |
33 int size_; | |
34 int offset_; | |
35 bool streaming_; | |
36 | |
37 DISALLOW_IMPLICIT_CONSTRUCTORS(BufferUrlProtocol); | |
38 }; | |
39 | |
40 } | |
scherkus (not reviewing)
2011/06/23 18:50:18
// namespace media
acolwell GONE FROM CHROMIUM
2011/06/23 22:42:17
Done.
| |
41 | |
42 #endif // MEDIA_FILTERS_BUFFER_URL_PROTOCOL_H_ | |
OLD | NEW |