diff --git a/src/neutrino.h b/src/neutrino.h index 2b875ab53..7be01b0df 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -187,6 +187,7 @@ public: int getLastMode() { return lastMode; } + int getVideoFormat() { return g_settings.video_Format; } void switchTvRadioMode(const int prev_mode = NeutrinoModes::mode_unknown); void switchInfoIconsOnOff(); //NI diff --git a/src/zapit/include/zapit/client/msgtypes.h b/src/zapit/include/zapit/client/msgtypes.h index 28da45cae..c457ce31b 100644 --- a/src/zapit/include/zapit/client/msgtypes.h +++ b/src/zapit/include/zapit/client/msgtypes.h @@ -150,9 +150,10 @@ class CZapitMessages CMD_SET_ASPECTRATIO = 110, CMD_GET_MODE43 = 111, CMD_SET_MODE43 = 112, - CMD_STOP_PIP = 113, - CMD_ZAPTO_EPG = 114, - CMD_LOCKRC = 115 + CMD_GET_VIDEO_FORMAT = 113, + CMD_STOP_PIP = 114, + CMD_ZAPTO_EPG = 115, + CMD_LOCKRC = 116 }; struct commandBoolean diff --git a/src/zapit/include/zapit/client/zapitclient.h b/src/zapit/include/zapit/client/zapitclient.h index 84368c402..0b24e6ca6 100644 --- a/src/zapit/include/zapit/client/zapitclient.h +++ b/src/zapit/include/zapit/client/zapitclient.h @@ -512,6 +512,7 @@ class CZapitClient:public CBasicClient void setAspectRatio(int ratio); void getMode43(int *m43); void setMode43(int m43); + void getVideoFormat(int *vf); /****************************************/ /* */ diff --git a/src/zapit/lib/zapitclient.cpp b/src/zapit/lib/zapitclient.cpp index fbc567d20..1f1acfde5 100644 --- a/src/zapit/lib/zapitclient.cpp +++ b/src/zapit/lib/zapitclient.cpp @@ -1302,6 +1302,17 @@ void CZapitClient::setMode43(int m43) close_connection(); } +void CZapitClient::getVideoFormat(int *vf) +{ + CZapitMessages::commandInt msg; + VALGRIND_PARANOIA; + OpenThreads::ScopedLock lock(mutex); + send(CZapitMessages::CMD_GET_VIDEO_FORMAT, 0, 0); + CBasicClient::receive_data((char* )&msg, sizeof(msg)); + * vf = msg.val; + close_connection(); +} + void CZapitClient::registerEvent(const unsigned int eventID, const unsigned int clientID, const char * const udsName) { CEventServer::commandRegisterEvent msg; diff --git a/src/zapit/src/pzapit.cpp b/src/zapit/src/pzapit.cpp index 1901ba983..4ff5abdd8 100644 --- a/src/zapit/src/pzapit.cpp +++ b/src/zapit/src/pzapit.cpp @@ -70,6 +70,7 @@ int usage (const char * basename) << "\t-var \tset aspect ratio" << std::endl << "\t-vm43\t\t\tget 4:3 mode" << std::endl << "\t-vm43 <4:3mode>\t\tset 4:3 mode" << std::endl + << "\t-vf\t\t\tget video format" << std::endl << "\t--1080\t\t\tswitch to hd 1080i mode" << std::endl << "\t--pal\t\t\tswitch to pal mode" << std::endl << "\t--720p\t\t\tswitch to hd 720p mode" << std::endl @@ -99,10 +100,11 @@ int main (int argc, char** argv) int mute = -1; int volume = -1; int nvod = -1; + int mosd = -1; int arat = -1; int m43 = -1; + int vf = -1; int lockrc = -1; - int mosd = -1; const char * channelName = NULL; bool playback = false; @@ -124,9 +126,10 @@ int main (int argc, char** argv) bool quiet = false; bool getchannel = false; bool getmode = false; + bool osd = false; bool aspectratio = false; bool mode43 = false; - bool osd = false; + bool videoformat = false; uint8_t motorCmdType = 0; uint8_t motorCmd = 0; uint8_t motorNumParameters = 0; @@ -286,6 +289,11 @@ int main (int argc, char** argv) } continue; } + else if (!strncmp(argv[i], "-vf", 3)) + { + videoformat = true; + continue; + } else if (!strncmp(argv[i], "-sb", 3)) { savebouquets = true; @@ -552,6 +560,13 @@ int main (int argc, char** argv) return 0; } + if (videoformat) + { + zapit.getVideoFormat(&vf); + printf("%d\n", vf); + return 0; + } + if (savebouquets) { zapit.saveBouquets(); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 680e2b4c1..a147361d0 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1878,6 +1878,13 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) break; } + case CZapitMessages::CMD_GET_VIDEO_FORMAT: { + CZapitMessages::commandInt msg; + msg.val = CNeutrinoApp::getInstance()->getVideoFormat(); + CBasicServer::send_data(connfd, &msg, sizeof(msg)); + break; + } + case CZapitMessages::CMD_GETPIDS: { if (current_channel) { CZapitClient::responseGetOtherPIDs responseGetOtherPIDs;