Line data Source code
1 : /* This Source Code Form is subject to the terms of the Mozilla Public
2 : * License, v. 2.0. If a copy of the MPL was not distributed with this
3 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 :
5 : #ifndef STREAM_H_
6 : #define STREAM_H_
7 :
8 : #include "nsISupportsImpl.h"
9 :
10 : namespace mp4_demuxer
11 : {
12 :
13 0 : class Stream
14 : {
15 : public:
16 0 : NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Stream);
17 :
18 : virtual bool ReadAt(int64_t offset, void* data, size_t size,
19 : size_t* bytes_read) = 0;
20 : virtual bool CachedReadAt(int64_t offset, void* data, size_t size,
21 : size_t* bytes_read) = 0;
22 : virtual bool Length(int64_t* size) = 0;
23 :
24 0 : virtual void DiscardBefore(int64_t offset) {}
25 :
26 : protected:
27 0 : virtual ~Stream() {}
28 : };
29 :
30 : }
31 :
32 : #endif
|