git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #6483 from qknight/kino-1.3.4-build-fix

kino-1.3.4 fixes

commit18ec13d9d2c9c10f9fc9370cb384d5750f8ccf8b authorArseniy Seroka <jagajaga@users.noreply.github.com> dateSat 21 Feb 2015, 13:32 (12 years ago) parent6f30dcd1a35a0a
5 files changed+154−2
pkgs/applications/video/kino/default.nix+5−2 pkgs/applications/video/kino/kino-1.3.4-libav-0.7.patch+60 pkgs/applications/video/kino/kino-1.3.4-libav-0.8.patch+57 pkgs/applications/video/kino/kino-1.3.4-libavcodec-pkg-config.patch+11 pkgs/applications/video/kino/kino-1.3.4-v4l1.patch+21
pkgs/applications/video/kino/default.nix+5−2
@@ -52,7 +52,7 @@
5252
5353{ stdenv, fetchurl, gtk, libglade, libxml2, libraw1394, libsamplerate, libdv
5454, pkgconfig, perl, perlXMLParser, libavc1394, libiec61883, libXv, gettext
55−, libX11, glib, cairo, intltool, ffmpeg
55+, libX11, glib, cairo, intltool, ffmpeg, libv4l
5656}:
5757
5858stdenv.mkDerivation {
@@ -64,7 +64,7 @@ stdenv.mkDerivation {
6464 };
6565
6666 buildInputs = [ gtk libglade libxml2 libraw1394 libsamplerate libdv
67− pkgconfig perl perlXMLParser libavc1394 libiec61883 intltool libXv gettext libX11 glib cairo ffmpeg ]; # TODOoptional packages
67+ pkgconfig perl perlXMLParser libavc1394 libiec61883 intltool libXv gettext libX11 glib cairo ffmpeg libv4l ]; # TODOoptional packages
6868
6969 configureFlags = "--enable-local-ffmpeg=no";
7070 #preConfigure = "
@@ -72,6 +72,9 @@ stdenv.mkDerivation {
7272 # ex
7373 #";
7474
75+ patches = [ ./kino-1.3.4-v4l1.patch ./kino-1.3.4-libav-0.7.patch ./kino-1.3.4-libav-0.8.patch ]; #./kino-1.3.4-libavcodec-pkg-config.patch ];
76+
77+
7578 postInstall = "
7679 rpath=`patchelf --print-rpath \$out/bin/kino`;
7780 for i in $\buildInputs; do
pkgs/applications/video/kino/kino-1.3.4-libav-0.7.patchnew file+60
@@ -0,0 +1,60 @@
1+--- kino-1.3.4.orig/src/frame.cc 2011-07-17 14:54:59.089481638 +0200
2++++ kino-1.3.4/src/frame.cc 2011-07-17 15:09:23.199481714 +0200
3+@@ -1063,7 +1063,12 @@
4+ AVPicture dest;
5+ int got_picture;
6+
7+- avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
8++ AVPacket pkt;
9++ av_init_packet(&pkt);
10++ pkt.data = data;
11++ pkt.size = GetFrameSize();
12++
13++ avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
14+ if ( got_picture )
15+ {
16+ avpicture_fill( &dest, static_cast<uint8_t*>( rgb ), PIX_FMT_RGB24, GetWidth(), GetHeight() );
17+@@ -1123,7 +1128,12 @@
18+ AVPicture output;
19+ int got_picture;
20+
21+- avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
22++ AVPacket pkt;
23++ av_init_packet(&pkt);
24++ pkt.data = data;
25++ pkt.size = GetFrameSize();
26++
27++ avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
28+ if ( got_picture )
29+ {
30+ avpicture_fill( &output, static_cast<uint8_t*>( yuv ), PIX_FMT_YUV422, GetWidth(), GetHeight() );
31+@@ -1156,7 +1166,12 @@
32+ AVFrame *frame = avcodec_alloc_frame();
33+ int got_picture;
34+
35+- avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
36++ AVPacket pkt;
37++ av_init_packet(&pkt);
38++ pkt.data = data;
39++ pkt.size = GetFrameSize();
40++
41++ avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
42+
43+ int width = GetWidth(), height = GetHeight();
44+
45+@@ -1319,12 +1334,12 @@
46+ #if defined(HAVE_LIBAVCODEC)
47+ if ( avformatEncoder == NULL )
48+ {
49+- avformatEncoder = av_alloc_format_context();
50++ avformatEncoder = avformat_alloc_context();
51+ if ( avformatEncoder )
52+ {
53+- avformatEncoder->oformat = guess_format( "dv", NULL, NULL );
54++ avformatEncoder->oformat = av_guess_format( "dv", NULL, NULL );
55+ AVStream* vst = av_new_stream( avformatEncoder, 0 );
56+- vst->codec->codec_type = CODEC_TYPE_VIDEO;
57++ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
58+ vst->codec->codec_id = CODEC_ID_DVVIDEO;
59+ vst->codec->bit_rate = 25000000;
60+ vst->start_time = 0;
pkgs/applications/video/kino/kino-1.3.4-libav-0.8.patchnew file+57
@@ -0,0 +1,57 @@
1+--- kino-1.3.4.orig/src/frame.cc 2012-05-14 19:55:42.153772418 -0700
2++++ kino-1.3.4/src/frame.cc 2012-05-14 20:28:34.448838653 -0700
3+@@ -101,8 +101,9 @@
4+ #if defined(HAVE_LIBAVCODEC)
5+ pthread_mutex_lock( &avcodec_mutex );
6+ av_register_all();
7+- libavcodec = avcodec_alloc_context();
8+- avcodec_open( libavcodec, avcodec_find_decoder( CODEC_ID_DVVIDEO ) );
9++ libavcodec = avcodec_alloc_context3(NULL);
10++ avcodec_open2( libavcodec,
11++ avcodec_find_decoder( CODEC_ID_DVVIDEO ), NULL );
12+ pthread_mutex_unlock( &avcodec_mutex );
13+ data = ( unsigned char* ) av_mallocz( 144000 );
14+ #if defined(HAVE_SWSCALE)
15+@@ -1338,7 +1339,7 @@
16+ if ( avformatEncoder )
17+ {
18+ avformatEncoder->oformat = av_guess_format( "dv", NULL, NULL );
19+- AVStream* vst = av_new_stream( avformatEncoder, 0 );
20++ AVStream* vst = avformat_new_stream( avformatEncoder, NULL );
21+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
22+ vst->codec->codec_id = CODEC_ID_DVVIDEO;
23+ vst->codec->bit_rate = 25000000;
24+@@ -1364,12 +1365,10 @@
25+ vst->sample_aspect_ratio = avcodecEncoder->sample_aspect_ratio;
26+ #endif
27+ avcodecEncoder->thread_count = 2;
28+- avcodec_thread_init( avcodecEncoder, avcodecEncoder->thread_count );
29+ avcodecEncoder->time_base= isPAL ? ( AVRational ){ 1, 25 } : ( AVRational ){ 1001, 30000 };
30+ avcodecEncoder->pix_fmt = isPAL ? PIX_FMT_YUV420P : PIX_FMT_YUV411P;
31+ avcodecEncoder->flags |= CODEC_FLAG_INTERLACED_DCT;
32+- av_set_parameters( avformatEncoder, NULL );
33+- avcodec_open( avcodecEncoder, avcodec_find_encoder( CODEC_ID_DVVIDEO ) );
34++ avcodec_open2( avcodecEncoder, avcodec_find_encoder( CODEC_ID_DVVIDEO ), NULL );
35+ av_new_packet( &avpacketEncoder, 144000 );
36+ tempImage = ( uint8_t* ) av_malloc(
37+ avpicture_get_size( avcodecEncoder->pix_fmt, avcodecEncoder->width, avcodecEncoder->height ) );
38+@@ -1475,16 +1474,16 @@
39+
40+ // Encode
41+ bytesInFrame = avcodec_encode_video( avcodecEncoder, avpacketEncoder.data, size, output );
42+- url_open_buf( &avformatEncoder->pb, data, bytesInFrame, URL_WRONLY );
43++ avformatEncoder->pb = avio_alloc_context(data, bytesInFrame, 0, NULL, NULL, NULL, NULL);
44+ avpacketEncoder.size = bytesInFrame;
45+ if ( !isEncoderHeaderWritten )
46+ {
47+- av_write_header( avformatEncoder );
48++ avformat_write_header( avformatEncoder, NULL );
49+ isEncoderHeaderWritten = true;
50+ }
51+ av_write_frame( avformatEncoder, &avpacketEncoder );
52+ #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
53+- url_close_buf( avformatEncoder->pb );
54++ avio_close( avformatEncoder->pb );
55+ #else
56+ url_close_buf( &avformatEncoder->pb );
57+ #endif
pkgs/applications/video/kino/kino-1.3.4-libavcodec-pkg-config.patchnew file+11
@@ -0,0 +1,11 @@
1+--- a/kino-1.3.4/configure.in 2009-09-08 02:35:23.000000000 -0400
2++++ b/kino-1.3.4/configure.in 2014-01-27 14:53:01.366063037 -0500
3+@@ -221,7 +221,7 @@
4+ if (test "x$avcodec_include" != x) || (test "x$avcodec_lib" != x) ; then
5+ local_legacy_ffmpeg_test
6+ else
7+- PKG_CHECK_MODULES(AVCODEC, libavformat,
8++ PKG_CHECK_MODULES(AVCODEC, [libavcodec libavformat libavutil],
9+ [
10+ AC_DEFINE(HAVE_LIBAVCODEC, 1, [Enable FFMPEG libavcodec])
11+ AC_SUBST(AVCODEC_LIBS)
pkgs/applications/video/kino/kino-1.3.4-v4l1.patchnew file+21
@@ -0,0 +1,21 @@
1+no-1.3.3.orig/ffmpeg/libavdevice/v4l.c 2011-05-17 02:20:37.161004916 +0400
2++++ kino-1.3.3.orig/ffmpeg/libavdevice/v4l.c 2011-05-17 02:21:57.302377529 +0400
3+@@ -26,7 +26,7 @@
4+ #include <sys/mman.h>
5+ #include <sys/time.h>
6+ #define _LINUX_TIME_H 1
7+-#include <linux/videodev.h>
8++#include <libv4l1-videodev.h>
9+ #include <time.h>
10+
11+ typedef struct {
12+--- kino-1.3.3.orig/src/v4l.h 2011-05-17 02:20:38.896969666 +0400
13++++ kino-1.3.3.orig/src/v4l.h 2011-05-17 02:21:39.922730395 +0400
14+@@ -40,7 +40,7 @@
15+
16+ #define _DEVICE_H_
17+ #define _LINUX_TIME_H
18+-#include <linux/videodev.h>
19++#include <libv4l1-videodev.h>
20+
21+ #include "displayer.h"