mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
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:
@@ -11,6 +11,7 @@ INCLUDES = \
|
||||
-I$(top_srcdir)/lib/libeventserver \
|
||||
-I$(top_srcdir)/lib/libconfigfile \
|
||||
-I$(top_srcdir)/lib/xmltree \
|
||||
-I$(top_srcdir)/lib/libcoolstream \
|
||||
@FREETYPE_CFLAGS@
|
||||
|
||||
noinst_LIBRARIES = libnhttpd_tuxboxapi.a
|
||||
|
@@ -170,6 +170,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
{"exec", &CControlAPI::ExecCGI, "+xml"},
|
||||
{"yweb", &CControlAPI::YWebCGI, "text/plain"},
|
||||
// video handling
|
||||
{"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"},
|
||||
{"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"},
|
||||
{"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"},
|
||||
{"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"},
|
||||
@@ -701,10 +702,16 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) {
|
||||
hh->SendOk();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void CControlAPI::AspectRatioCGI(CyhookHandler *hh)
|
||||
{
|
||||
hh->printf("%s",(NeutrinoAPI->getVideoAspectRatioAsString()).c_str());
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void CControlAPI::VideoFormatCGI(CyhookHandler *hh)
|
||||
{
|
||||
// FIXME: not implemented
|
||||
hh->SendOk();
|
||||
hh->printf("Videoformat:%s\n",(NeutrinoAPI->getVideoAspectRatioAsString()).c_str());
|
||||
// hh->SendOk();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -78,6 +78,7 @@ private:
|
||||
void YWebCGI(CyhookHandler *hh);
|
||||
void RebootCGI(CyhookHandler *hh);
|
||||
void RCEmCGI(CyhookHandler *hh);
|
||||
void AspectRatioCGI(CyhookHandler *hh);
|
||||
void VideoFormatCGI(CyhookHandler *hh);
|
||||
void VideoOutputCGI(CyhookHandler *hh);
|
||||
void VCROutputCGI(CyhookHandler *hh);
|
||||
|
@@ -19,12 +19,32 @@
|
||||
|
||||
// tuxbox
|
||||
#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/channel.h>
|
||||
#include <zapit/bouquets.h>
|
||||
|
||||
extern tallchans allchans;
|
||||
extern CBouquetManager *g_bouquetManager;
|
||||
extern CFrontend * frontend;
|
||||
extern cVideo * videoDecoder;
|
||||
extern cAudio * audioDecoder;
|
||||
|
||||
extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
|
||||
extern CZapitClient::SatelliteList satList;
|
||||
|
||||
// yhttpd
|
||||
#include "ylogging.h"
|
||||
@@ -38,7 +58,7 @@ void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = t
|
||||
// No Class Helpers
|
||||
//=============================================================================
|
||||
|
||||
static std::map<std::string, std::string> iso639;
|
||||
//static std::map<std::string, std::string> iso639;
|
||||
#ifndef initialize_iso639_map
|
||||
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::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"};
|
||||
|
||||
//=============================================================================
|
||||
@@ -385,3 +405,12 @@ std::string CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep)
|
||||
return result;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
std::string CNeutrinoAPI::getVideoAspectRatioAsString() {
|
||||
int aspectRatio = videoDecoder->getAspectRatio();
|
||||
if (aspectRatio >= 0 && aspectRatio <= 4)
|
||||
return videoformat_names[aspectRatio];
|
||||
else
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
|
@@ -46,7 +46,7 @@ class CNeutrinoAPI
|
||||
// some constants
|
||||
static std::string Dbox_Hersteller[4];
|
||||
static std::string videooutput_names[5];
|
||||
static std::string videoformat_names[4];
|
||||
static std::string videoformat_names[5];
|
||||
static std::string audiotype_names[5];
|
||||
|
||||
// get functions to collect data
|
||||
@@ -68,7 +68,7 @@ class CNeutrinoAPI
|
||||
|
||||
std::string timerEventType2Str(CTimerd::CTimerEventTypes type);
|
||||
std::string timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep);
|
||||
|
||||
std::string getVideoAspectRatioAsString();
|
||||
public:
|
||||
CNeutrinoAPI();
|
||||
~CNeutrinoAPI(void);
|
||||
|
@@ -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["BitRate"] = string_printf("%d\n", bitInfo[4]*50);
|
||||
|
||||
switch ( bitInfo[2] ) //format
|
||||
{
|
||||
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;
|
||||
}
|
||||
hh->ParamList["AspectRatio"] = NeutrinoAPI->getVideoAspectRatioAsString();
|
||||
|
||||
switch ( bitInfo[3] ) //fps
|
||||
{
|
||||
|
Reference in New Issue
Block a user