On Thu, Oct 06, 2011 at 04:32:31PM -0400, Brad wrote: > Here is an update to mjpegtools 2.0.0.
An updated diff for mjpegtools and WANTLIB update diff for gst-plugins-bad. Index: Makefile =================================================================== RCS file: /home/cvs/ports/multimedia/mjpegtools/Makefile,v retrieving revision 1.29 diff -u -p -r1.29 Makefile --- Makefile 16 Sep 2011 10:31:23 -0000 1.29 +++ Makefile 12 Oct 2011 20:31:28 -0000 @@ -2,21 +2,16 @@ COMMENT= tools to edit/modify/encode video streams -DISTNAME= mjpegtools-1.9.0rc3 -REVISION= 7 +DISTNAME= mjpegtools-2.0.0 CATEGORIES= multimedia -SHARED_LIBS= lavfile 4.0 \ - lavfile-1.9 4.0 \ - lavjpeg 4.0 \ - lavjpeg-1.9 4.0 \ - lavplay 4.0 \ - lavplay-1.9 4.0 \ - mjpegutils 4.0 \ - mjpegutils-1.9 4.0 \ - mpeg2encpp 5.0 \ - mpeg2encpp-1.9 5.0 \ - mplex2 5.0 \ - mplex2-1.9 5.0 +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mjpeg/} + +SHARED_LIBS= lavfile 5.0 \ + lavjpeg 5.0 \ + lavplay 5.0 \ + mjpegutils 5.0 \ + mpeg2encpp 6.0 \ + mplex2 6.0 \ HOMEPAGE= http://mjpeg.sourceforge.net/ @@ -26,49 +21,42 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mjpeg/} - -WANTLIB= X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext \ - Xfixes Xi Xinerama Xrandr Xrender atk-1.0 c cairo \ - expat fontconfig freetype gio-2.0 glib-2.0 \ - gmodule-2.0 gobject-2.0 m pango-1.0 pangocairo-1.0 \ - pangoft2-1.0 pcre pthread pthread-stubs pixman-1 \ - sndio stdc++ usbhid xcb z gthread-2.0 xcb-render \ - xcb-render-util SDL dv jpeg png gdk-x11-2.0 \ - gdk_pixbuf-2.0 gtk-x11-2.0 +WANTLIB+= GL SDL SDL_gfx X11 Xau Xcomposite Xcursor Xdamage Xdmcp +WANTLIB+= Xext Xfixes Xi Xinerama Xrandr Xrender Xxf86vm atk-1.0 +WANTLIB+= c cairo drm dv expat ffi fontconfig freetype gdk-x11-2.0 +WANTLIB+= gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 +WANTLIB+= gthread-2.0 gtk-x11-2.0 jpeg m pango-1.0 pangocairo-1.0 +WANTLIB+= pangoft2-1.0 pcre pixman-1 png pthread pthread-stubs +WANTLIB+= sndio stdc++ usbhid xcb xcb-render xcb-shm z -MODULES+= devel/gettext +MODULES= devel/gettext LIB_DEPENDS= sdl-*-!no_x11:devel/sdl \ - multimedia/libdv \ + devel/sdl-gfx \ graphics/jpeg \ graphics/png \ + multimedia/libdv \ x11/gtk+2 \ USE_LIBTOOL= Yes -USE_GROFF = Yes -CONFIGURE_STYLE= gnu +USE_GROFF= Yes +CONFIGURE_STYLE= autoconf +AUTOCONF_VERSION= 2.68 CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \ --with-x \ - --with-libpng \ - --with-libdv - -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${LOCALBASE}/include/libpng" \ - LDFLAGS="-L${LOCALBASE}/lib" \ - PKG_CONFIG="/usr/bin/pkg-config" + --without-v4l +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ + LDFLAGS="-L${LOCALBASE}/lib" FLAVORS= quicktime optimized FLAVOR?= -.if ${FLAVOR:L:Moptimized} -CONFIGURE_ARGS+= --enable-simd-accel -.else +.if !${FLAVOR:L:Moptimized} CONFIGURE_ARGS+= --disable-simd-accel .endif .if ${FLAVOR:L:Mquicktime} LIB_DEPENDS += multimedia/libquicktime -WANTLIB += quicktime>=2 GL -CONFIGURE_ARGS += --with-libquicktime +WANTLIB+= quicktime>=2 .else CONFIGURE_ARGS += --without-libquicktime .endif Index: distinfo =================================================================== RCS file: /home/cvs/ports/multimedia/mjpegtools/distinfo,v retrieving revision 1.5 diff -u -p -r1.5 distinfo --- distinfo 26 Jan 2008 02:10:26 -0000 1.5 +++ distinfo 5 Oct 2011 04:20:02 -0000 @@ -1,5 +1,5 @@ -MD5 (mjpegtools-1.9.0rc3.tar.gz) = 042tRDM+MjbMwNwe/bJ5EA== -RMD160 (mjpegtools-1.9.0rc3.tar.gz) = 9HxxzXYoH7bgL9o9CLChQuE85ec= -SHA1 (mjpegtools-1.9.0rc3.tar.gz) = QXgW5UjZ+7bDNt9kuI8xsC1v87E= -SHA256 (mjpegtools-1.9.0rc3.tar.gz) = ix4+hSicudWKe5jQMs8lh+qVf4ZkFqM1kYZnsdrHb/c= -SIZE (mjpegtools-1.9.0rc3.tar.gz) = 2537088 +MD5 (mjpegtools-2.0.0.tar.gz) = kD4eO5Z+68xf5WJtdRfcRg== +RMD160 (mjpegtools-2.0.0.tar.gz) = RU4jvtsr1ZKRKlRtBiG1w2YsO7I= +SHA1 (mjpegtools-2.0.0.tar.gz) = 9BHoVz1EZxHb6EVaauklfhr+HnA= +SHA256 (mjpegtools-2.0.0.tar.gz) = vzVBWT5xYC97RAwufYG0M/U9BRHnRkLzW+qbP+3tepc= +SIZE (mjpegtools-2.0.0.tar.gz) = 1749671 Index: patches/patch-configure =================================================================== RCS file: patches/patch-configure diff -N patches/patch-configure --- patches/patch-configure 26 Jan 2008 02:10:26 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@ -$OpenBSD: patch-configure,v 1.5 2008/01/26 02:10:26 jakemsr Exp $ ---- configure.orig Sat Jan 19 22:18:42 2008 -+++ configure Sat Jan 19 22:20:38 2008 -@@ -26853,7 +26853,7 @@ echo "${ECHO_T}no" >&6 - fi - fi - -- -+if test x"opts" = x"yes"; then - if test x$have_x86cpu = xtrue -o x$have_ppccpu = xtrue; then - if test x$host_alias != x; then - echo "$as_me:$LINENO: checking sub-architecture settings" >&5 -@@ -26879,6 +26879,7 @@ echo $ECHO_N "checking sub-architecture settings... $E - fi - echo "$as_me:$LINENO: result: $ARCHFLAGS" >&5 - echo "${ECHO_T}$ARCHFLAGS" >&6 -+fi - fi - - if test "x$enable_force_static" = "xyes" ; then Index: patches/patch-configure_ac =================================================================== RCS file: patches/patch-configure_ac diff -N patches/patch-configure_ac --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-configure_ac 5 Oct 2011 04:36:09 -0000 @@ -0,0 +1,39 @@ +$OpenBSD$ +--- configure.ac.orig Wed Oct 5 00:34:39 2011 ++++ configure.ac Wed Oct 5 00:35:53 2011 +@@ -445,35 +445,6 @@ EOF + fi + fi + +-dnl ********************************************************************* +-dnl For x86 and ppc machines check which code model we should use. This is +-dnl done with the helper script cpuinfo.sh because the logic to do the job +-dnl correctly is complex and lengthy (about as long as the entire configure.ac +-dnl file). +- +-if test x$have_x86cpu = xtrue -o x$have_ppccpu = xtrue; then +- if test x$host_alias != x; then +- dnl This is to allow cross compiling +- AC_MSG_CHECKING(sub-architecture settings) +- if test x$have_x86cpu = xtrue; then +- host_mod_cpu=`echo $host_cpu | tr _ -` +- ARCHFLAGS="-march=$host_mod_cpu -mcpu=$host_mod_cpu" +- fi +- else +- if test ! -r $srcdir/cpuinfo.sh; then +- AC_MSG_ERROR([cpuinfo.sh script not found - do a cvs update]) +- fi +- AC_MSG_CHECKING(sub-architecture settings) +- chmod +x $srcdir/cpuinfo.sh +- if test x$have_x86cpu = xtrue; then +- ARCHFLAGS=`$srcdir/cpuinfo.sh x86` +- elif test x$have_ppccpu = xtrue; then +- ARCHFLAGS=`$srcdir/cpuinfo.sh ppc` +- fi +- fi +- AC_MSG_RESULT($ARCHFLAGS) +-fi +- + dnl ********************************************************************** + dnl Handle forcing static linkage in key places + if test "x$enable_static_build" = "xyes" ; then Index: patches/patch-lavtools_Makefile_in =================================================================== RCS file: patches/patch-lavtools_Makefile_in diff -N patches/patch-lavtools_Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-lavtools_Makefile_in 9 Oct 2011 21:33:21 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- lavtools/Makefile.in.orig Sun Oct 9 17:31:35 2011 ++++ lavtools/Makefile.in Sun Oct 9 17:31:52 2011 +@@ -445,7 +445,7 @@ liblavinclude_HEADERS = \ + LAV_ALL_LIB_OPTS = \ + $(LT_STATIC) \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ +- -release $(LT_RELEASE) $(EXTRA_LDFLAGS) ++ $(EXTRA_LDFLAGS) + + liblavfile_la_SOURCES = editlist.c lav_io.c avilib.c + liblavfile_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDV_CFLAGS) $(JPEG_CFLAGS) Index: patches/patch-lavtools_png2yuv_c =================================================================== RCS file: patches/patch-lavtools_png2yuv_c diff -N patches/patch-lavtools_png2yuv_c --- patches/patch-lavtools_png2yuv_c 8 Jul 2011 20:36:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,525 +0,0 @@ -$OpenBSD: patch-lavtools_png2yuv_c,v 1.1 2011/07/08 20:36:09 naddy Exp $ - -Fix build with png-1.5. - ---- lavtools/png2yuv.c.orig Thu Nov 8 10:31:50 2007 -+++ lavtools/png2yuv.c Mon Jul 4 17:49:05 2011 -@@ -49,12 +49,9 @@ png2yuv - - #include "subsample.h" - #include "colorspace.h" --//#include "mplexconsts.hh" - - #define DEFAULT_CHROMA_MODE Y4M_CHROMA_420JPEG - --#define MAXPIXELS (2800*1152) /**< Maximum size of final image */ -- - typedef struct _parameters - { - char *pngformatstr; -@@ -70,14 +67,10 @@ typedef struct _parameters - int ss_mode; /**< subsampling mode (based on ssm_id from subsample.h) */ - - int new_width; /// new MPEG2 width, in case the original one is uneven -+ int new_height; /// new MPEG2 width, in case the original one is uneven - } parameters_t; - - --struct _parameters *sh_param; --png_structp png_ptr; --png_infop info_ptr, end_info; --uint8_t *raw0, *raw1, *raw2; /* buffer for RGB first, and then Y/Cb/Cr planes of decoded PNG */ -- - /* - * The User Interface parts - */ -@@ -152,8 +145,6 @@ static void parse_commandline(int argc, char ** argv, - param->interleave = -1; - param->verbose = 1; - param->ss_mode = DEFAULT_CHROMA_MODE; -- //param->mza_filename = NULL; -- //param->make_z_alpha = 0; - - /* parse options */ - for (;;) { -@@ -240,94 +231,44 @@ static void parse_commandline(int argc, char ** argv, - } - } - --void png_separation(png_structp png_ptr, png_row_infop row_info, png_bytep data) --{ -- int row_nr = png_ptr->row_number; // internal variable ? -- int i, width = row_info->width; -- int new_width = sh_param->new_width; - -- /* contents of row_info: -- * png_uint_32 width width of row -- * png_uint_32 rowbytes number of bytes in row -- * png_byte color_type color type of pixels -- * png_byte bit_depth bit depth of samples -- * png_byte channels number of channels (1-4) -- * png_byte pixel_depth bits per pixel (depth*channels) -- */ -- -- //mjpeg_debug("PNG YUV transformation callback; color_type is %d row_number %d\n", -- // row_info->color_type, row_nr); -- -- if(row_info->color_type == PNG_COLOR_TYPE_GRAY) // only Z available -- { -- //mjpeg_debug("Grayscale to YUV, row %d", row_nr); -- for (i = 0; i < width; i++) -- { -- raw0[i + row_nr * new_width] = data[i]; -- raw1[i + row_nr * new_width] = data[i]; -- raw2[i + row_nr * new_width] = data[i]; -- } -- return; -- } -- -- if(row_info->color_type == PNG_COLOR_TYPE_RGB) // Z and Alpha available -- { -- //mjpeg_info("RGB to YUV, row %d", row_nr); -- for (i = 0; i < width; i++) -- { -- raw0[i + row_nr * new_width] = data[i*3]; -- raw1[i + row_nr * new_width] = data[i*3 + 1]; -- raw2[i + row_nr * new_width] = data[i*3 + 2]; -- } -- return; -- } -- -- mjpeg_error_exit1("mpegz: UNKNOWN COLOR FORMAT %d in PNG transformation !\n", row_info->color_type); --} -- -- - /* - * The file handling parts - */ - /** - Reads one PNG file. --@param process Process the image data (0 for initial parameter determination) -+@param process Process the image data (NULL for initial parameter determination) - @returns -1 on failure, 1 on sucess -+@on success returns RGB data in the second, yuv, parameter - */ --int decode_png(const char *pngname, int process, parameters_t *param) -+int decode_png(const char *pngname, uint8_t *yuv[], parameters_t *param) - { -- int num_pass = 1; -- int bit_depth, color_type; -+ png_structp png_ptr; -+ png_infop info_ptr; - FILE *pngfile; -- //png_byte hdptr[8]; - -- /* Now open this PNG file, and examine its header to retrieve the -- YUV4MPEG info that shall be written */ -- pngfile = fopen(pngname, "rb"); -- if (!pngfile) -- { -- perror("PNG file open failed:"); -- return -1; -- } -+ /* libpng needs two structs - a png_struct and a png_info, there is no -+ * need to make the third, another png_info, because that is only used -+ * to store data (such as textual information) that can come after the -+ * PNG image. This code only cares about the image. -+ */ -+ info_ptr = NULL; -+ pngfile = NULL; -+ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); -+ if (!png_ptr) -+ mjpeg_error_exit1("%s: Could not allocate PNG read struct !", pngname); - -- //fread(hdptr, 1, 8, pngfile); -- --#if 0 -- bool is_png = !png_sig_cmp(hdptr, 0, 8); -- if (!is_png) -+ /* This needs to be done immediately after creation of the png_struct -+ * because storage allocation failures will longjmp back to here: -+ */ -+ if (setjmp(png_jmpbuf(png_ptr))) - { -- mjpeg_error("%s is _no_ PNG file !\n"); -+ png_destroy_read_struct(&png_ptr, &info_ptr, 0); -+ if (pngfile) (void)fclose(pngfile); -+ mjpeg_error("%s: Corrupted PNG file !", pngname); - return -1; - } --#endif - -- png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); -- if (!png_ptr) -- mjpeg_error_exit1("%s: Could not allocate PNG read struct !", pngname); -- -- png_init_io(png_ptr, pngfile); -- //png_set_sig_bytes(png_ptr, 8); -- - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) - { -@@ -336,79 +277,101 @@ int decode_png(const char *pngname, int process, param - mjpeg_error_exit1("%s: Could not allocate PNG info struct !", pngname); - } - -- end_info = png_create_info_struct(png_ptr); -- if (!end_info) -+ /* Now open this PNG file, and examine its header to retrieve the -+ YUV4MPEG info that shall be written */ -+ pngfile = fopen(pngname, "rb"); -+ if (!pngfile) - { -- png_destroy_read_struct(&png_ptr, &info_ptr, -- (png_infopp)NULL); -- mjpeg_error_exit1("%s: Could not allocate PNG end info struct !", pngname); -+ perror(pngname); -+ png_error(png_ptr, "PNG file open failed"); - } -- -- if (setjmp(png_jmpbuf(png_ptr))) -+ -+ png_init_io(png_ptr, pngfile); -+ -+ if (yuv) - { -- png_destroy_read_struct(&png_ptr, &info_ptr, -- &end_info); -- mjpeg_error("%s: Corrupted PNG file !", pngname); -- return -1; -+ png_uint_32 nr, input_height, input_width, output_height, output_width; -+ uint8_t *r, *g, *b; -+ png_bytepp rows; -+ -+ /* The code uses png_read_png to obtain a complete buffered copy of the -+ * PNG file reduced (or expanded) to 8 bit RGB. This is a little wasteful -+ * in the case of a non-interlaced image - the code could work row by -+ * row without buffering the whole image - but the interlaced case is -+ * almost impossible to handle this way so it is better to be simple and -+ * correct. -+ */ -+# if PNG_LIBPNG_VER >= 10500 && PNG_LIBPNG_VER < 10502 -+ /* There is a bug in 1.5 before 1.5.2 which causes png_read_png to -+ * whine most terribly on interlaced images, this stops it: -+ */ -+ (void)png_set_interlace_handling(png_ptr); -+# endif -+ png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | -+ PNG_TRANSFORM_STRIP_ALPHA | PNG_TRANSFORM_EXPAND | -+ PNG_TRANSFORM_GRAY_TO_RGB /* requires libpng 1.4 or later */, 0); -+ -+ /* And return the separated data to the parameters. */ -+ rows = png_get_rows(png_ptr, info_ptr); -+ -+ /* Since the PNG files for the frames are separate the actual PNG file -+ * that was read could be unrelated - a random width and height. Because -+ * the output may be interleaved the output height may be twice the input -+ * PNG height. Because the MPEG code requires an even width the output -+ * width may be one more than the original frame width. -+ * -+ * For the interleaving the PNG data is smashed into the lower half of -+ * the yuv rows. For the other cases the input data is cropped or -+ * top-lefted as appropriate. -+ */ -+ output_height = param->new_height; -+ -+ input_height = png_get_image_height(png_ptr, info_ptr); -+ if (input_height > output_height) -+ input_height = output_height; -+ -+ output_width = param->new_width; -+ -+ input_width = png_get_image_width(png_ptr, info_ptr); -+ if (input_width > output_width) -+ input_width = output_width; -+ -+ /* Breaking up the RGB data is not hard to do, the separated channels are -+ * simply packed into the three raw yuv arrays with new_width values per -+ * row. -+ */ -+ r = yuv[0]; -+ g = yuv[1]; -+ b = yuv[2]; -+ for (nr=0; nr<input_height; ++nr) -+ { -+ png_uint_32 nc; -+ png_bytep row = *rows++; -+ -+ for (nc=0; nc<input_width; ++nc) -+ { -+ *r++ = *row++; -+ *g++ = *row++; -+ *b++ = *row++; -+ } -+ -+ /* Pad the output: */ -+ for (; nc<output_width; ++nc) -+ *r++ = *g++ = *b++ = 0; -+ } - } -- -- if (process) -- png_set_read_user_transform_fn(png_ptr, png_separation); -- png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_STRIP_ALPHA, NULL); -- -- if (png_get_IHDR(png_ptr, info_ptr, ¶m->width, ¶m->height, &bit_depth, -- // &color_type, &interlace_type, &compression_type, &filter_type)) -- &color_type, NULL, NULL, NULL)) -- num_pass = png_set_interlace_handling(png_ptr); - else -- mjpeg_error_exit1("PNG header reading failed !!\n"); --#if 0 -- mjpeg_info("Reading info struct...\n"); -- png_read_info(png_ptr, info_ptr); -- mjpeg_info("Done...\n"); -- -- if (png_get_IHDR(png_ptr, info_ptr, ¶m->width, ¶m->height, &bit_depth, -- // &color_type, &interlace_type, &compression_type, &filter_type)) -- &color_type, NULL, NULL, NULL)) -- num_pass = png_set_interlace_handling(png_ptr); -- else -- mjpeg_error_exit1("PNG header reading failed !!\n"); -- -- if (process) - { -- printf("%d passes needed\n\n", num_pass); -- -- if (bit_depth != 8 && bit_depth != 16) -- { -- mjpeg_error_exit1("Invalid bit_depth %d, only 8 and 16 bit allowed !!\n", bit_depth); -- } -- -- png_set_strip_16(png_ptr); // always has to strip the 16bit input, MPEG can't handle it -- png_set_strip_alpha(png_ptr); // Alpha can't be processed until Z/Alpha is integrated -- -- printf("\nAllocating row buffer..."); -- png_set_read_user_transform_fn(png_ptr, png_separation); -- png_bytep row_buf = (png_bytep)png_malloc(png_ptr, -- png_get_rowbytes(png_ptr, info_ptr)); -- -- for (int n=0; n < num_pass; n++) -- for (int y=0; y < sh_param->height; y++) -- { -- printf("Writing row data for pass %d\n", n); -- png_read_rows(png_ptr, (png_bytepp)&row_buf, NULL, 1); -- } -- -- png_free(png_ptr, row_buf); -+ /* Just return the image width and height in *param */ -+ png_read_info(png_ptr, info_ptr); -+ -+ param->width = png_get_image_width(png_ptr, info_ptr); -+ param->height = png_get_image_height(png_ptr, info_ptr); - } -- png_read_end(png_ptr, info_ptr); --#endif -- if (setjmp(png_ptr->jmpbuf)) { -- png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); -- return 2; -- } - -+ /* Successful exit: */ -+ png_destroy_read_struct(&png_ptr, &info_ptr, 0); - fclose(pngfile); -- - return 1; - } - -@@ -419,13 +382,17 @@ int decode_png(const char *pngname, int process, param - */ - static int init_parse_files(parameters_t *param) - { -- char pngname[255]; -+ char pngname[PATH_MAX+1]; /* See POSIX 1003.1 section 2.9.5 */ - - snprintf(pngname, sizeof(pngname), - param->pngformatstr, param->begin); - mjpeg_debug("Analyzing %s to get the right pic params", pngname); - -- if (decode_png(pngname, 0, param) == -1) -+ /* The first frame (the param->begin frame) determines the height and -+ * width of the output. Passing NULL instead of yuv (see below) causes -+ * decode_png to fill in param with the image dimensions. -+ */ -+ if (decode_png(pngname, NULL, param) == -1) - mjpeg_error_exit1("Reading of %s failed.\n", pngname); - - mjpeg_info("Image dimensions are %ux%u", -@@ -455,6 +422,7 @@ static int init_parse_files(parameters_t *param) - - if (!(param->interleave) && (param->interlace != Y4M_ILACE_NONE)) - { -+ /* So the height in 'param' might be twice the PNG input height:*/ - param->height *= 2; - mjpeg_info("Non-interleaved fields (image height doubled)"); - } -@@ -466,33 +434,29 @@ static int init_parse_files(parameters_t *param) - static int generate_YUV4MPEG(parameters_t *param) - { - uint32_t frame; -- //size_t pngsize; -- char pngname[FILENAME_MAX]; -- uint8_t *yuv[3]; /* buffer for Y/U/V planes of decoded PNG */ -+ uint8_t *yuv[3]; /* Buffers, initially for R,G,B then Y,Cb,Cr */ - y4m_stream_info_t streaminfo; - y4m_frame_info_t frameinfo; - -- if ((param->width % 2) == 0) -- param->new_width = param->width; -- else -- { -- param->new_width = ((param->width >> 1) + 1) << 1; -- printf("Setting new, even image width %d", param->new_width); -- } -+ /* Make the output even, so the output may be one larger than the -+ * original PNG image width. -+ */ -+ param->new_width = param->width + (param->width & 1); -+ param->new_height = param->height + (param->height & 1); - - mjpeg_info("Now generating YUV4MPEG stream."); - y4m_init_stream_info(&streaminfo); - y4m_init_frame_info(&frameinfo); - - y4m_si_set_width(&streaminfo, param->new_width); -- y4m_si_set_height(&streaminfo, param->height); -+ y4m_si_set_height(&streaminfo, param->new_height); - y4m_si_set_interlace(&streaminfo, param->interlace); - y4m_si_set_framerate(&streaminfo, param->framerate); - y4m_si_set_chroma(&streaminfo, param->ss_mode); - -- yuv[0] = (uint8_t *)malloc(param->new_width * param->height * sizeof(yuv[0][0])); -- yuv[1] = (uint8_t *)malloc(param->new_width * param->height * sizeof(yuv[1][0])); -- yuv[2] = (uint8_t *)malloc(param->new_width * param->height * sizeof(yuv[2][0])); -+ yuv[0] = (uint8_t *)malloc(param->new_width * param->new_height * sizeof(yuv[0][0])); -+ yuv[1] = (uint8_t *)malloc(param->new_width * param->new_height * sizeof(yuv[1][0])); -+ yuv[2] = (uint8_t *)malloc(param->new_width * param->new_height * sizeof(yuv[2][0])); - - y4m_write_stream_header(STDOUT_FILENO, &streaminfo); - -@@ -500,15 +464,13 @@ static int generate_YUV4MPEG(parameters_t *param) - (frame < param->numframes + param->begin) || (param->numframes == -1); - frame++) - { -- // if (frame < 25) -- // else -- //snprintf(pngname, sizeof(pngname), param->pngformatstr, frame - 25); -+ char pngname[PATH_MAX+1]; - snprintf(pngname, sizeof(pngname), param->pngformatstr, frame); - -- raw0 = yuv[0]; -- raw1 = yuv[1]; -- raw2 = yuv[2]; -- if (decode_png(pngname, 1, param) == -1) -+ /* decode_png reads the PNG into the yuv buffers as r,g,b [0..255] -+ * values. -+ */ -+ if (decode_png(pngname, yuv, param) == -1) - { - mjpeg_info("Read from '%s' failed: %s", pngname, strerror(errno)); - if (param->numframes == -1) -@@ -523,79 +485,18 @@ static int generate_YUV4MPEG(parameters_t *param) - } - else - { --#if 0 -- mjpeg_debug("Preparing frame"); -- -- /* Now open this PNG file, and examine its header to retrieve the -- YUV4MPEG info that shall be written */ -- -- if ((param->interlace == Y4M_ILACE_NONE) || (param->interleave == 1)) -- { -- mjpeg_info("Processing non-interlaced/interleaved %s.", -- pngname, pngsize); -- -- decode_png(imagedata, 0, 420, yuv[0], yuv[1], yuv[2], -- param->width, param->height, param->new_width); -- --#if 0 -- if (param->make_z_alpha) -- { -- mjpeg_info("Writing Z/Alpha data.\n"); -- za_write(real_z_imagemap, param->width, param->height,z_alpha_fp,frame); -- } --#endif -- } -- else -- { -- mjpeg_error_exit1("Can't handle interlaced PNG information (yet) since there is no standard for it.\n" -- "Use interleaved mode (-L option) to create interlaced material."); -- -- switch (param->interlace) -- { -- case Y4M_ILACE_TOP_FIRST: -- mjpeg_info("Processing interlaced, top-first %s", pngname); --#if 0 -- decode_jpeg_raw(jpegdata, jpegsize, -- Y4M_ILACE_TOP_FIRST, -- 420, param->width, param->height, -- yuv[0], yuv[1], yuv[2]); --#endif -- break; -- case Y4M_ILACE_BOTTOM_FIRST: -- mjpeg_info("Processing interlaced, bottom-first %s", pngname); --#if 0 -- decode_jpeg_raw(jpegdata, jpegsize, -- Y4M_ILACE_BOTTOM_FIRST, -- 420, param->width, param->height, -- yuv[0], yuv[1], yuv[2]); --#endif -- break; -- default: -- mjpeg_error_exit1("FATAL logic error?!?"); -- break; -- } -- } --#endif - mjpeg_debug("Converting frame to YUV format."); - /* Transform colorspace, then subsample (in place) */ -- convert_RGB_to_YCbCr(yuv, param->height * param->new_width); -- chroma_subsample(param->ss_mode, yuv, param->new_width, param->height); -+ convert_RGB_to_YCbCr(yuv, param->new_height * param->new_width); -+ chroma_subsample(param->ss_mode, yuv, param->new_width, param->new_height); - - mjpeg_debug("Frame decoded, now writing to output stream."); - } -- -+ - mjpeg_debug("Frame decoded, now writing to output stream."); - y4m_write_frame(STDOUT_FILENO, &streaminfo, &frameinfo, yuv); - } - --#if 0 -- if (param->make_z_alpha) -- { -- za_write_end(z_alpha_fp); -- fclose(z_alpha_fp); -- } --#endif -- - y4m_fini_stream_info(&streaminfo); - y4m_fini_frame_info(&frameinfo); - free(yuv[0]); -@@ -614,7 +515,6 @@ static int generate_YUV4MPEG(parameters_t *param) - int main(int argc, char ** argv) - { - parameters_t param; -- sh_param = ¶m; - - y4m_accept_extensions(1); - -@@ -632,13 +532,3 @@ int main(int argc, char ** argv) - - return 0; - } -- -- -- -- -- -- -- -- -- -- Index: patches/patch-mpeg2enc_Makefile_in =================================================================== RCS file: patches/patch-mpeg2enc_Makefile_in diff -N patches/patch-mpeg2enc_Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-mpeg2enc_Makefile_in 9 Oct 2011 21:33:09 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- mpeg2enc/Makefile.in.orig Sun Oct 9 17:32:51 2011 ++++ mpeg2enc/Makefile.in Sun Oct 9 17:33:02 2011 +@@ -356,7 +356,7 @@ libmpeg2encpp_include_HEADERS = elemstrmwriter.hh enco + libmpeg2encpp_la_LDFLAGS = \ + ${LT_STATIC} \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ +- -release $(LT_RELEASE) ${EXTRA_LDFLAGS} ++ ${EXTRA_LDFLAGS} + + libmpeg2encpp_la_DEPENDENCIES = $(LIBMJPEGUTILS) + libmpeg2encpp_la_LIBADD = $(LIBMJPEGUTILS) @PTHREAD_LIBS@ Index: patches/patch-mplex_Makefile_in =================================================================== RCS file: patches/patch-mplex_Makefile_in diff -N patches/patch-mplex_Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-mplex_Makefile_in 9 Oct 2011 21:33:09 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- mplex/Makefile.in.orig Sun Oct 9 17:32:35 2011 ++++ mplex/Makefile.in Sun Oct 9 17:32:46 2011 +@@ -335,7 +335,7 @@ libmplex_include_HEADERS = \ + libmplex2_la_LDFLAGS = \ + $(LT_STATIC) \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ +- -release $(LT_RELEASE) $(EXTRA_LDFLAGS) ++ $(EXTRA_LDFLAGS) + + libmplex2_la_LIBADD = $(top_builddir)/utils/libmjpegutils.la \ + $(am__append_1) Index: patches/patch-utils_Makefile_in =================================================================== RCS file: patches/patch-utils_Makefile_in diff -N patches/patch-utils_Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-utils_Makefile_in 9 Oct 2011 21:33:09 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- utils/Makefile.in.orig Sun Oct 9 17:31:58 2011 ++++ utils/Makefile.in Sun Oct 9 17:32:28 2011 +@@ -304,7 +304,7 @@ libmjpegutils_la_LIBADD = $(mmxsse_lib) $(altivec_lib) + libmjpegutils_la_LDFLAGS = \ + $(LT_STATIC) \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ +- -release $(LT_RELEASE) $(EXTRA_LDFLAGS) ++ $(EXTRA_LDFLAGS) + + libmjpegutils_la_SOURCES = \ + mjpeg_logging.c \ Index: pkg/DESCR =================================================================== RCS file: /home/cvs/ports/multimedia/mjpegtools/pkg/DESCR,v retrieving revision 1.3 diff -u -p -r1.3 DESCR --- pkg/DESCR 4 Mar 2009 20:21:57 -0000 1.3 +++ pkg/DESCR 5 Oct 2011 04:41:54 -0000 @@ -1,11 +1,11 @@ The MJPEG-tools are a basic set of utilities for editing, playing back, filtering and encoding video under UNIX-like operating systems. -There are two FLAVORS for this port: +Flavors: - quicktime - builds the package with support for reading and writing - quicktime ".mov" files + quicktime - Builds the package with support for reading and writing + QuickTime ".MOV" files. - optimized - builds the package with SSE instructions. Packages built + optimized - Builds the package with SSE instructions. Packages built with this FLAVOR might not run on systems that are not SSE capable. Index: pkg/PFRAG.shared =================================================================== RCS file: /home/cvs/ports/multimedia/mjpegtools/pkg/PFRAG.shared,v retrieving revision 1.5 diff -u -p -r1.5 PFRAG.shared --- pkg/PFRAG.shared 26 Jan 2008 02:10:26 -0000 1.5 +++ pkg/PFRAG.shared 9 Oct 2011 21:33:43 -0000 @@ -1,13 +1,7 @@ @comment $OpenBSD: PFRAG.shared,v 1.5 2008/01/26 02:10:26 jakemsr Exp $ -@lib lib/liblavfile-1.9.so.${LIBlavfile-1.9_VERSION} @lib lib/liblavfile.so.${LIBlavfile_VERSION} -@lib lib/liblavjpeg-1.9.so.${LIBlavjpeg-1.9_VERSION} @lib lib/liblavjpeg.so.${LIBlavjpeg_VERSION} -@lib lib/liblavplay-1.9.so.${LIBlavplay-1.9_VERSION} @lib lib/liblavplay.so.${LIBlavplay_VERSION} -@lib lib/libmjpegutils-1.9.so.${LIBmjpegutils-1.9_VERSION} @lib lib/libmjpegutils.so.${LIBmjpegutils_VERSION} -@lib lib/libmpeg2encpp-1.9.so.${LIBmpeg2encpp-1.9_VERSION} @lib lib/libmpeg2encpp.so.${LIBmpeg2encpp_VERSION} -@lib lib/libmplex2-1.9.so.${LIBmplex2-1.9_VERSION} @lib lib/libmplex2.so.${LIBmplex2_VERSION} Index: pkg/PLIST =================================================================== RCS file: /home/cvs/ports/multimedia/mjpegtools/pkg/PLIST,v retrieving revision 1.7 diff -u -p -r1.7 PLIST --- pkg/PLIST 30 Jan 2009 00:41:24 -0000 1.7 +++ pkg/PLIST 9 Oct 2011 21:34:08 -0000 @@ -1,5 +1,6 @@ @comment $OpenBSD: PLIST,v 1.7 2009/01/30 00:41:24 sthen Exp $ @conflict mplex-* +%%SHARED%% %%quicktime%% bin/anytovcd.sh @bin bin/glav @@ -78,9 +79,8 @@ include/mjpegtools/mpeg2enc/mpeg2encoder include/mjpegtools/mpeg2enc/mpeg2encoptions.hh include/mjpegtools/mpeg2enc/mpeg2encparams.h include/mjpegtools/mpeg2enc/mpeg2syntaxcodes.h -include/mjpegtools/mpeg2enc/ontheflyratectl.hh -include/mjpegtools/mpeg2enc/pass1ratectl.hh -include/mjpegtools/mpeg2enc/pass2ratectl.hh +include/mjpegtools/mpeg2enc/ontheflyratectlpass1.hh +include/mjpegtools/mpeg2enc/ontheflyratectlpass2.hh include/mjpegtools/mpeg2enc/picture.hh include/mjpegtools/mpeg2enc/picturereader.hh include/mjpegtools/mpeg2enc/predict_ref.h @@ -156,4 +156,3 @@ lib/pkgconfig/mjpegtools.pc @man man/man1/yuvscaler.1 @man man/man1/yuvycsnoise.1 @man man/man5/yuv4mpeg.5 -%%SHARED%% Index: Makefile =================================================================== RCS file: /home/cvs/ports/multimedia/gstreamer-0.10/plugins-bad/Makefile,v retrieving revision 1.62 diff -u -p -r1.62 Makefile --- Makefile 16 Sep 2011 10:31:23 -0000 1.62 +++ Makefile 12 Oct 2011 23:53:34 -0000 @@ -11,9 +11,9 @@ PKGNAME-main = gstreamer-plugins-bad-${ PKGNAME-neon = gstreamer-neon-${V} PKGNAME-mjpeg = gstreamer-mjpeg-${V} -REVISION-main = 5 -REVISION-neon = 1 -REVISION-mjpeg = 1 +REVISION-main = 6 +REVISION-neon = 2 +REVISION-mjpeg = 2 MULTI_PACKAGES = -main -neon -mjpeg @@ -40,7 +40,7 @@ BUILD_DEPENDS += audio/ladspa \ WANTLIB-main += ${WANTLIB} WANTLIB-main += BPM GL SDL SoundTouch X11 Xau Xdamage Xdmcp Xext Xfixes WANTLIB-main += Xrender Xxf86vm ass bz2 cairo cdaudio croco-0.6 crypto -WANTLIB-main += curl dca drm dvdnav dvdread enca expat fontconfig +WANTLIB-main += curl dca drm dvdnav dvdread enca expat ffi fontconfig WANTLIB-main += freetype gdk_pixbuf-2.0 gio-2.0 gsm gstaudio-0.10 gstbase-0.10 WANTLIB-main += gstcontroller-0.10 gstinterfaces-0.10 gstpbutils-0.10 WANTLIB-main += gstriff-0.10 gstrtp-0.10 gstsdp-0.10 gsttag-0.10 gstvideo-0.10 @@ -72,12 +72,12 @@ RUN_DEPENDS-main = ${MODGETTEXT_RUN_DEPE WANTLIB-neon = ${WANTLIB} \ gstbase-0.10 neon \ - crypto expat ssl asn1 gssapi krb5 + crypto expat ffi ssl asn1 gssapi krb5 LIB_DEPENDS-neon = ${LIB_DEPENDS} \ net/neon WANTLIB-mjpeg = ${WANTLIB} \ - gstbase-0.10 stdc++ mjpegutils-1.9 mpeg2encpp-1.9 mplex2-1.9 + gstbase-0.10 ffi mjpegutils mpeg2encpp mplex2 stdc++ LIB_DEPENDS-mjpeg = ${LIB_DEPENDS} \ multimedia/mjpegtools -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.