nhttpd:controlapi: activate videoformat to API again

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@478 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
yjogol
2010-03-13 08:10:06 +00:00
parent e8e50a84f2
commit f779a33337
3 changed files with 23 additions and 6 deletions

View File

@@ -709,9 +709,14 @@ void CControlAPI::AspectRatioCGI(CyhookHandler *hh)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CControlAPI::VideoFormatCGI(CyhookHandler *hh) void CControlAPI::VideoFormatCGI(CyhookHandler *hh)
{ {
// FIXME: not implemented if (hh->ParamList.empty() || hh->ParamList["1"] == "status") {
hh->printf("Videoformat:%s\n",(NeutrinoAPI->getVideoAspectRatioAsString()).c_str()); hh->printf("%s",(NeutrinoAPI->getVideoAspectRatioAsString()).c_str());
// hh->SendOk(); return;
}
if (NeutrinoAPI->setVideoAspectRatioAsString(hh->ParamList["1"]) != -1)
hh->SendOk();
else
hh->SendError();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -406,11 +406,22 @@ std::string CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep)
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
std::string CNeutrinoAPI::getVideoAspectRatioAsString() { std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) {
int aspectRatio = videoDecoder->getAspectRatio(); int aspectRatio = videoDecoder->getAspectRatio();
if (aspectRatio >= 0 && aspectRatio <= 4) if (aspectRatio >= 0 && aspectRatio <= 4)
return videoformat_names[aspectRatio]; return videoformat_names[aspectRatio];
else else
return "unknown"; return "unknown";
} }
//-------------------------------------------------------------------------
int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) {
int newRatioInt = -1;
for(int i=0;i<sizeof(videoformat_names);i++)
if( videoformat_names[i] == newRatioString){
newRatioInt = i;
break;
}
if(newRatioInt != -1)
videoDecoder->setAspectRatio(newRatioInt, -1);
return newRatioInt;
}

View File

@@ -68,7 +68,8 @@ class CNeutrinoAPI
std::string timerEventType2Str(CTimerd::CTimerEventTypes type); std::string timerEventType2Str(CTimerd::CTimerEventTypes type);
std::string timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep); std::string timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep);
std::string getVideoAspectRatioAsString(); std::string getVideoAspectRatioAsString(void);
int setVideoAspectRatioAsString(std::string newRatioString);
public: public:
CNeutrinoAPI(); CNeutrinoAPI();
~CNeutrinoAPI(void); ~CNeutrinoAPI(void);