Add GST RTSP SERVER option
This commit is contained in:
committed by
Brendan Le Glaunec
parent
509017f8df
commit
c44a88b57a
@@ -17,7 +17,7 @@
|
||||
namespace etix {
|
||||
namespace cameradar {
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
// The main loop of the binary
|
||||
void
|
||||
@@ -49,7 +49,7 @@ dispatcher::run() {
|
||||
// Waiting for task to cleanup / force stop command
|
||||
while ((signal_handler::instance().should_stop() not_eq stop_priority::force_stop) and
|
||||
doing_stuff()) {
|
||||
std::this_thread::sleep_for(30ms);
|
||||
std::this_thread::sleep_for(30ms);
|
||||
}
|
||||
worker.join();
|
||||
}
|
||||
@@ -63,8 +63,13 @@ dispatcher::do_stuff() {
|
||||
queue.push_back(new etix::cameradar::parsing(cache, conf, nmap_output));
|
||||
}
|
||||
if (opts.second.exist("-b")) {
|
||||
queue.push_back(new etix::cameradar::brutelogs(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutepath(cache, conf, nmap_output));
|
||||
if (opts.second.exist("--gst-rtsp-server")) {
|
||||
queue.push_back(new etix::cameradar::brutepath(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutelogs(cache, conf, nmap_output));
|
||||
} else {
|
||||
queue.push_back(new etix::cameradar::brutelogs(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutepath(cache, conf, nmap_output));
|
||||
}
|
||||
}
|
||||
if (opts.second.exist("-t")) {
|
||||
queue.push_back(new etix::cameradar::thumbnail(cache, conf, nmap_output));
|
||||
@@ -76,8 +81,13 @@ dispatcher::do_stuff() {
|
||||
!opts.second.exist("-g")) {
|
||||
queue.push_back(new etix::cameradar::mapping(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::parsing(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutelogs(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutepath(cache, conf, nmap_output));
|
||||
if (opts.second.exist("--gst-rtsp-server")) {
|
||||
queue.push_back(new etix::cameradar::brutepath(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutelogs(cache, conf, nmap_output));
|
||||
} else {
|
||||
queue.push_back(new etix::cameradar::brutelogs(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::brutepath(cache, conf, nmap_output));
|
||||
}
|
||||
queue.push_back(new etix::cameradar::thumbnail(cache, conf, nmap_output));
|
||||
queue.push_back(new etix::cameradar::stream_check(cache, conf, nmap_output));
|
||||
}
|
||||
|
||||
@@ -41,6 +41,12 @@ parse_cmdline(int argc, char* argv[]) {
|
||||
opt_parse.optional("-g", "Check if the stream can be opened with GStreamer", false);
|
||||
opt_parse.optional("-v", "Display Cameradar's version", false);
|
||||
opt_parse.optional("-h", "Display this help", false);
|
||||
opt_parse.optional(
|
||||
"--gst-rtsp-server",
|
||||
"Change the order of the bruteforce to match GST RTSP Server's implementation of "
|
||||
"RTSP. Some cameras and RTSP servers will use this standard instead of the more "
|
||||
"standard one. For more information, see the README.md file.",
|
||||
false);
|
||||
opt_parse.execute();
|
||||
|
||||
if (opt_parse.exist("-h")) {
|
||||
|
||||
@@ -35,7 +35,7 @@ brutelogs::test_ids(const etix::cameradar::stream_model& stream,
|
||||
bool found = false;
|
||||
std::string path = stream.service_name + "://";
|
||||
if (username != "" || password != "") { path += username + ":" + password + "@"; }
|
||||
path += stream.address + ":" + std::to_string(stream.port);
|
||||
path += stream.address + ":" + std::to_string(stream.port) + stream.route;
|
||||
LOG_INFO_("Testing ids : " + path, "brutelogs");
|
||||
try {
|
||||
if (curl_describe(path, true)) {
|
||||
|
||||
@@ -54,7 +54,7 @@ parsing::parse_camera(TiXmlElement* xml_host, std::vector<stream_model>& data) c
|
||||
stream.service_name = "closed";
|
||||
stream.product = "closed";
|
||||
}
|
||||
data.push_back(stream);
|
||||
if (!stream.state.compare("open")) data.push_back(stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user