From 19b0917c6f0a918b3cc1255ea48532e33c96f7c6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:03 +0200 Subject: [PATCH 1/5] CFbAccelCSHD[1|2]::setMode(): Insert cVideo::updateOsdScreenInfo() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/40a4ec42628d27a941b104e49f6a9d89cf18c036 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) --- src/driver/fb_accel_cs_hd1.cpp | 4 ++++ src/driver/fb_accel_cs_hd2.cpp | 3 +++ src/driver/fb_accel_cs_hdx_inc.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index f890cfbcc..2d4f4ad2a 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -370,6 +370,10 @@ int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int) yRes = screeninfo.yres; bpp = screeninfo.bits_per_pixel; printf(LOGTAG "%dx%dx%d line length %d. using %s graphics accelerator.\n", xRes, yRes, bpp, stride, _fix.id); + + if (videoDecoder != NULL) + videoDecoder->updateOsdScreenInfo(); + int needmem = stride * yRes * 2; if (available >= needmem) { diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 7ca2eed3c..36a99ca0e 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -289,6 +289,9 @@ max res 1920x1080 stride 7680 */ + if (videoDecoder != NULL) + videoDecoder->updateOsdScreenInfo(); + int needmem = stride * yRes * 2; if (available >= needmem) { diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index da858312e..5135e953d 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -36,4 +36,7 @@ #include #include +#include #include + +extern cVideo * videoDecoder; From 7d49a497b5c041ad61e5553f742706b54417a42e Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:07 +0200 Subject: [PATCH 2/5] CStreamInfo2: Add new info items - Videosystem - OSD Resolution Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7cea75f37baca88c64bd72e7ca795146272e9db Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/streaminfo2.cpp | 33 +++++++++++++++++++++++++++++---- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 259a43e6a..db95f8756 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2319,8 +2319,10 @@ streaminfo.framerate Bildrate streaminfo.framerate_unknown unbekannt streaminfo.head Tech. Information streaminfo.not_available nicht verfügbar +streaminfo.osd_resolution OSD Auflösung streaminfo.resolution Auflösung streaminfo.signal Empfangssignal +streaminfo.videosystem Videosystem streaming.busy Ein oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufnahmen sind daher nicht möglich. streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. diff --git a/data/locale/english.locale b/data/locale/english.locale index 9bc1b4031..d203308bf 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2319,8 +2319,10 @@ streaminfo.framerate Framerate streaminfo.framerate_unknown unknown streaminfo.head Stream-Information streaminfo.not_available not available +streaminfo.osd_resolution OSD Resolution streaminfo.resolution Resolution streaminfo.signal Receipt signal +streaminfo.videosystem Videosystem streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart GUI. streaming.dir_not_writable The recording directory is not writable.\nRecording will not work. streaming.overflow Record buffer overflow, consider to stop some records diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index d99ab6818..b799c4c3f 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -527,18 +527,20 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) if(!channel) return; - int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + int array[]= {g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_VIDEOSYSTEM)), + g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_OSD_RESOLUTION)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_BITRATE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_SCANTS_FREQDATA))}; - for(i=0 ; i<6; i++) { + for(i=0 ; i<(int)(sizeof(array)/sizeof(array[0])); i++) { if(spaceoffset < array[i]) spaceoffset = array[i]; } - spaceoffset += g_Font[font_info]->getRenderWidth(" "); + spaceoffset += g_Font[font_info]->getRenderWidth(" "); average_bitrate_offset = spaceoffset; int box_width2 = box_width-(spaceoffset+xpos); @@ -557,7 +559,30 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) snprintf(buf, sizeof(buf), "%dx%d", xres, yres); g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); - //audio rate +#if HAVE_COOL_HARDWARE + //Video SYSTEM + ypos += iheight; + snprintf(buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_VIDEOSYSTEM)); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); + cs_vs_format_t vsfn; + videoDecoder->GetVideoSystemFormatName(&vsfn); +#ifdef BOXMODEL_CS_HD1 + snprintf(buf, sizeof(buf), "HDMI: %s%s", vsfn.format, +#else + snprintf(buf, sizeof(buf), "HDMI: %s, Scart/Cinch: %s%s", vsfn.formatHD, vsfn.formatSD, +#endif + (g_settings.video_Mode == VIDEO_STD_AUTO)?" (AUTO)":""); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); +#endif + + //OSD RESOLUTION + ypos += iheight; + snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_OSD_RESOLUTION)); + g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); + snprintf(buf, sizeof(buf), "%dx%d", frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width2, buf, COL_MENUCONTENT_TEXT); + + //Aspect Ratio ypos += iheight; snprintf(buf, sizeof(buf), "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO)); g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_MENUCONTENT_TEXT); diff --git a/src/system/locals.h b/src/system/locals.h index 024bb955b..05310ce1b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2346,8 +2346,10 @@ typedef enum LOCALE_STREAMINFO_FRAMERATE_UNKNOWN, LOCALE_STREAMINFO_HEAD, LOCALE_STREAMINFO_NOT_AVAILABLE, + LOCALE_STREAMINFO_OSD_RESOLUTION, LOCALE_STREAMINFO_RESOLUTION, LOCALE_STREAMINFO_SIGNAL, + LOCALE_STREAMINFO_VIDEOSYSTEM, LOCALE_STREAMING_BUSY, LOCALE_STREAMING_DIR_NOT_WRITABLE, LOCALE_STREAMING_OVERFLOW, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 3fdeaa47a..143579cbb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2346,8 +2346,10 @@ const char * locale_real_names[] = "streaminfo.framerate_unknown", "streaminfo.head", "streaminfo.not_available", + "streaminfo.osd_resolution", "streaminfo.resolution", "streaminfo.signal", + "streaminfo.videosystem", "streaming.busy", "streaming.dir_not_writable", "streaming.overflow", From e441a3738bbbbcc59a29f216e2500d0db9b5175f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:10 +0200 Subject: [PATCH 3/5] lib/libtuxtxt/tuxtxt.cpp: Update for hd1/hd2 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e08f4cb9253a006c68e5de03463c3796e6e3b24 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) --- lib/libtuxtxt/tuxtxt.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 5eae7e587..714494681 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -5524,7 +5524,7 @@ void CopyBB2FB() { fb_pixel_t *src, *dst, *topsrc; int fillcolor, i, screenwidth, swtmp; -#if defined(HAVE_SPARK_HARDWARE) || defined(BOXMODEL_CS_HD2) +#if defined(HAVE_SPARK_HARDWARE) || defined(HAVE_COOL_HARDWARE) CFrameBuffer *f = CFrameBuffer::getInstance(); #endif @@ -5537,7 +5537,7 @@ void CopyBB2FB() { #ifdef HAVE_SPARK_HARDWARE f->blit2FB(lbb, var_screeninfo.xres, var_screeninfo.yres, 0, 0, 0, 0, true); -#elif defined BOXMODEL_CS_HD2 +#elif defined(HAVE_COOL_HARDWARE) f->fbCopyArea(var_screeninfo.xres, var_screeninfo.yres, 0, 0, 0, var_screeninfo.yres); #else if ((uint32_t)stride > var_screeninfo.xres) { @@ -5586,7 +5586,7 @@ void CopyBB2FB() if (screenmode == 1) { screenwidth = ( TV43STARTX ); -#if defined(HAVE_SPARK_HARDWARE) || defined(BOXMODEL_CS_HD2) +#if defined(HAVE_SPARK_HARDWARE) int cx = var_screeninfo.xres - TV43STARTX; /* x start */ int cw = TV43STARTX; /* width */ int cy = StartY; @@ -5594,8 +5594,6 @@ void CopyBB2FB() #endif #ifdef HAVE_SPARK_HARDWARE f->blit2FB(lbb, cw, ch, cx, cy, cx, cy, true); -#elif defined BOXMODEL_CS_HD2 - f->fbCopyArea(cw, ch, cx, cy, cx, cy+var_screeninfo.yres); #else fb_pixel_t *topdst = dst; size_t width = (ex - screenwidth) * sizeof(fb_pixel_t); From edee66e5cbcc5b663bd010fcd53a9d40754af8a3 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:13 +0200 Subject: [PATCH 4/5] fb_accel hd1/hd2: Add fb_accel_cs_hdx.cpp for common functions - Add 'class CFbAccelCSHDx' to fb_accel.h - Some small code updates Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3c1f2bfe0566e83b293c94f9e60ce22074228394 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) --- src/driver/Makefile.am | 2 + src/driver/fb_accel.h | 34 ++++++++- src/driver/fb_accel_cs_hd1.cpp | 14 +++- src/driver/fb_accel_cs_hd2.cpp | 32 ++++++-- src/driver/fb_accel_cs_hdx.cpp | 122 +++++++++++++++++++++++++++++++ src/driver/fb_accel_cs_hdx_inc.h | 10 ++- 6 files changed, 199 insertions(+), 15 deletions(-) create mode 100644 src/driver/fb_accel_cs_hdx.cpp diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index e7d4eaf43..37040c4b0 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -47,6 +47,8 @@ libneutrino_driver_a_SOURCES = \ volume.cpp if BOXTYPE_COOL +libneutrino_driver_a_SOURCES += \ + fb_accel_cs_hdx.cpp if BOXMODEL_CS_HD2 libneutrino_driver_a_SOURCES += \ fb_accel_cs_hd2.cpp \ diff --git a/src/driver/fb_accel.h b/src/driver/fb_accel.h index 84e42ffe1..6343056f9 100644 --- a/src/driver/fb_accel.h +++ b/src/driver/fb_accel.h @@ -78,17 +78,41 @@ class CFbAccelSTi void setBlendLevel(int); }; -class CFbAccelCSHD1 +class CFbAccelCSHDx : public CFbAccel { private: + + protected: + OpenThreads::Mutex mutex; + + int fbCopy(uint32_t *mem_p, int width, int height, int dst_x, int dst_y, int src_x, int src_y, int mode); + int fbFill(int sx, int sy, int width, int height, fb_pixel_t color, int mode=0); + + public: + CFbAccelCSHDx(); +// ~CFbAccelCSHDx(); + +#if 0 + /* TODO: Run this functions with hardware acceleration */ + void SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp); + void RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp); + void Clear(); +#endif +}; + +class CFbAccelCSHD1 + : public CFbAccelCSHDx +{ + private: fb_pixel_t lastcol; + fb_pixel_t *backbuffer; int devmem_fd; /* to access the GXA register we use /dev/mem */ unsigned int smem_start; /* as aquired from the fbdev, the framebuffers physical start address */ volatile uint8_t *gxa_base; /* base address for the GXA's register access */ + void setColor(fb_pixel_t col); - void run(void); - fb_pixel_t *backbuffer; + public: CFbAccelCSHD1(); ~CFbAccelCSHD1(); @@ -113,10 +137,12 @@ class CFbAccelCSHD1 }; class CFbAccelCSHD2 - : public CFbAccel + : public CFbAccelCSHDx { private: fb_pixel_t *backbuffer; + int sysRev; + bool IsApollo; public: CFbAccelCSHD2(); diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index 2d4f4ad2a..2b6b0e0dd 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -264,13 +264,21 @@ void CFbAccelCSHD1::paintBoxRel(const int x, const int y, const int dx, const in void CFbAccelCSHD1::fbCopyArea(uint32_t width, uint32_t height, uint32_t dst_x, uint32_t dst_y, uint32_t src_x, uint32_t src_y) { + if ((width == 0) || (height == 0)) + return; + uint32_t w_, h_; w_ = (width > xRes) ? xRes : width; h_ = (height > yRes) ? yRes : height; - //printf("\033[33m>>>>\033[0m [CFbAccelCSHD1::%s:%d] fb_copyarea w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - printf("\033[31m>>>>\033[0m [CFbAccelCSHD1::%s:%d] sw blit w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - CFrameBuffer::fbCopyArea(width, height, dst_x, dst_y, src_x, src_y); + int mode = CS_FBCOPY_FB2FB; + uint32_t src_y_ = src_y; + if (src_y >= yRes) { + mode = CS_FBCOPY_BB2FB; + src_y_ -= yRes; + } + fbCopy(NULL, w_, h_, dst_x, dst_y, src_x, src_y_, mode); +// printf("\033[31m>>>>\033[0m%s hw blit w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func_ext__, w_, h_, dst_x, dst_y, src_x, src_y); } void CFbAccelCSHD1::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp) diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 36a99ca0e..cfafaf4bf 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -28,7 +28,9 @@ CFbAccelCSHD2::CFbAccelCSHD2() { - fb_name = "Coolstream HD2 framebuffer"; + fb_name = "Coolstream HD2 framebuffer"; + IsApollo = false; + sysRev = -1; } /* @@ -143,11 +145,22 @@ void CFbAccelCSHD2::paintBoxRel(const int x, const int y, const int dx, const in void CFbAccelCSHD2::fbCopyArea(uint32_t width, uint32_t height, uint32_t dst_x, uint32_t dst_y, uint32_t src_x, uint32_t src_y) { + if ((width == 0) || (height == 0)) + return; + uint32_t w_, h_; w_ = (width > xRes) ? xRes : width; h_ = (height > yRes) ? yRes : height; - if(!(w_%4)) { + if (sysRev < 0) { + sysRev = cs_get_revision(); + IsApollo = (sysRev == 9); + } + + if(!(w_ % 4) && !IsApollo) { + /* workaround for bad fb driver */ + w_ -= 1; + h_ -= 1; fb_copyarea area; area.dx = dst_x; area.dy = dst_y; @@ -156,11 +169,18 @@ void CFbAccelCSHD2::fbCopyArea(uint32_t width, uint32_t height, uint32_t dst_x, area.sx = src_x; area.sy = src_y; ioctl(fd, FBIO_COPY_AREA, &area); - //printf("\033[33m>>>>\033[0m [CFbAccelCSHD2::%s:%d] fb_copyarea w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - return; +// printf("\033[33m>>>>\033[0m%s fb_copyarea w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func_ext__, w_, h_, dst_x, dst_y, src_x, src_y); + } + else { + int mode = CS_FBCOPY_FB2FB; + uint32_t src_y_ = src_y; + if (src_y >= yRes) { + mode = CS_FBCOPY_BB2FB; + src_y_ -= yRes; + } + fbCopy(NULL, w_, h_, dst_x, dst_y, src_x, src_y_, mode); +// printf("\033[31m>>>>\033[0m%s fbCopy w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func_ext__, w_, h_, dst_x, dst_y, src_x, src_y); } - //printf("\033[31m>>>>\033[0m [CFbAccelCSHD2::%s:%d] sw blit w: %d, h: %d, dst_x: %d, dst_y: %d, src_x: %d, src_y: %d\n", __func__, __LINE__, w_, h_, dst_x, dst_y, src_x, src_y); - CFrameBuffer::fbCopyArea(width, height, dst_x, dst_y, src_x, src_y); } void CFbAccelCSHD2::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff, uint32_t xp, uint32_t yp, bool transp) diff --git a/src/driver/fb_accel_cs_hdx.cpp b/src/driver/fb_accel_cs_hdx.cpp new file mode 100644 index 000000000..3ab238f35 --- /dev/null +++ b/src/driver/fb_accel_cs_hdx.cpp @@ -0,0 +1,122 @@ +/* + Framebuffer acceleration hardware abstraction functions. + The common functions for coolstream hd1/hd2 graphic chips + are represented in this class. + + (C) 2017 M. Liebmann + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "fb_accel_cs_hdx_inc.h" + +#define LOGTAG "[fb_accel_cs_hdx] " + +CFbAccelCSHDx::CFbAccelCSHDx() +{ + fb_name = "CST HDx framebuffer"; +} + +/* +CFbAccelCSHDx::~CFbAccelCSHDx() +{ +} +*/ + +int CFbAccelCSHDx::fbCopy(uint32_t *mem_p, int width, int height, + int dst_x, int dst_y, int src_x, int src_y, int mode) +{ + if (videoDecoder == NULL) { + if (dst_y < (int)yRes) { + uint32_t src_y_ = src_y; + if (mode == CS_FBCOPY_BB2FB) + src_y_ += yRes; + CFrameBuffer::fbCopyArea(width, height, dst_x, dst_y, src_x, src_y_); + return 0; + } + return -1; + } + + mutex.lock(); + setActive(false); + int ret = videoDecoder->fbCopy(mem_p, width, height, dst_x, dst_y, src_x, src_y, mode); + add_gxa_sync_marker(); + setActive(true); + mutex.unlock(); + return ret; +} + +int CFbAccelCSHDx::fbFill(int sx, int sy, int width, int height, fb_pixel_t color, int mode/*=0*/) +{ + if (videoDecoder == NULL) { + CFbAccel::paintRect(sx, sy, width, height, color); + return 0; + } + + mutex.lock(); + setActive(false); + int ret = videoDecoder->fbFill(sx, sy, width, height, color, mode); + add_gxa_sync_marker(); + setActive(true); + mutex.unlock(); + return ret; +} + +#if 0 +/* TODO: Run this functions with hardware acceleration */ +void CFbAccelCSHDx::SaveScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp) +{ + if (!getActive()) + return; + + checkFbArea(x, y, dx, dy, true); + fb_pixel_t * pos = getFrameBufferPointer() + x + swidth * y; + fb_pixel_t * bkpos = memp; + for (int count = 0; count < dy; count++) { + fb_pixel_t * dest = (fb_pixel_t *)pos; + for (int i = 0; i < dx; i++) + *(bkpos++) = *(dest++); + pos += swidth; + } + checkFbArea(x, y, dx, dy, false); +printf("%s\n", __func_ext__); +} + +void CFbAccelCSHDx::RestoreScreen(int x, int y, int dx, int dy, fb_pixel_t * const memp) +{ + if (!getActive()) + return; + + checkFbArea(x, y, dx, dy, true); + fb_pixel_t * fbpos = getFrameBufferPointer() + x + swidth * y; + fb_pixel_t * bkpos = memp; + for (int count = 0; count < dy; count++) + { + memmove(fbpos, bkpos, dx * sizeof(fb_pixel_t)); + fbpos += swidth; + bkpos += dx; + } + mark(x, y, x + dx, y + dy); + checkFbArea(x, y, dx, dy, false); +printf("%s\n", __func_ext__); +} + +void CFbAccelCSHDx::Clear() +{ + paintBackground(); +printf("%s\n", __func_ext__); +} +#endif diff --git a/src/driver/fb_accel_cs_hdx_inc.h b/src/driver/fb_accel_cs_hdx_inc.h index 5135e953d..5f98cd34b 100644 --- a/src/driver/fb_accel_cs_hdx_inc.h +++ b/src/driver/fb_accel_cs_hdx_inc.h @@ -1,6 +1,6 @@ /* Framebuffer acceleration hardware abstraction functions. - The hardware dependent acceleration functions for coolstream hdx graphic chips + The common functions for coolstream hd1/hd2 graphic chips are represented in this class. (C) 2017 M. Liebmann @@ -23,6 +23,8 @@ along with this program. If not, see . */ +#ifndef FB_ACCEL_CS_HDX_INC_H +#define FB_ACCEL_CS_HDX_INC_H #include #include @@ -31,12 +33,16 @@ #include #include #include +#include + #include #include #include - #include #include +#include #include extern cVideo * videoDecoder; + +#endif // FB_ACCEL_CS_HDX_INC_H From 841a7b077edaed72cec800fe2db9a13dba971a60 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 28 Mar 2017 23:55:16 +0200 Subject: [PATCH 5/5] Fix videosystem auto mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b612c1f620c00e628d1cafc854d01e59753e2ba5 Author: Michael Liebmann Date: 2017-03-28 (Tue, 28 Mar 2017) --- src/gui/movieplayer.cpp | 4 +++- src/neutrino.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 9f1eb5862..9b9590d99 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -257,7 +257,9 @@ void CMoviePlayerGui::restoreNeutrino() return; #ifdef ENABLE_CHANGE_OSD_RESOLUTION - if ((currentVideoSystem > -1) && (g_settings.video_Mode == VIDEO_STD_AUTO)) { + if ((currentVideoSystem > -1) && + (g_settings.video_Mode == VIDEO_STD_AUTO) && + (g_settings.enabled_auto_modes[currentVideoSystem] == 1)) { COsdHelpers *coh = COsdHelpers::getInstance(); if (currentVideoSystem != coh->getVideoSystem()) { coh->setVideoSystem(currentVideoSystem, false); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a37a4d3df..3bba42f54 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2995,7 +2995,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) printf(">>>>>[CNeutrinoApp::%s:%d] Receive EVT_AUTO_SET_VIDEOSYSTEM message\n", __func__, __LINE__); COsdHelpers *coh = COsdHelpers::getInstance(); int videoSystem = (int)data; - if (coh->getVideoSystem() != videoSystem) { + if ((videoSystem != -1) /* -1 => not enabled for automode */ && + (coh->getVideoSystem() != videoSystem)) { coh->setVideoSystem(videoSystem, false); if (frameBufferInitialized) coh->changeOsdResolution(0, true, false);