From 465d0482eaf7dc20b992642a1a5ac52704616abb Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 12 Mar 2019 21:59:42 +0100 Subject: [PATCH 1/5] ShowPicture: return boolean expression Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/90c3600026eadce445007644c6944644ca04c871 Author: GetAway Date: 2019-03-12 (Tue, 12 Mar 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 19 ++++++++++++++----- libarmbox/video_lib.h | 2 +- libazbox/video.cpp | 16 +++++++++------- libazbox/video_lib.h | 2 +- libgeneric-pc/video.cpp | 7 +++++-- libgeneric-pc/video_lib.h | 2 +- libraspi/video.cpp | 4 ++-- libraspi/video_lib.h | 2 +- libspark/video.cpp | 17 +++++++++++++---- libspark/video_lib.h | 2 +- libtriple/video_td.cpp | 8 +++++--- libtriple/video_td.h | 2 +- 12 files changed, 54 insertions(+), 29 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 3e3f7ca..445b185 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -632,18 +632,26 @@ void cVideo::SetVideoMode(analog_mode_t mode) proc_put("/proc/stb/avs/0/colorformat", m, strlen(m)); } -void cVideo::ShowPicture(const char * fname) +bool cVideo::ShowPicture(const char * fname) { - hal_info("%s(%s)\n", __func__, fname); + bool ret = false; + hal_debug("%s(%s)\n", __func__, fname); if (video_standby) { /* does not work and the driver does not seem to like it */ hal_info("%s: video_standby == true\n", __func__); - return; + return ret; } + /* in movieplayer mode, fd is not opened */ + if (fd == -1) + { + hal_info("%s: decoder not opened\n", __func__); + return ret; + } + struct stat st; if (stat(fname, &st)){ - return; + return ret; } closeDevice(); openDevice(); @@ -663,8 +671,9 @@ void cVideo::ShowPicture(const char * fname) usleep(150000); ioctl(fd, VIDEO_STOP, 0); ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX); + ret = true; } - return; + return ret; } void cVideo::StopPicture() diff --git a/libarmbox/video_lib.h b/libarmbox/video_lib.h index 636c3a2..2b5cd50 100644 --- a/libarmbox/video_lib.h +++ b/libarmbox/video_lib.h @@ -233,7 +233,7 @@ class cVideo bool SetCECMode(VIDEO_HDMI_CEC_MODE); void SetCECAutoView(bool); void SetCECAutoStandby(bool); - void ShowPicture(const char * fname); + bool ShowPicture(const char * fname); void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719); diff --git a/libazbox/video.cpp b/libazbox/video.cpp index f557f58..02d692a 100644 --- a/libazbox/video.cpp +++ b/libazbox/video.cpp @@ -321,8 +321,9 @@ void cVideo::SetVideoMode(analog_mode_t mode) proc_put("/proc/stb/avs/0/colorformat", m, strlen(m)); } -void cVideo::ShowPicture(const char * fname) +bool cVideo::ShowPicture(const char * fname) { + bool ret = false; hal_debug("%s(%s)\n", __func__, fname); char destname[512]; char cmd[512]; @@ -334,18 +335,18 @@ void cVideo::ShowPicture(const char * fname) { /* does not work and the driver does not seem to like it */ hal_info("%s: video_standby == true\n", __func__); - return; + return ret; } - if (fd < 0) + if (fd == -1) { - hal_info("%s: decoder not opened?\n", __func__); - return; + hal_info("%s: decoder not opened\n", __func__); + return ret; } strcpy(destname, "/var/cache"); if (stat(fname, &st2)) { hal_info("%s: could not stat %s (%m)\n", __func__, fname); - return; + return ret; } mkdir(destname, 0755); /* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg): @@ -395,10 +396,11 @@ void cVideo::ShowPicture(const char * fname) read(mfd, iframe, st.st_size); show_iframe(fd, iframe, st.st_size); free(iframe); + ret = true; out: close(mfd); pthread_mutex_unlock(&stillp_mutex); - return; + return ret; } void cVideo::StopPicture() diff --git a/libazbox/video_lib.h b/libazbox/video_lib.h index b6050f5..a17b863 100644 --- a/libazbox/video_lib.h +++ b/libazbox/video_lib.h @@ -175,7 +175,7 @@ class cVideo bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; void SetCECAutoStandby(bool) { return; }; - void ShowPicture(const char * fname); + bool ShowPicture(const char * fname); void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600); diff --git a/libgeneric-pc/video.cpp b/libgeneric-pc/video.cpp index 102ea7b..5e167ce 100644 --- a/libgeneric-pc/video.cpp +++ b/libgeneric-pc/video.cpp @@ -235,8 +235,9 @@ void cVideo::SetVideoMode(analog_mode_t) { } -void cVideo::ShowPicture(const char *fname) +bool cVideo::ShowPicture(const char *fname) { + bool ret = false; hal_info("%s(%s)\n", __func__, fname); if (access(fname, R_OK)) return; @@ -260,7 +261,7 @@ void cVideo::ShowPicture(const char *fname) if (avformat_open_input(&avfc, fname, NULL, NULL) < 0) { hal_info("%s: Could not open file %s\n", __func__, fname); - return; + return ret; } if (avformat_find_stream_info(avfc, NULL) < 0) { @@ -333,6 +334,7 @@ void cVideo::ShowPicture(const char *fname) buf_num--; } buf_m.unlock(); + ret = true; } } av_packet_unref(&avpkt); @@ -344,6 +346,7 @@ void cVideo::ShowPicture(const char *fname) out_close: avformat_close_input(&avfc); hal_debug("%s(%s) end\n", __func__, fname); + return ret; } void cVideo::StopPicture() diff --git a/libgeneric-pc/video_lib.h b/libgeneric-pc/video_lib.h index 8201f7c..de6c012 100644 --- a/libgeneric-pc/video_lib.h +++ b/libgeneric-pc/video_lib.h @@ -180,7 +180,7 @@ class cVideo : public OpenThreads::Thread bool Pause(void); int SetStreamType(VIDEO_FORMAT type); - void ShowPicture(const char * fname); + bool ShowPicture(const char * fname); void SetSyncMode(AVSYNC_TYPE mode); bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; diff --git a/libraspi/video.cpp b/libraspi/video.cpp index 7aa8f4c..0cda7dd 100644 --- a/libraspi/video.cpp +++ b/libraspi/video.cpp @@ -125,11 +125,11 @@ void cVideo::SetVideoMode(analog_mode_t) { } -void cVideo::ShowPicture(const char *fname) +bool cVideo::ShowPicture(const char *fname) { hal_info("%s(%s)\n", __func__, fname); if (access(fname, R_OK)) - return; + return true; } void cVideo::StopPicture() diff --git a/libraspi/video_lib.h b/libraspi/video_lib.h index e70c343..cc23a06 100644 --- a/libraspi/video_lib.h +++ b/libraspi/video_lib.h @@ -180,7 +180,7 @@ class cVideo bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; void SetCECAutoStandby(bool) { return; }; - void ShowPicture(const char * fname); + bool ShowPicture(const char * fname); void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600); diff --git a/libspark/video.cpp b/libspark/video.cpp index eaf6927..ff1104b 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -564,8 +564,9 @@ void cVideo::SetVideoMode(analog_mode_t mode) proc_put("/proc/stb/avs/0/colorformat", m, strlen(m)); } -void cVideo::ShowPicture(const char * fname, const char *_destname) +bool cVideo::ShowPicture(const char * fname, const char *_destname) { + bool ret = false; hal_debug("%s(%s)\n", __func__, fname); //static const unsigned char pes_header[] = { 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x80, 0x00, 0x00 }; static const unsigned char pes_header[] = {0x0, 0x0, 0x1, 0xe0, 0x00, 0x00, 0x80, 0x80, 0x5, 0x21, 0x0, 0x1, 0x0, 0x1}; @@ -578,8 +579,15 @@ void cVideo::ShowPicture(const char * fname, const char *_destname) { /* does not work and the driver does not seem to like it */ hal_info("%s: video_standby == true\n", __func__); - return; + return ret; } + if (fd == -1) + { + /* in movieplayer mode, fd is not opened */ + hal_info("%s: decoder not opened\n", __func__); + return ret; + } + const char *lastDot = strrchr(fname, '.'); if (lastDot && !strcasecmp(lastDot + 1, "m2v")) strncpy(destname, fname, sizeof(destname)); @@ -591,7 +599,7 @@ void cVideo::ShowPicture(const char * fname, const char *_destname) if (stat(fname, &st2)) { hal_info("%s: could not stat %s (%m)\n", __func__, fname); - return; + return ret; } mkdir(destname, 0755); /* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg): @@ -657,10 +665,11 @@ void cVideo::ShowPicture(const char * fname, const char *_destname) write(fd, iframe, 8192); ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX); free(iframe); + ret = true; } out: close(mfd); - return; + return ret; } void cVideo::StopPicture() diff --git a/libspark/video_lib.h b/libspark/video_lib.h index 278b88e..d77415c 100644 --- a/libspark/video_lib.h +++ b/libspark/video_lib.h @@ -199,7 +199,7 @@ class cVideo bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; void SetCECAutoStandby(bool) { return; }; - void ShowPicture(const char * fname, const char *_destname = NULL); + bool ShowPicture(const char * fname, const char *_destname = NULL); void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719); diff --git a/libtriple/video_td.cpp b/libtriple/video_td.cpp index 33f1fc4..72e7e79 100644 --- a/libtriple/video_td.cpp +++ b/libtriple/video_td.cpp @@ -389,8 +389,9 @@ void cVideo::SetVideoMode(analog_mode_t mode) fop(ioctl, MPEG_VID_SET_OUTFMT, outputformat); } -void cVideo::ShowPicture(const char * fname) +bool cVideo::ShowPicture(const char * fname) { + bool ret = false; hal_debug("%s(%s)\n", __FUNCTION__, fname); char destname[512]; char cmd[512]; @@ -402,7 +403,7 @@ void cVideo::ShowPicture(const char * fname) if (stat(fname, &st2)) { hal_info("%s: could not stat %s (%m)\n", __func__, fname); - return; + return ret; } mkdir(destname, 0755); /* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg): @@ -451,13 +452,14 @@ void cVideo::ShowPicture(const char * fname) buf.ulStartAdrOff = (int)data; Stop(false); fop(ioctl, MPEG_VID_STILLP_WRITE, &buf); + ret = true; } free(data); } close(mfd); out: pthread_mutex_unlock(&stillp_mutex); - return; + return ret; #if 0 /* DirectFB based picviewer: works, but is slow and the infobar draws in the same plane */ diff --git a/libtriple/video_td.h b/libtriple/video_td.h index b9b7921..4c0e032 100644 --- a/libtriple/video_td.h +++ b/libtriple/video_td.h @@ -172,7 +172,7 @@ class cVideo bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; void SetCECAutoView(bool) { return; }; void SetCECAutoStandby(bool) { return; }; - void ShowPicture(const char * fname); + bool ShowPicture(const char * fname); void StopPicture(); void Standby(unsigned int bOn); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600); From 4f1bf66804ebef650711c196b5bd37146f170e2f Mon Sep 17 00:00:00 2001 From: GetAway Date: Tue, 12 Mar 2019 21:59:42 +0100 Subject: [PATCH 2/5] arm: fix black screen in channel swiching this fixes wrong commit e20d1913 Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/a94547e7a37aaa815491a1a1517fb2af6cc6bf40 Author: GetAway Date: 2019-03-12 (Tue, 12 Mar 2019) ------------------ 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 445b185..0cf60bb 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -927,7 +927,7 @@ void cVideo::SetControl(int control, int value) case VIDEO_CONTROL_ZAPPING_MODE: zapping_mode = value; const char *mode_zapping[] = { "hold", "mute" }; - proc_put("/proc/stb/video/zapping_mode", mode_zapping[zapping_mode], strlen(mode_zapping[zapping_mode])); + proc_put("/proc/stb/video/zapmode", mode_zapping[zapping_mode], strlen(mode_zapping[zapping_mode])); break; } if (p) { From 45aa6b0d6f0c078137c067cea755e7e978d3c402 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 12 Mar 2019 22:03:14 +0100 Subject: [PATCH 3/5] libazbox/video.cpp: fix wrong brackets Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/1b0bc23265ac8212c9d141a70cd2bd9a4e88f14c Author: vanhofen Date: 2019-03-12 (Tue, 12 Mar 2019) Origin message was: ------------------ - libazbox/video.cpp: fix wrong brackets ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libazbox/video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libazbox/video.cpp b/libazbox/video.cpp index 02d692a..9f9f9cf 100644 --- a/libazbox/video.cpp +++ b/libazbox/video.cpp @@ -160,7 +160,7 @@ int cVideo::setAspectRatio(int aspect, int mode) int n; int mo = (mode < 0||mode > 3) ? 4 : mode; - hal_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mo]); + hal_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mo)]); if (aspect > 3 || aspect == 0) hal_info("%s: invalid aspect: %d\n", __func__, aspect); From aee4bcb7664beb0cfc1984539ddc2401873910ed Mon Sep 17 00:00:00 2001 From: FlatTV Date: Wed, 13 Mar 2019 16:32:37 +0100 Subject: [PATCH 4/5] ca_ci.cpp: No decoding using the same SID after switching to a FTA channel Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/05ac4769a01d035129b77c26cd1c1dfda68bbd02 Author: FlatTV Date: 2019-03-13 (Wed, 13 Mar 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- common/ca_ci.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index bab57c9..471cac0 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -632,6 +632,7 @@ bool cCA::StopLiveCI( u64 TP, u16 SID, u8 source, u32 calen) { if ((*it)->liveUse[j] && (*it)->TP == TP && (*it)->SID[j] == SID && (*it)->source == source && !calen) { + (*it)->SID[j] = 0; (*it)->liveUse[j] = false; return true; } @@ -650,6 +651,7 @@ bool cCA::StopRecordCI( u64 TP, u16 SID, u8 source, u32 calen) { if ((*it)->recordUse[j] && (*it)->TP == TP && (*it)->SID[j] == SID && (*it)->source == source && !calen) { + (*it)->SID[j] = 0; (*it)->recordUse[j] = false; return true; } From 913f08f446d855808e7cf674de1440cb81f1d690 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Fri, 15 Mar 2019 12:18:01 +0100 Subject: [PATCH 5/5] Not starting record or stream to pc, when watching live-tv via CI module and stream or record needs the module thx DboxOldie Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/62a355559b5218067159e6bce8bf18ea379424e5 Author: Frankenstone Date: 2019-03-15 (Fri, 15 Mar 2019) ------------------ This commit was generated by Migit --- common/ca_ci.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index 471cac0..c46e028 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -878,6 +878,10 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char * cabuf, (*It)->SID[0] = SID; (*It)->ci_use_count = 1; (*It)->TP = TP; +#if HAVE_ARM_HARDWARE + if(!checkLiveSlot && mode && (*It)->source != source) + setInputSource((eDVBCISlot*)(*It), false); +#endif (*It)->source = source; (*It)->pmtlen = calen; for (i = 0; i < calen; i++)