From e41cbd8e4f84ce4ef23095e7eaba9c885922ba92 Mon Sep 17 00:00:00 2001 From: Ronny Strutz Date: Mon, 14 Nov 2005 02:50:47 +0000 Subject: [PATCH] add setInput() --- lib/driver/avswitch.cpp | 21 +++++++++++++++++++++ lib/driver/avswitch.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp index 80c7755b..5038ee53 100644 --- a/lib/driver/avswitch.cpp +++ b/lib/driver/avswitch.cpp @@ -26,6 +26,27 @@ eAVSwitch *eAVSwitch::getInstance() return instance; } +void eAVSwitch::setInput(int val) +{ + /* + 0-encoder + 1-scart + 2-aux + */ + + char *input[] = {"encoder", "scart", "aux"}; + + int fd; + + if((fd = open("/proc/stb/avs/0/input", O_WRONLY)) < 0) { + printf("cannot open /proc/stb/avs/0/input\n"); + return; + } + + write(fd, input[val], strlen(input[val])); + close(fd); +} + void eAVSwitch::setColorFormat(int format) { /* diff --git a/lib/driver/avswitch.h b/lib/driver/avswitch.h index 15794882..ec7d5c13 100644 --- a/lib/driver/avswitch.h +++ b/lib/driver/avswitch.h @@ -15,6 +15,8 @@ public: void setColorFormat(int format); void setAspectRatio(int ratio); void setVideomode(int mode); + void setInput(int val); + }; #endif -- 2.30.2