summaryrefslogtreecommitdiff
blob: c4938ff93aa7f33b13edd3967885e9a57039c4c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
diff -ru image-0.2.7/data.h image-svn/data.h
--- image-0.2.7/data.h	2006-01-27 22:31:04.000000000 +0100
+++ image-svn/data.h	2007-07-05 13:00:01.000000000 +0200
@@ -42,6 +42,7 @@
 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:
diff -ru image-0.2.7/exif.c image-svn/exif.c
--- image-0.2.7/exif.c	2006-05-30 19:41:21.000000000 +0200
+++ image-svn/exif.c	2007-07-05 13:00:01.000000000 +0200
@@ -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 -ru image-0.2.7/HISTORY image-svn/HISTORY
--- image-0.2.7/HISTORY	2007-01-02 14:56:07.000000000 +0100
+++ image-svn/HISTORY	2007-07-05 13:00:01.000000000 +0200
@@ -1,7 +1,11 @@
 VDR Plugin 'image' Revision History
 -----------------------------------
 
-2006-01-02
+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
 
 2006-12-24
diff -ru image-0.2.7/liboutput/encode.c image-svn/liboutput/encode.c
--- image-0.2.7/liboutput/encode.c	2006-12-24 13:04:16.000000000 +0100
+++ image-svn/liboutput/encode.c	2007-07-05 12:59:57.000000000 +0200
@@ -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 @@
     }
     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 -ru image-0.2.7/liboutput/encode.h image-svn/liboutput/encode.h
--- image-0.2.7/liboutput/encode.h	2006-01-11 20:23:30.000000000 +0100
+++ image-svn/liboutput/encode.h	2007-07-05 12:59:57.000000000 +0200
@@ -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
diff -ru image-0.2.7/liboutput/Makefile image-svn/liboutput/Makefile
--- image-0.2.7/liboutput/Makefile	2006-01-29 17:04:05.000000000 +0100
+++ image-svn/liboutput/Makefile	2007-07-05 12:59:57.000000000 +0200
@@ -9,6 +9,7 @@
 
 CXX      ?= g++
 CXXFLAGS ?= -O0 -g -Wall -Woverloaded-virtual
+PKG-CONFIG ?= pkg-config
 
 -include $(VDRDIR)/Make.config
 
@@ -18,14 +19,28 @@
 INCLUDES += -I$(VDRDIR)/include -I.
 ifdef FFMDIR
 INCLUDES += -I$(FFMDIR)/libavcodec -I$(FFMDIR)/libavutil
+DEFINES += -DFFMDIR
+ifndef WITHOUT_SWSCALER
+  DEFINES += -DHAVE_SWSCALER
+  INCLUDES += -I$(FFMDIR)/libswscale
+endif
+else
+
+ifndef WITHOUT_SWSCALER
+  DEFINES += -DHAVE_SWSCALER
+  PKG-INCLUDES += libswscale
+endif
+
+  PKG-INCLUDES += libavcodec
 endif
 
 DEFINES  += -D_GNU_SOURCE
 
-ifdef FFMDIR
-DEFINES += -DFFMDIR
+ifdef PKG-INCLUDES
+INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
 endif
 
+
 ### The object files (add further files here):
 
 OBJS = encode.o stillimage.o stillimage-player.o
diff -ru image-0.2.7/LIESMICH image-svn/LIESMICH
--- image-0.2.7/LIESMICH	2006-01-28 08:06:34.000000000 +0100
+++ image-svn/LIESMICH	2007-07-05 13:00:01.000000000 +0200
@@ -22,7 +22,9 @@
 - 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 @@
 
     $ 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
diff -ru image-0.2.7/Makefile image-svn/Makefile
--- image-0.2.7/Makefile	2006-08-27 15:51:11.000000000 +0200
+++ image-svn/Makefile	2007-07-05 13:00:01.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # Makefile for Image plugin to VDR
 #
-# (C) 2004-2006 Andreas Brachold    <anbr at users.berlios.de>
+# (C) 2004-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
@@ -31,6 +31,7 @@
 
 CXX      ?= g++
 CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual
+PKG-CONFIG ?= pkg-config
 
 ###############################################
 ###############################################
@@ -86,26 +87,38 @@
 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
+ifndef WITHOUT_SWSCALER
+  DEFINES += -DHAVE_SWSCALER
+  LIBS += -L$(FFMDIR)/libswscale -lswscale
+endif
+else
+  PKG-LIBS += libavcodec
+ifndef WITHOUT_SWSCALER
+  PKG-LIBS += libswscale
 endif
-
-LIBS += -lavcodec
-LIBS += -lz
-
-ifdef FFMDIR
-DEFINES += -DFFMDIR
 endif
 
 ifndef WITHOUT_LIBEXIF
-  LIBS    += -lexif
+  PKG-INCLUDES += libexif
+  PKG-LIBS += libexif
   DEFINES += -DHAVE_LIBEXIF
 endif
 
+
+ifdef PKG-INCLUDES
+INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
+endif
+
+ifdef PKG-LIBS
+LIBS    += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS))
+endif
+
 ### The object files (add further files here):
 
 OBJS = ${PLUGIN}.o i18n.o data.o menu.o data-image.o menu-image.o \
@@ -166,8 +179,7 @@
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
 	@echo Distribution package created as $(PACKAGE).tar.gz
 
-clean:
-	@-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~  examples/*~ scripts/*~
+subdirs-clean:
 	@for i in $(SUBDIRS) ;\
 	do \
 	    ( cd $$i;\
@@ -175,3 +187,6 @@
        ) \
 	|| exit 1;\
 	done
+
+clean: subdirs-clean
+	@-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~  examples/*~ scripts/*~
diff -ru image-0.2.7/README image-svn/README
--- image-0.2.7/README	2006-01-14 12:07:29.000000000 +0100
+++ image-svn/README	2007-07-05 13:00:01.000000000 +0200
@@ -22,7 +22,9 @@
 - 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 @@
 
     $ 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