+Input *create_input(const std::string &stream_id, const std::string &url)
+{
+ string protocol, host, port, path;
+ if (!parse_url(url, &protocol, &host, &port, &path)) {
+ return NULL;
+ }
+ if (protocol == "http") {
+ return new HTTPInput(stream_id, url);
+ }
+ return NULL;
+}
+
+Input *create_input(const InputProto &serialized)
+{
+ string protocol, host, port, path;
+ if (!parse_url(serialized.url(), &protocol, &host, &port, &path)) {
+ return NULL;
+ }
+ if (protocol == "http") {
+ return new HTTPInput(serialized);
+ }
+ return NULL;
+}
+