diff options
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | LIESMICH | 9 | ||||
-rw-r--r-- | Makefile | 21 | ||||
-rw-r--r-- | README | 9 | ||||
-rw-r--r-- | data.h | 1 | ||||
-rw-r--r-- | exif.c | 4 | ||||
-rw-r--r-- | liboutput/Makefile | 9 | ||||
-rw-r--r-- | liboutput/encode.c | 36 | ||||
-rw-r--r-- | liboutput/encode.h | 2 |
9 files changed, 76 insertions, 19 deletions
@@ -1,6 +1,10 @@ VDR Plugin 'image' Revision History ----------------------------------- +2007-06-10 +- for build now 'pkg-config' needed +- Use swscale to converting image (Thanks to Holger Brunn, for summit a patch) + 2007-01-02 - Release Version 0.2.7 @@ -22,7 +22,9 @@ Benötigt: - das Plugin ist abhängig vom folgenden Paketen + ffmpeg (getestet mit ffmpeg-0.4.8/ffmpeg-0.4.9pre1/ffmpeg-cvs) http://ffmpeg.sourceforge.net - + libexif-0.6.13 (siehe unten, für Kompilieren ohne diese) + + Zum Kompilieren wird 'pkg-config' benötigt + http://pkgconfig.freedesktop.org/ + + libexif-0.6.13 ... 0.6.15 (siehe unten, für Kompilieren ohne diese) http://libexif.sourceforge.net/ + zur Ausführung wird auch das Paket netpbm benötigt http://netpbm.sourceforge.net/ @@ -65,6 +67,11 @@ wird noch das Paket "netpbm" benötigt. $ make plugins FFMDIR=/usr/src/ffmpeg-cvs + Kompilieren ohne swscaler zur Bildconvertierung mittels ffmpeg + (WITHOUT_SWSCALER=1 verwendet img_convert, notwendig für ältere Versionen von ffmpeg) + + $ make plugins WITHOUT_SWSCALER=1 + Kompilieren ohne libexif ¹) $ make plugins WITHOUT_LIBEXIF=1 @@ -31,6 +31,7 @@ CXX ?= g++ CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual +PKG-CONFIG ?= pkg-config ############################################### ############################################### @@ -86,26 +87,26 @@ LIBS += liboutput/liboutput.a libimage/libimage.a INCLUDES += -I$(VDRDIR)/include -I. ifdef FFMDIR -INCLUDES += -I$(FFMDIR)/libavcodec -I$(FFMDIR)/libavutil -LIBS += -L$(FFMDIR)/libavcodec +DEFINES += -DFFMDIR +LIBS += -L$(FFMDIR)/libavcodec -lavcodec -lz ifeq ($(LIBAVCODECVERSION),51) LIBS += -L$(FFMDIR)/libavformat -L$(FFMDIR)/libavutil LIBS += -lavformat -lavutil endif -endif - -LIBS += -lavcodec -LIBS += -lz - -ifdef FFMDIR -DEFINES += -DFFMDIR +else + LIBS += $(shell $(PKG-CONFIG) --libs libavcodec) endif ifndef WITHOUT_LIBEXIF - LIBS += -lexif + INCLUDES += $(shell $(PKG-CONFIG) --cflags libexif) + LIBS += $(shell $(PKG-CONFIG) --libs libexif) DEFINES += -DHAVE_LIBEXIF endif +ifndef WITHOUT_SWSCALER + LIBS += $(shell $(PKG-CONFIG) --libs libswscale) +endif + ### The object files (add further files here): OBJS = ${PLUGIN}.o i18n.o data.o menu.o data-image.o menu-image.o \ @@ -22,7 +22,9 @@ Required: - plugin depends follow packages + ffmpeg (tested with ffmpeg-0.4.8/ffmpeg-0.4.9pre1/ffmpeg-cvs) http://ffmpeg.sourceforge.net - + libexif-0.6.13 (see below for build without this) + + for build you need 'pkg-config' + http://pkgconfig.freedesktop.org/ + + libexif-0.6.13 ... 0.6.15 (see below for build without this) http://libexif.sourceforge.net/ + for running your will need also package netpbm http://netpbm.sourceforge.net/ @@ -65,6 +67,11 @@ need netpbm for image conversion. $ make plugins FFMDIR=/usr/src/ffmpeg-cvs + compile without swscaler to convert images via ffmpeg + (WITHOUT_SWSCALER=1 use img_convert, needed for older versions from ffmpeg) + + $ make plugins WITHOUT_SWSCALER=1 + compile without libexif ¹) $ make plugins WITHOUT_LIBEXIF=1 @@ -42,6 +42,7 @@ extern char *AddPath(const char *dir, const char *filename); class cScanDir { char *QuoteString(const char *str); protected: + virtual ~cScanDir() {}; enum eScanType { stFile, stDir }; virtual void DoItem(cFileSource *src, const char *subdir, const char *name)=0; public: @@ -1,7 +1,7 @@ /* * Image plugin to VDR (C++) * - * (C) 2006 Andreas Brachold <anbr at users.berlios.de> + * (C) 2006-2007 Andreas Brachold <anbr at users.berlios.de> * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,9 +19,11 @@ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html */ +extern "C" { #include <libexif/exif-data.h> #include <libexif/exif-ifd.h> #include <libexif/exif-loader.h> +} #include <sstream> diff --git a/liboutput/Makefile b/liboutput/Makefile index 126cfc8..7300393 100644 --- a/liboutput/Makefile +++ b/liboutput/Makefile @@ -9,6 +9,7 @@ VDRDIR = ../../../.. CXX ?= g++ CXXFLAGS ?= -O0 -g -Wall -Woverloaded-virtual +PKG-CONFIG ?= pkg-config -include $(VDRDIR)/Make.config @@ -18,12 +19,16 @@ CXXFLAGS ?= -O0 -g -Wall -Woverloaded-virtual INCLUDES += -I$(VDRDIR)/include -I. ifdef FFMDIR INCLUDES += -I$(FFMDIR)/libavcodec -I$(FFMDIR)/libavutil +DEFINES += -DFFMDIR +else + INCLUDES += $(shell $(PKG-CONFIG) --cflags libavcodec) endif DEFINES += -D_GNU_SOURCE -ifdef FFMDIR -DEFINES += -DFFMDIR +ifndef WITHOUT_SWSCALER + DEFINES += -DHAVE_SWSCALER + INCLUDES += $(shell $(PKG-CONFIG) --cflags libswscale) endif ### The object files (add further files here): diff --git a/liboutput/encode.c b/liboutput/encode.c index 67d78f7..ae8bff6 100644 --- a/liboutput/encode.c +++ b/liboutput/encode.c @@ -1,7 +1,7 @@ /*************************************************************************** * encode.c * - * (C) Copyright 2004-2006 Andreas Brachold <anbr at users.berlios.de> + * (C) Copyright 2004-2007 Andreas Brachold <anbr at users.berlios.de> * Created: Thu Aug 5 2004 * ****************************************************************************/ @@ -26,6 +26,16 @@ #include <string.h> #include <stdlib.h> +extern "C" { +#ifdef HAVE_SWSCALER +#ifdef FFMDIR +#include <swscale.h> +#else +#include <ffmpeg/swscale.h> +#endif +#endif +} + #include "encode.h" #include <vdr/device.h> #include <vdr/tools.h> @@ -190,11 +200,29 @@ bool cEncode::ConvertImageToFrame(AVFrame *frame) } else { - if(img_convert((AVPicture*)frame->data, PIX_FMT_YUV420P, + int result; +#ifndef HAVE_SWSCALER + result=img_convert((AVPicture*)frame->data, PIX_FMT_YUV420P, (AVPicture*)m_pImageFilled, PIX_FMT_RGB24, - m_nWidth, m_nHeight)) + m_nWidth, m_nHeight); +#else + SwsContext* convert_ctx = sws_getContext(m_nWidth, m_nHeight, + PIX_FMT_RGB24, m_nWidth, m_nHeight, + PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL); + + if(!convert_ctx) { + esyslog("imageplugin: failed to initialize swscaler context"); + return false; + } + + result=sws_scale(convert_ctx, ((AVPicture*)m_pImageFilled)->data, + ((AVPicture*)m_pImageFilled)->linesize, + 0, m_nHeight, frame->data, frame->linesize); + sws_freeContext(convert_ctx); +#endif + if(result < 0) { - esyslog("imageplugin: failed convert RGB to YUV"); + esyslog("imageplugin: failed convert RGB to YUV: %X", result); return false; } } diff --git a/liboutput/encode.h b/liboutput/encode.h index 805e279..77437fe 100644 --- a/liboutput/encode.h +++ b/liboutput/encode.h @@ -25,11 +25,13 @@ #ifndef _ENCODE_H #define _ENCODE_H +extern "C" { #ifdef FFMDIR #include <avcodec.h> #else #include <ffmpeg/avcodec.h> #endif +} #include "../setup-image.h" //#define TESTCODE |