add support to passthough mjpeg images
This commit is contained in:
9
main.cpp
9
main.cpp
@ -41,9 +41,11 @@ int main(int argc, char* argv[])
|
||||
Config config;
|
||||
argp_parse(&argp, argc, argv, 0, 0, &config);
|
||||
|
||||
bool passthough = config.mjpeg && config.overlay.empty();
|
||||
|
||||
std::cout<<"UVOS webcam sender v0.1\n";
|
||||
|
||||
Webcam webcam(config.device, config.Xres, config.Yres, config.mjpeg);
|
||||
Webcam webcam(config.device, config.Xres, config.Yres, config.mjpeg, passthough);
|
||||
|
||||
std::stringstream ss;
|
||||
ss<<"nc "<<config.url<<' '<<config.port<<'\n';
|
||||
@ -68,7 +70,10 @@ int main(int argc, char* argv[])
|
||||
Image frame = webcam.frame(10);
|
||||
if(!config.overlay.empty())
|
||||
overlayImage(frame, overlay);
|
||||
compressJpegImage(netcat, &frame);
|
||||
if(!passthough)
|
||||
compressJpegImage(netcat, &frame);
|
||||
else
|
||||
fwrite(frame.data.get(), frame.size(), 1, netcat);
|
||||
fflush(netcat);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user