input/curl: add public function to construct an instance

This commit is contained in:
Max Kellermann 2018-01-11 15:43:49 +01:00
parent f392e13077
commit 1ad21c27c9
2 changed files with 28 additions and 0 deletions

View File

@ -468,6 +468,14 @@ CurlInputStream::Open(const char *url,
return std::make_unique<IcyInputStream>(std::move(c), std::move(icy));
}
InputStreamPtr
OpenCurlInputStream(const char *uri,
const std::multimap<std::string, std::string> &headers,
Mutex &mutex, Cond &cond)
{
return CurlInputStream::Open(uri, headers, mutex, cond);
}
static InputStreamPtr
input_curl_open(const char *url, Mutex &mutex, Cond &cond)
{

View File

@ -20,6 +20,26 @@
#ifndef MPD_INPUT_CURL_HXX
#define MPD_INPUT_CURL_HXX
#include "input/Ptr.hxx"
#include <string>
#include <map>
class Mutex;
class Cond;
extern const struct InputPlugin input_plugin_curl;
/**
* Open a #CurlInputStream with custom request headers.
*
* This stream does not support Icy metadata.
*
* Throws on error.
*/
InputStreamPtr
OpenCurlInputStream(const char *uri,
const std::multimap<std::string, std::string> &headers,
Mutex &mutex, Cond &cond);
#endif