You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.6 KiB
48 lines
1.6 KiB
#include "hardwareResourceVideoProvider.h"
|
|
|
|
#define LOG( X ) hardwareResource::m_pLog->Log( "HWR_VIDEO", this, X )
|
|
|
|
#ifdef DEBUG
|
|
#define LOG_ERROR( X ) {\
|
|
char _tBfrErrMSG2w34[256];\
|
|
sprintf( _tBfrErrMSG2w34, "In file %s[%d] in func:%s %s",__FILE__, __LINE__, __func__, X );\
|
|
hardwareResource::m_pLog->Log( "HWR_VIDEO", this, _LOG_ERROR, _tBfrErrMSG2w34 );\
|
|
}
|
|
#else
|
|
#define LOG_ERROR( X ) hardwareResource::m_pLog->Log( "HWR_VIDEO", this, _LOG_ERROR, X );
|
|
#endif
|
|
|
|
hardwareResourceVideoProvider::hardwareResourceVideoProvider( uint32_t id, HARDWARE_PROVIDERS type ):hardwareResource( id, type ){
|
|
if( m_pDBC!= NULL ){
|
|
DBC_MEDIA_STREAM_DATA *tData = m_pDBC->getMediaStreamData( m_sResourceSettings.aux_id );
|
|
if( tData != NULL ) {
|
|
memcpy( &m_sStreamData, tData, sizeof(DBC_MEDIA_STREAM_DATA));
|
|
#ifdef DEBUG
|
|
|
|
#endif
|
|
free( tData );
|
|
} else {
|
|
memset( &m_sStreamData, 0, sizeof(DBC_MEDIA_STREAM_DATA));
|
|
};
|
|
} else {
|
|
memset( &m_sStreamData, 0, sizeof(DBC_MEDIA_STREAM_DATA));
|
|
};
|
|
};
|
|
|
|
hardwareResourceVideoProvider::~hardwareResourceVideoProvider(){
|
|
m_pDBC->setStreamValid( m_sStreamData.id, false );
|
|
};
|
|
|
|
bool hardwareResourceVideoProvider::create( void ){
|
|
LOG("Creating Local Video Source!");
|
|
if( m_pDBC->updateLocalCam( m_sStreamData.source_id ) ){
|
|
LOG("Cam Updated!");
|
|
return m_pDBC->setStreamValid( m_sStreamData.id );
|
|
};
|
|
LOG("Cam NOT! Updated!");
|
|
return false;
|
|
};
|
|
|
|
#undef LOG
|
|
#undef LOG_ERROR
|
|
|