diff --git a/inc/V4l2RTSPServer.h b/inc/V4l2RTSPServer.h index 517e858..ec3935a 100644 --- a/inc/V4l2RTSPServer.h +++ b/inc/V4l2RTSPServer.h @@ -144,7 +144,7 @@ class V4l2RTSPServer { StreamReplicator* CreateVideoReplicator( const V4L2DeviceParameters& inParam, int queueSize, int useThread, int repeatConfig, - const std::string& outputFile, V4l2IoType ioTypeOut, V4l2Output* out, + const std::string& outputFile, V4l2IoType ioTypeOut, V4l2Output*& out, std::string& rtpVideoFormat); #ifdef HAVE_ALSA @@ -287,4 +287,4 @@ class V4l2RTSPServer { UsageEnvironment* m_env; RTSPServer* m_rtspServer; int m_rtspPort; -}; \ No newline at end of file +}; diff --git a/main.cpp b/main.cpp index e546add..975030c 100755 --- a/main.cpp +++ b/main.cpp @@ -321,10 +321,12 @@ int main(int argc, char** argv) decodeDevice(deviceName, videoDev, audioDev); std::string baseUrl; + std::string output(outputFile); if (devList.size() > 1) { baseUrl = getDeviceName(videoDev); baseUrl.append("/"); + output.append(getDeviceName(videoDev)); } V4l2Output* out = NULL; @@ -333,7 +335,7 @@ int main(int argc, char** argv) StreamReplicator* videoReplicator = rtspServer.CreateVideoReplicator( inParam, queueSize, useThread, repeatConfig, - outputFile + getDeviceName(videoDev), ioTypeOut, out, + output, ioTypeOut, out, rtpVideoFormat); if (out != NULL) { outList.push_back(out); diff --git a/src/V4l2RTSPServer.cpp b/src/V4l2RTSPServer.cpp index 3f2ed43..dd1840d 100644 --- a/src/V4l2RTSPServer.cpp +++ b/src/V4l2RTSPServer.cpp @@ -26,7 +26,7 @@ StreamReplicator* V4l2RTSPServer::CreateVideoReplicator( const V4L2DeviceParameters& inParam, int queueSize, int useThread, int repeatConfig, - const std::string& outputFile, V4l2IoType ioTypeOut, V4l2Output* out, + const std::string& outputFile, V4l2IoType ioTypeOut, V4l2Output*& out, std::string& rtpVideoFormat) { StreamReplicator* videoReplicator = NULL; @@ -48,6 +48,9 @@ StreamReplicator* V4l2RTSPServer::CreateVideoReplicator( if (out != NULL) { outfd = out->getFd(); + LOG(INFO) << "Output fd:" << outfd << " " << outputFile; + } else { + LOG(WARN) << "Cannot open output:" << outputFile; } } @@ -197,4 +200,4 @@ StreamReplicator* V4l2RTSPServer::CreateAudioReplicator( } return audioReplicator; } -#endif \ No newline at end of file +#endif