#include <limits.h>
#include <stdint.h>
- //#define MOV_EXPORT_ALL_METADATA
-
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/display.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
mov_metadata_creation_time(&c->fc->metadata, creation_time);
c->time_scale = avio_rb32(pb); /* time scale */
- av_dlog(c->fc, "time scale = %i\n", c->time_scale);
+ av_log(c->fc, AV_LOG_TRACE, "time scale = %i\n", c->time_scale);
c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
+ // set the AVCodecContext duration because the duration of individual tracks
+ // may be inaccurate
+ if (c->time_scale > 0)
+ c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale);
avio_rb32(pb); /* preferred scale */
avio_rb16(pb); /* preferred volume */
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
- sc->display_matrix[i * 3 + j] = display_matrix[j][i];
+ sc->display_matrix[i * 3 + j] = display_matrix[i][j];
+
+ rotate = av_display_rotation_get(sc->display_matrix);
+ if (!isnan(rotate)) {
+ char rotate_buf[64];
+ rotate = -rotate;
+ if (rotate < 0) // for backward compatibility
+ rotate += 360;
+ snprintf(rotate_buf, sizeof(rotate_buf), "%g", rotate);
+ av_dict_set(&st->metadata, "rotate", rotate_buf, 0);
+ }
}
// transform the display width/height according to the matrix
--- /dev/null
- Version: 11.4
+Name: libav
+Summary: AV codec lib
++Version: 12.1
+Release: 0
+Group: Multimedia/Libraries
+URL: http://libav.org
+License: LGPL-2.1+
+Source0: %{name}-%{version}.tar.gz
+
+
+%description
+AV codec library
+
+%package -n libavtools
+Summary: AV tools
+Group: Multimedia/Libraries
+
+%description -n libavtools
+AV tools binary
+
+%package -n libavcodec
+Summary: AV codec lib
+Group: Multimedia/Libraries
+
+%description -n libavcodec
+AV codec library
+
+%package -n libavcodec-devel
+Summary: AV codec lib (devel)
+Group: Multimedia/Libraries
+Requires: libavcodec = %{version}-%{release}
+
+%description -n libavcodec-devel
+AV codec library (devel)
+
+%package -n libavformat
+Summary: AV format lib
+Group: Multimedia/Libraries
+
+%description -n libavformat
+AV format library
+
+%package -n libavformat-devel
+Summary: AV format lib (devel)
+Group: Multimedia/Libraries
+Requires: libavformat = %{version}-%{release}
+
+%description -n libavformat-devel
+AV format library (devel)
+
+%package -n libavutil
+Summary: AV util lib
+Group: Multimedia/Libraries
+
+%description -n libavutil
+AV util library
+
+%package -n libavutil-devel
+Summary: AV util lib (devel)
+Group: Multimedia/Libraries
+Requires: libavutil = %{version}-%{release}
+
+%description -n libavutil-devel
+AV util library (devel)
+
+%package -n libavfilter
+Summary: AV util lib
+Group: Multimedia/Libraries
+
+%description -n libavfilter
+AV filter library
+
+%package -n libavfilter-devel
+Summary: AV util lib (devel)
+Group: Multimedia/Libraries
+Requires: libavfilter = %{version}-%{release}
+
+%description -n libavfilter-devel
+AV filter library (devel)
+
+%package -n libswscale
+Summary: SW scale lib
+Group: Multimedia/Libraries
+
+%description -n libswscale
+development files for libswsacle
+
+%package -n libswscale-devel
+Summary: SW scale lib (devel)
+Group: Multimedia/Libraries
+Requires: libswscale = %{version}-%{release}
+
+%description -n libswscale-devel
+development files for libswsacle
+
+
+%prep
+%setup -q
+
+export CONFIGURE_OPTIONS="--enable-shared --disable-static \
+--disable-version3 --disable-devices --disable-nonfree --disable-gpl --disable-doc \
+--disable-zlib --disable-network \
+--disable-avdevice \
+--disable-bsfs --disable-filters \
+--enable-filter=buffer --enable-filter=buffersink --enable-filter=crop \
+--enable-filter=hflip --enable-filter=lut --enable-filter=lutyuv \
+--enable-filter=lutrgb --enable-filter=overlay --enable-filter=scale \
+--enable-filter=transpose --enable-filter=unsharp --enable-filter=vflip \
+--disable-protocols \
+--disable-avresample \
+--enable-protocol=file \
+--disable-encoders \
+--disable-muxers \
+--disable-parsers \
+--enable-parser=aac --enable-parser=h264 --enable-parser=mpegaudio \
+--enable-parser=h263 --enable-parser=mpeg4video --enable-parser=mpegvideo \
+--enable-parser=hevc \
+--disable-demuxers \
+--enable-demuxer=aac --enable-demuxer=h264 --enable-demuxer=mpegts \
+--enable-demuxer=amr --enable-demuxer=m4v --enable-demuxer=mpegtsraw \
+--enable-demuxer=asf --enable-demuxer=mmf --enable-demuxer=mpegvideo \
+--enable-demuxer=avi --enable-demuxer=mov --enable-demuxer=ogg \
+--enable-demuxer=flac --enable-demuxer=mp3 --enable-demuxer=wav \
+--enable-demuxer=h263 --enable-demuxer=mpegps --enable-demuxer=matroska \
+--enable-demuxer=dv --enable-demuxer=flv --enable-demuxer=rm \
+--enable-demuxer=aiff --enable-muxer=mpeg1video --enable-muxer=mpeg2video --enable-demuxer=hevc \
+--disable-decoders \
+--enable-decoder=alac --enable-decoder=h264 --enable-decoder=wmv1 \
+--enable-decoder=flac --enable-decoder=mpeg4 --enable-decoder=wmv2 \
+--enable-decoder=h263 --enable-decoder=mpegvideo --enable-decoder=wmv3 \
+--enable-decoder=vc1 --enable-decoder=flv --enable-decoder=rv40 \
+--enable-decoder=h263i --enable-decoder=theora --enable-decoder=mpeg1video --enable-decoder=mpeg2video \
+--enable-decoder=pcm_alaw --enable-decoder=pcm_mulaw \
+--enable-decoder=msmpeg4v3 --enable-decoder=hevc --enable-encoder=libx265 \
+--enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 \
+--enable-decoder=bmp --enable-encoder=bmp --enable-encoder=mpeg1video --enable-encoder=mpeg2video \
+--enable-decoder=tiff \
+--enable-decoder=mp3 --enable-decoder=amrnb \
+--enable-encoder=aac --enable-decoder=aac \
+--enable-swscale --disable-yasm \
+--enable-fft --enable-rdft --enable-mdct --enable-neon \
+%{?asan:--disable-inline-asm} \
+"
+
+%if 0%{?TIZEN_PRODUCT_TV}
+export CONFIGURE_OPTIONS+="--enable-parser=vp8 --enable-decoder=vp8 --enable-decoder=vp9 "
+%else
+%endif
+
+%ifarch %{arm} aarch64
+export CONFIGURE_OPTIONS+="--disable-mmx "
+%else
+%endif
+
+CFLAGS="%{optflags} -fPIC -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; export CFLAGS
+
+%ifarch %{arm}
+export CONFIGURE_OPTIONS+="--extra-cflags=-mfpu=neon"
+%endif
+
+./configure \
+ --prefix=%{_prefix} \
+ --libdir=%_libdir \
+ --shlibdir=%_libdir \
+ $CONFIGURE_OPTIONS
+
+%build
+
+
+%__make %{?_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files -n libavtools
+%manifest libavtools.manifest
+%defattr(-,root,root,-)
+%{_bindir}/av*
+%{_datadir}/avconv/*.avpreset
+
+%files -n libavcodec
+%manifest libavcodec.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libavcodec.so.*
+%license COPYING.LGPLv2.1
+%post -n libavcodec -p /sbin/ldconfig
+%postun -n libavcodec -p /sbin/ldconfig
+
+%files -n libavformat
+%manifest libavformat.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libavformat.so.*
+%license COPYING.LGPLv2.1
+%post -n libavformat -p /sbin/ldconfig
+%postun -n libavformat -p /sbin/ldconfig
+
+%files -n libavutil
+%manifest libavutil.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libavutil.so.*
+%license COPYING.LGPLv2.1
+%post -n libavutil -p /sbin/ldconfig
+%postun -n libavutil -p /sbin/ldconfig
+
+%files -n libavfilter
+%manifest libavfilter.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libavfilter.so.*
+%license COPYING.LGPLv2.1
+%post -n libavfilter -p /sbin/ldconfig
+%postun -n libavfilter -p /sbin/ldconfig
+
+%files -n libswscale
+%manifest libswscale.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libswscale.so.*
+%license COPYING.LGPLv2.1
+%post -n libswscale -p /sbin/ldconfig
+%postun -n libswscale -p /sbin/ldconfig
+
+%files -n libavcodec-devel
+%defattr(-,root,root,-)
+%_includedir/libavcodec/*
+%_libdir/libavcodec.so
+%_libdir/pkgconfig/libavcodec.pc
+
+%files -n libavformat-devel
+%defattr(-,root,root,-)
+%_includedir/libavformat/*
+%_libdir/libavformat.so
+%_libdir/pkgconfig/libavformat.pc
+
+%files -n libavutil-devel
+%defattr(-,root,root,-)
+%_includedir/libavutil/*
+%_libdir/libavutil.so
+%_libdir/pkgconfig/libavutil.pc
+
+%files -n libavfilter-devel
+%defattr(-,root,root,-)
+%_includedir/libavfilter/*
+%_libdir/libavfilter.so
+%_libdir/pkgconfig/libavfilter.pc
+
+%files -n libswscale-devel
+%defattr(-,root,root,-)
+%_includedir/libswscale/*
+%_libdir/libswscale.so
+%_libdir/pkgconfig/libswscale.pc