[packages/x262] - initial; proper library is not built yet, just encoder

qboosh qboosh at pld-linux.org
Mon Apr 20 21:55:42 CEST 2015


commit 2ecf1a5726fc972348d708f60eae5c0fa7b0b23d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Apr 20 21:57:31 2015 +0200

    - initial; proper library is not built yet, just encoder

 x262-lsmash-update.patch | 99 ++++++++++++++++++++++++++++++++++++++++++++++++
 x262.spec                | 58 ++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+)
---
diff --git a/x262.spec b/x262.spec
new file mode 100644
index 0000000..7b837b6
--- /dev/null
+++ b/x262.spec
@@ -0,0 +1,58 @@
+Summary:	MPEG-2 encoder based on x264
+Summary(pl.UTF-8):	Koder MPEG-2 oparty na x264
+Name:		x262
+Version:	0
+%define	snap	20150316
+Release:	0.%{snap}.1
+License:	GPL v2+
+Group:		Libraries
+# git clone git://git.videolan.org/x262.git
+Source0:	%{name}.tar.xz
+# Source0-md5:	24b9949ae551f5881c44be65a410b0ee
+Patch0:		%{name}-lsmash-update.patch
+URL:		https://www.videolan.org/developers/x262.html
+# libswscale libavformat libavcodec libavutil
+BuildRequires:	ffmpeg-devel >= 0.7.1
+BuildRequires:	ffmpegsource-devel >= 2.16
+BuildRequires:	gpac-devel >= 0.5.0-3
+BuildRequires:	l-smash-devel >= 1.5
+%ifarch %{ix86} %{x8664}
+BuildRequires:	yasm
+%endif
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+x262 is an MPEG-2 encoder based on the best-in-class features of x264.
+
+%description -l pl.UTF-8
+x262 to koder MPEG-2 oparty na najlepszych cechach x264.
+
+%prep
+%setup -q -n %{name}
+%patch0 -p1
+
+%build
+%configure \
+	--extra-cflags="%{rpmcflags}" \
+	--extra-ldflags="%{rpmldflags}"
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+# installs as x264
+#%{__make} install \
+#	DESTDIR=$RPM_BUILD_ROOT
+
+install -D x264 $RPM_BUILD_ROOT%{_bindir}/x262
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS doc/{ratecontrol,vui}.txt
+%attr(755,root,root) %{_bindir}/x262
diff --git a/x262-lsmash-update.patch b/x262-lsmash-update.patch
new file mode 100644
index 0000000..f7cb85d
--- /dev/null
+++ b/x262-lsmash-update.patch
@@ -0,0 +1,99 @@
+From 8a85db879d57537f91a9908be3585512981c08b8 Mon Sep 17 00:00:00 2001
+From: Yusuke Nakamura <muken.the.vfrmaniac at gmail.com>
+Date: Thu, 19 Jun 2014 05:21:29 +0900
+Subject: [PATCH] mp4_lsmash: Use new I/O API instead of deprecated one.
+
+---
+ configure           |    4 ++--
+ output/mp4_lsmash.c |   32 ++++++++++++++++++--------------
+ 2 files changed, 20 insertions(+), 16 deletions(-)
+
+diff --git a/configure b/configure
+index f71c696..0a4cb94 100755
+--- a/configure
++++ b/configure
+@@ -943,10 +943,10 @@ if [ "$lsmash" = "auto" ] ; then
+     [ -z "$LSMASH_LIBS" ] && LSMASH_LIBS="-llsmash"
+ 
+     if cc_check lsmash.h "$LSMASH_CFLAGS $LSMASH_LIBS" ; then
+-        if cpp_check lsmash.h "$LSMASH_CFLAGS" "LSMASH_VERSION_MAJOR > 0 || (LSMASH_VERSION_MAJOR == 0 && LSMASH_VERSION_MINOR >= 1)" ; then
++        if cpp_check lsmash.h "$LSMASH_CFLAGS" "LSMASH_VERSION_MAJOR > 1 || (LSMASH_VERSION_MAJOR == 1 && LSMASH_VERSION_MINOR >= 5)" ; then
+             lsmash="yes"
+         else
+-            echo "Warning: lsmash is too old, update to rev.751 or later"
++            echo "Warning: lsmash is too old, update to rev.895 or later"
+         fi
+     fi
+ fi
+diff --git a/output/mp4_lsmash.c b/output/mp4_lsmash.c
+index b4ed31c..ce259d7 100644
+--- a/output/mp4_lsmash.c
++++ b/output/mp4_lsmash.c
+@@ -79,6 +79,7 @@ typedef struct
+     int i_dts_compress_multiplier;
+     int b_use_recovery;
+     int b_fragments;
++    lsmash_file_parameters_t file_param;
+ } mp4_hnd_t;
+ 
+ /*******************/
+@@ -88,16 +89,10 @@ static void remove_mp4_hnd( hnd_t handle )
+     mp4_hnd_t *p_mp4 = handle;
+     if( !p_mp4 )
+         return;
+-    if( p_mp4->p_sei_buffer )
+-    {
+-        free( p_mp4->p_sei_buffer );
+-        p_mp4->p_sei_buffer = NULL;
+-    }
+-    if( p_mp4->p_root )
+-    {
+-        lsmash_destroy_root( p_mp4->p_root );
+-        p_mp4->p_root = NULL;
+-    }
++    lsmash_cleanup_summary( (lsmash_summary_t *)p_mp4->summary );
++    lsmash_close_file( &p_mp4->file_param );
++    lsmash_destroy_root( p_mp4->p_root );
++    free( p_mp4->p_sei_buffer );
+     free( p_mp4 );
+ }
+ 
+@@ -181,9 +176,13 @@ static int open_file( char *psz_filename, hnd_t *p_handle, cli_output_opt_t *opt
+     p_mp4->b_fragments    = !b_regular;
+     p_mp4->b_stdout       = !strcmp( psz_filename, "-" );
+ 
+-    p_mp4->p_root = lsmash_open_movie( psz_filename, p_mp4->b_fragments ? LSMASH_FILE_MODE_WRITE_FRAGMENTED : LSMASH_FILE_MODE_WRITE );
++    p_mp4->p_root = lsmash_create_root();
+     MP4_FAIL_IF_ERR_EX( !p_mp4->p_root, "failed to create root.\n" );
+ 
++    MP4_FAIL_IF_ERR_EX( lsmash_open_file( psz_filename, 0, &p_mp4->file_param ) < 0, "failed to open an output file.\n" );
++    if( p_mp4->b_fragments )
++        p_mp4->file_param.mode |= LSMASH_FILE_MODE_FRAGMENTED;
++
+     p_mp4->summary = (lsmash_video_summary_t *)lsmash_create_summary( LSMASH_SUMMARY_TYPE_VIDEO );
+     MP4_FAIL_IF_ERR_EX( !p_mp4->summary,
+                         "failed to allocate memory for summary information of video.\n" );
+@@ -219,12 +218,17 @@ static int set_param( hnd_t handle, x264_param_t *p_param )
+             brands[brand_count++] = ISOM_BRAND_TYPE_ISO6;   /* cslg and visual random access grouping */
+     }
+ 
++    /* Set file */
++    lsmash_file_parameters_t *file_param = &p_mp4->file_param;
++    file_param->major_brand   = brands[0];
++    file_param->brands        = brands;
++    file_param->brand_count   = brand_count;
++    file_param->minor_version = 0;
++    MP4_FAIL_IF_ERR( !lsmash_set_file( p_mp4->p_root, file_param ), "failed to add an output file into a ROOT.\n" );
++
+     /* Set movie parameters. */
+     lsmash_movie_parameters_t movie_param;
+     lsmash_initialize_movie_parameters( &movie_param );
+-    movie_param.major_brand = ISOM_BRAND_TYPE_MP42;
+-    movie_param.brands = brands;
+-    movie_param.number_of_brands = brand_count;
+     MP4_FAIL_IF_ERR( lsmash_set_movie_parameters( p_mp4->p_root, &movie_param ),
+                      "failed to set movie parameters.\n" );
+     p_mp4->i_movie_timescale = lsmash_get_movie_timescale( p_mp4->p_root );
+-- 
+1.7.10.4
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/x262.git/commitdiff/2ecf1a5726fc972348d708f60eae5c0fa7b0b23d



More information about the pld-cvs-commit mailing list