@@ -80,9 +80,9 @@ using namespace std;
80
80
int getTypeOfInput (string sType )
81
81
{
82
82
int iType = -1 ;
83
- if (strcmp (sType .c_str (), " HDMI" ) == 0 )
83
+ if (0 == strcmp (sType .c_str (), " HDMI" ))
84
84
iType = HDMI;
85
- else if (strcmp (sType .c_str (), " COMPOSITE" ) == 0 )
85
+ else if (0 == strcmp (sType .c_str (), " COMPOSITE" ))
86
86
iType = COMPOSITE;
87
87
else
88
88
throw " Invalide type of INPUT, please specify HDMI/COMPOSITE" ;
@@ -131,15 +131,15 @@ const string AVInput::Initialize(PluginHost::IShell * /* service */)
131
131
LOGINFO (" device::Manager::Initialize success" );
132
132
if (!_registeredDsEventHandlers) {
133
133
_registeredDsEventHandlers = true ;
134
- device::Host::getInstance ().Register (baseInterface<device::Host::IHdmiInEvents>(), " WPE::HdmiInEvents " );
135
- device::Host::getInstance ().Register (baseInterface<device::Host::ICompositeInEvents>(), " WPE::CompositeInEvents " );
134
+ device::Host::getInstance ().Register (baseInterface<device::Host::IHdmiInEvents>(), " WPE::AVInputHdmi " );
135
+ device::Host::getInstance ().Register (baseInterface<device::Host::ICompositeInEvents>(), " WPE::AVInputComp " );
136
136
}
137
137
}
138
138
catch (const device::Exception& err)
139
139
{
140
140
LOGINFO (" device::Manager::Initialize failed" );
141
141
LOG_DEVICE_EXCEPTION0 ();
142
- return std::string (" AVInput: Initialization failed" );
142
+ return std::string (" AVInput: Initialization failed due to device::manager::Initialize() " );
143
143
}
144
144
145
145
return (string ());
@@ -152,15 +152,15 @@ void AVInput::Deinitialize(PluginHost::IShell * /* service */)
152
152
device::Host::getInstance ().UnRegister (baseInterface<device::Host::ICompositeInEvents>());
153
153
_registeredDsEventHandlers = false ;
154
154
try
155
- {
156
- device::Manager::DeInitialize ();
157
- LOGINFO (" device::Manager::DeInitialize success" );
158
- }
155
+ {
156
+ device::Manager::DeInitialize ();
157
+ LOGINFO (" device::Manager::DeInitialize success" );
158
+ }
159
159
catch (const device::Exception& err)
160
- {
161
- LOGINFO (" device::Manager::DeInitialize failed" );
162
- LOG_DEVICE_EXCEPTION0 ();
163
- }
160
+ {
161
+ LOGINFO (" device::Manager::DeInitialize failed due to device::Manager::DeInitialize() " );
162
+ LOG_DEVICE_EXCEPTION0 ();
163
+ }
164
164
165
165
AVInput::_instance = nullptr ;
166
166
}
@@ -342,7 +342,7 @@ uint32_t AVInput::startInput(const JsonObject& parameters, JsonObject& response)
342
342
343
343
try
344
344
{
345
- if (iType == HDMI ) {
345
+ if (HDMI == iType ) {
346
346
device::HdmiInput::getInstance ().selectPort (portId,audioMix,planeType,topMostPlane);
347
347
}
348
348
else if (iType == COMPOSITE) {
@@ -383,10 +383,10 @@ uint32_t AVInput::stopInput(const JsonObject& parameters, JsonObject& response)
383
383
device::Host::getInstance ().setAudioMixerLevels (dsAUDIO_INPUT_SYSTEM,DEFAULT_INPUT_VOL_LEVEL);
384
384
isAudioBalanceSet = false ;
385
385
}
386
- if (iType == HDMI ) {
386
+ if (HDMI == iType ) {
387
387
device::HdmiInput::getInstance ().selectPort (-1 );
388
388
}
389
- else if (iType == COMPOSITE ) {
389
+ else if (COMPOSITE == iType ) {
390
390
device::CompositeInput::getInstance ().selectPort (-1 );
391
391
}
392
392
}
@@ -464,7 +464,7 @@ bool AVInput::setVideoRectangle(int x, int y, int width, int height, int type)
464
464
465
465
try
466
466
{
467
- if (type == HDMI ) {
467
+ if (HDMI == type ) {
468
468
device::HdmiInput::getInstance ().scaleVideo (x, y, width, height);
469
469
}
470
470
else {
@@ -554,7 +554,7 @@ JsonArray AVInput::getInputDevices(int iType)
554
554
try
555
555
{
556
556
int num = 0 ;
557
- if (iType == HDMI ) {
557
+ if (HDMI == iType ) {
558
558
num = device::HdmiInput::getInstance ().getNumberOfInputs ();
559
559
}
560
560
else if (iType == COMPOSITE) {
@@ -567,11 +567,11 @@ JsonArray AVInput::getInputDevices(int iType)
567
567
JsonObject hash;
568
568
hash[" id" ] = i;
569
569
std::stringstream locator;
570
- if (iType == HDMI ) {
570
+ if (HDMI == iType ) {
571
571
locator << " hdmiin://localhost/deviceid/" << i;
572
572
hash[" connected" ] = device::HdmiInput::getInstance ().isPortConnected (i);
573
573
}
574
- else if (iType == COMPOSITE ) {
574
+ else if (COMPOSITE == iType ) {
575
575
locator << " cvbsin://localhost/deviceid/" << i;
576
576
hash[" connected" ] = device::CompositeInput::getInstance ().isPortConnected (i);
577
577
}
@@ -1661,7 +1661,7 @@ void AVInput::OnHdmiInVRRStatus(dsHdmiInPort_t port, dsVRRType_t vrrType)
1661
1661
return ;
1662
1662
1663
1663
// Handle transitions
1664
- if (vrrType == dsVRR_NONE ) {
1664
+ if (dsVRR_NONE == vrrType ) {
1665
1665
if (AVInput::_instance->m_currentVrrType != dsVRR_NONE) {
1666
1666
AVInput::_instance->AVInputVRRChange (port,AVInput::_instance->m_currentVrrType ,false );
1667
1667
}
0 commit comments