Browse Source

Some Changes in img_mill to work with AVIF

AGP
root 12 months ago
parent
commit
84f03672e3
  1. 1
      Projects/img_mill/IM_ClientHandler.cpp
  2. 2
      Projects/img_mill/IM_DataBaseAdapter.cpp
  3. 3
      Projects/img_mill/IM_DataStructs.h
  4. 1
      Projects/img_mill/IM_DnnWorker.cpp
  5. 2
      Projects/img_mill/IM_DnnWorker.h
  6. 4
      Projects/img_mill/IM_Kernel.cpp
  7. 3
      Projects/img_mill/IM_Kernel.h
  8. 2
      Projects/img_mill/img_mill.vpj
  9. 2
      Projects/img_mill/makefile
  10. 6
      lib/data/net/netServer.cpp
  11. 2
      lib/data/net/netServiceEngine.h

1
Projects/img_mill/IM_ClientHandler.cpp

@ -28,6 +28,7 @@ IM_ClientHandler::IM_ClientHandler( int SOCKET, networkServiceEngine *ptr ) :
m_pLog = basicLogCollection::getInstance();
m_pDBA = IM_DataBaseAdapter::getInstance();
m_pMyCurrentJob = NULL;
LOG("New Client!");
if( create() ){
m_pPort = new serverPort( SOCKET );
if( m_pPort != NULL ){

2
Projects/img_mill/IM_DataBaseAdapter.cpp

@ -134,6 +134,7 @@ IM_ITEM_DATA *IM_DataBaseAdapter::getItemDataById( uint32_t itemID ){
if( strstr( it->second.c_str(),"GIF" ) ) tVal->type = IM_ITEM_TYPE_GIF;
if( strstr( it->second.c_str(),"TIFF" ) ) tVal->type = IM_ITEM_TYPE_TIFF;
if( strstr( it->second.c_str(),"AGIF" ) ) tVal->type = IM_ITEM_TYPE_AGIF;
if( strstr( it->second.c_str(),"AVIF" ) ) tVal->type = IM_ITEM_TYPE_AVIF;
};
};
};
@ -185,6 +186,7 @@ IM_ITEM_DATA *IM_DataBaseAdapter::getItemDataByMd5( CSTR md5 ){
if( strstr( it->second.c_str(),"GIF" ) ) tVal->type = IM_ITEM_TYPE_GIF;
if( strstr( it->second.c_str(),"TIFF" ) ) tVal->type = IM_ITEM_TYPE_TIFF;
if( strstr( it->second.c_str(),"AGIF" ) ) tVal->type = IM_ITEM_TYPE_AGIF;
if( strstr( it->second.c_str(),"AVIF" ) ) tVal->type = IM_ITEM_TYPE_AVIF;
};
};
};

3
Projects/img_mill/IM_DataStructs.h

@ -18,7 +18,8 @@ typedef enum E_IM_ITEM_TYPES{
IM_ITEM_TYPE_PNG = 1,
IM_ITEM_TYPE_GIF = 2,
IM_ITEM_TYPE_AGIF = 3,
IM_ITEM_TYPE_TIFF = 4
IM_ITEM_TYPE_TIFF = 4,
IM_ITEM_TYPE_AVIF = 5
}IM_ITEM_TYPES;
typedef enum E_IM_PROCESS_TYPES{

1
Projects/img_mill/IM_DnnWorker.cpp

@ -322,6 +322,7 @@ bool IM_DnnWorker::enqueueJob( IM_JOB *ptr ){
case IM_ITEM_TYPE_PNG: sprintf( tPath, "%s/%s/%s/%s/%s.png", m_pPicturesBase, p1, p2, p3, ptr->md5 ); break;
case IM_ITEM_TYPE_GIF: sprintf( tPath, "%s/%s/%s/%s/%s.gif", m_pPicturesBase, p1, p2, p3, ptr->md5 ); break;
case IM_ITEM_TYPE_AGIF: sprintf( tPath, "%s/%s/%s/%s/%s.gif", m_pPicturesBase, p1, p2, p3, ptr->md5 ); break;
case IM_ITEM_TYPE_AVIF: sprintf( tPath, "%s/%s/%s/%s/%s.avif", m_pPicturesBase, p1, p2, p3, ptr->md5 ); break;
case IM_ITEM_TYPE_TIFF: sprintf( tPath, "%s/%s/%s/%s/%s.tiff", m_pPicturesBase, p1, p2, p3, ptr->md5 ); break;
};
#ifdef DEBUG

2
Projects/img_mill/IM_DnnWorker.h

@ -7,7 +7,7 @@
#include "../../lib/components/base/basicEventHeap.h"
#include "IM_DataStructs.h"
#define DARKNET
//#define DARKNET
#ifdef DARKNET
#define GPU

4
Projects/img_mill/IM_Kernel.cpp

@ -71,9 +71,11 @@ bool IM_Kernel::stop( bool Force ){
return true;
};
networkClientHandler *IM_Kernel::attachNewClient( int SocketID ){
networkClientHandler *IM_Kernel::attachNewClient( int SocketID, void *ptp ){
IM_ClientHandler *tVal;
LOG("BEFORE NEW CLIENT");
tVal = new IM_ClientHandler( SocketID, this );
LOG("AFTER NEW CLIENT");
return (networkClientHandler *) tVal;
};

3
Projects/img_mill/IM_Kernel.h

@ -38,7 +38,8 @@ class IM_Kernel : public networkServiceEngine, public basicThread {
virtual bool start();
virtual bool stop( bool Force = false );
uint8_t getExitCause( void ){ return m_bExitCause;};
virtual networkClientHandler * attachNewClient( int SocketID );
//virtual networkClientHandler * attachNewClient( int SocketID );
virtual networkClientHandler * attachNewClient( int SocketID, void *ptr = NULL );
virtual bool detachClient( networkClientHandler *ptr );
bool enqueueJob( IM_JOB *ptr );
//IM_RESULT * getResult( IM_JOB *ptr );

2
Projects/img_mill/img_mill.vpj

@ -13,7 +13,7 @@
Version="1"
OutputFile="%bdimg_mill"
CompilerConfigName="Latest Version"
Defines='"/D_OPENCV_" "/DDEBUG" "/DOPENCV" "/DDARKNET"'>
Defines='"/D_OPENCV_" "/DDEBUG" "/DOPENCV"'>
<Menu>
<Target
Name="Compile"

2
Projects/img_mill/makefile

@ -71,7 +71,7 @@ ALL_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \
-lz -ldarknet -lGL -lGLU -lc -lm -lz -L/usr/local/cuda/lib64 \
-lcublas -lcudnn -lcurand -lcudart -lcusolver
COMPILE=g++ -c -x c++ "-D_OPENCV_" "-DDEBUG" "-DOPENCV" "-DDARKNET" -g -ggdb -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
COMPILE=g++ -c -x c++ "-D_OPENCV_" "-DDEBUG" "-DOPENCV" -g -ggdb -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -g -ggdb -o "$(OUTFILE)" $(ALL_OBJ)
# Pattern rules

6
lib/data/net/netServer.cpp

@ -21,13 +21,13 @@ networkServer::networkServer( config_setting_t *Settings, networkServiceEngine *
m_bConnectionType = 0;
m_vHandlersPool.clear();
MainSocketAddress = NULL;
m_pKernelEngine = ptr;
MainSocket = INVALID_SOCKET;
if( Settings != NULL ) {
m_pSettings = Settings;
} else {
m_pSettings = basicSettingsProvider::getInstance()->getSubNode( NULL, "NETWORK_SERVER" );
};
m_pKernelEngine = ptr;
};
networkServer::~networkServer(){
@ -457,11 +457,11 @@ void networkServer::m_fThreadProc( void ){
#endif
if( m_pKernelEngine ) {
networkClientHandler *tHandle;
#ifdef DEBUG_EXTRA
#ifdef DEBUG
LOG("Before New Handler");
#endif
tHandle = m_pKernelEngine->attachNewClient( ClientSocket, &ClientAddress );
#ifdef DEBUG_EXTRA
#ifdef DEBUG
LOG("After New Handler");
#endif
if( tHandle != NULL ) {

2
lib/data/net/netServiceEngine.h

@ -10,7 +10,7 @@ class networkServiceEngine: public basicEngine {
networkServiceEngine();
virtual ~networkServiceEngine();
//void *ptr -> optionall additional info ususally (struct sockaddr *)
virtual networkClientHandler * attachNewClient( int SocketID, void *ptr = NULL ){ return 0; };
virtual networkClientHandler * attachNewClient( int SocketID, void *ptr = NULL ){ return NULL; };
virtual bool detachClient( networkClientHandler *ptr ){ return false; };
virtual bool start(){ return false; };
virtual bool stop( bool force = true ){ return false; };

Loading…
Cancel
Save