upgrade libv4l2cpp

pull/243/head
mpromonet 3 years ago
parent d671433388
commit fbf1a380a2

@ -141,9 +141,9 @@ class V4l2RTSPServer {
// create video capture & replicator
// -----------------------------------------
StreamReplicator* CreateVideoReplicator(
const std::string& videoDev, const std::list<unsigned int>& videoformatList, int width, int height, int fps, int verbose, int openflags, V4l2Access::IoType ioTypeIn,
const V4L2DeviceParameters& inParam,
int queueSize, int useThread, int repeatConfig,
const std::string& outputFile, V4l2Access::IoType ioTypeOut, V4l2Output* out,
const std::string& outputFile, V4l2IoType ioTypeOut, V4l2Output* out,
std::string& rtpVideoFormat);
#ifdef HAVE_ALSA
@ -182,7 +182,7 @@ class V4l2RTSPServer {
os << "/" << sampleRate << "/" << channels;
return os.str();
}
StreamReplicator* CreateAudioReplicator(
const std::string& audioDev, const std::list<snd_pcm_format_t>& audioFmtList, int audioFreq, int audioNbChannels, int verbose,
int queueSize, int useThread,

@ -136,8 +136,8 @@ int main(int argc, char** argv)
bool multicast = false;
int verbose = 0;
std::string outputFile;
V4l2Access::IoType ioTypeIn = V4l2Access::IOTYPE_MMAP;
V4l2Access::IoType ioTypeOut = V4l2Access::IOTYPE_MMAP;
V4l2IoType ioTypeIn = IOTYPE_MMAP;
V4l2IoType ioTypeOut = IOTYPE_MMAP;
int openflags = O_RDWR | O_NONBLOCK;
std::string url = "unicast";
std::string murl = "multicast";
@ -189,8 +189,8 @@ int main(int argc, char** argv)
case 'U': userPasswordList.push_back(optarg); break;
// V4L2
case 'r': ioTypeIn = V4l2Access::IOTYPE_READWRITE; break;
case 'w': ioTypeOut = V4l2Access::IOTYPE_READWRITE; break;
case 'r': ioTypeIn = IOTYPE_READWRITE; break;
case 'w': ioTypeOut = IOTYPE_READWRITE; break;
case 'B': openflags = O_RDWR; break;
case 's': useThread = false; break;
case 'f': format = V4l2Device::fourcc(optarg); if (format) {videoformatList.push_back(format);}; break;
@ -328,9 +328,10 @@ int main(int argc, char** argv)
baseUrl.append("/");
}
V4L2DeviceParameters inParam(videoDev.c_str(), videoformatList, width, height, fps, ioTypeIn, verbose, openflags);
std::string rtpVideoFormat;
StreamReplicator* videoReplicator = rtspServer.CreateVideoReplicator(
videoDev, videoformatList, width, height, fps, verbose, openflags, ioTypeIn,
inParam,
queueSize, useThread, repeatConfig,
outputFile, ioTypeOut, out,
rtpVideoFormat);

@ -24,27 +24,27 @@
#endif
StreamReplicator* V4l2RTSPServer::CreateVideoReplicator(
const std::string& videoDev, const std::list<unsigned int>& videoformatList, int width, int height, int fps, int verbose, int openflags, V4l2Access::IoType ioTypeIn,
const V4L2DeviceParameters& inParam,
int queueSize, int useThread, int repeatConfig,
const std::string& outputFile, V4l2Access::IoType ioTypeOut, V4l2Output* out,
const std::string& outputFile, V4l2IoType ioTypeOut, V4l2Output* out,
std::string& rtpVideoFormat) {
StreamReplicator* videoReplicator = NULL;
std::string videoDev(inParam.m_devName);
if (!videoDev.empty())
{
// Init video capture
LOG(NOTICE) << "Create V4L2 Source..." << videoDev;
V4L2DeviceParameters param(videoDev.c_str(), videoformatList, width, height, fps, verbose, openflags);
V4l2Capture* videoCapture = V4l2Capture::create(param, ioTypeIn);
V4l2Capture* videoCapture = V4l2Capture::create(inParam);
if (videoCapture)
{
int outfd = -1;
if (!outputFile.empty())
{
V4L2DeviceParameters outparam(outputFile.c_str(), videoCapture->getFormat(), videoCapture->getWidth(), videoCapture->getHeight(), 0,verbose);
out = V4l2Output::create(outparam, ioTypeOut);
V4L2DeviceParameters outparam(outputFile.c_str(), videoCapture->getFormat(), videoCapture->getWidth(), videoCapture->getHeight(), 0, ioTypeOut, inParam.m_verbose);
out = V4l2Output::create(outparam);
if (out != NULL)
{
outfd = out->getFd();

@ -1 +1 @@
Subproject commit 283c43c1630e942d04ad867c7a3f194182c62522
Subproject commit bc0c46cadc6c4d642bd9c744eda1e77b9aa435e3
Loading…
Cancel
Save