[packages] ffmpeg: update to 0.5.2
[openwrt/svn-archive/archive.git] / multimedia / ffmpeg / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ffmpeg
11 PKG_VERSION:=0.5.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://ffmpeg.org/releases/
16 PKG_MD5SUM:=
17
18 FFMPEG_ENCODERS:= \
19 ac3 \
20 jpegls \
21 mpeg1video \
22 mpeg2video \
23 mpeg4 \
24 pcm_s16be \
25 pcm_s16le \
26 png \
27 zlib \
28
29 FFMPEG_DECODERS:= \
30 ac3 \
31 atrac3 \
32 gif \
33 h264 \
34 jpegls \
35 mp3 \
36 mpeg1video \
37 mpeg2video \
38 mpeg4 \
39 mpeg4aac \
40 mpegvideo \
41 pcm_s16be \
42 pcm_s16le \
43 png \
44 wmav1 \
45 wmav2 \
46 zlib \
47
48 FFMPEG_MUXERS:= \
49 ac3 \
50 ffm \
51 h264 \
52 mp3 \
53 mp4 \
54 mpeg1video \
55 mpeg2video \
56 mpegts \
57 oss \
58 rtp \
59
60 FFMPEG_DEMUXERS:= \
61 ac3 \
62 ffm \
63 h264 \
64 mp3 \
65 mpegps \
66 mpegts \
67 mpegvideo \
68 rm \
69 rtsp \
70 sdp \
71 v4l2 \
72
73 FFMPEG_PARSERS:= \
74 ac3 \
75 h264 \
76 mpegaudio \
77 mpegvideo \
78 mpeg4video \
79
80 FFMPEG_PROTOCOLS:= \
81 file http pipe rtp tcp udp
82
83 PKG_CONFIG_DEPENDS:= \
84 $(patsubst %,CONFIG_FFMPEG_ENCODER_%,$(FFMPEG_ENCODERS)) \
85 $(patsubst %,CONFIG_FFMPEG_DECODER_%,$(FFMPEG_DECODERS)) \
86 $(patsubst %,CONFIG_FFMPEG_MUXER_%,$(FFMPEG_DEMUXERS)) \
87 $(patsubst %,CONFIG_FFMPEG_DEMUXER_%,$(FFMPEG_DEMUXERS)) \
88 $(patsubst %,CONFIG_FFMPEG_PARSER_%,$(FFMPEG_PARSERS)) \
89 $(patsubst %,CONFIG_FFMPEG_PROTOCOL_%,$(FFMPEG_PROTOCOLS))
90
91 include $(INCLUDE_DIR)/package.mk
92
93 define Package/ffmpeg/Default
94 TITLE:=FFmpeg
95 URL:=http://ffmpeg.mplayerhq.hu/
96 endef
97
98 define Package/ffmpeg/Default/description
99 FFmpeg is a a software package that can record, convert and stream digital
100 audio and video in numerous formats.
101 endef
102
103 define Package/ffmpeg
104 $(call Package/ffmpeg/Default)
105 SECTION:=multimedia
106 CATEGORY:=Multimedia
107 TITLE+= program
108 DEPENDS+= +libpthread +libffmpeg
109 endef
110
111 define Package/ffmpeg/description
112 $(call Package/ffmpeg/Default/description)
113 .
114 This package contains the FFmpeg command line tool.
115 endef
116
117 define Package/ffserver
118 $(call Package/ffserver/Default)
119 SECTION:=multimedia
120 CATEGORY:=Multimedia
121 TITLE+= streaming server
122 DEPENDS+= +libpthread +libffmpeg +@FFMPEG_FFSERVER_SUPPORT
123 endef
124
125 define Package/ffserver/description
126 $(call Package/ffmpeg/Default/description)
127 .
128 This package contains the FFmpeg streaming server.
129 endef
130
131 define Package/libffmpeg
132 $(call Package/ffmpeg/Default)
133 SECTION:=libs
134 CATEGORY:=Libraries
135 TITLE+= libraries
136 DEPENDS+= +libpthread +zlib
137 MENU:=1
138 endef
139
140 define Package/libffmpeg/config
141 source "$(SOURCE)/Config.in"
142 endef
143
144 define Package/libffmeg/description
145 $(call Package/ffmpeg/Default/description)
146 .
147 This package contains FFmpeg shared libraries.
148 endef
149
150 define Package/libpostproc
151 SECTION:=libs
152 CATEGORY:=Libraries
153 TITLE:=libpostproc
154 URL:=http://ffmpeg.mplayerhq.hu/
155 DEPENDS:=+libffmpeg
156 endef
157
158 FILTER_CONFIG= \
159 $(foreach c, $(3), \
160 $(if $(CONFIG_FFMPEG_$(1)_$(c)),--enable-$(2)="$(c)") \
161 )
162
163 FFMPEG_CONFIGURE_ENCODERS:=$(call FILTER_CONFIG,ENCODER,encoder,$(FFMPEG_ENCODERS))
164 FFMPEG_CONFIGURE_DECODERS:=$(call FILTER_CONFIG,DECODER,decoder,$(FFMPEG_DECODERS))
165 FFMPEG_CONFIGURE_MUXERS:=$(call FILTER_CONFIG,MUXER,muxer,$(FFMPEG_MUXERS))
166 FFMPEG_CONFIGURE_DEMUXERS:=$(call FILTER_CONFIG,DEMUXER,demuxer,$(FFMPEG_DEMUXERS))
167 FFMPEG_CONFIGURE_PARSERS:=$(call FILTER_CONFIG,PARSER,parser,$(FFMPEG_PARSERS))
168 FFMPEG_CONFIGURE_PROTOCOLS:=$(call FILTER_CONFIG,PROTOCOL,protocol,$(FFMPEG_PROTOCOLS))
169
170 # XXX: add --disable-mmx & --disable-mmx2 to fix build failure on x86
171 # libpostproc/postprocess_template.c:2195: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
172 # libpostproc/postprocess_template.c:3124: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
173 # libpostproc/postprocess_template.c:3207: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
174
175 define Build/Configure
176 # this is *NOT* GNU configure
177 ( cd $(PKG_BUILD_DIR); \
178 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
179 LDFLAGS="$(TARGET_LDFLAGS)" \
180 ./configure \
181 --enable-cross-compile \
182 --cross-prefix="$(TARGET_CROSS)" \
183 --arch="$(ARCH)" \
184 --prefix="/usr" \
185 --enable-shared \
186 --enable-static \
187 --disable-debug \
188 --enable-ffmpeg \
189 --enable-ffserver \
190 --enable-gpl \
191 --disable-libfaad \
192 --disable-mmx \
193 --disable-mmx2 \
194 --enable-pthreads \
195 --disable-optimizations \
196 --enable-small \
197 --disable-stripping \
198 --disable-vhook \
199 --enable-zlib \
200 --enable-postproc \
201 \
202 $(if $(CONFIG_FFMPEG_IPV6),,--disable-ipv6) \
203 \
204 --disable-bsfs \
205 --disable-devices \
206 --disable-encoders \
207 $(FFMPEG_CONFIGURE_ENCODERS) \
208 --disable-decoders \
209 $(FFMPEG_CONFIGURE_DECODERS) \
210 --disable-muxers \
211 $(FFMPEG_CONFIGURE_MUXERS) \
212 --disable-demuxers \
213 $(FFMPEG_CONFIGURE_DEMUXERS) \
214 --disable-parsers \
215 $(FFMPEG_CONFIGURE_PARSERS) \
216 --disable-protocols \
217 $(FFMPEG_CONFIGURE_PROTOCOLS) \
218 )
219 endef
220
221 define Build/Compile
222 $(MAKE) -C $(PKG_BUILD_DIR) \
223 DESTDIR="$(PKG_INSTALL_DIR)" \
224 all install
225 endef
226
227 define Build/InstallDev
228 $(INSTALL_DIR) $(1)/usr/include
229 $(CP) $(PKG_INSTALL_DIR)/usr/include/libav{codec,device,format,util} $(1)/usr/include/
230 $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
231 $(INSTALL_DIR) $(1)/usr/lib
232 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.{a,so*} $(1)/usr/lib/
233 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
234 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
235 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libav{codec,device,format,util}.pc $(1)/usr/lib/pkgconfig/
236 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
237 endef
238
239 define Package/ffmpeg/install
240 $(INSTALL_DIR) $(1)/usr/bin
241 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/
242 endef
243
244 define Package/ffserver/install
245 $(INSTALL_DIR) $(1)/usr/bin
246 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffserver $(1)/usr/bin/
247 endef
248
249 define Package/libffmpeg/install
250 $(INSTALL_DIR) $(1)/usr/lib
251 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libav{codec,device,format,util}.so.* $(1)/usr/lib/
252 endef
253
254 define Package/libpostproc/install
255 $(INSTALL_DIR) $(1)/usr/lib
256 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
257 endef
258
259 $(eval $(call BuildPackage,ffmpeg))
260 $(eval $(call BuildPackage,ffserver))
261 $(eval $(call BuildPackage,libffmpeg))
262 $(eval $(call BuildPackage,libpostproc))