Files
haiku-beta6/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp
T

54 lines
686 B
C++

/*
* Copyright 2016, Dario Casalinuovo
* Distributed under the terms of the MIT License.
*/
#include "HTTPStreamerPlugin.h"
#include "HTTPMediaIO.h"
#include "MediaDebug.h"
HTTPStreamer::HTTPStreamer()
{
CALLED();
}
HTTPStreamer::~HTTPStreamer()
{
CALLED();
}
status_t
HTTPStreamer::Sniff(const BUrl& url, BDataIO** source)
{
CALLED();
HTTPMediaIO* outSource = new HTTPMediaIO(url);
status_t ret = outSource->Open();
if (ret == B_OK) {
*source = outSource;
return B_OK;
}
delete outSource;
return ret;
}
BStreamer*
HTTPStreamerPlugin::NewStreamer()
{
return new HTTPStreamer();
}
BMediaPlugin *instantiate_plugin()
{
return new HTTPStreamerPlugin();
}