openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
httpstream.h
Go to the documentation of this file.
1 #ifndef __lib_base_httpstream_h
2 #define __lib_base_httpstream_h
3 
4 #include <string>
5 #include <lib/base/ebase.h>
6 #include <lib/base/itssource.h>
7 #include <lib/base/thread.h>
8 
9 class eHttpStream: public iTsSource, public sigc::trackable, public eThread
10 {
11  DECLARE_REF(eHttpStream);
12 
13  int streamSocket;
14  enum { BUSY, CONNECTED, FAILED } connectionStatus;
15  bool isChunked;
16  size_t currentChunkSize;
17  std::string streamUrl;
18  std::string authorizationData;
19  char partialPkt[192];
20  size_t partialPktSz;
21  char* tmpBuf;
22  size_t tmpBufSize;
23  int startDelay;
24 
25  int openUrl(const std::string &url, std::string &newurl);
26  void thread();
27  ssize_t httpChunkedRead(void *buf, size_t count);
28  ssize_t syncNextRead(void *buf, ssize_t count);
29 
30  /* iTsSource */
31  ssize_t read(off_t offset, void *buf, size_t count);
32  off_t length();
33  off_t offset();
34  int valid();
35  bool isStream() { return true; };
36  int reconnect();
37 
38 public:
39  eHttpStream();
40  ~eHttpStream();
41  int open(const char *url);
42  int close();
43 };
44 
45 #endif
Definition: httpstream.h:10
eHttpStream()
Definition: httpstream.cpp:11
~eHttpStream()
Definition: httpstream.cpp:30
int close()
Definition: httpstream.cpp:294
int open(const char *url)
Definition: httpstream.cpp:247
Definition: thread.h:27
Definition: itssource.h:7
int count
Definition: newplugin.py:14