Commit 940c518e authored by Kai Lauterbach's avatar Kai Lauterbach Committed by Jean-Baptiste Kempf

atmo: add support for Fnordlicht devices

The Fnordlicht-Class implements only parts of the fnordlicht-protocol:
sync, stop, start_bootloader, boot_enter_application and fade_rgb
Have a look at http://github.com/fd0/fnordlicht/raw/master/doc/PROTOCOL
for more details.
Signed-off-by: default avatarAndré Weber <atmo@videolan.org>
(cherry picked from commit c215f7b79628a32373cf0041152cff1a5042d15b)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ff5d0145
......@@ -71,6 +71,7 @@ SOURCES_atmo = atmo/atmo.cpp \
atmo/DmxTools.cpp atmo/DmxTools.h \
atmo/AtmoMultiConnection.cpp atmo/AtmoMultiConnection.h \
atmo/MoMoConnection.cpp atmo/MoMoConnection.h \
atmo/FnordlichtConnection.cpp atmo/FnordlichtConnection.h \
atmo/AtmoPacketQueue.cpp atmo/AtmoPacketQueue.h
SOURCES_video_filter_wrapper = wrapper.c
noinst_HEADERS = filter_common.h filter_picture.h
......
......@@ -44,6 +44,10 @@ CAtmoConfig::CAtmoConfig()
m_AtmoZoneDefCount = -1;
m_DMX_BaseChannels = NULL;
m_chWhiteAdj_Red = NULL;
m_chWhiteAdj_Green = NULL;
m_chWhiteAdj_Blue = NULL;
LoadDefaults();
}
......@@ -59,6 +63,10 @@ CAtmoConfig::~CAtmoConfig() {
m_ZoneDefinitions = NULL;
}
delete []m_chWhiteAdj_Red;
delete []m_chWhiteAdj_Green;
delete []m_chWhiteAdj_Blue;
free( m_DMX_BaseChannels );
#if defined (_ATMO_VLC_PLUGIN_)
......@@ -99,8 +107,6 @@ void CAtmoConfig::LoadDefaults() {
m_UpdateEdgeWeightningFlag = 0;
m_Software_gamma_mode = agcNone;
m_Software_gamma_red = 10;
m_Software_gamma_green = 10;
......@@ -112,6 +118,17 @@ void CAtmoConfig::LoadDefaults() {
m_WhiteAdjustment_Blue = 255;
m_UseSoftwareWhiteAdj = 1;
m_WhiteAdjPerChannel = ATMO_FALSE;
m_chWhiteAdj_Count = 0;
delete []m_chWhiteAdj_Red;
delete []m_chWhiteAdj_Green;
delete []m_chWhiteAdj_Blue;
m_chWhiteAdj_Red = NULL;
m_chWhiteAdj_Green = NULL;
m_chWhiteAdj_Blue = NULL;
m_ColorChanger_iSteps = 50;
m_ColorChanger_iDelay = 25;
......@@ -145,6 +162,7 @@ void CAtmoConfig::LoadDefaults() {
m_LiveView_DisplayNr = 0;
m_LiveView_FrameDelay = 30;
m_LiveView_GDI_FrameRate = 25;
m_LiveView_RowsPerFrame = 0;
m_Hardware_global_gamma = 128;
......@@ -161,6 +179,7 @@ void CAtmoConfig::LoadDefaults() {
m_DMX_RGB_Channels = 5; // so wie atmolight
m_MoMo_Channels = 3; // default momo, there exists also a 4 ch version!
m_Fnordlicht_Amount = 2; // default fnordlicht, there are 2 fnordlicht's!
m_ZonesTopCount = 1;
m_ZonesBottomCount = 1;
......@@ -168,7 +187,6 @@ void CAtmoConfig::LoadDefaults() {
m_ZoneSummary = ATMO_FALSE;
UpdateZoneCount();
clearAllChannelMappings();
m_CurrentChannelAssignment = 0;
CAtmoChannelAssignment *temp = new CAtmoChannelAssignment();
......@@ -201,6 +219,25 @@ void CAtmoConfig::Assign(CAtmoConfig *pAtmoConfigSrc) {
this->m_WhiteAdjustment_Blue = pAtmoConfigSrc->m_WhiteAdjustment_Blue;
this->m_UseSoftwareWhiteAdj = pAtmoConfigSrc->m_UseSoftwareWhiteAdj;
this->m_WhiteAdjPerChannel = pAtmoConfigSrc->m_WhiteAdjPerChannel;
this->m_chWhiteAdj_Count = pAtmoConfigSrc->m_chWhiteAdj_Count;
delete []m_chWhiteAdj_Red;
delete []m_chWhiteAdj_Green;
delete []m_chWhiteAdj_Blue;
if(m_chWhiteAdj_Count > 0)
{
m_chWhiteAdj_Red = new int[ m_chWhiteAdj_Count ];
m_chWhiteAdj_Green = new int[ m_chWhiteAdj_Count ];
m_chWhiteAdj_Blue = new int[ m_chWhiteAdj_Count ];
memcpy(m_chWhiteAdj_Red, pAtmoConfigSrc->m_chWhiteAdj_Red, sizeof(int) * m_chWhiteAdj_Count);
memcpy(m_chWhiteAdj_Green, pAtmoConfigSrc->m_chWhiteAdj_Green, sizeof(int) * m_chWhiteAdj_Count);
memcpy(m_chWhiteAdj_Blue, pAtmoConfigSrc->m_chWhiteAdj_Blue, sizeof(int) * m_chWhiteAdj_Count);
} else {
m_chWhiteAdj_Red = NULL;
m_chWhiteAdj_Green = NULL;
m_chWhiteAdj_Blue = NULL;
}
this->m_IsSetShutdownColor = pAtmoConfigSrc->m_IsSetShutdownColor;
this->m_ShutdownColor_Red = pAtmoConfigSrc->m_ShutdownColor_Red;
this->m_ShutdownColor_Green = pAtmoConfigSrc->m_ShutdownColor_Green;
......@@ -223,7 +260,6 @@ void CAtmoConfig::Assign(CAtmoConfig *pAtmoConfigSrc) {
this->m_show_statistics = pAtmoConfigSrc->m_show_statistics;
this->m_LiveView_EdgeWeighting = pAtmoConfigSrc->m_LiveView_EdgeWeighting;
this->m_LiveView_BrightCorrect = pAtmoConfigSrc->m_LiveView_BrightCorrect;
this->m_LiveView_DarknessLimit = pAtmoConfigSrc->m_LiveView_DarknessLimit;
......@@ -236,6 +272,7 @@ void CAtmoConfig::Assign(CAtmoConfig *pAtmoConfigSrc) {
this->m_LiveView_DisplayNr = pAtmoConfigSrc->m_LiveView_DisplayNr;
this->m_LiveView_FrameDelay = pAtmoConfigSrc->m_LiveView_FrameDelay;
this->m_LiveView_GDI_FrameRate = pAtmoConfigSrc->m_LiveView_GDI_FrameRate;
this->m_LiveView_RowsPerFrame = pAtmoConfigSrc->m_LiveView_RowsPerFrame;
this->m_ZonesTopCount = pAtmoConfigSrc->m_ZonesTopCount;
this->m_ZonesBottomCount = pAtmoConfigSrc->m_ZonesBottomCount;
......@@ -255,6 +292,8 @@ void CAtmoConfig::Assign(CAtmoConfig *pAtmoConfigSrc) {
this->m_MoMo_Channels = pAtmoConfigSrc->m_MoMo_Channels;
this->m_Fnordlicht_Amount = pAtmoConfigSrc->m_Fnordlicht_Amount;
this->m_CurrentChannelAssignment = pAtmoConfigSrc->m_CurrentChannelAssignment;
clearChannelMappings();
......@@ -278,8 +317,6 @@ void CAtmoConfig::Assign(CAtmoConfig *pAtmoConfigSrc) {
UpdateZoneDefinitionCount();
}
int CAtmoConfig::getNumChannelAssignments() {
int z=0;
for(int i=0;i<10;i++)
......@@ -336,8 +373,6 @@ void CAtmoConfig::UpdateZoneCount()
m_computed_zones_count++;
}
int CAtmoConfig::getZoneCount()
{
return(m_computed_zones_count);
......@@ -423,3 +458,50 @@ void CAtmoConfig::setDMX_BaseChannels(char *channels)
m_DMX_BaseChannels = strdup(channels);
}
void CAtmoConfig::getChannelWhiteAdj(int channel,int &red,int &green,int &blue)
{
if(channel >= m_chWhiteAdj_Count)
{
red = 256;
green = 256;
blue = 256;
} else {
red = m_chWhiteAdj_Red[ channel ];
green = m_chWhiteAdj_Green[ channel ];
blue = m_chWhiteAdj_Blue[ channel ];
}
}
void CAtmoConfig::setChannelWhiteAdj(int channel,int red,int green,int blue)
{
if(channel >= m_chWhiteAdj_Count)
{
int *tmp = new int[channel+1];
if(m_chWhiteAdj_Red)
memcpy( tmp, m_chWhiteAdj_Red, m_chWhiteAdj_Count * sizeof(int) );
delete []m_chWhiteAdj_Red;
m_chWhiteAdj_Red = tmp;
tmp = new int[channel + 1];
if(m_chWhiteAdj_Green)
memcpy( tmp, m_chWhiteAdj_Green, m_chWhiteAdj_Count * sizeof(int) );
delete []m_chWhiteAdj_Green;
m_chWhiteAdj_Green = tmp;
tmp = new int[channel + 1];
if(m_chWhiteAdj_Blue)
memcpy( tmp, m_chWhiteAdj_Blue, m_chWhiteAdj_Count * sizeof(int) );
delete []m_chWhiteAdj_Blue;
m_chWhiteAdj_Blue = tmp;
m_chWhiteAdj_Count = channel + 1;
}
m_chWhiteAdj_Red[channel] = red;
m_chWhiteAdj_Green[channel] = green;
m_chWhiteAdj_Blue[channel] = blue;
}
......@@ -19,7 +19,6 @@
# include <string.h>
#endif
class CAtmoConfig {
protected:
......@@ -42,6 +41,12 @@ class CAtmoConfig {
int m_WhiteAdjustment_Green;
int m_WhiteAdjustment_Blue;
ATMO_BOOL m_WhiteAdjPerChannel;
int m_chWhiteAdj_Count;
int *m_chWhiteAdj_Red;
int *m_chWhiteAdj_Green;
int *m_chWhiteAdj_Blue;
protected:
int m_IsSetShutdownColor;
int m_ShutdownColor_Red;
......@@ -76,7 +81,6 @@ class CAtmoConfig {
CAtmoZoneDefinition **m_ZoneDefinitions;
int m_AtmoZoneDefCount;
/*
zone layout description for generating the default Zone weightning
*/
......@@ -94,7 +98,6 @@ class CAtmoConfig {
public:
int getZoneCount();
protected:
/* Live View Parameters (most interesting) */
AtmoFilterMode m_LiveViewFilterMode;
......@@ -104,6 +107,9 @@ class CAtmoConfig {
ATMO_BOOL m_show_statistics;
// number of rows to process each frame
int m_LiveView_RowsPerFrame;
// weighting of distance to edge
int m_LiveView_EdgeWeighting; // = 8;
// brightness correction
......@@ -154,6 +160,9 @@ class CAtmoConfig {
protected:
int m_MoMo_Channels;
protected:
int m_Fnordlicht_Amount;
protected:
AtmoGammaCorrect m_Software_gamma_mode;
......@@ -165,7 +174,6 @@ class CAtmoConfig {
public:
volatile int m_UpdateEdgeWeightningFlag;
public:
CAtmoConfig();
virtual ~CAtmoConfig();
......@@ -210,6 +218,13 @@ class CAtmoConfig {
ATMO_BOOL isUseSoftwareWhiteAdj() { return m_UseSoftwareWhiteAdj; }
void setUseSoftwareWhiteAdj(ATMO_BOOL value) { m_UseSoftwareWhiteAdj = value; }
/* White ADJ per Channel settings */
ATMO_BOOL isWhiteAdjPerChannel() { return m_WhiteAdjPerChannel; }
void setWhiteAdjPerChannel( ATMO_BOOL value) { m_WhiteAdjPerChannel = value; }
void setChannelWhiteAdj(int channel,int red,int green,int blue);
void getChannelWhiteAdj(int channel,int &red,int &green,int &blue);
int isSetShutdownColor() { return m_IsSetShutdownColor; }
void SetSetShutdownColor(int value) { m_IsSetShutdownColor = value; }
int getShutdownColor_Red() { return m_ShutdownColor_Red; }
......@@ -236,7 +251,6 @@ class CAtmoConfig {
int getStaticColor_Blue() { return m_StaticColor_Blue; }
void setStaticColor_Blue(int value) { m_StaticColor_Blue=value; }
AtmoConnectionType getConnectionType() { return m_eAtmoConnectionType; }
void setConnectionType(AtmoConnectionType value) { m_eAtmoConnectionType = value; }
......@@ -258,6 +272,9 @@ class CAtmoConfig {
int getLiveView_EdgeWeighting() { return m_LiveView_EdgeWeighting; }
void setLiveView_EdgeWeighting(int value) { m_LiveView_EdgeWeighting=value; }
int getLiveView_RowsPerFrame() { return m_LiveView_RowsPerFrame; }
void setLiveView_RowsPerFrame(int value) { m_LiveView_RowsPerFrame=value; }
int getLiveView_BrightCorrect() { return m_LiveView_BrightCorrect; }
void setLiveView_BrightCorrect(int value) { m_LiveView_BrightCorrect=value; }
......@@ -312,7 +329,6 @@ class CAtmoConfig {
int getHardware_gamma_blue() { return m_Hardware_gamma_blue; }
void setHardware_gamma_blue(int value) { m_Hardware_gamma_blue=value; }
AtmoGammaCorrect getSoftware_gamma_mode() { return m_Software_gamma_mode; }
int getSoftware_gamma_red() { return m_Software_gamma_red; }
int getSoftware_gamma_green() { return m_Software_gamma_green; }
......@@ -359,6 +375,9 @@ class CAtmoConfig {
int getMoMo_Channels() { return m_MoMo_Channels; }
void setMoMo_Channels(int chCount) { m_MoMo_Channels = chCount; }
int getFnordlicht_Amount() { return m_Fnordlicht_Amount; }
void setFnordlicht_Amount(int fnordlichtAmount) { m_Fnordlicht_Amount = fnordlichtAmount; }
};
#endif
......@@ -114,7 +114,8 @@ enum AtmoConnectionType
actNUL = 3,
actMultiAtmo = 4,
actMondolight = 5,
actMoMoLight = 6
actMoMoLight = 6,
actFnordlicht = 7
};
static const char *AtmoDeviceTypes[] = {
"Atmo-Classic",
......@@ -123,10 +124,10 @@ static const char *AtmoDeviceTypes[] = {
"Nul-Device",
"Multi-Atmo",
"Mondolight",
"MoMoLight"
"MoMoLight",
"Fnordlicht"
};
#define ATMO_DEVICE_COUNT 7
#define ATMO_DEVICE_COUNT 8
#if defined(_ATMO_VLC_PLUGIN_)
enum EffectMode {
......
......@@ -13,6 +13,7 @@
#include "AtmoDmxSerialConnection.h"
#include "AtmoMultiConnection.h"
#include "MoMoConnection.h"
#include "FnordlichtConnection.h"
#include "AtmoExternalCaptureInput.h"
#include <math.h>
......@@ -27,7 +28,6 @@
# include "AtmoGdiDisplayCaptureInput.h"
#endif
CAtmoTools::CAtmoTools(void)
{
}
......@@ -40,7 +40,6 @@ void CAtmoTools::ShowShutdownColor(CAtmoDynData *pDynData)
{
pDynData->LockCriticalSection();
CAtmoConnection *atmoConnection = pDynData->getAtmoConnection();
CAtmoConfig *atmoConfig = pDynData->getAtmoConfig();
if((atmoConnection != NULL) && (atmoConfig!=NULL) && atmoConfig->isSetShutdownColor()) {
......@@ -403,6 +402,24 @@ ATMO_BOOL CAtmoTools::RecreateConnection(CAtmoDynData *pDynData)
return ATMO_TRUE;
}
case actFnordlicht: {
CFnordlichtConnection *tempConnection = new CFnordlichtConnection( atmoConfig );
if(tempConnection->OpenConnection() == ATMO_FALSE) {
pDynData->setAtmoConnection(tempConnection);
pDynData->UnLockCriticalSection();
return ATMO_FALSE;
}
pDynData->setAtmoConnection(tempConnection);
pDynData->ReloadZoneDefinitionBitmaps();
tempConnection->CreateDefaultMapping( atmoConfig->getChannelAssignment(0) );
CAtmoTools::SetChannelAssignment(pDynData, atmoConfig->getCurrentChannelAssignment() );
pDynData->UnLockCriticalSection();
return ATMO_TRUE;
}
default: {
pDynData->UnLockCriticalSection();
return ATMO_FALSE;
......
This diff is collapsed.
/*
* FnordlichtConnection.h: class to access a FnordlichtLight Hardware
* - the description could be found
* here: http://github.com/fd0/fnordlicht/raw/master/doc/PROTOCOL
*
* (C) Kai Lauterbach (klaute at gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
#ifndef _FnordlichtConnection_h_
#define _FnordlichtConnection_h_
#include "AtmoDefs.h"
#include "AtmoConnection.h"
#include "AtmoConfig.h"
#if defined(WIN32)
# include <windows.h>
#endif
class CFnordlichtConnection : public CAtmoConnection
{
private:
HANDLE m_hComport;
ATMO_BOOL sync(void);
ATMO_BOOL stop(unsigned char addr);
ATMO_BOOL reset(unsigned char addr);
ATMO_BOOL start_bootloader(unsigned char addr);
ATMO_BOOL boot_enter_application(unsigned char addr);
#if defined(WIN32)
DWORD m_dwLastWin32Error;
public:
DWORD getLastError() { return m_dwLastWin32Error; }
#endif
public:
CFnordlichtConnection (CAtmoConfig *cfg);
virtual ~CFnordlichtConnection (void);
virtual ATMO_BOOL OpenConnection();
virtual void CloseConnection();
virtual ATMO_BOOL isOpen(void);
virtual ATMO_BOOL SendData(pColorPacket data);
virtual ATMO_BOOL HardwareWhiteAdjust(int global_gamma,
int global_contrast,
int contrast_red,
int contrast_green,
int contrast_blue,
int gamma_red,
int gamma_green,
int gamma_blue,
ATMO_BOOL storeToEeprom);
virtual int getAmountFnordlichter();
virtual const char *getDevicePath() { return "fnordlicht"; }
#if !defined(_ATMO_VLC_PLUGIN_)
virtual char *getChannelName(int ch);
virtual ATMO_BOOL ShowConfigDialog(HINSTANCE hInst, HWND parent,
CAtmoConfig *cfg);
#endif
virtual ATMO_BOOL CreateDefaultMapping(CAtmoChannelAssignment *ca);
};
#endif
......@@ -145,7 +145,8 @@ static const int pi_device_type_values[] = {
1, /* AtmoLight classic */
2, /* Quattro AtmoLight */
3, /* DMX Device */
4 /* MoMoLight device */
4, /* MoMoLight device */
5 /* fnordlicht */
};
static const char *const ppsz_device_type_descriptions[] = {
#if defined( WIN32 )
......@@ -154,7 +155,8 @@ static const char *const ppsz_device_type_descriptions[] = {
N_("Classic AtmoLight"),
N_("Quattro AtmoLight"),
N_("DMX"),
N_("MoMoLight")
N_("MoMoLight"),
N_("fnordlicht")
};
#define DMX_CHANNELS_TEXT N_("Count of AtmoLight channels")
......@@ -168,6 +170,11 @@ static const char *const ppsz_device_type_descriptions[] = {
#define MOMO_CHANNELS_LONGTEXT N_("Depending on your MoMoLight hardware " \
"choose 3 or 4 channels")
#define FNORDLICHT_AMOUNT_TEXT N_("Count of fnordlicht's")
#define FNORDLICHT_AMOUNT_LONGTEXT N_("Depending on the amount your " \
"fnordlicht hardware " \
"choose 1 to 4 channels")
#if defined( WIN32 )
# define DEFAULT_DEVICE 0
#else
......@@ -382,7 +389,7 @@ add_string(CFG_PREFIX "serialdev", "COM1", NULL,
add_file(CFG_PREFIX "atmowinexe", NULL, NULL,
ATMOWINEXE_TEXT, ATMOWINEXE_LONGTEXT, false )
#else
add_string(CFG_PREFIX "serialdev", "/dev/ttyS01", NULL,
add_string(CFG_PREFIX "serialdev", "/dev/ttyUSB0", NULL,
SERIALDEV_TEXT, SERIALDEV_LONGTEXT, false )
#endif
......@@ -427,6 +434,13 @@ set_section( N_("MoMoLight options" ), 0 )
add_integer_with_range(CFG_PREFIX "momo-channels", 3, 3, 4, NULL,
MOMO_CHANNELS_TEXT, MOMO_CHANNELS_LONGTEXT, false)
/* 2,2,4 means 2 is the default value, 1 minimum amount,
4 maximum amount
*/
set_section( N_("fnordlicht options" ), 0 )
add_integer_with_range(CFG_PREFIX "fnordlicht-amount", 2, 1, 4, NULL,
FNORDLICHT_AMOUNT_TEXT,
FNORDLICHT_AMOUNT_LONGTEXT, false)
/*
......@@ -658,6 +672,7 @@ static const char *const ppsz_filter_options[] = {
"dmx-channels",
"dmx-chbase",
"momo-channels",
"fnordlicht-amount",
#if defined(WIN32 )
"atmowinexe",
......@@ -1529,6 +1544,14 @@ static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
p_atmo_config->setMoMo_Channels(
var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "momo-channels")
);
/*
fnordlicht options
*/
p_atmo_config->setFnordlicht_Amount(
var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "fnordlicht-amount")
);
}
......@@ -1609,55 +1632,64 @@ static void Atmo_SetupParameters(filter_t *p_filter)
/* importing all required functions I hope*/
p_sys->pf_ctrl_atmo_initialize =
(int32_t (*)(void))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoInitialize");
(int32_t (*)(void))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoInitialize");
if(!p_sys->pf_ctrl_atmo_initialize)
msg_Err( p_filter, "export AtmoInitialize missing.");
p_sys->pf_ctrl_atmo_finalize =
(void (*)(int32_t))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoFinalize");
(void (*)(int32_t))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoFinalize");
if(!p_sys->pf_ctrl_atmo_finalize)
msg_Err( p_filter, "export AtmoFinalize missing.");
p_sys->pf_ctrl_atmo_switch_effect =
(int32_t(*)(int32_t))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoSwitchEffect");
(int32_t(*)(int32_t))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoSwitchEffect");
if(!p_sys->pf_ctrl_atmo_switch_effect)
msg_Err( p_filter, "export AtmoSwitchEffect missing.");
p_sys->pf_ctrl_atmo_set_live_source =
(int32_t(*)(int32_t))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoSetLiveSource");
(int32_t(*)(int32_t))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoSetLiveSource");
if(!p_sys->pf_ctrl_atmo_set_live_source)
msg_Err( p_filter, "export AtmoSetLiveSource missing.");
p_sys->pf_ctrl_atmo_create_transfer_buffers =
(void (*)(int32_t, int32_t, int32_t , int32_t))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoCreateTransferBuffers");
(void (*)(int32_t, int32_t, int32_t , int32_t))
GetProcAddress(p_sys->h_AtmoCtrl,"AtmoCreateTransferBuffers");
if(!p_sys->pf_ctrl_atmo_create_transfer_buffers)
msg_Err( p_filter, "export AtmoCreateTransferBuffers missing.");
p_sys->pf_ctrl_atmo_lock_transfer_buffer=
(uint8_t*(*) (void))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoLockTransferBuffer");
(uint8_t*(*) (void))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoLockTransferBuffer");
if(!p_sys->pf_ctrl_atmo_lock_transfer_buffer)
msg_Err( p_filter, "export AtmoLockTransferBuffer missing.");
p_sys->pf_ctrl_atmo_send_pixel_data =
(void (*)(void))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoSendPixelData");
(void (*)(void))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoSendPixelData");
if(!p_sys->pf_ctrl_atmo_send_pixel_data)
msg_Err( p_filter, "export AtmoSendPixelData missing.");
p_sys->pf_ctrl_atmo_get_image_size =
(void (*)(int32_t*,int32_t*))GetProcAddress(p_sys->h_AtmoCtrl,"AtmoWinGetImageSize");
(void (*)(int32_t*,int32_t*))GetProcAddress(p_sys->h_AtmoCtrl,
"AtmoWinGetImageSize");
if(!p_sys->pf_ctrl_atmo_get_image_size)
msg_Err( p_filter, "export AtmoWinGetImageSize missing.");
} else {
/* the DLL is missing try internal filter ...*/
msg_Warn( p_filter, "AtmoCtrlLib.dll missing fallback to internal atmo classic driver");
msg_Warn( p_filter,
"AtmoCtrlLib.dll missing fallback to internal atmo classic driver");
p_sys->i_device_type = 1;
}
}
#endif
if(p_sys->i_device_type >= 1) {
msg_Dbg( p_filter, "try use buildin driver %d ", p_sys->i_device_type );
msg_Dbg( p_filter, "try use buildin driver %d ", p_sys->i_device_type);
/*
now we have to read a lof of options from the config dialog
most important the serial device if not set ... we can skip
......@@ -1690,6 +1722,10 @@ static void Atmo_SetupParameters(filter_t *p_filter)
p_sys->p_atmo_config->setConnectionType( actMoMoLight );
break;
case 5:
p_sys->p_atmo_config->setConnectionType( actFnordlicht );
break;
default:
msg_Warn( p_filter, "invalid device type %d found",
p_sys->i_device_type );
......@@ -2245,7 +2281,8 @@ static void CreateMiniImage( filter_t *p_filter, picture_t *p_inpic)
}
}
msg_Dbg( p_filter, "AtmoFrame %u Time: %d ms", p_sys->ui_frame_counter, mdate() / 1000);
msg_Dbg( p_filter, "AtmoFrame %u Time: %d ms", p_sys->ui_frame_counter,
mdate() / 1000);
p_sys->ui_frame_counter++;
#endif
......@@ -2840,10 +2877,14 @@ static void atmo_parse_crop(char *psz_cropconfig,
i_crop_bottom = strtol( psz_end, &psz_end, 10 );
if( *psz_end != '\0' ) return;
i_width = fmt_render.i_visible_width - i_crop_left - i_crop_right;
i_width = fmt_render.i_visible_width -
i_crop_left -
i_crop_right;
i_visible_width = i_width;
i_height = fmt_render.i_visible_height - i_crop_top - i_crop_bottom;
i_height = fmt_render.i_visible_height -
i_crop_top -
i_crop_bottom;
i_visible_height = i_height;
i_x_offset = i_crop_left;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment