9 Input(const std::string &stream_id);
11 // Connect to the given URL and start streaming.
12 // WARNING: Currently this blocks; it does not run in a separate thread!
13 void run(const std::string &url);
16 // Recovers the this pointer and calls curl_callback().
17 static size_t curl_callback_thunk(char *ptr, size_t size, size_t nmemb, void *userdata);
19 // Stores the given data, looks for Metacube blocks (skipping data if needed),
20 // and calls process_block() for each one.
21 void curl_callback(char *ptr, size_t bytes);
22 void process_block(const char *data, uint32_t size, uint32_t flags);
24 // Drops <num_bytes> bytes from the head of <pending_data>,
25 // and outputs a warning.
26 void drop_pending_data(size_t num_bytes);
28 std::string stream_id;
30 // Data we have received but not fully processed yet.
31 std::vector<char> pending_data;
33 // If <pending_data> starts with a Metacube header,
35 bool has_metacube_header;
38 #endif // !defined(_INPUT_H)