2017-08-25 17:48:06 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) 2017 FIRST. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#include <cstdio>
|
2016-10-13 00:18:16 -07:00
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#include <llvm/raw_ostream.h>
|
2016-10-13 00:18:16 -07:00
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#include "cscore.h"
|
2016-11-18 11:44:25 -08:00
|
|
|
|
2016-10-13 00:18:16 -07:00
|
|
|
int main() {
|
2016-11-18 11:44:25 -08:00
|
|
|
llvm::outs() << "hostname: " << cs::GetHostname() << '\n';
|
|
|
|
|
llvm::outs() << "IPv4 network addresses:\n";
|
|
|
|
|
for (const auto& addr : cs::GetNetworkInterfaces())
|
|
|
|
|
llvm::outs() << " " << addr << '\n';
|
2016-12-04 00:08:47 -08:00
|
|
|
cs::UsbCamera camera{"usbcam", 1};
|
2016-10-13 00:18:16 -07:00
|
|
|
camera.SetVideoMode(cs::VideoMode::kMJPEG, 320, 240, 30);
|
2016-12-04 00:08:47 -08:00
|
|
|
cs::MjpegServer mjpegServer{"httpserver", 8081};
|
2016-10-15 22:44:26 -07:00
|
|
|
mjpegServer.SetSource(camera);
|
|
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
std::getchar();
|
2016-10-13 00:18:16 -07:00
|
|
|
}
|