Browse Source

Sequental Video Recording and Separating EmbedVideoEncoder from StreamHandler

pull/7/head
Evgeny Gagua 5 months ago
parent
commit
9849225955
  1. 2
      Projects/la_mojo/build
  2. 2
      Projects/la_mojo/la_mojo.vpj
  3. 53
      Projects/la_mojo/makefile
  4. 3683
      lib/App/common/kernelModuleEmbedVideo.cpp
  5. 413
      lib/App/common/kernelModuleEmbedVideo.h
  6. 8
      lib/App/common/kernelModuleOnvifObserver.cpp

2
Projects/la_mojo/build

@ -7,7 +7,7 @@
#make clean -e "CFG=LRF_Proxy_ONLY"
#make -e "CFG=LRF_Proxy_ONLY" -j$(nproc)
#make clean -e "CFG=Debug86"
make clean -e "CFG=Debug86"
make -e "CFG=Debug86" -j$(nproc)
#cd Debug86
#strip ./mojo_d

2
Projects/la_mojo/la_mojo.vpj

@ -669,6 +669,7 @@
<F N="../../lib/data/net/serverPort.h"/>
<F N="../../lib/data/sqlite/sqlite_class.h"/>
<F N="../../lib/data/ssdp/ssdpAnnouncer.h"/>
<F N="../../lib/App/common/streamHandler.h"/>
<F N="../../lib/App/common/targetPipeLine.h"/>
<F N="../../lib/data/transport/transportSerial.h"/>
<F N="../../lib/data/transport/transportSocket.h"/>
@ -785,6 +786,7 @@
<F N="../../lib/data/net/serverPort.cpp"/>
<F N="../../lib/data/sqlite/sqlite_class.cpp"/>
<F N="../../lib/App/common/SQLite_dataBinder.cpp"/>
<F N="../../lib/App/common/streamHandler.cpp"/>
<F N="../../lib/App/common/targetPipeLine.cpp"/>
<F N="../../lib/alg/generic/Transform.cpp"/>
<F N="../../lib/data/transport/transportSocket.cpp"/>

53
Projects/la_mojo/makefile

@ -76,8 +76,9 @@ COMMON_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
@ -129,8 +130,9 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o -lsqlite3 -lpthread -lmysqlclient -lssl -lcurl \
-lm -lcrypto -lconfig -lz -lv4l1 -lv4l2 -lhidapi-libusb `pkg-config \
@ -273,8 +275,9 @@ COMMON_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
@ -326,8 +329,9 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o
@ -470,8 +474,9 @@ COMMON_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
@ -523,8 +528,9 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o -lsqlite3 -lpthread -lmysqlclient -lssl -lcurl \
-lm -lcrypto -lconfig -lz -lv4l1 -lv4l2 -lhidapi-libusb `pkg-config \
@ -672,8 +678,9 @@ COMMON_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
@ -725,8 +732,9 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o -lsqlite3 -lpthread -lmysqlclient -lssl -lcurl \
-lm -lcrypto -lconfig -lz -lv4l1 -lv4l2 -lhidapi-libusb `pkg-config \
@ -871,8 +879,9 @@ COMMON_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
@ -924,8 +933,9 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
$(OUTDIR)/protocolPTZ.o $(OUTDIR)/protocolPTZ_ONVIF.o \
$(OUTDIR)/protocolPTZ_PELCO.o $(OUTDIR)/protocolPTZ_VISCA.o \
$(OUTDIR)/serverPort.o $(OUTDIR)/sqlite_class.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/targetPipeLine.o \
$(OUTDIR)/Transform.o $(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/SQLite_dataBinder.o $(OUTDIR)/streamHandler.o \
$(OUTDIR)/targetPipeLine.o $(OUTDIR)/Transform.o \
$(OUTDIR)/transportSocket.o $(OUTDIR)/utm.o \
$(OUTDIR)/videoAVLIBSource.o $(OUTDIR)/videoLive555AVLibSource.o \
$(OUTDIR)/xmlParser.o -lsqlite3 -lpthread -lmysqlclient -lssl -lcurl \
-lm -lcrypto -lconfig -lz -lhidapi-libusb -latomic `pkg-config \
@ -1079,7 +1089,7 @@ $(OUTDIR)/libzip.o: ../../lib/alg/generic/libzip.cpp ../../lib/alg/generic/libzi
$(OUTDIR)/mask.o: ../../lib/alg/lgs/mask.cpp ../../lib/alg/lgs/mask.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/gui/gui.h
$(OUTDIR)/md5.o: ../../lib/alg/generic/md5.cpp ../../lib/alg/generic/md5.h
$(OUTDIR)/mojoBackend.o: ../../lib/App/mojo/mojoBackend.cpp ../../lib/App/mojo/mojoBackend.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMemoryOperation.h ../../lib/components/base/basicSettings.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/object/objectFileLoggingService.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/App/mojo/mojoKernel.h ../../lib/alg/generic/md5.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/gui/gui.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h
$(OUTDIR)/mojoKernel.o: ../../lib/App/mojo/mojoKernel.cpp ../../lib/App/mojo/mojoKernel.h ../../lib/alg/generic/md5.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/gui/gui.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/kernelEventFilterAPF.h ../../lib/App/common/kernelEventFilterBubble.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/App/common/kernelEventFilterTrain.h ../../lib/App/common/kernelModuleEmbedVideo.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h
$(OUTDIR)/mojoKernel.o: ../../lib/App/mojo/mojoKernel.cpp ../../lib/App/mojo/mojoKernel.h ../../lib/alg/generic/md5.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/gui/gui.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/kernelEventFilterAPF.h ../../lib/App/common/kernelEventFilterBubble.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/App/common/kernelEventFilterTrain.h ../../lib/App/common/kernelModuleEmbedVideo.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h ../../lib/App/common/deviceNode2D.h
$(OUTDIR)/mojoRemoteClient.o: ../../lib/App/mojo/mojoRemoteClient.cpp ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/mojo/mojoKernel.h ../../lib/alg/generic/md5.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/gui/gui.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/deviceNodeCamera.h ../../lib/App/common/deviceNodeFactory.h ../../lib/App/common/deviceNodeSensor.h
$(OUTDIR)/mysql_class.o: ../../lib/data/mysql/mysql_class.cpp ../../lib/data/mysql/mysql_class.h
$(OUTDIR)/MySQL_dataBinder.o: ../../lib/App/common/MySQL_dataBinder.cpp ../../lib/App/common/MySQL_dataBinder.h
@ -1105,6 +1115,7 @@ $(OUTDIR)/protocolPTZ_VISCA.o: ../../lib/data/protocol/protocolPTZ_VISCA.cpp ../
$(OUTDIR)/serverPort.o: ../../lib/data/net/serverPort.cpp ../../lib/data/net/serverPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h
$(OUTDIR)/sqlite_class.o: ../../lib/data/sqlite/sqlite_class.cpp ../../lib/data/sqlite/sqlite_class.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h
$(OUTDIR)/SQLite_dataBinder.o: ../../lib/App/common/SQLite_dataBinder.cpp ../../lib/App/common/SQLite_dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h
$(OUTDIR)/streamHandler.o: ../../lib/App/common/streamHandler.cpp ../../lib/App/common/streamHandler.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMediaDestination.h ../../lib/components/base/basicMediaSource.h ../../lib/App/common/kernelModuleEmbedVideo.h
$(OUTDIR)/targetPipeLine.o: ../../lib/App/common/targetPipeLine.cpp ../../lib/App/common/targetPipeLine.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicPosition.h ../../lib/components/base/basicTypes.h ../../lib/alg/generic/Transform.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h
$(OUTDIR)/Transform.o: ../../lib/alg/generic/Transform.cpp ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h
$(OUTDIR)/transportSocket.o: ../../lib/data/transport/transportSocket.cpp ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h

3683
lib/App/common/kernelModuleEmbedVideo.cpp
File diff suppressed because it is too large
View File

413
lib/App/common/kernelModuleEmbedVideo.h

@ -4,12 +4,9 @@
#include "../../components/base/basicEventHeap.h"
#include "../../components/base/basicMutex.h"
#include "kernelModule.h"
#include "streamHandler.h"
#define EVE_SEQUENTAL_OUTPUT
#ifndef EVE_SEQUENTAL_OUTPUT
#define EVE_ENABLE_EASE_OUTPUT_FPS
#endif
extern const char * m_pVideoScratchPath;
#define EVE_OUTPUT_PICTURES 1
#define EVE_OUTPUT_VIDEO 2
@ -19,156 +16,7 @@
// #include "../../data/media/video/videoAVLIBDestination.h"
#include "../../components/base/basicMediaDestination.h"
#include "../../components/base/basicMediaSource.h"
#define HAVE_SMAL_PREVIEW_STREAMS
#ifdef HAVE_SMAL_PREVIEW_STREAMS
// frame is 16/9
#define PREVIEW_SIZE_WIDTH 320
#define PREVIEW_SIZE_HEIGHT 180
#endif
#define VIDEO_SCRATCHPAD_PATH (DB_SHMEM_POINT "/video_scratch")
class kernelModuleEmbedVideo;
#define FILESTREAMBUFFERSZ 1048576
#ifndef MEKOROT_PROJECT__
#define EVE_ENABLE_VIDEO
#endif
#define USE_SCALING_IN
// #define USE_CV_DENOISE
// #define USE_CV_TONEMAP
#ifndef DB_SHMEM_POINT
#define DB_SHMEM_POINT "/dev/shm/argus"
#endif
#ifdef EVE_ENABLE_VIDEO
#define VIDEO_OUTPUT_FPS 10
#define SEPARATED_VIDEO_ENCODERS
// #define EVE_DONT_DELETE_SEGMENTS
/* Video CODECS */
#define VC_VPX 0
#define VC_X264 1
#define VC_MP4 2
#define VC_MJPEG 3
#define VC_FLV 4
/* Video FORMATS */
#define VF_WEBM 0
#define VF_MP4 1
#define VF_MP3 2
#define VF_AAC 3
#define VF_OGG 4
#define VF_MJPEG 5
#define VF_FLV 6
/* Encoder PROFILES */
#define VP_ULTRAFAST 0
#define VP_VERYFAST 1
#define VP_FAST 2
#define VP_MEDIUM 3
#define VP_SLOW 4
#define VP_VERYSLOW 5
#define VP_ULTRASLOW 6
#define VO_MJPEG 1
#define VO_MPEG4 2
#define VO_H264 3
#define VO_H265 4
#define VO_FLV 5
#define VO_DIRECT_MJPG 6
#define DIRECT_MJPEG_COMPOSING
#ifdef DIRECT_MJPEG_COMPOSING
#define VIDEO_OUTPUT VO_DIRECT_MJPG
#else
#define OPENCV_VIDEO_OUTPUT
#define VIDEO_OUTPUT VO_DIRECT_MJPG
#ifndef OPENCV_VIDEO_OUTPUT
// #define VIDEO_OUTPUT VO_MJPEG
#define VIDEO_OUTPUT VO_MPEG4
// #define VIDEO_OUTPUT VO_H264
// #define VIDEO_OUTPUT VO_H265
// #define VIDEO_OUTPUT VO_FLV
// #define VIDEO_OUTPUT_WIDTH 640 //1920
// #define VIDEO_OUTPUT_HEIGHT 480 //1080
// #define VIDEO_OUTPUT_FPS 10
// #define VIDEO_OUTPUT_GOP 15
#else // OPENCV_VIDEO_OUTPUT
#define VIDEO_OUTPUT VO_MJPEG // VO_CV_MP4
#endif
#endif // DIRECT_MJPEG_COMPOSING
#if (LIBAVCODEC_VERSION_MAJOR < 54)
#define VIDEO_OUTPUT_CODEC CODEC_ID_MJPEG
#define VIDEO_OUTPUT_PIX_FMT PIX_FMT_YUVJ422P
#else
#if VIDEO_OUTPUT == VO_MJPEG
#define VIDEO_OUTPUT_CODEC AV_CODEC_ID_MJPEG
#define VIDEO_OUTPUT_PIX_FMT AV_PIX_FMT_YUV420P // AV_PIX_FMT_YUVJ422P
#define VIDEO_OUTPUT_CONTAINER_LONG "mjpeg"
#define VIDEO_OUTPUT_BITRATE 4000000
#define VIDEO_OUTPUT_CONTAINER "mjpeg"
#elif VIDEO_OUTPUT == VO_MPEG4
#define VIDEO_OUTPUT_CODEC AV_CODEC_ID_MPEG4
#define VIDEO_OUTPUT_PIX_FMT AV_PIX_FMT_YUV420P
#define VIDEO_OUTPUT_CONTAINER_LONG "mp4"
#define VIDEO_OUTPUT_BITRATE 4000000
#define VIDEO_OUTPUT_CONTAINER "mp4"
#elif VIDEO_OUTPUT == VO_H264
#define VIDEO_OUTPUT_CODEC AV_CODEC_ID_H264
#define VIDEO_OUTPUT_PIX_FMT AV_PIX_FMT_YUV420P
#define VIDEO_OUTPUT_BITRATE 4000000
#define VIDEO_OUTPUT_CONTAINER_LONG "mp4"
#define VIDEO_OUTPUT_CONTAINER "mp4"
#elif VIDEO_OUTPUT == VO_H265
#define VIDEO_OUTPUT_CODEC AV_CODEC_ID_H265
#define VIDEO_OUTPUT_PIX_FMT AV_PIX_FMT_YUV420P
#define VIDEO_OUTPUT_BITRATE 4000000
#define VIDEO_OUTPUT_CONTAINER_LONG "mp4"
#define VIDEO_OUTPUT_CONTAINER "mp4"
#elif VIDEO_OUTPUT == VO_FLV
#define VIDEO_OUTPUT_CODEC AV_CODEC_ID_FLV1
#define VIDEO_OUTPUT_PIX_FMT AV_PIX_FMT_YUV420P
#define VIDEO_OUTPUT_CONTAINER_LONG "flv"
#define VIDEO_OUTPUT_BITRATE 4000000
#define VIDEO_OUTPUT_CONTAINER "flv"
#elif VIDEO_OUTPUT == VO_CV_MP4
#define VIDEO_OUTPUT_PIX_FMT AV_PIX_FMT_YUV420P
#define VIDEO_OUTPUT_BITRATE 4000000
#define VIDEO_OUTPUT_CONTAINER_LONG "mp4"
#define VIDEO_OUTPUT_CONTAINER "mp4"
#elif VIDEO_OUTPUT == VO_DIRECT_MJPG
#define VIDEO_OUTPUT_CONTAINER_LONG "mjpeg"
#define VIDEO_OUTPUT_CONTAINER "mjpeg"
#endif
#endif
#endif // EVE_ENABLE_VIDEO
typedef struct S_buffer_data
{
uint8_t * buf;
int size;
uint8_t * ptr;
size_t room; ///< size left in the buffer
} buffer_data;
#define NR_COLORS 4
#define AVIO_BUFFER_SIZE 4096
#define BD_BUFFER_SIZE 1024
// #define USE_CV_DENOISE
// #define USE_CV_TONEMAP
class streamHandler;
typedef struct S_WEB_CLIENT_CTX
{
int m_iSocketFID;
@ -216,261 +64,6 @@ typedef vector<uchar> compressedFRAME;
typedef map<uint32_t, compressedFRAME> mapSTREAMCAPS;
typedef map<uint32_t, cv::Mat> mapSTREAMMAPS;
#define PRE_ALARM_TIME_MILSECONDS 5000 // 5 sec
#define POST_ALARM_TIME_MILSECONDS 5000 // 5 sec
#define ENCODING_SEGMENT_MILSECONDS 50000 // 50 sec
#define ENCODING_SEGMENT_LIMIT_MILSECONDS 60000 // 1 minute
// #define ENCODING_SEGMENT_LIMIT_MILSECONDS 900000 // 15 minutes
// #define ENCODER_DISABLED 0
// #define ENCODER_ENABLED 1
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
#define EVE_EASE_FPS_DIVIDER_MINIMUM 1
#define EVE_EASE_FPS_DIVIDER_MAXIMUM 5
#define EVE_EASE_FPS_QUEUE_SIZE_MAXIMUM 8
#define EVE_EASE_FPS_QUEUE_SIZE_MINIMUM 2
#else
#define EVE_ENABLE_DROP_OUTPUT_FPS
#endif
#ifdef EVE_ENABLE_VIDEO
#ifdef DIRECT_MJPEG_COMPOSING
typedef struct S_ENCODING_BUFFER
{
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
bool flag_sa;
bool flag_sb;
#endif
uint8_t * data;
size_t size;
} ENCODING_BUFFER;
#else //! DIRECT_MJPEG_COMPOSING
#ifdef OPENCV_VIDEO_OUTPUT
typedef struct S_ENCODING_BUFFER
{
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
bool flag_sa;
bool flag_sb;
#endif
int cols;
int rows;
uint8_t * data;
size_t size;
} ENCODING_BUFFER;
#else //! OPENCV_VIDEO_OUTPUT
typedef struct S_ENCODING_BUFFER
{
int linesize[2];
int rows;
uint8_t * data[2];
size_t size;
} ENCODING_BUFFER;
#endif //! OPENCV_VIDEO_OUTPUT
#endif //! DIRECT_MJPEG_COMPOSING
typedef std::queue<ENCODING_BUFFER *> Q_ENCODING_BUFFER;
#endif
class streamHandler :
public basicMediaDestination
#ifdef EVE_ENABLE_VIDEO
,
public basicThread
#endif
{
private:
basicLogCollection * m_pLog;
basicMediaSource * m_pSource;
MEDIA_SOURCE_DESC m_sSourceDesc;
char m_cSourceType;
DBC_MEDIA_STREAM_DATA m_sStreamData;
basicMutex m_mProtector;
kernelModuleEmbedVideo * m_pMaster;
uint8_t m_bEvtMarkerCounter;
uint8_t m_bCamMoveCounter;
dataBinder * m_pDBC;
MS_WORK_MODE m_eWM;
basicMutex m_mEvtIDS_Protector;
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
uint8_t m_bWebFrameSkeepDividerCounter;
uint8_t m_bWebFrameSkeepDivider;
#endif
#ifdef EVE_ENABLE_VIDEO
#ifdef EVE_SEQUENTAL_OUTPUT
basicMutex m_mEventBindingBlocker;
#endif
#ifndef EVE_SEQUENTAL_OUTPUT
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
uint8_t m_bAFrameSkeepDivider;
uint8_t m_bAFrameSkeepDividerCounter;
uint8_t m_bAOutputFPS;
uint8_t m_bBFrameSkeepDivider;
uint8_t m_bBFrameSkeepDividerCounter;
uint8_t m_bBOutputFPS;
uint8_t m_bInitialOutputFPS;
uint8_t m_bCurrentOutputFPS;
uint32_t m_nAPreAlarmFrames;
uint32_t m_nAPostAlarmFrames;
uint32_t m_nASegmentLimitFrames;
uint32_t m_nAHardLimitFrames;
uint32_t m_nBPreAlarmFrames;
uint32_t m_nBPostAlarmFrames;
uint32_t m_nBSegmentLimitFrames;
uint32_t m_nBHardLimitFrames;
#else
uint32_t m_nPreAlarmFrames;
uint32_t m_nPostAlarmFrames;
uint32_t m_nSegmentLimitFrames;
uint32_t m_nHardLimitFrames;
#endif
#else // EVE_SEQUENTAL_OUTPUT
uint32_t m_nPreAlarmFrames;
uint32_t m_nPostAlarmFrames;
uint32_t m_nSegmentLimitFrames;
uint32_t m_nHardLimitFrames;
#endif // EVE_SEQUENTAL_OUTPUT
basicMutex m_mFrameCounterProtector;
uint64_t m_nGlobalFrameCounter;
uint64_t m_nValidatorFrameCounter;
#ifndef EVE_SEQUENTAL_OUTPUT
uint32_t m_nSegAFrameCounter;
uint32_t m_nSegBFrameCounter;
uint32_t m_nSegAShiftFrames;
uint32_t m_nSegBShiftFrames;
uint32_t m_nSegASkippedFrames;
uint32_t m_nSegBSkippedFrames;
uint8_t m_bActiveEncoderStream;
bool m_bSegAActive;
bool m_bSegADelete;
bool m_bSegBActive;
bool m_bSegBDelete;
VIDEO_SEGMENT_INFO m_sStreamSegmentInfo[2];
#else
uint32_t m_nSegFrameCounter;
uint32_t m_nSegShiftFrames;
uint32_t m_nSegSkippedFrames;
bool m_bSegActive;
bool m_bSegDelete;
bool m_bNSegDelete;
VIDEO_SEGMENT_INFO m_sStreamSegmentInfo;
#endif
uint8_t m_bFlipMode;
basicMutex m_mCurrentOperationProtector;
uint8_t m_bCOP;
#ifdef DIRECT_MJPEG_COMPOSING
#ifndef EVE_SEQUENTAL_OUTPUT
FILE * m_pOutputFD[2];
#else
FILE * m_pOutputFD;
#endif
#else // !DIRECT_MJPEG_COMPOSING
#ifdef OPENCV_VIDEO_OUTPUT
#ifndef EVE_SEQUENTAL_OUTPUT
cv::VideoWriter * m_pEncoderA;
cv::VideoWriter * m_pEncoderB;
#else
cv::VideoWriter * m_pEncoder;
#endif
#else //! OPENCV_VIDEO_OUTPUT
// char m_pVideoScratchPath[PATH_MAX];
#ifdef SEPARATED_VIDEO_ENCODERS
// LibAV encoding video stuff
#ifndef EVE_SEQUENTAL_OUTPUT
// Stream A
AVCodec * m_pVideoACodec;
AVCodecContext * m_pCodecACtx;
AVFrame * m_pAVAFrame;
uint8_t * m_pOutABuffer;
// Stream B
AVCodec * m_pVideoBCodec;
AVCodecContext * m_pCodecBCtx;
AVFrame * m_pAVBFrame;
uint8_t * m_pOutBBuffer;
#else
AVCodec * m_pVideoCodec;
AVCodecContext * m_pCodecCtx;
AVFrame * m_pAVFrame;
uint8_t * m_pOutBuffer;
#endif
#else //! SEPARATED_VIDEO_ENCODERS
// LibAV encoding video stuff
AVCodec * m_pVideoCodec;
AVCodecContext * m_pCodecCtx;
AVFrame * m_pAVFrame;
uint8_t * m_pOutBuffer;
#endif //! SEPARATED_VIDEO_ENCODERS
// Common Pix Converter ( for both streams )
SwsContext * m_pConvertCtx;
#endif //! OPENCV_VIDEO_OUTPUT
// char m_cSegNameA[128];
// char m_cSegMD5A[33];
// char m_cSegNameB[128];
// char m_cSegMD5B[33];
AVOutputFormat * m_pFormat;
#ifdef SEPARATED_VIDEO_ENCODERS
// File Context 2 units
AVFormatContext * m_pFormatCtxA;
AVFormatContext * m_pFormatCtxB;
AVStream * m_pVideoStrA;
AVStream * m_pVideoStrB;
#else
// File Context 1 units
AVFormatContext * m_pFormatCtx;
AVStream * m_pVideoStr;
#endif
// common output options
AVDictionary * m_pFormatOpts;
#endif //! DIRECT_MJPEG_COMPOSING
basicMutex m_mEncodingQueueProtector;
Q_ENCODING_BUFFER m_qEncodingQueue;
#ifndef EVE_SEQUENTAL_OUTPUT
bool openSegmentA(void);
void closeSegmentA(void);
bool openSegmentB(void);
void closeSegmentB(void);
#else
bool openSegment(void);
void closeSegment(void);
#endif
void swapActiveStreams(void);
void closeAll();
bool initVideoOutput();
protected:
void m_fThreadProc(void);
#endif //! EVE_ENABLE_VIDEO
public:
explicit streamHandler(kernelModuleEmbedVideo * ptr, MS_WORK_MODE M = MS_MODE_DECODE_FRAMES, uint8_t flip_mode = 0);
virtual ~streamHandler();
bool create(dataBinder * ptr, uint32_t stremID);
/* from Media Destination */
virtual bool pushFrame(AVFrame * Frame, void * src = NULL);
// virtual void pushFrame( cv::Mat* Frame, void* src = NULL);
virtual bool pushFrame(cv::Mat & Frame, void * src = NULL);
bool triggerEvent(uint32_t eid, uint32_t & dbid, uint32_t & frame);
bool triggerCamMove(void);
bool validate(void);
};
typedef map<uint32_t, streamHandler *> mapSTREAMHANDLERS;
class kernelModuleEmbedVideo : public kernelModule, public basicDualThread
{

8
lib/App/common/kernelModuleOnvifObserver.cpp

@ -361,12 +361,12 @@ void kernelModuleOnvifObserver::m_fThreadProc()
bOptVal = true;
bOptLen = sizeof(bool);
RetVal = setsockopt(socketFD, SOL_SOCKET, SO_BROADCAST, (char *) &bOptVal, bOptLen);
#ifdef DEBUG_EXTRA
if( RetVal < 0 )
{
LOG_ERROR("Setting Socket as Broadcasted Error!");
};
#ifdef DEBUG_EXTRA
//#ifdef DEBUG_EXTRA
LOG("Join Boadcast Group");
#endif
@ -375,13 +375,13 @@ void kernelModuleOnvifObserver::m_fThreadProc()
memcpy(&req.gr_group, &r_address, sizeof(r_address));
RetVal = setsockopt(socketFD, IPPROTO_IP, MCAST_JOIN_GROUP, (char *) &req, sizeof(req));
// The broadcast address to be used may be determined by issuing an ioctl() with the SIOCGIFBRDADDR request.
#ifdef DEBUG_EXTRA
if( RetVal < 0 )
{
LOG_ERROR("Join Socket to a Broadcast Group Error!");
};
#ifdef DEBUG_EXTRA
//#ifdef DEBUG_EXTRA
LOG("Sending Probe Request");
#endif
RetVal = sendto(socketFD, send_buff, strlen(send_buff), 0, (struct sockaddr *) &r_address, sizeof(struct sockaddr_in));

Loading…
Cancel
Save