nhttpd:controlapi: add aspectratio to API again

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@477 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
yjogol
2010-03-13 07:44:07 +00:00
parent 4c8c4fc0a0
commit e8e50a84f2
6 changed files with 45 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ INCLUDES = \
-I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/libeventserver \
-I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/libconfigfile \
-I$(top_srcdir)/lib/xmltree \ -I$(top_srcdir)/lib/xmltree \
-I$(top_srcdir)/lib/libcoolstream \
@FREETYPE_CFLAGS@ @FREETYPE_CFLAGS@
noinst_LIBRARIES = libnhttpd_tuxboxapi.a noinst_LIBRARIES = libnhttpd_tuxboxapi.a

View File

@@ -170,6 +170,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
{"exec", &CControlAPI::ExecCGI, "+xml"}, {"exec", &CControlAPI::ExecCGI, "+xml"},
{"yweb", &CControlAPI::YWebCGI, "text/plain"}, {"yweb", &CControlAPI::YWebCGI, "text/plain"},
// video handling // video handling
{"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"},
{"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"}, {"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"},
{"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"}, {"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"},
{"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"}, {"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"},
@@ -701,10 +702,16 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) {
hh->SendOk(); hh->SendOk();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CControlAPI::AspectRatioCGI(CyhookHandler *hh)
{
hh->printf("%s",(NeutrinoAPI->getVideoAspectRatioAsString()).c_str());
}
//-----------------------------------------------------------------------------
void CControlAPI::VideoFormatCGI(CyhookHandler *hh) void CControlAPI::VideoFormatCGI(CyhookHandler *hh)
{ {
// FIXME: not implemented // FIXME: not implemented
hh->SendOk(); hh->printf("Videoformat:%s\n",(NeutrinoAPI->getVideoAspectRatioAsString()).c_str());
// hh->SendOk();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -78,6 +78,7 @@ private:
void YWebCGI(CyhookHandler *hh); void YWebCGI(CyhookHandler *hh);
void RebootCGI(CyhookHandler *hh); void RebootCGI(CyhookHandler *hh);
void RCEmCGI(CyhookHandler *hh); void RCEmCGI(CyhookHandler *hh);
void AspectRatioCGI(CyhookHandler *hh);
void VideoFormatCGI(CyhookHandler *hh); void VideoFormatCGI(CyhookHandler *hh);
void VideoOutputCGI(CyhookHandler *hh); void VideoOutputCGI(CyhookHandler *hh);
void VCROutputCGI(CyhookHandler *hh); void VCROutputCGI(CyhookHandler *hh);

View File

@@ -19,12 +19,32 @@
// tuxbox // tuxbox
#include <neutrinoMessages.h> #include <neutrinoMessages.h>
#include <global.h>
#include <neutrino.h>
#include <driver/fontrenderer.h>
#include <driver/rcinput.h>
#include <driver/screen_max.h>
#include <gui/color.h>
#include <gui/widget/icons.h>
#include <gui/customcolor.h>
#include <daemonc/remotecontrol.h>
#include <zapit/frontend_c.h>
#include <video_cs.h>
#include <audio_cs.h>
#include <dmx_cs.h>
#include <zapit/satconfig.h>
#include <zapit/client/zapitclient.h> #include <zapit/client/zapitclient.h>
#include <zapit/channel.h> #include <zapit/channel.h>
#include <zapit/bouquets.h> #include <zapit/bouquets.h>
extern tallchans allchans; extern tallchans allchans;
extern CBouquetManager *g_bouquetManager; extern CBouquetManager *g_bouquetManager;
extern CFrontend * frontend;
extern cVideo * videoDecoder;
extern cAudio * audioDecoder;
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern CZapitClient::SatelliteList satList;
// yhttpd // yhttpd
#include "ylogging.h" #include "ylogging.h"
@@ -38,7 +58,7 @@ void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = t
// No Class Helpers // No Class Helpers
//============================================================================= //=============================================================================
static std::map<std::string, std::string> iso639; //static std::map<std::string, std::string> iso639;
#ifndef initialize_iso639_map #ifndef initialize_iso639_map
bool _initialize_iso639_map(void) bool _initialize_iso639_map(void)
{ {
@@ -77,7 +97,7 @@ const char * _getISO639Description(const char * const iso)
//============================================================================= //=============================================================================
std::string CNeutrinoAPI::Dbox_Hersteller[4] = {"none", "Nokia", "Philips", "Sagem"}; std::string CNeutrinoAPI::Dbox_Hersteller[4] = {"none", "Nokia", "Philips", "Sagem"};
std::string CNeutrinoAPI::videooutput_names[5] = {"CVBS", "RGB with CVBS", "S-Video", "YUV with VBS", "YUV with CVBS"}; std::string CNeutrinoAPI::videooutput_names[5] = {"CVBS", "RGB with CVBS", "S-Video", "YUV with VBS", "YUV with CVBS"};
std::string CNeutrinoAPI::videoformat_names[4] = {"automatic", "16:9", "4:3 (LB)", "4:3 (PS)"}; std::string CNeutrinoAPI::videoformat_names[5] = {"automatic", "4:3", "14:9", "16:9", "20:9"};
std::string CNeutrinoAPI::audiotype_names[5] = {"none", "single channel","dual channel","joint stereo","stereo"}; std::string CNeutrinoAPI::audiotype_names[5] = {"none", "single channel","dual channel","joint stereo","stereo"};
//============================================================================= //=============================================================================
@@ -385,3 +405,12 @@ std::string CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep)
return result; return result;
} }
//-------------------------------------------------------------------------
std::string CNeutrinoAPI::getVideoAspectRatioAsString() {
int aspectRatio = videoDecoder->getAspectRatio();
if (aspectRatio >= 0 && aspectRatio <= 4)
return videoformat_names[aspectRatio];
else
return "unknown";
}

View File

@@ -46,7 +46,7 @@ class CNeutrinoAPI
// some constants // some constants
static std::string Dbox_Hersteller[4]; static std::string Dbox_Hersteller[4];
static std::string videooutput_names[5]; static std::string videooutput_names[5];
static std::string videoformat_names[4]; static std::string videoformat_names[5];
static std::string audiotype_names[5]; static std::string audiotype_names[5];
// get functions to collect data // get functions to collect data
@@ -68,7 +68,7 @@ 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();
public: public:
CNeutrinoAPI(); CNeutrinoAPI();
~CNeutrinoAPI(void); ~CNeutrinoAPI(void);

View File

@@ -679,13 +679,7 @@ std::string CNeutrinoYParser::func_get_current_stream_info(CyhookHandler *hh, s
hh->ParamList["VideoFormat"] = string_printf("%d x %d", bitInfo[0], bitInfo[1] ); hh->ParamList["VideoFormat"] = string_printf("%d x %d", bitInfo[0], bitInfo[1] );
hh->ParamList["BitRate"] = string_printf("%d\n", bitInfo[4]*50); hh->ParamList["BitRate"] = string_printf("%d\n", bitInfo[4]*50);
switch ( bitInfo[2] ) //format hh->ParamList["AspectRatio"] = NeutrinoAPI->getVideoAspectRatioAsString();
{
case 2: hh->ParamList["AspectRatio"] = "4:3"; break;
case 3: hh->ParamList["AspectRatio"] = "16:9"; break;
case 4: hh->ParamList["AspectRatio"] = "2.21:1"; break;
default: hh->ParamList["AspectRatio"]= "unknown"; break;
}
switch ( bitInfo[3] ) //fps switch ( bitInfo[3] ) //fps
{ {