From ccc5d43b9991e0b5d74e3f446bc1b4054ab76f7a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 19 May 2018 18:34:26 +0200 Subject: [PATCH 1/2] add av input switch in deep/standby Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f182216d9437167a8c9ada68ab2f89359d31e508 Author: Jacek Jendrzej Date: 2018-05-19 (Sat, 19 May 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index b7cf3c2..2af8e7b 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -301,6 +301,19 @@ int image_to_mpeg2(const char *image_name, int fd) 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) { lt_debug("%s unit %u\n", __func__, unit); @@ -323,6 +336,8 @@ cVideo::cVideo(int, void *, void *, unsigned int unit) cVideo::~cVideo(void) { + if(fd >= 0) + setAVInput(1); if (standby_cec_activ && fd >= 0) SetCECState(true); @@ -619,10 +634,14 @@ void cVideo::Standby(unsigned int bOn) if (bOn) { closeDevice(); + if(fd < 0) + setAVInput(1); } else { openDevice(); + if(fd >= 0) + setAVInput(0); } video_standby = bOn; SetCECState(video_standby); From 3ea20a98cab46b002e27ef18ea42901ab6b1cce1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 19 May 2018 19:21:22 +0200 Subject: [PATCH 2/2] use enum for setAVInput Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5a2865d01c8d131cca43e4fe599072d5a4c04bf6 Author: Jacek Jendrzej Date: 2018-05-19 (Sat, 19 May 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 2af8e7b..12e542a 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -300,12 +300,9 @@ int image_to_mpeg2(const char *image_name, int fd) av_free(formatContext); return ret; } - +enum{ENCODER,AUX}; 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"}; @@ -337,7 +334,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit) cVideo::~cVideo(void) { if(fd >= 0) - setAVInput(1); + setAVInput(AUX); if (standby_cec_activ && fd >= 0) SetCECState(true); @@ -634,14 +631,12 @@ void cVideo::Standby(unsigned int bOn) if (bOn) { closeDevice(); - if(fd < 0) - setAVInput(1); + setAVInput(AUX); } else { openDevice(); - if(fd >= 0) - setAVInput(0); + setAVInput(ENCODER); } video_standby = bOn; SetCECState(video_standby);