Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Mauro Carvalho Chehab
554bf7eb9b Bump to version 3.106
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-21 08:36:52 -03:00
Mauro Carvalho Chehab
ae646b73f9 Update sources for xawtv 3.106
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-21 08:36:44 -03:00
6 changed files with 6 additions and 251 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ xawtv-3.98.tar.bz2
/xawtv-3.101.tar.bz2
/xawtv-3.103.tar.bz2
/xawtv-3.105.tar.bz2
/xawtv-3.106.tar.bz2

View file

@ -1,84 +0,0 @@
From 185c8b182ac6f7fa6a5c69975f9dabdb9af6fce0 Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Date: Mon, 11 Jun 2018 13:34:08 -0300
Subject: [PATCH 1/3] fbtv: don't keep a black screen in case of fatal errors
If something bad happens and fbtv exits, it should restore
the VT window, as otherwise the error messages won't be
displayed.
So, be sure to call fb_cleanup() before calling exit().
Let's also start ncurses later, as this is used only to get
keys, and this happens only within the image display loop.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
console/fbtv.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/console/fbtv.c b/console/fbtv.c
index aba517e4fc8e..33372385b7c6 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -279,8 +279,8 @@ fb_initcolors(int fd, int gray)
#endif
break;
default:
- fprintf(stderr, "Oops: %i bit/pixel ???\n",
- fb_var.bits_per_pixel);
+ fb_cleanup();
+ fprintf(stderr, "Oops: %i bit/pixel ???\n", fb_var.bits_per_pixel);
exit(1);
}
@@ -404,6 +404,7 @@ static void do_capture(int from, int to, int tmp_switch)
if (0 != ng_grabber_setformat(&fmt,1)) {
gfmt = fmt;
if (NULL == (conv = ng_grabber_findconv(&gfmt,0))) {
+ fb_cleanup();
fprintf(stderr,"can't find useful capture format\n");
exit(1);
}
@@ -528,6 +529,7 @@ grabber_init(void)
drv = ng_vid_open(&ng_dev.video, ng_dev.driver, &screen, 0, &h_drv);
if (NULL == drv) {
+ fb_cleanup();
fprintf(stderr,"no grabber device available\n");
exit(1);
}
@@ -724,7 +726,6 @@ main(int argc, char *argv[])
exit_hook = do_exit;
fullscreen_hook = do_fullscreen;
- tty_init();
memset(&act,0,sizeof(act));
act.sa_handler = ctrlc;
sigemptyset(&act.sa_mask);
@@ -770,6 +771,7 @@ main(int argc, char *argv[])
}
#endif
+ tty_init();
fb_memset(fb_mem+fb_mem_offset,0,fb_fix.smem_len);
for (;!sig;) {
if ((fb_switch_state == FB_ACTIVE || keep_dma_on) && !quiet) {
@@ -824,6 +826,14 @@ main(int argc, char *argv[])
fps++;
/* grab + convert frame */
if (NULL == (buf = ng_grabber_grab_image(0))) {
+ do_va_cmd(2,"capture","off");
+ if (mute)
+ audio_off();
+ drv->close(h_drv);
+ if (fb_switch_state == FB_ACTIVE)
+ fb_memset(fb_mem+fb_mem_offset,0,fb_fix.smem_len);
+ tty_cleanup();
+ fb_cleanup();
fprintf(stderr,"capturing image failed\n");
exit(1);
}
--
2.17.1

View file

@ -1,74 +0,0 @@
From bc3b0ec4d5f2af3e9b8e70287b4bdc885111f174 Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Date: Mon, 11 Jun 2018 16:54:13 -0300
Subject: [PATCH 2/3] fbdev: prevent writing outsize framebuffer area
There are a series of things at the code that could overflow
and make it to try writing past the framebuffer. Prevent it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
console/fbtv.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/console/fbtv.c b/console/fbtv.c
index 33372385b7c6..1d700e6f945f 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -377,6 +377,14 @@ static void do_capture(int from, int to, int tmp_switch)
break;
}
+ /* Sanity check: don't accept resolution higher than framebuffer */
+ if (ww && hh) {
+ if (ww > fb_var.xres)
+ ww = fb_var.xres;
+ if (hh > fb_var.yres)
+ hh = fb_var.yres;
+ }
+
/* on */
memset(&buf,0,sizeof(buf));
switch (to) {
@@ -411,8 +419,9 @@ static void do_capture(int from, int to, int tmp_switch)
ch = ng_convert_alloc(conv,&gfmt,&fmt);
ng_convert_init(ch);
}
- dx += (fb_var.xres-24-fmt.width)/2;
- dy += (fb_var.yres-16-fmt.height)/2;
+
+ dx += (fb_var.xres - 24 - fmt.width)/2;
+ dy += (fb_var.yres - 16 - fmt.height)/2;
if (f_drv & CAN_CAPTURE)
drv->startvideo(h_drv,-1,2);
@@ -464,6 +473,12 @@ static void do_capture(int from, int to, int tmp_switch)
}
break;
}
+
+ /* Sanity checks: some of the formula above could overflow */
+ if (dx < 0 || dx > fb_var.xres)
+ dx = 0;
+ if (dy < 0 || dy > fb_var.yres)
+ dy = 0;
}
static void
@@ -848,7 +863,13 @@ main(int argc, char *argv[])
linesize = buf->fmt.width * (ng_vfmt_to_depth[fmt.fmtid] / 8);
+ /* Prevent writing at the next line */
+ if (linesize > fb_fix.line_length)
+ linesize = fb_fix.line_length;
for (ui = 0; ui < buf->fmt.height; ui++) {
+ if ((char *)dst + linesize > (char *)fb_mem + fb_mem_offset + fb_fix.smem_len)
+ break;
+
memcpy(dst, src, linesize);
src += buf->fmt.bytesperline;
dst += fb_fix.line_length;
--
2.17.1

View file

@ -1,85 +0,0 @@
From a4493b399e45a97b9dd14499f54719cc4095f447 Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Date: Mon, 11 Jun 2018 17:04:14 -0300
Subject: [PATCH 3/3] fbtv: allow displaying texts over the camera streaming
screen
When the image is too big, there won't be a f->height space
before the streaming window. So, allow overwriting the fonts
on the top of it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
console/fbtv.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/console/fbtv.c b/console/fbtv.c
index 1d700e6f945f..278443fcbf3c 100644
--- a/console/fbtv.c
+++ b/console/fbtv.c
@@ -604,7 +604,7 @@ main(int argc, char *argv[])
unsigned long freq;
struct timeval tv;
time_t t;
- char text[145],event[64],*env,*src,*dst;
+ char text1[145], text2[145], event[64], *env, *src, *dst;
fd_set set;
struct sigaction act,old;
@@ -790,26 +790,28 @@ main(int argc, char *argv[])
fb_memset(fb_mem+fb_mem_offset,0,fb_fix.smem_len);
for (;!sig;) {
if ((fb_switch_state == FB_ACTIVE || keep_dma_on) && !quiet) {
- /* clear first lines */
- fb_memset(fb_mem+fb_mem_offset,0,f->height*fb_fix.line_length);
if (message[0] != '\0') {
- strcpy(text,message);
+ strcpy(text1, message);
} else {
- sprintf(text,"Framebuffer TV - %s",default_title);
+ sprintf(text1, "Framebuffer TV - %s",default_title);
}
/* debugging + preformance monitoring */
switch (cur_capture) {
case CAPTURE_GRABDISPLAY:
- sprintf(text+strlen(text), " - grab %d.%d fps",fps/5,(fps*2)%10);
+ sprintf(text1 + strlen(text1), " - grab %d.%d fps",
+ fps / 5, (fps * 2) % 10);
break;
}
- text_out(0,0,text);
- if (dy > 0) {
- /* display time */
- time(&t);
- strftime(text,16,"%H:%M",localtime(&t));
- text_out(fb_var.xres - text_width(text) - f->width, 0, text);
+ /* display time */
+ time(&t);
+ strftime(text2, 16, "%H:%M", localtime(&t));
+
+ if (dy >= f->height) {
+ /* clear first lines */
+ fb_memset(fb_mem+fb_mem_offset,0,f->height*fb_fix.line_length);
+ text_out(0,0,text1);
+ text_out(fb_var.xres - text_width(text2) - f->width, 0, text2);
}
}
if (switch_last != fb_switch_state)
@@ -883,6 +885,13 @@ main(int argc, char *argv[])
tv.tv_usec = 0;
rc = select(fdmax,&set,NULL,NULL,&tv);
}
+
+ /* If space is too short, overlay text at screen */
+ if ((fb_switch_state == FB_ACTIVE || keep_dma_on) && !quiet && dy < f->height) {
+ text_out(0,0,text1);
+ text_out(fb_var.xres - text_width(text2) - f->width, 0, text2);
+ }
+
err = errno;
if (switch_last != fb_switch_state)
console_switch();
--
2.17.1

View file

@ -1 +1 @@
SHA512 (xawtv-3.105.tar.bz2) = 0c1e2c3a73b3452778762b26a061f5646ef2a34de80027e17777ee9f6ca91ca5370b4790e2bdbe4b5edc864fe9775c9125c52e951fb08c83dc1706afbdf21e55
SHA512 (xawtv-3.106.tar.bz2) = 79d69455a85626fde130cf60dabab5733b8031200bf998dc3199c3a511cb87e3a07b4d975829b192fafafda052f6fce93a193ba5e0e5728d38ba3022e880d68e

View file

@ -2,15 +2,12 @@
Summary: TV applications for video4linux compliant devices
Name: xawtv
Version: 3.105
Version: 3.106
Release: 4%{?dist}
License: GPLv2+
URL: http://linuxtv.org/wiki/index.php/Xawtv
Source0: http://linuxtv.org/downloads/xawtv/%{name}-%{version}.tar.bz2
Patch0: 0001-fbtv-don-t-keep-a-black-screen-in-case-of-fatal-erro.patch
Patch1: 0002-fbdev-prevent-writing-outsize-framebuffer-area.patch
Patch2: 0003-fbtv-allow-displaying-texts-over-the-camera-streamin.patch
BuildRequires: gcc
BuildRequires: mesa-libGL-devel, libXaw-devel, libXext-devel
@ -59,9 +56,6 @@ which support teletext.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -Wno-pointer-sign"
@ -157,6 +151,9 @@ ln -s consolehelper $RPM_BUILD_ROOT%{_bindir}/v4l-conf
%changelog
* Thu Feb 21 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 3.106-1
- upgrade to version 3.106
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.105-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild