From 646ac4cdf2054e5cd38c1869701a4e839f8436b2 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 5 Mar 2008 05:38:06 +0000 Subject: configure.ac: Clean up detection of different mjpegtoolsAPI versions. Original commit message from CVS: Patch by: Mark Nauwelaerts * configure.ac: Clean up detection of different mjpegtoolsAPI versions. * ext/mpeg2enc/gstmpeg2enc.cc: * ext/mpeg2enc/gstmpeg2enc.hh: * ext/mpeg2enc/gstmpeg2encoder.cc: * ext/mpeg2enc/gstmpeg2encoptions.cc: * ext/mpeg2enc/gstmpeg2encpicturereader.cc: * ext/mpeg2enc/gstmpeg2encpicturereader.hh: * ext/mpeg2enc/gstmpeg2encstreamwriter.cc: * ext/mpeg2enc/gstmpeg2encstreamwriter.hh: Streamline conditional code for evolving mjpegtools API, optimize and fix/prevent crash in log handling, use names/nicks for enums in the usual way andm inor updates in code and properties/settings. Partially fixes bug #520329. --- ext/mpeg2enc/gstmpeg2encpicturereader.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'ext/mpeg2enc/gstmpeg2encpicturereader.cc') diff --git a/ext/mpeg2enc/gstmpeg2encpicturereader.cc b/ext/mpeg2enc/gstmpeg2encpicturereader.cc index 6b09bd1c..5bd09dd7 100644 --- a/ext/mpeg2enc/gstmpeg2encpicturereader.cc +++ b/ext/mpeg2enc/gstmpeg2encpicturereader.cc @@ -25,10 +25,6 @@ #include -#ifdef GST_MJPEGTOOLS_19x -#include -#endif - #include "gstmpeg2enc.hh" #include "gstmpeg2encpicturereader.hh" @@ -107,14 +103,13 @@ GstMpeg2EncPictureReader::StreamPictureParams (MPEG2EncInVidParams & strm) */ bool -#ifdef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API >= 10900 GstMpeg2EncPictureReader::LoadFrame (ImagePlanes & image) #else GstMpeg2EncPictureReader::LoadFrame () #endif { - -#ifndef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API < 10900 gint n; #endif gint i, x, y; @@ -136,27 +131,27 @@ bool } frame = GST_BUFFER_DATA (enc->buffer); -#ifndef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API < 10900 n = frames_read % input_imgs_buf_size; #endif x = encparams.horizontal_size; y = encparams.vertical_size; for (i = 0; i < y; i++) { -#ifdef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API >= 10900 memcpy (image.Plane (0) + i * encparams.phy_width, frame, x); #else memcpy (input_imgs_buf[n][0] + i * encparams.phy_width, frame, x); #endif frame += x; } -#ifndef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API < 10900 lum_mean[n] = LumMean (input_imgs_buf[n][0]); #endif x >>= 1; y >>= 1; for (i = 0; i < y; i++) { -#ifdef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API >= 10900 memcpy (image.Plane (1) + i * encparams.phy_chrom_width, frame, x); #else memcpy (input_imgs_buf[n][1] + i * encparams.phy_chrom_width, frame, x); @@ -164,7 +159,7 @@ bool frame += x; } for (i = 0; i < y; i++) { -#ifdef GST_MJPEGTOOLS_19x +#if GST_MJPEGTOOLS_API >= 10900 memcpy (image.Plane (2) + i * encparams.phy_chrom_width, frame, x); #else memcpy (input_imgs_buf[n][2] + i * encparams.phy_chrom_width, frame, x); -- cgit v1.2.1