diff --git a/0001-XV-Fix-segfault-under-certain-conditions.patch b/0001-XV-Fix-segfault-under-certain-conditions.patch new file mode 100644 index 0000000..43c0ffc --- /dev/null +++ b/0001-XV-Fix-segfault-under-certain-conditions.patch @@ -0,0 +1,27 @@ +From c69289c5c11e7a65d99db91e8ee38c0e58212c51 Mon Sep 17 00:00:00 2001 +From: "Bernhard M. Wiedemann" +Date: Sat, 27 Dec 2014 14:42:24 +0100 +Subject: [PATCH xawtv3 1/9] XV: Fix segfault under certain conditions + +Signed-off-by: Hans de Goede +--- + x11/blit.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/x11/blit.c b/x11/blit.c +index 0ac88b8..7b1de1b 100644 +--- a/x11/blit.c ++++ b/x11/blit.c +@@ -937,7 +937,8 @@ void blit_putframe(struct blit_state *st, struct ng_video_buf *buf) + + #ifdef HAVE_LIBXV + case STATUS_XVIDEO: +- memcpy(st->xvimage->data,buf->data,buf->size); ++ memcpy(st->xvimage->data,buf->data, ++ buf->size < st->xvimage->data_size ? buf->size : st->xvimage->data_size); + ng_release_video_buf(buf); + xv_blit(XtDisplay(st->widget), XtWindow(st->widget), + st->gc, st->xvimage, +-- +2.7.1 + diff --git a/0002-v4l2_getimage-prefer-CAP_STREAMING-over-CAP_READWRIT.patch b/0002-v4l2_getimage-prefer-CAP_STREAMING-over-CAP_READWRIT.patch new file mode 100644 index 0000000..7d6daa4 --- /dev/null +++ b/0002-v4l2_getimage-prefer-CAP_STREAMING-over-CAP_READWRIT.patch @@ -0,0 +1,64 @@ +From 0f373e489aa12dbb42256c690899f9f4529c7f98 Mon Sep 17 00:00:00 2001 +From: Stas Sergeev +Date: Sat, 27 Dec 2014 22:04:58 +0300 +Subject: [PATCH xawtv3 2/9] v4l2_getimage: prefer CAP_STREAMING over + CAP_READWRITE + +This patch fixes Fedora buzilla #1155784: + https://bugzilla.redhat.com/show_bug.cgi?id=1155784 + +And got merged at Fedora xawtv package by: + Dmitry Butskoy + +Signed-off-by: Mauro Carvalho Chehab +--- + libng/plugins/drv0-v4l2.tmpl.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/libng/plugins/drv0-v4l2.tmpl.c b/libng/plugins/drv0-v4l2.tmpl.c +index ded868d..2cbd34b 100644 +--- a/libng/plugins/drv0-v4l2.tmpl.c ++++ b/libng/plugins/drv0-v4l2.tmpl.c +@@ -1241,7 +1241,19 @@ v4l2_getimage(void *handle) + + size = h->fmt_me.bytesperline * h->fmt_me.height; + buf = ng_malloc_video_buf(&h->fmt_me,size); +- if (h->cap.capabilities & V4L2_CAP_READWRITE) { ++ if (h->cap.capabilities & V4L2_CAP_STREAMING) { ++ if (-1 == v4l2_start_streaming(h,1)) { ++ v4l2_stop_streaming(h); ++ return NULL; ++ } ++ frame = v4l2_waiton(h); ++ if (-1 == frame) { ++ v4l2_stop_streaming(h); ++ return NULL; ++ } ++ memcpy(buf->data,h->buf_me[0].data,size); ++ v4l2_stop_streaming(h); ++ } else { + #ifndef USE_LIBV4L + rc = read(h->fd,buf->data,size); + #else /* USE_LIBV4L */ +@@ -1269,18 +1281,6 @@ v4l2_getimage(void *handle) + ng_release_video_buf(buf); + return NULL; + } +- } else { +- if (-1 == v4l2_start_streaming(h,1)) { +- v4l2_stop_streaming(h); +- return NULL; +- } +- frame = v4l2_waiton(h); +- if (-1 == frame) { +- v4l2_stop_streaming(h); +- return NULL; +- } +- memcpy(buf->data,h->buf_me[0].data,size); +- v4l2_stop_streaming(h); + } + return buf; + } +-- +2.7.1 + diff --git a/0003-alsa-Fix-not-being-able-to-get-a-larger-latency-on-c.patch b/0003-alsa-Fix-not-being-able-to-get-a-larger-latency-on-c.patch new file mode 100644 index 0000000..7002bb1 --- /dev/null +++ b/0003-alsa-Fix-not-being-able-to-get-a-larger-latency-on-c.patch @@ -0,0 +1,84 @@ +From daf4665a0d3c1af65b31887575ea8848ad71ace2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 1 Feb 2016 21:43:37 +0100 +Subject: [PATCH xawtv3 3/9] alsa: Fix not being able to get a larger latency + on capture devices with small max period sizes + +On some capture devices (e.g. bttv cards) the max period size is somewhat +small. Since we only use 2 perios on these devices we end up with only +allowing small latencies, which is a problem when e.g. using a usb codec +as output. + +This commit fixes this by adjusting the amount of periods on the capture +side when this happens. + +Signed-off-by: Hans de Goede +--- + common/alsa_stream.c | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/common/alsa_stream.c b/common/alsa_stream.c +index 3e33b5e..1165554 100644 +--- a/common/alsa_stream.c ++++ b/common/alsa_stream.c +@@ -109,9 +109,10 @@ static void getparams_periods(snd_pcm_t *handle, + snd_pcm_hw_params_t *params, + unsigned int *usecs, + unsigned int *count, +- const char *id) ++ int allow_adjust, const char *id) + { + unsigned min = 0, max = 0; ++ unsigned desired = *usecs * *count; + + snd_pcm_hw_params_get_periods_min(params, &min, 0); + snd_pcm_hw_params_get_periods_max(params, &max, 0); +@@ -137,6 +138,13 @@ static void getparams_periods(snd_pcm_t *handle, + if (*usecs > max) + *usecs = max; + } ++ ++ /* If we deviate from the desired size by more then 20% adjust count */ ++ if (allow_adjust && (((*usecs * *count) < (desired * 8 / 10)) || ++ ((*usecs * *count) > (desired * 12 / 10)))) { ++ *count = (desired + *usecs / 2) / *usecs; ++ getparams_periods(handle, params, usecs, count, 0, id); ++ } + } + + static int setparams_periods(snd_pcm_t *handle, +@@ -351,12 +359,16 @@ static int setparams(snd_pcm_t *phandle, snd_pcm_t *chandle, + /* Negotiate period parameters */ + + c_periodtime = latency * 1000 / c_periods; +- getparams_periods(chandle, c_hwparams, &c_periodtime, &c_periods, "capture"); ++ getparams_periods(chandle, c_hwparams, &c_periodtime, &c_periods, 1, "capture"); + p_periods = c_periods * 2; + p_periodtime = c_periodtime; +- getparams_periods(phandle, p_hwparams, &p_periodtime, &p_periods, "playback"); ++ getparams_periods(phandle, p_hwparams, &p_periodtime, &p_periods, 0, "playback"); + c_periods = p_periods / 2; + ++ if (verbose) ++ fprintf(error_fp, "alsa: Capture %u periods of %u usecs, Playback %u periods of %u usecs\n", ++ c_periods, c_periodtime, p_periods, p_periodtime); ++ + /* + * Some playback devices support a very limited periodtime range. If the user needs to + * use a higher latency to avoid overrun/underrun, use an alternate algorithm of incresing +@@ -365,10 +377,10 @@ static int setparams(snd_pcm_t *phandle, snd_pcm_t *chandle, + if (p_periodtime < c_periodtime) { + c_periodtime = p_periodtime; + c_periods = round (latency * 1000.0 / c_periodtime + 0.5); +- getparams_periods(chandle, c_hwparams, &c_periodtime, &c_periods, "capture"); ++ getparams_periods(chandle, c_hwparams, &c_periodtime, &c_periods, 0, "capture"); + p_periods = c_periods * 2; + p_periodtime = c_periodtime; +- getparams_periods(phandle, p_hwparams, &p_periodtime, &p_periods, "playback"); ++ getparams_periods(phandle, p_hwparams, &p_periodtime, &p_periods, 0, "playback"); + c_periods = p_periods / 2; + } + +-- +2.7.1 + diff --git a/0004-xawtv-Allow-setting-alsa_latency-from-.xawtv.patch b/0004-xawtv-Allow-setting-alsa_latency-from-.xawtv.patch new file mode 100644 index 0000000..7fb192a --- /dev/null +++ b/0004-xawtv-Allow-setting-alsa_latency-from-.xawtv.patch @@ -0,0 +1,83 @@ +From 196a14977a6c783cf4df531f8a71949763a63527 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 2 Feb 2016 12:46:46 +0100 +Subject: [PATCH xawtv3 4/9] xawtv: Allow setting alsa_latency from ~/.xawtv + +This avoids the need to always have to specify this on the cmdline on +systems which need a value different from the default. + +Signed-off-by: Hans de Goede +--- + man/xawtvrc.5 | 5 +++++ + x11/xt.c | 16 +++++++++++++--- + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/man/xawtvrc.5 b/man/xawtvrc.5 +index 136ceba..f1c3333 100644 +--- a/man/xawtvrc.5 ++++ b/man/xawtvrc.5 +@@ -209,6 +209,11 @@ details. + .TP + .B filter = name + Enable the specified filter. ++.TP ++.B alsa_latency = time_in_ms ++This can be used to specify the latency for the ALSA digital sound loopback ++which xawtv does. The default is 30ms if you're getting sound dropouts on your ++system try increasing this setting. + .SS The [launch] section + You can start other programs from within xawtv. This is configured + with entries in the "[launch]" section: +diff --git a/x11/xt.c b/x11/xt.c +index 2065ff4..9affb4a 100644 +--- a/x11/xt.c ++++ b/x11/xt.c +@@ -65,6 +65,10 @@ + + /*----------------------------------------------------------------------*/ + ++#define ALSA_LATENCY_DEFAULT 30 ++#define STR(X) __STR(X) ++#define __STR(X) #X ++ + XtAppContext app_context; + Widget app_shell, tv; + Widget on_shell; +@@ -167,7 +171,7 @@ XtResource args_desc[] = { + "alsa_latency", + XtCValue, XtRInt, sizeof(int), + XtOffset(struct ARGS*,alsa_latency), +- XtRString, "30" ++ XtRString, STR(ALSA_LATENCY_DEFAULT) + },{ + /* Integer */ + "debug", +@@ -1414,9 +1418,15 @@ static void x11_mute_notify(int val) + { + if (val) + alsa_thread_stop(); +- else if (!alsa_thread_is_running()) ++ else if (!alsa_thread_is_running()) { ++ if (args.readconfig && args.alsa_latency == ALSA_LATENCY_DEFAULT) { ++ int val = cfg_get_int("global", "alsa_latency"); ++ if (val > 0) ++ args.alsa_latency = val; ++ } + alsa_thread_startup(alsa_out, alsa_cap, args.alsa_latency, + stderr, debug); ++ } + } + #endif + +@@ -1698,7 +1708,7 @@ usage(void) + " -(no)alsa enable/disable alsa streaming. Default: enabled\n" + " -(no)alsa-cap manually specify an alsa capture interface\n" + " -(no)alsa-pb manually specify an alsa playback interface\n" +- " -alsa-latency manually specify an alsa latency in ms. Default: 30\n" ++ " -alsa-latency manually specify an alsa latency in ms. Default: " STR(ALSA_LATENCY_DEFAULT) "\n" + #endif + " -b -bpp n color depth of the display is n (n=24,32)\n" + " -o -outfile file filename base for snapshots\n" +-- +2.7.1 + diff --git a/0005-v4l2-Add-a-workaround-for-bttv-kernel-driver-planar-.patch b/0005-v4l2-Add-a-workaround-for-bttv-kernel-driver-planar-.patch new file mode 100644 index 0000000..2a62d4a --- /dev/null +++ b/0005-v4l2-Add-a-workaround-for-bttv-kernel-driver-planar-.patch @@ -0,0 +1,48 @@ +From 033d4af24e572741d0ab4f6064f01665395c38f9 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 7 Feb 2016 17:21:19 +0100 +Subject: [PATCH xawtv3 5/9] v4l2: Add a workaround for bttv kernel driver + planar fmt width bug + +The bttv driver has a bug where it will return a width which is not +a multiple of 16 for planar formats, while it cannot handle this, +this commit adds a workaround for this. + +A kernel fix has been send upstream for this for 4.5 / 4.6, so +eventually this workaround should be removed again. + +Signed-off-by: Hans de Goede +--- + libng/plugins/drv0-v4l2.tmpl.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/libng/plugins/drv0-v4l2.tmpl.c b/libng/plugins/drv0-v4l2.tmpl.c +index 2cbd34b..8186ac7 100644 +--- a/libng/plugins/drv0-v4l2.tmpl.c ++++ b/libng/plugins/drv0-v4l2.tmpl.c +@@ -1122,6 +1122,22 @@ retry: + } + if (h->fmt_v4l2.fmt.pix.pixelformat != xawtv_pixelformat[fmt->fmtid]) + return -1; ++ ++ /* ++ * The bttv driver has a bug where it will return a width which is not ++ * a multiple of 16 for planar formats, while it cannot handle this, ++ * fix this up. ++ * ++ * A kernel fix has been send upstream for this for 4.5 / 4.6, so ++ * eventually this workaround should be removed. ++ */ ++ if (!strcmp(h->cap.driver, "bttv") && ++ (fmt->fmtid == VIDEO_YUV422P || fmt->fmtid == VIDEO_YUV420P) && ++ h->fmt_v4l2.fmt.pix.width % 16) { ++ fmt->width = h->fmt_v4l2.fmt.pix.width & ~15; ++ goto retry; ++ } ++ + fmt->width = h->fmt_v4l2.fmt.pix.width; + fmt->height = h->fmt_v4l2.fmt.pix.height; + fmt->bytesperline = h->fmt_v4l2.fmt.pix.bytesperline; +-- +2.7.1 + diff --git a/0006-get_media_devices.c-Remove-superfluous-add-end-of-fu.patch b/0006-get_media_devices.c-Remove-superfluous-add-end-of-fu.patch new file mode 100644 index 0000000..b29266a --- /dev/null +++ b/0006-get_media_devices.c-Remove-superfluous-add-end-of-fu.patch @@ -0,0 +1,45 @@ +From 5ccb09b039bcc517293bd1013faa86719a950a51 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 11 Feb 2016 13:11:48 +0100 +Subject: [PATCH xawtv3 6/9] get_media_devices.c: Remove superfluous ; add end + of functions + +Signed-off-by: Hans de Goede +--- + common/get_media_devices.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/common/get_media_devices.c b/common/get_media_devices.c +index a2d6354..619734e 100644 +--- a/common/get_media_devices.c ++++ b/common/get_media_devices.c +@@ -227,7 +227,7 @@ static int add_v4l_class(struct media_device_entry *md) + md->type = MEDIA_V4L_SUBDEV; + + return 0; +-}; ++} + + static int add_snd_class(struct media_device_entry *md) + { +@@ -270,7 +270,7 @@ static int add_snd_class(struct media_device_entry *md) + md->node = strdup(node); + + return 0; +-}; ++} + + static int add_dvb_class(struct media_device_entry *md) + { +@@ -294,7 +294,7 @@ static int add_dvb_class(struct media_device_entry *md) + md->type = MEDIA_DVB_OSD; + + return 0; +-}; ++} + + static int sort_media_device_entry(const void *a, const void *b) + { +-- +2.7.1 + diff --git a/0007-mtt-Fix-mtt-not-being-able-to-tune-tv-channels.patch b/0007-mtt-Fix-mtt-not-being-able-to-tune-tv-channels.patch new file mode 100644 index 0000000..af351e5 --- /dev/null +++ b/0007-mtt-Fix-mtt-not-being-able-to-tune-tv-channels.patch @@ -0,0 +1,28 @@ +From d9a279f4d71edd070e7a549f29541951e546c60e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 15 Feb 2016 22:07:50 +0100 +Subject: [PATCH xawtv3 7/9] mtt: Fix mtt not being able to tune tv channels + +Teletext should use the tv tuner not the radio tuner... + +Signed-off-by: Hans de Goede +--- + x11/vbi-gui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/x11/vbi-gui.c b/x11/vbi-gui.c +index f4b19da..429c8b2 100644 +--- a/x11/vbi-gui.c ++++ b/x11/vbi-gui.c +@@ -917,7 +917,7 @@ static void vbi_station_cb(Widget widget, XtPointer client, XtPointer call) + struct v4l2_frequency frequency; + + memset (&frequency, 0, sizeof(frequency)); +- frequency.type = V4L2_TUNER_RADIO; ++ frequency.type = V4L2_TUNER_ANALOG_TV; + frequency.frequency = channels[i]->freq; + if (-1 == ioctl(vbi->fd, VIDIOC_S_FREQUENCY, &frequency)) + perror("ioctl VIDIOCSFREQ"); +-- +2.7.1 + diff --git a/0008-Add-desktop-and-appdata-files-for-xawtv-motv-and-mtt.patch b/0008-Add-desktop-and-appdata-files-for-xawtv-motv-and-mtt.patch new file mode 100644 index 0000000..84ee4b7 --- /dev/null +++ b/0008-Add-desktop-and-appdata-files-for-xawtv-motv-and-mtt.patch @@ -0,0 +1,146 @@ +From b9f78802002fdca9e61cd67e257ad7ad9ef3ee28 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 15 Feb 2016 18:24:16 +0100 +Subject: [PATCH xawtv3 8/9] Add desktop and appdata files for xawtv, motv and + mtt + +Signed-off-by: Hans de Goede +--- + contrib/motv.desktop | 10 ++++++++++ + contrib/motv.metainfo.xml | 11 +++++++++++ + contrib/mtt.desktop | 10 ++++++++++ + contrib/mtt.metainfo.xml | 11 +++++++++++ + contrib/xawtv.appdata.xml | 33 +++++++++++++++++++++++++++++++++ + contrib/xawtv.desktop | 10 ++++++++++ + 6 files changed, 85 insertions(+) + create mode 100644 contrib/motv.desktop + create mode 100644 contrib/motv.metainfo.xml + create mode 100644 contrib/mtt.desktop + create mode 100644 contrib/mtt.metainfo.xml + create mode 100644 contrib/xawtv.appdata.xml + create mode 100644 contrib/xawtv.desktop + +diff --git a/contrib/motv.desktop b/contrib/motv.desktop +new file mode 100644 +index 0000000..37093d4 +--- /dev/null ++++ b/contrib/motv.desktop +@@ -0,0 +1,10 @@ ++[Desktop Entry] ++Comment=Analog TV viewing application ++Icon=xawtv ++Exec=motv ++Name=MoTV Television Viewer ++Terminal=false ++StartupNotify=false ++Type=Application ++Categories=AudioVideo;Video; ++Keywords=video;tv;viewer;v4l;v4l2;video4linux; +diff --git a/contrib/motv.metainfo.xml b/contrib/motv.metainfo.xml +new file mode 100644 +index 0000000..7d3bc31 +--- /dev/null ++++ b/contrib/motv.metainfo.xml +@@ -0,0 +1,11 @@ ++ ++ ++ motv.desktop ++ xawtv.desktop ++ CC0-1.0 ++ GPL-2.0+ ++ MoTV Television Viewer ++ Motif UI version of xawtv ++ http://linuxtv.org/wiki/index.php/Xawtv ++ jwrdegoede_at_fedoraproject.org ++ +diff --git a/contrib/mtt.desktop b/contrib/mtt.desktop +new file mode 100644 +index 0000000..f04c29a +--- /dev/null ++++ b/contrib/mtt.desktop +@@ -0,0 +1,10 @@ ++[Desktop Entry] ++Comment=Analog TV Teletext viewing application ++Icon=xawtv ++Exec=mtt ++Name=MTT Teletext Viewer ++Terminal=false ++StartupNotify=false ++Type=Application ++Categories=AudioVideo;Video; ++Keywords=video;tv;viewer;v4l;v4l2;video4linux;teletext; +diff --git a/contrib/mtt.metainfo.xml b/contrib/mtt.metainfo.xml +new file mode 100644 +index 0000000..28f5c84 +--- /dev/null ++++ b/contrib/mtt.metainfo.xml +@@ -0,0 +1,11 @@ ++ ++ ++ mtt.desktop ++ xawtv.desktop ++ CC0-1.0 ++ GPL-2.0+ ++ MTT Teletext Viewer ++ Easy to use Teletext GUI ++ http://linuxtv.org/wiki/index.php/Xawtv ++ jwrdegoede_at_fedoraproject.org ++ +diff --git a/contrib/xawtv.appdata.xml b/contrib/xawtv.appdata.xml +new file mode 100644 +index 0000000..92959d2 +--- /dev/null ++++ b/contrib/xawtv.appdata.xml +@@ -0,0 +1,33 @@ ++ ++ ++ xawtv.desktop ++ CC0-1.0 ++ GPL-2.0+ ++ xawtv ++ Analog TV viewing application ++ ++

++ xawtv was originally just an analog TV viewing application for Bttv ++ devices (bt848, bt878) using the Athena widgets, but evolved into a ++ small suite of X11 applications for V4L devices. ++

++

++ The xawtv package includes a number of useful console commandline ++ utilities: ++

++
    ++
  • alevtd - a http deamon for use with analogue TV teletext
  • ++
  • radio -- a console radio listening app
  • ++
  • scantv -- an analogue TV frequency scanner
  • ++
  • v4l-conf -- current video mode (size and color depth)
  • ++
  • v4lctl -- used to control a v4l device and set varying image parameters
  • ++
  • webcam -- capture images from a webcam
  • ++
++
++ http://linuxtv.org/wiki/index.php/Xawtv ++ ++ http://www.easylinux.de/Artikel/ausgabe/2004/01/036-xawtv/tv_8.png ++ http://www.easylinux.de/Artikel/ausgabe/2004/01/036-xawtv/xawtv1.png ++ ++ jwrdegoede_at_fedoraproject.org ++
+diff --git a/contrib/xawtv.desktop b/contrib/xawtv.desktop +new file mode 100644 +index 0000000..349394d +--- /dev/null ++++ b/contrib/xawtv.desktop +@@ -0,0 +1,10 @@ ++[Desktop Entry] ++Comment=Analog TV viewing application ++Icon=xawtv ++Exec=xawtv ++Name=XawTV Television Viewer ++Terminal=false ++StartupNotify=false ++Type=Application ++Categories=AudioVideo;Video; ++Keywords=video;tv;viewer;v4l;v4l2;video4linux; +-- +2.7.1 + diff --git a/0009-alevtd-Drop-supplementary-group-IDs-when-dropping-pr.patch b/0009-alevtd-Drop-supplementary-group-IDs-when-dropping-pr.patch new file mode 100644 index 0000000..695a93f --- /dev/null +++ b/0009-alevtd-Drop-supplementary-group-IDs-when-dropping-pr.patch @@ -0,0 +1,44 @@ +From 2344af22120f3092a044881c4ed14af17a0d6f41 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 15 Feb 2016 23:10:12 +0100 +Subject: [PATCH xawtv3 9/9] alevtd: Drop supplementary group IDs when dropping + privileges + +Noticed by rpmlint, seek POS36-C on the web for details about the problem. + +Signed-off-by: Hans de Goede +--- + vbistuff/alevtd.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/vbistuff/alevtd.c b/vbistuff/alevtd.c +index c6211d3..2df4886 100644 +--- a/vbistuff/alevtd.c ++++ b/vbistuff/alevtd.c +@@ -168,8 +168,10 @@ fix_ug(void) + } + + /* set group */ +- if (getegid() != gr->gr_gid || getgid() != gr->gr_gid) ++ if (getegid() != gr->gr_gid || getgid() != gr->gr_gid) { ++ setgroups(0, NULL); + setgid(gr->gr_gid); ++ } + if (getegid() != gr->gr_gid || getgid() != gr->gr_gid) { + xerror(LOG_ERR,"setgid failed",NULL); + exit(1); +@@ -177,8 +179,10 @@ fix_ug(void) + strncpy(group,gr->gr_name,16); + + /* set user */ +- if (geteuid() != pw->pw_uid || getuid() != pw->pw_uid) ++ if (geteuid() != pw->pw_uid || getuid() != pw->pw_uid) { ++ setgroups(0, NULL); + setuid(pw->pw_uid); ++ } + if (geteuid() != pw->pw_uid || getuid() != pw->pw_uid) { + xerror(LOG_ERR,"setuid failed",NULL); + exit(1); +-- +2.7.1 + diff --git a/xawtv-3.103-cap_streaming.patch b/xawtv-3.103-cap_streaming.patch deleted file mode 100644 index 9679018..0000000 --- a/xawtv-3.103-cap_streaming.patch +++ /dev/null @@ -1,56 +0,0 @@ -From dddc0a9664387497e2701afac6c9feca72650e28 Mon Sep 17 00:00:00 2001 -From: Stas Sergeev -Date: Sat, 27 Dec 2014 22:04:58 +0300 -Subject: [PATCH] v4l2_getimage: prefer CAP_STREAMING over CAP_READWRITE - ---- - libng/plugins/drv0-v4l2.tmpl.c | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/libng/plugins/drv0-v4l2.tmpl.c b/libng/plugins/drv0-v4l2.tmpl.c -index ded868d..2cbd34b 100644 ---- a/libng/plugins/drv0-v4l2.tmpl.c -+++ b/libng/plugins/drv0-v4l2.tmpl.c -@@ -1241,7 +1241,19 @@ v4l2_getimage(void *handle) - - size = h->fmt_me.bytesperline * h->fmt_me.height; - buf = ng_malloc_video_buf(&h->fmt_me,size); -- if (h->cap.capabilities & V4L2_CAP_READWRITE) { -+ if (h->cap.capabilities & V4L2_CAP_STREAMING) { -+ if (-1 == v4l2_start_streaming(h,1)) { -+ v4l2_stop_streaming(h); -+ return NULL; -+ } -+ frame = v4l2_waiton(h); -+ if (-1 == frame) { -+ v4l2_stop_streaming(h); -+ return NULL; -+ } -+ memcpy(buf->data,h->buf_me[0].data,size); -+ v4l2_stop_streaming(h); -+ } else { - #ifndef USE_LIBV4L - rc = read(h->fd,buf->data,size); - #else /* USE_LIBV4L */ -@@ -1269,18 +1281,6 @@ v4l2_getimage(void *handle) - ng_release_video_buf(buf); - return NULL; - } -- } else { -- if (-1 == v4l2_start_streaming(h,1)) { -- v4l2_stop_streaming(h); -- return NULL; -- } -- frame = v4l2_waiton(h); -- if (-1 == frame) { -- v4l2_stop_streaming(h); -- return NULL; -- } -- memcpy(buf->data,h->buf_me[0].data,size); -- v4l2_stop_streaming(h); - } - return buf; - } --- -2.1.0 - diff --git a/xawtv.spec b/xawtv.spec index e3b04b2..b4edbf4 100644 --- a/xawtv.spec +++ b/xawtv.spec @@ -1,25 +1,31 @@ -%bcond_with motif %bcond_with quicktime Summary: TV applications for video4linux compliant devices Name: xawtv Version: 3.103 -Release: 7%{?dist} +Release: 8%{?dist} Group: Applications/Multimedia License: GPLv2+ -URL: http://git.linuxtv.org/xawtv3.git +URL: http://linuxtv.org/wiki/index.php/Xawtv Source0: http://linuxtv.org/downloads/xawtv/%{name}-%{version}.tar.bz2 Source1: xawtv.desktop -Patch1: xawtv-3.103-cap_streaming.patch +Patch1: 0001-XV-Fix-segfault-under-certain-conditions.patch +Patch2: 0002-v4l2_getimage-prefer-CAP_STREAMING-over-CAP_READWRIT.patch +Patch3: 0003-alsa-Fix-not-being-able-to-get-a-larger-latency-on-c.patch +Patch4: 0004-xawtv-Allow-setting-alsa_latency-from-.xawtv.patch +Patch5: 0005-v4l2-Add-a-workaround-for-bttv-kernel-driver-planar-.patch +Patch6: 0006-get_media_devices.c-Remove-superfluous-add-end-of-fu.patch +Patch7: 0007-mtt-Fix-mtt-not-being-able-to-tune-tv-channels.patch +Patch8: 0008-Add-desktop-and-appdata-files-for-xawtv-motv-and-mtt.patch +Patch9: 0009-alevtd-Drop-supplementary-group-IDs-when-dropping-pr.patch BuildRequires: mesa-libGL-devel, libXaw-devel, libXext-devel BuildRequires: libXft-devel, libXinerama-devel BuildRequires: libXpm-devel, libXrandr-devel, libXt-devel BuildRequires: libXxf86dga-devel, libXv-devel -# Note: it compiles with lesstif-devel, but does not work properly. -%{?with_motif:BuildRequires: openmotif-devel} +BuildRequires: motif-devel %{?with_quicktime:BuildRequires: libquicktime-devel} BuildRequires: ncurses-devel, fileutils, libjpeg-devel, libpng-devel @@ -29,12 +35,11 @@ BuildRequires: libdv-devel %endif BuildRequires: zvbi-devel, aalib-devel BuildRequires: gpm-devel, slang-devel -BuildRequires: desktop-file-utils +BuildRequires: ImageMagick desktop-file-utils libappstream-glib BuildRequires: libv4l-devel Requires: usermode xorg-x11-fonts-misc hicolor-icon-theme - %description Xawtv is a simple xaw-based TV program which uses the bttv driver or video4linux. Xawtv contains various command-line utilities for @@ -42,49 +47,62 @@ grabbing images and .avi movies, for tuning in to TV stations, etc. Xawtv also includes a grabber driver for vic. +%package motv +Summary: MoTV Analog Television Viewer +Requires: %{name} = %{version}-%{release} + +%description motv +Motif UI version of the xawtv analog television viewer. + + +%package mtt +Summary: Analog TV Teletext viewing application +Requires: %{name} = %{version}-%{release} + +%description mtt +Easy to use Motif UI for viewing analog tv teletext on video4linux devices +which support teletext. + + %prep %setup -q %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build export CFLAGS="$RPM_OPT_FLAGS -Wno-pointer-sign" - -%if %{with motif} -export X_LIBS="-L/usr/lib/openmotif" -export X_CFLAGS="-I/usr/include/openmotif" -%endif - -%configure \ - %{!?_with_motif: --disable-motif} \ - %{!?_with_quicktime: --disable-quicktime} +%configure %{!?_with_quicktime: --disable-quicktime} make %{?_smp_mflags} verbose=yes %install -make DESTDIR=$RPM_BUILD_ROOT SUID_ROOT="" install - -%if %{without motif} -rm -f $RPM_BUILD_ROOT%{_mandir}/*/motv.* -rm -f $RPM_BUILD_ROOT%{_mandir}/*/mtt.* -%endif +%make_install SUID_ROOT="" %if %{without quicktime} rm -f $RPM_BUILD_ROOT%{_bindir}/showqt %endif for i in 16x16 32x32 48x48; do mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$i/apps - install -p -m 0644 contrib/%{name}$i.xpm \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$i/apps/%{name}.xpm + convert contrib/%{name}$i.xpm \ + $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$i/apps/%{name}.png done -desktop-file-install \ -%if 0%{?fedora} && 0%{?fedora} < 19 - --vendor fedora \ -%endif - --dir $RPM_BUILD_ROOT%{_datadir}/applications \ - %{SOURCE1} - +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata +for i in xawtv motv mtt; do + desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \ + contrib/$i.desktop + install -p -m 0644 contrib/$i.*.xml $RPM_BUILD_ROOT%{_datadir}/appdata + appstream-util validate-relax --nonet \ + $RPM_BUILD_ROOT%{_datadir}/appdata/$i.*.xml +done # v4l-conf stuff @@ -127,27 +145,54 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files +%doc README TODO contrib/frequencies* +%license COPYING %config(noreplace) %{_sysconfdir}/pam.d/v4l-conf %config(noreplace) %{_sysconfdir}/security/console.apps/v4l-conf %{_bindir}/* +%exclude %{_bindir}/motv +%exclude %{_bindir}/mtt %{_sbindir}/* %{_libdir}/xawtv %{_datadir}/xawtv -%{_datadir}/X11/app-defaults/* -%{_datadir}/icons/hicolor/*/apps/%{name}.xpm -%{_datadir}/applications/* +%{_datadir}/X11/app-defaults/Xawtv +%{_datadir}/icons/hicolor/*/apps/%{name}.png +%{_datadir}/appdata/%{name}.appdata.xml +%{_datadir}/applications/%{name}.desktop %{_mandir}/man?/* +%exclude %{_mandir}/man1/motv.1* +%exclude %{_mandir}/man1/mtt.1* %lang(es) %{_mandir}/es/*/* %lang(fr) %{_mandir}/fr/*/* -%doc COPYING README TODO contrib/frequencies* -%if %{with motif} -%lang(de) %{_datadir}/X11/de_DE.UTF-8/app-defaults/* -%lang(fr) %{_datadir}/X11/fr_FR.UTF-8/app-defaults/* -%lang(fr) %{_datadir}/X11/it_IT.UTF-8/app-defaults/* -%endif + +%files motv +%{_bindir}/motv +%{_mandir}/man1/motv.1* +%{_datadir}/X11/app-defaults/MoTV* +%lang(de) %{_datadir}/X11/de_DE.UTF-8/app-defaults/MoTV* +%lang(fr) %{_datadir}/X11/fr_FR.UTF-8/app-defaults/MoTV* +%lang(it) %{_datadir}/X11/it_IT.UTF-8/app-defaults/MoTV* +%{_datadir}/appdata/motv.metainfo.xml +%{_datadir}/applications/motv.desktop + +%files mtt +%{_bindir}/mtt +%{_mandir}/man1/mtt.1* +%{_datadir}/X11/app-defaults/mtt* +%{_datadir}/appdata/mtt.metainfo.xml +%{_datadir}/applications/mtt.desktop %changelog +* Mon Feb 15 2016 Hans de Goede - 3.103-8 +- Bring in several bugfix patch from upstream +- Fix crash with saa7134 driver (rhbz#1305389) +- Use png instead of xpm for icons +- Add appdata +- Build motv and mtt now that we have a FOSS motif, put them in + xawtv-motv resp xawtv-mtt sub-packages +- Remove changelog entries older then 10 years + * Fri Feb 05 2016 Fedora Release Engineering - 3.103-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild @@ -210,7 +255,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - Update to Xawtv version 3.99.rc2 - All other patches from Fedora are now upstream -* Thu Jan 28 2011 Mauro Carvalho Chehab 3.99.rc1-1 +* Fri Jan 28 2011 Mauro Carvalho Chehab 3.99.rc1-1 - Update to Xawtv version 3.99.rc1 - Applied some fixes upstream fixing radio application and also some improvements from other patches that were found on Fedora. @@ -287,222 +332,3 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : bitstream-vera is now a default for "big" fullscreen-mode fonts. - add desktop entry and icons - add ALEVTD_REGION environment to change default teletext's region - - -* Tue Oct 21 2003 Florian La Roche -- add BuildReq for fontconfig-devel and freetype-devel, these seem - to get picked up - -* Mon Sep 01 2003 Than Ngo 3.88-5 -- Added missing BuildRequires for libpng-devel (bug #103447) - -* Tue Jun 17 2003 Than Ngo 3.88-4 -- fixed permission problem (bug #90921) - -* Tue Jun 17 2003 Than Ngo 3.88-3 -- rebuilt - -* Wed Jun 04 2003 Elliot Lee -- rebuilt - -* Tue May 6 2003 Than Ngo 3.88-1 -- 3.88 - -* Thu Mar 3 2003 Than Ngo 3.85-1 -- 3.85, (#85557, #81588, #74684, #61717) -- own /usr/lib/xawtv, (bug #73981) -- dependency on libjpeg-devel, (bug #48925) -- include alevtd daemon (bug #53878) -- create default configuration by install (bug #73270) - -* Sun Feb 10 2003 Than Ngo 3.81-6 -- install correct pam file, #83820 - -* Mon Jan 27 2003 Than Ngo 3.81-5 -- fix #81791 - -* Wed Jan 22 2003 Tim Powers -- rebuilt - -* Tue Jan 21 2003 Than Ngo 3.81-3 -- fix #81851 - -* Mon Dec 16 2002 Than Ngo 3.81-2 -- rebuild - -* Fri Dec 13 2002 Than Ngo 3.81-1 -- update 3.81 -- move bitmap fonts to bitmap-fonts package - -* Tue Nov 12 2002 Nalin Dahyabhai 3.78-2 -- adjust PAM configuration to not use absolute paths so that the right module - set gets used for the current arch on multilib systems - -* Thu Nov 7 2002 Than Ngo 3.78-1 -- 3.78 - -* Fri Jun 21 2002 Tim Powers -- automated rebuild - -* Thu Jun 20 2002 Than Ngo 3.74-3 -- Don't forcibly strip binaries - -* Sun May 26 2002 Tim Powers -- automated rebuild - -* Thu May 23 2002 Harald Hoyer -- 3.74 - -* Sun Apr 07 2002 han Ngo 3.73-3 -- remove motv manpage (#62771) - -* Tue Apr 2 2002 Than Ngo 3.73-2 -- get rid of openmotif - -* Sun Mar 24 2002 Than Ngo 3.73-1 -- update -- fix bug #61719 - -* Fri Mar 22 2002 Tim Powers -- rebuilt motv against new openmotif-2.2.2 - -* Tue Feb 26 2002 Than Ngo 3.72-1 -- update to 3.72 - -* Tue Feb 19 2002 Bernhard Rosenkraenzer 3.71-1 -- 3.71 - -* Fri Jan 18 2002 Than Ngo 3.68-1 -- update to 3.68 -- enable XFree extensions -- fix Url -- add missing plugins - -* Wed Dec 5 2001 Than Ngo 3.65-1 -- update to 3.65 -- fix build on ia64 - -* Wed Nov 14 2001 Than Ngo 3.64-1 -- update to 3.64 - -* Mon Sep 17 2001 Than Ngo 3.62-1 -- update to 3.62 (bug #53711 #52847) - -* Tue Aug 28 2001 Than Ngo 3.54-5 -- fix spec file bug (Bug #52675) - -* Fri Aug 10 2001 Than Ngo 3.54-4 -- add requires usermode (bug #51474) - -* Sun Aug 5 2001 Nalin Dahyabhai 3.54-3 -- tweak PAM setup so that v4l-conf can access the display properly - -* Tue Jul 10 2001 Elliot Lee 3.54-2 -- Rebuild to remove libXv/libXxf86dga deps - -* Mon Jul 02 2001 Than Ngo -- update to 3.54 - -* Fri Jun 22 2001 Than Ngo -- update to 3.53 -- add buildprereq -- remove some uneeeded patches - -* Tue Jun 19 2001 Karsten Hopp -- excludearch s390 s390x - -* Wed Jun 13 2001 Than Ngo -- update to 3.51 - -* Thu Jun 07 2001 Than Ngo -- update to 3.50 - -* Thu May 31 2001 Than Ngo -- udate to 3.49 - -* Tue May 22 2001 Than Ngo -- update to 3.48 - -* Mon May 21 2001 Tim Powers -- built for the distro - -* Wed May 18 2001 Karsten Hopp -- make xawtv work with kernel-2.4 - -* Wed May 16 2001 Than Ngo -- update to 3.47 - -* Mon May 07 2001 Than Ngo -- update to 3.45 -- add missing fonts - -* Tue Feb 13 2001 Than Ngo -- update to 3.34 -- use consolehelper for v4l-conf -- add excludearch sparc, bdftopcf is broken on sparc - -* Wed Jan 24 2001 Than Ngo -- updated to 3.30 -- use /dev/video0 instead /dev/video (bug #24871) -- fixed dependencies (Bug #24881) - -* Sun Nov 19 2000 Than Ngo -- update to 3.24 -- add missing tools (rootv,scantv) -- add missing prereq on xset and mkfontdir - -* Fri Nov 3 2000 Than Ngo -- update to 3.23 - -* Wed Aug 23 2000 Tim Powers -- rebuilt against new XFree86 to fix DGA problems - -* Mon Aug 21 2000 Than Ngo -- update to 3.18 (Bugfix release) -- option -nodga to disable DGA (Bug #16577, #15702) -- compress fonts with gzip - -* Mon Aug 07 2000 Tim Powers -- fixed bug #15435 - -* Mon Aug 07 2000 Than Ngo -- rebuilt against the new DGA -- fixed in post and postun, so that it does not - emits to console (Bug #15436) - - -* Sat Jul 29 2000 Than Ngo -- update to 3.17 - -* Mon Jul 24 2000 Prospector -- rebuilt - -* Wed Jul 12 2000 Than Ngo -- FHS fixes - -* Mon Jul 03 2000 Prospector -- automatic rebuild - -* Sun May 28 2000 Ngo Than -- update to 3.14 for 7.0 -- put man page in correct place -- add webcam -- bzip2 source -- cleanup specfile - -* Wed Jan 19 2000 Preston Brown -- font fix (#8610) in post and postun -- add missing files in bin - -* Sun Jan 16 2000 Preston Brown -- whoops! 3.07 already bugfix release - -* Fri Jan 14 2000 Ngo Than -- updated to 3.06 - -* Mon Jul 26 1999 Tim Powers -- updated to 2.46 -- built for 6.1 - -* Wed Apr 28 1999 Preston Brown -- initial build for Powertools 6.0