vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / plugins / http_streamer / HTTPStreamerPlugin.cpp
blobc821b3d12af6f04e28261928e923465a42f643f9
1 /*
2 * Copyright 2016, Dario Casalinuovo
3 * Distributed under the terms of the MIT License.
4 */
7 #include "HTTPStreamerPlugin.h"
9 #include "HTTPMediaIO.h"
11 #include "debug.h"
14 HTTPStreamer::HTTPStreamer()
16 CALLED();
20 HTTPStreamer::~HTTPStreamer()
22 CALLED();
26 status_t
27 HTTPStreamer::Sniff(const BUrl& url, BDataIO** source)
29 CALLED();
31 HTTPMediaIO* outSource = new HTTPMediaIO(url);
33 status_t ret = outSource->Open();
34 if (ret == B_OK) {
35 *source = outSource;
36 return B_OK;
38 delete outSource;
39 return ret;
43 Streamer*
44 HTTPStreamerPlugin::NewStreamer()
46 return new HTTPStreamer();
50 MediaPlugin *instantiate_plugin()
52 return new HTTPStreamerPlugin();