From: Markham Date: Sun, 1 Oct 2017 16:27:20 +0000 (+0200) Subject: fbshot: fix for new driver with higher resolution X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=fb1f5860345fe7a97703f66053e3d6991f5d4c92;p=bs-cst-neutrino-hd.git fbshot: fix for new driver with higher resolution --- diff --git a/archive-patches/fbshot_cs_hd2.diff b/archive-patches/fbshot_cs_hd2.diff new file mode 100644 index 0000000..9ea490a --- /dev/null +++ b/archive-patches/fbshot_cs_hd2.diff @@ -0,0 +1,38 @@ +--- a/fbshot.c ++++ b/fbshot.c +@@ -148,6 +148,8 @@ + pict->bps=fb_varinfo.bits_per_pixel; + pict->gray=fb_varinfo.grayscale; + ++ int stride=fb_fixinfo.line_length; ++ + if(fb_fixinfo.visual==FB_VISUAL_PSEUDOCOLOR){ + pict->colormap=(struct fb_cmap*)malloc(sizeof(struct fb_cmap)); + pict->colormap->red=(__u16*)malloc(sizeof(__u16)*(1<bps)); +@@ -203,8 +205,24 @@ + if (vt_num!=-1) + chvt(vt_num); + +- j= (read(fd, pict->buffer, ((pict->xres * pict->yres) * i) )!= +- (pict->xres * pict->yres *i )); ++ /* Workaround for broken osd screenshot with new fb driver ++ and 1280x720 resolution */ ++ if ((pict->xres * i) < stride) { ++ char* toBuf = pict->buffer; ++ int fromRead = 0; ++ int ii; ++ for (ii = 0; ii < pict->yres; ii++) { ++ j = (read(fd, toBuf, pict->xres*i) != (pict->xres *i)); ++ fromRead += stride; ++ int seekRet = lseek(fd, fromRead, SEEK_SET); ++ toBuf += pict->xres * i; ++ if (j != 0) ++ break; ++ } ++ } ++ else ++ j = (read(fd, pict->buffer, ((pict->xres * pict->yres) * i) ) != (pict->xres * pict->yres *i )); ++ + #ifdef DEBUG + printf("to read:%i read:%i\n",(pict->xres* pict->yres * i), j); + #endif diff --git a/make/applications.mk b/make/applications.mk index 672749f..048017a 100755 --- a/make/applications.mk +++ b/make/applications.mk @@ -89,14 +89,15 @@ $(D)/hotplug: $(D)/libblkid $(D)/libuuid $(ARCHIVE)/hotplug.tar.gz | $(TARGETPRE $(REMOVE)/hotplug touch $@ -$(D)/fbshot: $(D)/zlib $(ARCHIVE)/fbshot-0.3.tar.gz | $(TARGETPREFIX) - $(UNTAR)/fbshot-0.3.tar.gz - pushd $(BUILD_TMP)/fbshot-0.3 && \ +$(D)/fbshot: $(D)/zlib $(ARCHIVE)/fbshot-$(FBSHOT_VER).tar.gz | $(TARGETPREFIX) + $(UNTAR)/fbshot-$(FBSHOT_VER).tar.gz + pushd $(BUILD_TMP)/fbshot-$(FBSHOT_VER) && \ $(PATCH)/fbshot-0.3-32bit_cs_fb.diff && \ + $(PATCH)/fbshot_cs_hd2.diff && \ $(TARGET)-gcc $(TARGET_CFLAGS) $(TARGET_LDFLAGS) fbshot.c -lpng -lz -o $(TARGETPREFIX)/bin/fbshot cd $(TARGETPREFIX)/bin && \ ln -sf fbshot dboxshot - $(REMOVE)/fbshot-0.3 + $(REMOVE)/fbshot-$(FBSHOT_VER) touch $@ $(D)/ntp: $(D)/openssl $(ARCHIVE)/ntp-$(NTP_VER).tar.gz | $(TARGETPREFIX) diff --git a/make/archives.mk b/make/archives.mk index 8279e8f..512f96b 100755 --- a/make/archives.mk +++ b/make/archives.mk @@ -30,8 +30,8 @@ $(ARCHIVE)/libpng-$(PNG_VER).tar.xz: $(ARCHIVE)/hotplug.tar.gz: $(WGET) http://www.fhloston-paradise.de/hotplug.tar.gz -$(ARCHIVE)/fbshot-0.3.tar.gz: - $(WGET) http://www.fhloston-paradise.de/fbshot-0.3.tar.gz +$(ARCHIVE)/fbshot-$(FBSHOT_VER).tar.gz: + $(WGET) http://distro.ibiblio.org/amigolinux/download/Utils/fbshot/fbshot-$(FBSHOT_VER).tar.gz $(ARCHIVE)/ffmpeg-git-$(FFMPEG_GIT).tar.gz: set -e; cd $(BUILD_TMP); \ diff --git a/make/versions.mk b/make/versions.mk index b61c565..ffdff46 100644 --- a/make/versions.mk +++ b/make/versions.mk @@ -46,6 +46,9 @@ E2FSPROGS_VER=1.42.13 # C library for parsing XML EXPAT_VER = 2.2.0 +# Picture from Framebuffer +FBSHOT_VER = 0.3 + # FFMPEG-3.3 | A complete, cross-platform solution to record, convert and stream audio and video FFMPEG_GIT = 2ba896f