1 /* 2 * Copyright 2016, Dario Casalinuovo 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "HTTPStreamerPlugin.h" 8 9 #include "HTTPMediaIO.h" 10 11 #include "MediaDebug.h" 12 13 14 HTTPStreamer::HTTPStreamer() 15 { 16 CALLED(); 17 } 18 19 20 HTTPStreamer::~HTTPStreamer() 21 { 22 CALLED(); 23 } 24 25 26 status_t 27 HTTPStreamer::Sniff(const BUrl& url, BDataIO** source) 28 { 29 CALLED(); 30 31 HTTPMediaIO* outSource = new HTTPMediaIO(url); 32 33 status_t ret = outSource->Open(); 34 if (ret == B_OK) { 35 *source = outSource; 36 return B_OK; 37 } 38 delete outSource; 39 return ret; 40 } 41 42 43 Streamer* 44 HTTPStreamerPlugin::NewStreamer() 45 { 46 return new HTTPStreamer(); 47 } 48 49 50 MediaPlugin *instantiate_plugin() 51 { 52 return new HTTPStreamerPlugin(); 53 } 54