From 18cc3ab773121656dd805f304228e54a2a47ee4a Mon Sep 17 00:00:00 2001 From: "bdefreese@debian2.bddebian.com" Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 1/8] configure_gtk2 Gbp-Pq: Name 0001-configure_gtk2.patch --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ab14ad7..7f4844d 100755 --- a/configure +++ b/configure @@ -20082,7 +20082,7 @@ fi have_gtk="false" if $use_gtk; then - REQUIRES='glib >= 1.2.4 gtk+ >= 1.2.4' + REQUIRES='glib-2.0 >= 2.0.0 gtk+-2.0 >= 2.0.0' if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then diff --git a/configure.ac b/configure.ac index 2b95735..753068d 100644 --- a/configure.ac +++ b/configure.ac @@ -162,7 +162,7 @@ AM_CONDITIONAL(HOST_X86_64, test x$arch_x86_64 = xtrue) dnl Checks for libraries. have_gtk="false" if $use_gtk; then - REQUIRES='glib >= 1.2.4 gtk+ >= 1.2.4' + REQUIRES='glib-2.0 >= 2.0.0 gtk+-2.0 >= 2.0.0' PKG_CHECK_MODULES(GTK,$REQUIRES,have_gtk="true",have_gtk="false") AC_DEFINE(HAVE_GTK) fi From 9136e4d3df1fff3659fc145bd9607c685609779d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 2/8] Add proper Hurd-specific _IOT defines for the video1394_mmap and video1394_wait structs. Gbp-Pq: Name 0002-hurd_ftbfs_fix.patch --- encodedv/dvconnect.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/encodedv/dvconnect.c b/encodedv/dvconnect.c index f276846..10be339 100644 --- a/encodedv/dvconnect.c +++ b/encodedv/dvconnect.c @@ -117,6 +117,13 @@ struct video1394_wait #define VIDEO1394_LISTEN_POLL_BUFFER \ _IOWR('#', 0x18, struct video1394_wait) +#ifdef __GNU__ +#define _IOT_video1394_mmap \ + _IOT(_IOTS(int), 1, _IOTS(unsigned int), 7, 0, 0) +#define _IOT_video1394_wait \ + _IOT(_IOTS(unsigned int), 2, _IOTS(struct timeval), 1, 0, 0) +#endif + static int cap_start_frame = 0; static int cap_num_frames = 0xfffffff; static int cap_verbose_mode; From 3ef513ad64b13761cfe029663c5e90c7cf51c20e Mon Sep 17 00:00:00 2001 From: Daniel Kobras Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 3/8] dv_types.h is part of the libdv API that has to be included in application code. Therefore, it may not reference libdv's private config.h. Of course, config.h was included for a reason, and this patch tries to cover it up, because at least in the scope of the Debian package we can reliably guess at the contents of config.h. Gbp-Pq: Name 0003-zap_config_h.patch --- libdv/dv_types.h | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/libdv/dv_types.h b/libdv/dv_types.h index 1f90561..be141a5 100644 --- a/libdv/dv_types.h +++ b/libdv/dv_types.h @@ -26,10 +26,11 @@ #ifndef DV_TYPES_H #define DV_TYPES_H -#if HAVE_CONFIG_H -# include -#endif - +/* The Debian package is always compiled with popt support, but using it + * in an application is optional. Declare HAVE_LIBPOPT before including + * the libdv headers in order to access popt-specific entries in the + * libdv API. + */ #if HAVE_LIBPOPT #include #endif // HAVE_LIBPOPT @@ -38,11 +39,11 @@ #include #include #include -#if HAVE_ENDIAN_H +/* FIXME Some systems use machine/endian.h instead. We probably ought to + * AC_SUBST the correct value in here. (Or use a namespace-clean dvconfig.h.) + * This quick fix should do for glibc-based systems. + */ #include -#elif HAVE_MACHINE_ENDIAN_H -#include -#endif /* please tell me these are defined somewhere standard??? */ #ifndef FALSE @@ -61,16 +62,33 @@ #define CLAMP(a,x,b) (MIN(b,MAX(a,x))) #endif +/* FIXME These values indicate whether libdv was built with asm optimizations. + * It had better be AC_SUBSTed, but for the purpose of the Debian package, we + * can easily guess the correct value from standard compiler macros. + */ +#if !defined(ARCH_X86) && !defined(ARCH_X86_64) +# if defined (__x86_64) +# define ARCH_X86 0 +# define ARCH_X86_64 1 +# elif defined(i386) +# define ARCH_X86 1 +# define ARCH_X86_64 0 +# else +# define ARCH_X86 0 +# define ARCH_X86_64 0 +# endif +#endif + // For now assume ARCH_X86 means GCC with hints. #ifdef ARCH_X86 -#define HAVE_GCC 1 +#define LIBDV_HAVE_GCC 1 #endif #ifdef ARCH_X86_64 -#define HAVE_GCC 1 +#define LIBDV_HAVE_GCC 1 #endif -//#define HAVE_GCC 0 +//#define LIBDV_HAVE_GCC 0 -#if HAVE_GCC +#if LIBDV_HAVE_GCC #define ALIGN64 __attribute__ ((aligned (64))) #define ALIGN32 __attribute__ ((aligned (32))) #define ALIGN8 __attribute__ ((aligned (8))) From 82fb853d7058c87e9314193b7952e8621852b811 Mon Sep 17 00:00:00 2001 From: Daniel Kobras Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 4/8] Removing inclusion of config.h from dv_types.h revealed two files that should include it themselves. Gbp-Pq: Name 0004-move_config_h_to_apps.patch --- encodedv/encodedv.c | 4 ++++ encodedv/insert_audio.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/encodedv/encodedv.c b/encodedv/encodedv.c index f50ba4b..32fd977 100644 --- a/encodedv/encodedv.c +++ b/encodedv/encodedv.c @@ -24,6 +24,10 @@ * The libdv homepage is http://libdv.sourceforge.net/. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include "libdv/dv_types.h" #include "libdv/dv.h" diff --git a/encodedv/insert_audio.c b/encodedv/insert_audio.c index a470926..0c68483 100644 --- a/encodedv/insert_audio.c +++ b/encodedv/insert_audio.c @@ -23,6 +23,10 @@ * The libdv homepage is http://libdv.sourceforge.net/. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "libdv/dv_types.h" #include From d8e1be60c26c491b31926936a2de2ae997ae566c Mon Sep 17 00:00:00 2001 From: Debian QA Group Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 5/8] Fix FTBFS with --no-add-needed. Gbp-Pq: Name 0005-no_as_needed.patch --- playdv/Makefile.am | 2 +- playdv/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playdv/Makefile.am b/playdv/Makefile.am index 1a3ae89..e5c9273 100644 --- a/playdv/Makefile.am +++ b/playdv/Makefile.am @@ -15,4 +15,4 @@ bin_PROGRAMS= playdv noinst_HEADERS= display.h oss.h playdv_SOURCES= playdv.c display.c display.h oss.c -playdv_LDADD= $(SDL_LIBS) $(GTK_LIBS) $(XV_LIB) ../libdv/libdv.la $(POPT_LIB) +playdv_LDADD= $(SDL_LIBS) $(GTK_LIBS) $(XV_LIB) ../libdv/libdv.la $(POPT_LIB) -lXext -lX11 diff --git a/playdv/Makefile.in b/playdv/Makefile.in index 39b98f1..45b44d3 100644 --- a/playdv/Makefile.in +++ b/playdv/Makefile.in @@ -213,7 +213,7 @@ CLEANFILES = AM_CFLAGS = $(SDL_CFLAGS) $(GTK_CFLAGS) noinst_HEADERS = display.h oss.h playdv_SOURCES = playdv.c display.c display.h oss.c -playdv_LDADD = $(SDL_LIBS) $(GTK_LIBS) $(XV_LIB) ../libdv/libdv.la $(POPT_LIB) +playdv_LDADD = $(SDL_LIBS) $(GTK_LIBS) $(XV_LIB) ../libdv/libdv.la $(POPT_LIB) -lXext -lX11 all: all-am .SUFFIXES: From ceadbe2a42989e59dd79579008a18158d7d8fb38 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 6/8] Fix small misspellings. Forwarded: no Gbp-Pq: Name 0006-misspellings.patch --- playdv/playdv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playdv/playdv.c b/playdv/playdv.c index 91736e6..dd6bff6 100644 --- a/playdv/playdv.c +++ b/playdv/playdv.c @@ -146,7 +146,7 @@ dv_player_new(void) result->option_table[DV_PLAYER_OPT_NO_MMAP] = (struct poptOption) { longName: "no-mmap", arg: &result->no_mmap, - descrip: "don't use mmap for reading. (usefull for pipes)" + descrip: "don't use mmap for reading. (useful for pipes)" }; /* no mmap */ result->option_table[DV_PLAYER_OPT_LOOP_COUNT] = (struct poptOption) { From 42dfb0442e52740d4b149168ad3427e6d55d9739 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 7/8] Fix hyphen-used-as-minus-sign. Forwarded: no Gbp-Pq: Name 0007-manpages.patch --- encodedv/encodedv.1 | 2 +- playdv/playdv.1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/encodedv/encodedv.1 b/encodedv/encodedv.1 index 3cf8b43..ec8f2e8 100644 --- a/encodedv/encodedv.1 +++ b/encodedv/encodedv.1 @@ -90,7 +90,7 @@ Choose output-filter: [>raw<] .TP \fB\-q\fR, \fB\-\-static\-qno\fR=\fItable-no\fR Static qno tables for quantisation on 2 VLC passes. -For turbo (but somewhat lossy encoding) try -q [1,2] -p [2,3]. +For turbo (but somewhat lossy encoding) try \-q [1,2] \-p [2,3]. There are only two static qno tables registered right now: 1 : for sharp DV pictures diff --git a/playdv/playdv.1 b/playdv/playdv.1 index c5e3a9d..6b0813a 100644 --- a/playdv/playdv.1 +++ b/playdv/playdv.1 @@ -61,9 +61,9 @@ target audio device; e.g. /dev/dsp, which is also the default. \fB\-\-audio\-file\fR=\fIfile\fR send raw decoded audio stream to \fIfile\fR, skipping audio ioctls. .TP -\fB\-\-audio\-mix\fR=\fI(-16 .. 16)\fR +\fB\-\-audio\-mix\fR=\fI(\-16 .. 16)\fR mixing level of 4 channel audio for 32KHz 12bit. 0 [default]. --16 selects second channel, 16 selects first channel. +\-16 selects second channel, 16 selects first channel. .PP Video Output Options .TP From 115743ce7a03c71874956f48e0935a227553a8ea Mon Sep 17 00:00:00 2001 From: Debian QA Group Date: Sat, 14 May 2022 00:43:58 +0800 Subject: [PATCH 8/8] YUV_420_USE_YV12 build option affects encoding of NTSC frames Gbp-Pq: Name 1001-yuv_420_use_yv12_wrong_encoding.patch --- libdv/encode.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libdv/encode.c b/libdv/encode.c index b5aabbe..2ec9b68 100644 --- a/libdv/encode.c +++ b/libdv/encode.c @@ -1712,15 +1712,15 @@ yuy2_to_ycb( uint8_t *data, int isPAL, short *img_y, short *img_cr, short *img_c /* --------------------------------------------------------------------------- */ static void -yv12_to_ycb( uint8_t **in, int isPAL, short *img_y, short *img_cr, short *img_cb) +yv12_to_ycb( uint8_t **in, short *img_y, short *img_cr, short *img_cb) { - register int total = DV_WIDTH * (isPAL ? DV_PAL_HEIGHT : DV_NTSC_HEIGHT); + register int total = DV_WIDTH * DV_PAL_HEIGHT; register int i, j, k; for (i = 0; i < total; i++) img_y[i] = (((short) in[0][i]) - 128) << DCT_YUV_PRECISION; - for (i = 0; i < (isPAL ? DV_PAL_HEIGHT : DV_NTSC_HEIGHT)/2; ++i) { + for (i = 0; i < (DV_PAL_HEIGHT / 2); ++i) { for (j = 0; j < DV_WIDTH/2 ; j++) { k = i * DV_WIDTH/2 + j; @@ -1796,11 +1796,12 @@ int dv_encode_full_frame(dv_encoder_t *dv_enc, uint8_t **in, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); break; case e_dv_color_yuv: -#ifndef YUV_420_USE_YV12 - yuy2_to_ycb( in[0], dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); -#else - yv12_to_ycb( in, dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); +#ifdef YUV_420_USE_YV12 + if (dv_enc->isPAL) + yv12_to_ycb( in, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); + else #endif + yuy2_to_ycb( in[0], dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); break; default: fprintf(stderr, "Invalid value for color_space "