mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
add av input switch in deep/standby
This commit is contained in:
@@ -301,6 +301,19 @@ int image_to_mpeg2(const char *image_name, int fd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setAVInput(int val)
|
||||||
|
{
|
||||||
|
if (val != 0 && val != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int input_fd = open("/proc/stb/avs/0/input", O_WRONLY);
|
||||||
|
if(input_fd){
|
||||||
|
const char *input[] = {"encoder", "aux"};
|
||||||
|
write(input_fd, input[val], strlen(input[val]));
|
||||||
|
close(input_fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cVideo::cVideo(int, void *, void *, unsigned int unit)
|
cVideo::cVideo(int, void *, void *, unsigned int unit)
|
||||||
{
|
{
|
||||||
lt_debug("%s unit %u\n", __func__, unit);
|
lt_debug("%s unit %u\n", __func__, unit);
|
||||||
@@ -323,6 +336,8 @@ cVideo::cVideo(int, void *, void *, unsigned int unit)
|
|||||||
|
|
||||||
cVideo::~cVideo(void)
|
cVideo::~cVideo(void)
|
||||||
{
|
{
|
||||||
|
if(fd >= 0)
|
||||||
|
setAVInput(1);
|
||||||
if (standby_cec_activ && fd >= 0)
|
if (standby_cec_activ && fd >= 0)
|
||||||
SetCECState(true);
|
SetCECState(true);
|
||||||
|
|
||||||
@@ -619,10 +634,14 @@ void cVideo::Standby(unsigned int bOn)
|
|||||||
if (bOn)
|
if (bOn)
|
||||||
{
|
{
|
||||||
closeDevice();
|
closeDevice();
|
||||||
|
if(fd < 0)
|
||||||
|
setAVInput(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
openDevice();
|
openDevice();
|
||||||
|
if(fd >= 0)
|
||||||
|
setAVInput(0);
|
||||||
}
|
}
|
||||||
video_standby = bOn;
|
video_standby = bOn;
|
||||||
SetCECState(video_standby);
|
SetCECState(video_standby);
|
||||||
|
Reference in New Issue
Block a user