Browse Source

Started Argus Server

AGP
Evgeny Gagua 3 years ago
parent
commit
8c767b2531
  1. 39
      Linux_Workspace.vpw
  2. 289
      Projects/argus_server/argus_server.vpj
  3. 9
      Projects/argus_server/build
  4. 144
      Projects/argus_server/makefile
  5. 101
      lib/App/common/kernelModuleEmbedVideo.cpp
  6. 18
      lib/App/common/kernelModuleEmbedVideo.h

39
Linux_Workspace.vpw

@ -1,22 +1,23 @@
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">
<Workspace Version="10.0" VendorName="SlickEdit">
<Projects>
<Project File="Projects/3dClientGui/3dClientGui.vpj"/>
<Project File="Projects/argus/argus.vpj"/>
<Project File="Projects/la_mojo/la_mojo.vpj"/>
<Project File="Projects/defender-dc-trig/defender-dc-trig.vpj"/>
<Project File="Projects/DirectMemo/DirectMemo.vpj"/>
<Project File="Projects/DirectPRU/DirectPRU.vpj"/>
<Project File="Projects/img_mill/img_mill.vpj"/>
<Project File="Projects/JustADCTest/JustADCTest.vpj"/>
<Project File="Projects/libDFSL/libDFSL.vpj"/>
<Project File="Projects/libONVIF/LibONVIF.vpj"/>
<Project File="Projects/LRF_Server/LRF_Server.vpj"/>
<Project File="Projects/LRF_ServerSlim/LRF_ServerSlim.vpj"/>
<Project File="Projects/LRF_Slave/LRF_Slave.vpj"/>
<Project File="Projects/MastBaum/MastBaum.vpj"/>
<Project File="Projects/Pathfinder/Pathfinder.vpj"/>
<Project File="Projects/PRU_CORES/PRU_CORES.vpj"/>
<Project File="Projects/starProcDaemon/starProcDaemon.vpj"/>
</Projects>
<Projects>
<Project File="Projects/3dClientGui/3dClientGui.vpj"/>
<Project File="Projects/argus/argus.vpj"/>
<Project File="Projects/argus_server/argus_server.vpj"/>
<Project File="Projects/defender-dc-trig/defender-dc-trig.vpj"/>
<Project File="Projects/DirectMemo/DirectMemo.vpj"/>
<Project File="Projects/DirectPRU/DirectPRU.vpj"/>
<Project File="Projects/img_mill/img_mill.vpj"/>
<Project File="Projects/JustADCTest/JustADCTest.vpj"/>
<Project File="Projects/la_mojo/la_mojo.vpj"/>
<Project File="Projects/libDFSL/libDFSL.vpj"/>
<Project File="Projects/libONVIF/LibONVIF.vpj"/>
<Project File="Projects/LRF_Server/LRF_Server.vpj"/>
<Project File="Projects/LRF_ServerSlim/LRF_ServerSlim.vpj"/>
<Project File="Projects/LRF_Slave/LRF_Slave.vpj"/>
<Project File="Projects/MastBaum/MastBaum.vpj"/>
<Project File="Projects/Pathfinder/Pathfinder.vpj"/>
<Project File="Projects/PRU_CORES/PRU_CORES.vpj"/>
<Project File="Projects/starProcDaemon/starProcDaemon.vpj"/>
</Projects>
</Workspace>

289
Projects/argus_server/argus_server.vpj

@ -0,0 +1,289 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir="."
BuildSystem="automakefile"
BuildMakeFile="makefile">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdargus_server"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" CFG=%b'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<Rules Name="Compile">
<Rule
InputExts="*.ada"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gnat -g -c -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.adb"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gnat -g -c -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.f"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gfortran -c -g -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.f90"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gfortran -c -g -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.d"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gdc -c -g -o "%bd%n.o" "%f"'/>
</Rule>
</Rules>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdargus_server"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" CFG=%b'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<Rules Name="Compile">
<Rule
InputExts="*.ada"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gnat -O -c -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.adb"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gnat -O -c -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.f"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gfortran -O -g -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.f90"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gfortran -O -g -o "%bd%n.o" "%f"'/>
</Rule>
<Rule
InputExts="*.d"
OutputExts="*.o"
LinkObject="1">
<Exec CmdLine='gdc -c -g -o "%bd%n.o" "%f"'/>
</Rule>
</Rules>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.scala;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d;*.m;*.mm;*.go;*.groovy;*.gsh"
GUID="{03BEF1E1-D7E3-4088-A72A-934FCD9D6E12}">
<F N="../../lib/App/common/dataBinder.cpp"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.h++;*.inc;*.sh;*.cpy;*.if"
GUID="{C88BFD35-0EEE-410B-BA7B-4185A3758B41}"/>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"
GUID="{33FEA10D-DF60-414E-B175-254C6871A2D5}"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"
GUID="{1313B49C-1BCD-41CB-93FF-7C1FA1F85244}"/>
<Folder
Name="Other Files"
Filters=""
GUID="{D7A04B32-E227-4EC8-AA59-53C59AE4120C}">
<F
N="makefile"
Type="Makefile"/>
</Folder>
</Files>
<List Name="RTE">
</List>
</Project>

9
Projects/argus_server/build

@ -0,0 +1,9 @@
#! /bin/sh
make clean -e "CFG=Debug"
make -j4 -e "CFG=Debug"
#make clean -e "CFG=Release"
#make -j4 -e "CFG=Release"

144
Projects/argus_server/makefile

@ -0,0 +1,144 @@
# SlickEdit generated file. Do not edit this file except in designated areas.
# Make command to use for dependencies
MAKE=make
RM=rm
MKDIR=mkdir
# -----Begin user-editable area-----
# -----End user-editable area-----
# If no configuration is specified, "Debug" will be used
ifndef CFG
CFG=Debug
endif
#
# Configuration: Debug
#
ifeq "$(CFG)" "Debug"
OUTDIR=Debug
OUTFILE=$(OUTDIR)/argus_server
CFG_INC=
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/dataBinder.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/dataBinder.o
COMPILE=g++ -c -g -o "$(OUTDIR)/$(*F).o" $(CFG_INC) "$<"
LINK=g++ -g -o "$(OUTFILE)" $(OBJ) $(CFG_LIB)
COMPILE_ADA=gnat -g -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_ADB=gnat -g -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F=gfortran -c -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F90=gfortran -c -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_D=gdc -c -g -o "$(OUTDIR)/$(*F).o" "$<"
# Pattern rules
$(OUTDIR)/%.o : ../../lib/App/common/%.d
$(COMPILE_D)
$(OUTDIR)/%.o : ../../lib/App/common/%.f90
$(COMPILE_F90)
$(OUTDIR)/%.o : ../../lib/App/common/%.f
$(COMPILE_F)
$(OUTDIR)/%.o : ../../lib/App/common/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../lib/App/common/%.ada
$(COMPILE_ADA)
$(OUTDIR)/%.o : ../../lib/App/common/%.adb
$(COMPILE_ADB)
# Build rules
all: $(OUTFILE)
$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)
$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall
@$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all
# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)
# Clean this project and all dependencies
cleanall: clean
endif
#
# Configuration: Release
#
ifeq "$(CFG)" "Release"
OUTDIR=Release
OUTFILE=$(OUTDIR)/argus_server
CFG_INC=
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/dataBinder.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/dataBinder.o
COMPILE=g++ -c -o "$(OUTDIR)/$(*F).o" $(CFG_INC) "$<"
LINK=g++ -o "$(OUTFILE)" $(OBJ) $(CFG_LIB)
COMPILE_ADA=gnat -O -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_ADB=gnat -O -c -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F=gfortran -O -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_F90=gfortran -O -g -o "$(OUTDIR)/$(*F).o" "$<"
COMPILE_D=gdc -c -g -o "$(OUTDIR)/$(*F).o" "$<"
# Pattern rules
$(OUTDIR)/%.o : ../../lib/App/common/%.d
$(COMPILE_D)
$(OUTDIR)/%.o : ../../lib/App/common/%.f90
$(COMPILE_F90)
$(OUTDIR)/%.o : ../../lib/App/common/%.f
$(COMPILE_F)
$(OUTDIR)/%.o : ../../lib/App/common/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../lib/App/common/%.ada
$(COMPILE_ADA)
$(OUTDIR)/%.o : ../../lib/App/common/%.adb
$(COMPILE_ADB)
# Build rules
all: $(OUTFILE)
$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)
$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall
@$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all
# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)
# Clean this project and all dependencies
cleanall: clean
endif
#
# include dependencies:
#
$(OUTDIR)/dataBinder.o: ../../lib/App/common/dataBinder.cpp ../../lib/App/common/dataBinder.h

101
lib/App/common/kernelModuleEmbedVideo.cpp

@ -86,6 +86,10 @@ kernelModuleEmbedVideo::kernelModuleEmbedVideo( uint32_t moduleID ): kernelModul
};
n_pNoSignalData = NULL;
m_nNoSignalSize = 0;
#ifdef HAVE_SMAL_PREVIEW_STREAMS
n_pNoSignalSmallData = NULL;
m_nNoSignalSmallSize = 0;
#endif
char tBuff[1024];
sprintf( m_pBaseSavePath, "%s/data/reports", getcwd(tBuff, 1024) );
#ifdef DEBUG
@ -192,6 +196,9 @@ kernelModuleEmbedVideo::~kernelModuleEmbedVideo(){
LOG("Deleting No Signal");
#endif
if( n_pNoSignalData ) free(n_pNoSignalData);
#ifdef HAVE_SMAL_PREVIEW_STREAMS
if( n_pNoSignalSmallData ) free(n_pNoSignalSmallData);
#endif
if( fileExist( m_pVideoScratchPath )) {
// Clean Video Scratch
char tCMD[MAX_PATH];
@ -314,10 +321,13 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){
TLOG( cGetURI );
#endif
};
if( ( strncmp( cGetURI, "/stream", 7 ) == 0 ) || ( strncmp( cGetURI, "/video_feed", 11 ) == 0 ) ) {
//if( ( strncmp( cGetURI, "/stream", 7 ) == 0 ) || ( strncmp( cGetURI, "/video_feed", 11 ) == 0 ) ) {
if( strncmp( cGetURI, "/video_feed", 11 ) == 0 ) {
uint32_t tStreamID = 0;
CSTR tP;
#ifdef HAVE_SMAL_PREVIEW_STREAMS
if( tP = strstr( cGetURI, "/preview" ) ) CTX->bPreviewMode = true;
#endif
if( tP = strstr( cGetURI, "?" ) ) {
CSTR tB;
tP++;
@ -355,10 +365,21 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){
};
if( CTX->ModulePtr->n_pNoSignalData ) {
//Send Dummy Picture
sprintf( mesg, ht_no_signal, CTX->ModulePtr->m_nNoSignalSize );
send( CTX->m_iSocketFID, mesg, strlen(mesg), 0 );
send( CTX->m_iSocketFID, CTX->ModulePtr->n_pNoSignalData, CTX->ModulePtr->m_nNoSignalSize, 0 );
send( CTX->m_iSocketFID, "\r\n\r\n", 4, 0 );
#ifdef HAVE_SMAL_PREVIEW_STREAMS
if( CTX->bPreviewMode ){
sprintf( mesg, ht_no_signal, CTX->ModulePtr->m_nNoSignalSize );
send( CTX->m_iSocketFID, mesg, strlen(mesg), 0 );
send( CTX->m_iSocketFID, CTX->ModulePtr->n_pNoSignalSmallData, CTX->ModulePtr->m_nNoSignalSmallSize, 0 );
send( CTX->m_iSocketFID, "\r\n\r\n", 4, 0 );
} else {
#endif
sprintf( mesg, ht_no_signal, CTX->ModulePtr->m_nNoSignalSize );
send( CTX->m_iSocketFID, mesg, strlen(mesg), 0 );
send( CTX->m_iSocketFID, CTX->ModulePtr->n_pNoSignalData, CTX->ModulePtr->m_nNoSignalSize, 0 );
send( CTX->m_iSocketFID, "\r\n\r\n", 4, 0 );
#ifdef HAVE_SMAL_PREVIEW_STREAMS
};
#endif
#ifdef DEBUG_EXTRA
TLOG("Sent No Signal Image!");
#endif
@ -401,29 +422,57 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){
*/
/**************/
CTX->ModulePtr->m_mEncodedProtector.lock();
if( CTX->ModulePtr->m_mapCAPTURES[CTX->mediaStreamId].size() ) {
msgSize = CTX->ModulePtr->m_mapCAPTURES[CTX->mediaStreamId].size();
if( msgSize < FILESTREAMBUFFERSZ ) {
memcpy( tBuf, CTX->ModulePtr->m_mapCAPTURES[CTX->mediaStreamId].data(), msgSize );
CTX->ModulePtr->m_mEncodedProtector.unlock();
#ifdef HAVE_SMAL_PREVIEW_STREAMS
if( CTX->bPreviewMode ){
if( CTX->ModulePtr->m_mapPREVIEWS[CTX->mediaStreamId].size() ) {
msgSize = CTX->ModulePtr->m_mapPREVIEWS[CTX->mediaStreamId].size();
if( msgSize < FILESTREAMBUFFERSZ ) {
memcpy( tBuf, CTX->ModulePtr->m_mapPREVIEWS[CTX->mediaStreamId].data(), msgSize );
CTX->ModulePtr->m_mEncodedProtector.unlock();
} else {
CTX->ModulePtr->m_mEncodedProtector.unlock();
TLOG_ERROR("Data too Big in Pipe Transfer!");
w = false;
continue;
};
} else {
CTX->ModulePtr->m_mEncodedProtector.unlock();
TLOG_ERROR("Data too Big in Pipe Transfer!");
w = false;
continue;
if( CTX->ModulePtr->n_pNoSignalSmallData ){
msgSize = CTX->ModulePtr->m_nNoSignalSmallSize;
memcpy( tBuf, CTX->ModulePtr->n_pNoSignalSmallData, msgSize );
} else {
TLOG_ERROR("Data too Big in Pipe Transfer!");
w = false;
continue;
};
};
} else {
CTX->ModulePtr->m_mEncodedProtector.unlock();
if( CTX->ModulePtr->n_pNoSignalData ){
msgSize = CTX->ModulePtr->m_nNoSignalSize;
memcpy( tBuf, CTX->ModulePtr->n_pNoSignalData, msgSize );
#endif
if( CTX->ModulePtr->m_mapCAPTURES[CTX->mediaStreamId].size() ) {
msgSize = CTX->ModulePtr->m_mapCAPTURES[CTX->mediaStreamId].size();
if( msgSize < FILESTREAMBUFFERSZ ) {
memcpy( tBuf, CTX->ModulePtr->m_mapCAPTURES[CTX->mediaStreamId].data(), msgSize );
CTX->ModulePtr->m_mEncodedProtector.unlock();
} else {
CTX->ModulePtr->m_mEncodedProtector.unlock();
TLOG_ERROR("Data too Big in Pipe Transfer!");
w = false;
continue;
};
} else {
TLOG_ERROR("Data too Big in Pipe Transfer!");
w = false;
continue;
CTX->ModulePtr->m_mEncodedProtector.unlock();
if( CTX->ModulePtr->n_pNoSignalData ){
msgSize = CTX->ModulePtr->m_nNoSignalSize;
memcpy( tBuf, CTX->ModulePtr->n_pNoSignalData, msgSize );
} else {
TLOG_ERROR("Data too Big in Pipe Transfer!");
w = false;
continue;
};
};
#ifdef HAVE_SMAL_PREVIEW_STREAMS
};
#endif
/*********/
sprintf( mesg, "--MPFrame\r\nContent-type: image/jpeg\r\nContent-length: %d\r\n\r\n", msgSize );
if( send( CTX->m_iSocketFID, mesg, strlen( mesg ), 0 )< 0 ){
@ -2147,6 +2196,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
m_pMaster->m_mapCAPTURES[tMD->mediaStreamId].clear();
cv::imencode( ".jpg", m_pMaster->m_mapMATS[tMD->mediaStreamId], m_pMaster->m_mapCAPTURES[tMD->mediaStreamId], compression_params );
#ifdef HAVE_SMAL_PREVIEW_STREAMS
// Make Small Preview Thumb
cv::Mat dst;
cv::resize( m_pMaster->m_mapMATS[tMD->mediaStreamId], dst, cv::Size( PREVIEW_SIZE_WIDTH, PREVIEW_SIZE_HEIGHT ));
m_pMaster->m_mapPREVIEWS[tMD->mediaStreamId].clear();
cv::imencode( ".jpg", dst, m_pMaster->m_mapPREVIEWS[tMD->mediaStreamId], compression_params );
#endif
m_pMaster->m_mEncodedProtector.unlock();
#ifdef EVE_ENABLE_EASE_OUTPUT_FPS
};

18
lib/App/common/kernelModuleEmbedVideo.h

@ -9,6 +9,14 @@
#include "../components/base/basicMediaDestination.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;
@ -148,6 +156,9 @@ typedef struct S_WEB_CLIENT_CTX{
bool initDone;
bool headerIsSent;
uint32_t mediaStreamId;
#ifdef HAVE_SMAL_PREVIEW_STREAMS
bool bPreviewMode;
#endif
streamHandler * m_pHandler;
kernelModuleEmbedVideo * ModulePtr;
}WEB_CLIENT_CTX;
@ -401,11 +412,16 @@ class kernelModuleEmbedVideo: public kernelModule, public basicDualThread {
basicMutex m_mEncodedProtector;
vectorHANDLERS m_vHandlersPool;
DBC_MODULE_EMBED_VIDEO_DATA m_sEmbedVideoData;
mapSTREAMCAPS m_mapCAPTURES;
mapSTREAMMAPS m_mapMATS;
mapSTREAMHANDLERS m_mapHANDLERS;
mapSTREAMCAPS m_mapCAPTURES;
uint8_t * n_pNoSignalData;
uint32_t m_nNoSignalSize;
#ifdef HAVE_SMAL_PREVIEW_STREAMS
mapSTREAMCAPS m_mapPREVIEWS;
uint8_t * n_pNoSignalSmallData;
uint32_t m_nNoSignalSmallSize;
#endif
cv::Mat m_mLogoPic;
cv::Mat m_mLogoMask;
char m_pBaseSavePath[PATH_MAX];

Loading…
Cancel
Save