3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / plugins / http_streamer / HTTPMediaIO.h
blobe917391d24013f72fb63893504a22b6cb77d96a6
1 /*
2 * Copyright 2016, Dario Casalinuovo
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _HTTP_MEDIA_IO_H
6 #define _HTTP_MEDIA_IO_H
9 #include <AdapterIO.h>
10 #include <FileRequest.h>
11 #include <Url.h>
12 #include <UrlContext.h>
13 #include <UrlProtocolAsynchronousListener.h>
16 class FileListener;
18 class HTTPMediaIO : public BAdapterIO {
19 public:
20 HTTPMediaIO(BUrl url);
21 virtual ~HTTPMediaIO();
23 virtual void GetFlags(int32* flags) const;
25 virtual ssize_t WriteAt(off_t position,
26 const void* buffer, size_t size);
28 virtual status_t SetSize(off_t size);
30 virtual status_t Open();
32 virtual bool IsRunning() const;
34 protected:
35 virtual status_t SeekRequested(off_t position);
37 // Other custom stuff
39 void UpdateSize();
41 friend class FileListener;
42 private:
43 BUrlRequest* fReq;
44 FileListener* fListener;
45 thread_id fReqThread;
47 BUrl fUrl;
48 off_t fTotalSize;
49 bool fIsMutable;
52 #endif