From 99b15a27b5d094adbee82358b106fa76ea611e3c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 19 Oct 2017 21:39:55 +0200 Subject: [PATCH 1/3] armbox: improve cec Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0b69bc17f90f165c148a2613a3fe1f0ab4f93bae Author: TangoCash Date: 2017-10-19 (Thu, 19 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 18 ++++++++++++++++-- libarmbox/video_lib.h | 5 ++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index f5f0964..7e62f5b 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -161,6 +161,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit) } else devnum = unit; fd = -1; + hdmiFd = -1; standby_cec_activ = autoview_cec_activ = false; openDevice(); } @@ -815,9 +816,21 @@ bool cVideo::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType) physicalAddress[0] = 0x10; physicalAddress[1] = 0x00; logicalAddress = 1; - deviceType = 1; /* default: recorder */ + + if (_deviceType == VIDEO_HDMI_CEC_MODE_OFF) + { + if (hdmiFd >= 0) { + close hdmiFd; + hdmiFd = -1; + } + return false; + } + else + deviceType = _deviceType; + + if (hdmiFd == -1) + hdmiFd = open("/dev/cec0", O_RDWR | O_CLOEXEC); - hdmiFd = open("/dev/cec0", O_RDWR | O_CLOEXEC); if (hdmiFd >= 0) { __u32 monitor = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER; @@ -891,6 +904,7 @@ bool cVideo::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType) GetCECAddressInfo(); + return true; } void cVideo::GetCECAddressInfo() diff --git a/libarmbox/video_lib.h b/libarmbox/video_lib.h index 2090ab5..15224bc 100644 --- a/libarmbox/video_lib.h +++ b/libarmbox/video_lib.h @@ -118,11 +118,10 @@ typedef enum { VIDEO_STD_MAX = VIDEO_STD_AUTO } VIDEO_STD; -/* not used, for dummy functions */ typedef enum { VIDEO_HDMI_CEC_MODE_OFF = 0, - VIDEO_HDMI_CEC_MODE_TUNER, - VIDEO_HDMI_CEC_MODE_RECORDER + VIDEO_HDMI_CEC_MODE_TUNER = 3, + VIDEO_HDMI_CEC_MODE_RECORDER = 1 } VIDEO_HDMI_CEC_MODE; typedef enum From fb28448d769f4e78c931a7d28599ed430adf61ba Mon Sep 17 00:00:00 2001 From: TangoCash Date: Thu, 19 Oct 2017 21:42:11 +0200 Subject: [PATCH 2/3] fix typo Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/36cc88ad7e37e332cf517f2a0b3bbb1b8d10ae39 Author: TangoCash Date: 2017-10-19 (Thu, 19 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 7e62f5b..ed5b3a1 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -820,7 +820,7 @@ bool cVideo::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType) if (_deviceType == VIDEO_HDMI_CEC_MODE_OFF) { if (hdmiFd >= 0) { - close hdmiFd; + close(hdmiFd); hdmiFd = -1; } return false; From dec022b20c93b3bea700862091cc6387443c862f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 20 Oct 2017 19:21:41 +0200 Subject: [PATCH 3/3] rmove unused code Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5ae1ba0530c1db3994eecb297c918fdcb9854817 Author: Jacek Jendrzej Date: 2017-10-20 (Fri, 20 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 84baf20..b8cd307 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -462,7 +462,6 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, mAudioStream = 0; //create playback path - char file[400] = {""}; bool isHTTP = false; if(!strncmp("http://", filename, 7)) @@ -493,10 +492,6 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, { isHTTP = true; } - else - strcat(file, "file://"); - - strcat(file, filename); if (isHTTP) uri = g_uri_escape_string(filename, G_URI_RESERVED_CHARS_GENERIC_DELIMITERS, true);