Author: oget
Update of /cvs/free/rpms/avbin/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv30290/devel
Modified Files:
.cvsignore sources
Added Files:
avbin-Makefile-shared.patch avbin-SAMPLE_FMT_S24.patch
avbin-swscale.patch avbin.spec
Log Message:
* Thu Jan 15 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-6
- The S24 was actually needed for ffmpeg revision >= 15124. Updated the patch
* Thu Jan 15 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-5
- Fix license again
- Fix description length
- Patch for compilation against ffmpeg revision >= 16176
* Thu Dec 04 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-4
- Update the Makefile patch to do the linking in a proper way
- Preserve the timestamp of the Changelog
* Wed Dec 03 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-3
- Set the license to GPLv3 since we are linking to sws_scale which is from the
GPL part of ffmpeg.
* Sat Nov 22 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-2
- Patch to use ffmpeg's sws_scale() instead of the deprecated img_convert().
* Thu Oct 23 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-1
- Linked avbin to ffmpeg dynamically
- Use the release version 7 because the avbin code hasn't changed since in svn.
- Update the description
* Thu Oct 23 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> -
7-0.20081023svn.1
- Initial build. This is ffmpeg's SPEC file modified.
avbin-Makefile-shared.patch:
--- NEW FILE avbin-Makefile-shared.patch ---
diff -rupN avbin-src-7/Makefile avbin-src-7-new/Makefile
--- avbin-src-7/Makefile 2008-09-21 02:45:33.000000000 -0400
+++ avbin-src-7-new/Makefile 2008-11-22 20:32:48.000000000 -0500
@@ -1,7 +1,8 @@
# $Id: Makefile 18 2008-04-13 06:18:31Z Alex.Holkner $
CFLAGS += -DAVBIN_VERSION=$(AVBIN_VERSION) \
- -DFFMPEG_REVISION=$(FFMPEG_REVISION)
+ -DFFMPEG_REVISION=$(FFMPEG_REVISION) \
+ -fPIC $(RPM_OPT_FLAGS)
CC = gcc
LD = ld
@@ -13,7 +14,14 @@ OBJNAME = $(BUILDDIR)/avbin.o
INCLUDE_DIRS = -I include \
-I $(FFMPEG)
-include Makefile.$(PLATFORM)
+LINKNAME=libavbin.so
+SONAME=$(LINKNAME).$(AVBIN_VERSION)
+LIBNAME=$(OUTDIR)/$(SONAME)
+
+LDFLAGS += -shared -Wl,-soname=$(SONAME) -lavformat -lavcodec -lavutil -lswscale
+
+$(LIBNAME) : $(OBJNAME) $(OUTDIR)
+ $(CC) $(LDFLAGS) -o $@ $<
all : $(LIBNAME)
ln -sf $(LIBNAME) $(LINKNAME)
@@ -31,3 +39,10 @@ clean :
rm -f $(OBJNAME)
rm -f $(LINKNAME)
rm -f $(LIBNAME)
+
+install :
+ mkdir -p $(DESTDIR)/$(INCLUDEDIR)
+ mkdir -p $(DESTDIR)/$(LIBDIR)
+ install -pm 644 include/avbin.h $(DESTDIR)/$(INCLUDEDIR)
+ install -pm 755 dist/$(SONAME) $(DESTDIR)/$(LIBDIR)
+ ln -s $(SONAME) $(DESTDIR)/$(LIBDIR)/$(LINKNAME)
avbin-SAMPLE_FMT_S24.patch:
--- NEW FILE avbin-SAMPLE_FMT_S24.patch ---
diff -rupN avbin-src-7/src/avbin.c avbin-src-7-new/src/avbin.c
--- avbin-src-7/src/avbin.c 2009-01-15 13:49:29.000000000 -0500
+++ avbin-src-7-new/src/avbin.c 2009-01-15 13:50:20.000000000 -0500
@@ -216,10 +216,12 @@ int avbin_stream_info(AVbinFile *file, i
info->audio.sample_format = AVBIN_SAMPLE_FORMAT_S16;
info->audio.sample_bits = 16;
break;
+#if FFMPEG_REVISION < 15124
case SAMPLE_FMT_S24:
info->audio.sample_format = AVBIN_SAMPLE_FORMAT_S24;
info->audio.sample_bits = 24;
break;
+#endif
case SAMPLE_FMT_S32:
info->audio.sample_format = AVBIN_SAMPLE_FORMAT_S32;
info->audio.sample_bits = 32;
avbin-swscale.patch:
--- NEW FILE avbin-swscale.patch ---
diff -rupN avbin-src-7/src/avbin.c avbin-src-7-new/src/avbin.c
--- avbin-src-7/src/avbin.c 2008-09-21 02:45:33.000000000 -0400
+++ avbin-src-7-new/src/avbin.c 2008-11-22 20:32:48.000000000 -0500
@@ -28,6 +28,7 @@
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
+#include <libswscale/swscale.h>
struct _AVbinFile {
AVFormatContext *context;
@@ -334,13 +335,27 @@ int avbin_decode_video(AVbinStream *stre
avpicture_fill(&picture_rgb, data_out, PIX_FMT_RGB24, width, height);
- /* img_convert is marked deprecated in favour of swscale, don't
- * be surprised if this stops working the next time the ffmpeg version
- * is pushed. Example use of the new API is in ffplay.c. */
- img_convert(&picture_rgb, PIX_FMT_RGB24,
- (AVPicture *) stream->frame, stream->codec_context->pix_fmt,
- width, height);
+ static int sws_flags = SWS_BICUBIC;
+ static struct SwsContext *img_convert_ctx;
+ img_convert_ctx = sws_getContext( width,
+ height,
+ stream->codec_context->pix_fmt,
+ width,
+ height,
+ PIX_FMT_RGB24,
+ sws_flags, NULL, NULL, NULL);
+
+ sws_scale( img_convert_ctx,
+ stream->frame->data,
+ stream->frame->linesize,
+ 0,
+ height,
+ picture_rgb.data,
+ picture_rgb.linesize);
+
+ sws_freeContext(img_convert_ctx);
+
return used;
}
--- NEW FILE avbin.spec ---
Summary: Cross-platform media decoding library
Name: avbin
Version: 7
Release: 6%{?dist}
# Note that this license is implicitly converted to GPLv3 because we are linking to
# a GPLv2+ ffmpeg:
License: LGPLv3+
Group: System Environment/Libraries
URL:
http://code.google.com/p/avbin/
Source0:
http://avbin.googlecode.com/files/%{name}-src-%{version}.tar.gz
# avbin is patched to use sws_scale() instead of the obsolete img_convert().
# Patch sent upstream:
#
http://code.google.com/p/avbin/issues/detail?id=8
Patch0: avbin-swscale.patch
# SAMPLE_FMT_S24 is deprecated on ffmpeg rev > 16176:
Patch1: avbin-SAMPLE_FMT_S24.patch
# The original Makefile links ffmpeg statically. This is the modified
# Makefile that tells the compiler to link dynamically to ffmpeg:
Patch9: avbin-Makefile-shared.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: doxygen
BuildRequires: ffmpeg >= 0.4.9-0.48.20080908
BuildRequires: ffmpeg-devel >= 0.4.9-0.48.20080908
%description
AVbin is a thin wrapper around FFmpeg, providing binary compatibility for
applications and languages that need it. AVbin allows programs that require
dynamic linkage to use FFmpeg. It does this by providing
* an accurate version number within the shared library, allowing applications
to select the appropriate data structures and functions to use at runtime,
* a simplified interface with an unchanging ABI to the most common decoding
functionality within FFmpeg.
%package devel
Summary: Development package for AVbin
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
AVbin is a thin wrapper around FFmpeg, providing binary compatibility for
applications and languages that need it. This package provides the header
and the documentation files for AVbin.
%prep
%setup -q -n %{name}-src-%{version}
%patch0 -p1
%patch1 -p1
%patch9 -p1
# Fix permissions and end of line encoding issues:
sed 's/\r//' CHANGELOG > CHANGELOG.bak
touch -r CHANGELOG CHANGELOG.bak
mv -f CHANGELOG.bak CHANGELOG
%build
# Now compile avbin
make %{?_smp_mflags} \
AVBIN_VERSION=$(cat VERSION) \
FFMPEG_REVISION=$(ffmpeg -version |grep FFmpeg |sed 's|[^0-9]*||') \
FFMPEG=%{_includedir}/ffmpeg
# Generate the doc files:
doxygen Doxyfile
%install
rm -rf $RPM_BUILD_ROOT
make install AVBIN_VERSION=$(cat VERSION) \
INCLUDEDIR=%{_includedir} \
LIBDIR=%{_libdir} \
DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc COPYING.LESSER CHANGELOG README
%{_libdir}/lib%{name}.so.%{version}
%files devel
%defattr(-,root,root,-)
%doc doc/html/* COPYING.LESSER
%{_includedir}/*
%{_libdir}/lib%{name}.so
%changelog
* Thu Jan 15 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-6
- The S24 was actually needed for ffmpeg revision >= 15124. Updated the patch
* Thu Jan 15 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-5
- Fix license again
- Fix description length
- Patch for compilation against ffmpeg revision >= 16176
* Thu Dec 04 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-4
- Update the Makefile patch to do the linking in a proper way
- Preserve the timestamp of the Changelog
* Wed Dec 03 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-3
- Set the license to GPLv3 since we are linking to sws_scale which is from the
GPL part of ffmpeg.
* Sat Nov 22 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-2
- Patch to use ffmpeg's sws_scale() instead of the deprecated img_convert().
* Thu Oct 23 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 7-1
- Linked avbin to ffmpeg dynamically
- Use the release version 7 because the avbin code hasn't changed since in svn.
- Update the description
* Thu Oct 23 2008 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> -
7-0.20081023svn.1
- Initial build. This is ffmpeg's SPEC file modified.
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/avbin/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 16 Jan 2009 14:27:05 -0000 1.1
+++ .cvsignore 16 Jan 2009 14:35:32 -0000 1.2
@@ -0,0 +1 @@
+avbin-src-7.tar.gz
Index: sources
===================================================================
RCS file: /cvs/free/rpms/avbin/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 16 Jan 2009 14:27:05 -0000 1.1
+++ sources 16 Jan 2009 14:35:32 -0000 1.2
@@ -0,0 +1 @@
+9c08f4f6e778021dcd154e11fd0f79ad avbin-src-7.tar.gz