]> git.pld-linux.org Git - packages/vtk.git/blame - vtk-ffmpeg.patch
- force build with system hdf5
[packages/vtk.git] / vtk-ffmpeg.patch
CommitLineData
e33b075c
JB
1--- VTK5.10.1/CMake/vtkTestFFMPEG.cmake.orig 2012-10-15 22:33:21.000000000 +0200
2+++ VTK5.10.1/CMake/vtkTestFFMPEG.cmake 2012-12-16 15:58:22.460839307 +0100
3@@ -1,10 +1,10 @@
4 IF (FFMPEG_INCLUDE_DIR)
5 IF("VTK_FFMPEG_HAS_OLD_HEADER" MATCHES "^VTK_FFMPEG_HAS_OLD_HEADER$" OR NOT "VTK_FFMPEG_CACHED_INCLUDE" MATCHES "^${FFMPEG_INCLUDE_DIR}$")
6- IF (EXISTS ${FFMPEG_INCLUDE_DIR}/ffmpeg)
7- SET(VTK_FFMPEG_HAS_OLD_HEADER "TRUE" CACHE INTERNAL "Is the FFMPEG include in the old location" FORCE)
8- ELSE (EXISTS ${FFMPEG_INCLUDE_DIR}/ffmpeg)
9- SET(VTK_FFMPEG_HAS_OLD_HEADER "FALSE" CACHE INTERNAL "Is the FFMPEG include in the old location" FORCE)
10- ENDIF (EXISTS ${FFMPEG_INCLUDE_DIR}/ffmpeg)
11+ IF (EXISTS ${FFMPEG_INCLUDE_DIR}/libavformat)
12+ SET(VTK_FFMPEG_HAS_OLD_HEADER "FALSE" CACHE INTERNAL "Is the FFMPEG include in the old location" FORCE)
13+ ELSE (EXISTS ${FFMPEG_INCLUDE_DIR}/libavformat)
14+ SET(VTK_FFMPEG_HAS_OLD_HEADER "TRUE" CACHE INTERNAL "Is the FFMPEG include in the old location" FORCE)
15+ ENDIF (EXISTS ${FFMPEG_INCLUDE_DIR}/libavformat)
16 IF (VTK_FFMPEG_HAS_OLD_HEADER)
17 MESSAGE(STATUS "Checking if FFMPEG uses old style header files - yes")
18 ELSE (VTK_FFMPEG_HAS_OLD_HEADER)
19--- VTK5.10.1/IO/vtkFFMPEGWriter.cxx.orig 2012-10-15 22:33:21.000000000 +0200
20+++ VTK5.10.1/IO/vtkFFMPEGWriter.cxx 2012-12-16 18:46:55.227295191 +0100
21@@ -123,7 +123,7 @@
22 }
23
24 //choose avi media file format
25- this->avOutputFormat = guess_format("avi", NULL, NULL);
26+ this->avOutputFormat = av_guess_format("avi", NULL, NULL);
27 if (!this->avOutputFormat)
28 {
29 vtkGenericWarningMacro (<< "Could not open the avi media file format.");
30@@ -150,7 +150,7 @@
31 //Set up the codec.
32 AVCodecContext *c = this->avStream->codec;
33 c->codec_id = (CodecID)this->avOutputFormat->video_codec;
34- c->codec_type = CODEC_TYPE_VIDEO;
35+ c->codec_type = AVMEDIA_TYPE_VIDEO;
36 c->width = this->Dim[0];
37 c->height = this->Dim[1];
38 c->pix_fmt = PIX_FMT_YUVJ420P;
39@@ -192,13 +192,6 @@
40 c->bit_rate_tolerance = this->Writer->GetBitRateTolerance();
41 }
42
43- //apply the chosen parameters
44- if (av_set_parameters(this->avFormatContext, NULL) < 0)
45- {
46- vtkGenericWarningMacro (<< "Invalid output format parameters." );
47- return 0;
48- }
49-
50 //manufacture a codec with the chosen parameters
51 AVCodec *codec = avcodec_find_encoder(c->codec_id);
52 if (!codec)
53@@ -259,14 +252,14 @@
54
55
56 //Finally, open the file and start it off.
57- if (url_fopen(&this->avFormatContext->pb, this->avFormatContext->filename, URL_WRONLY) < 0)
58+ if (avio_open(&this->avFormatContext->pb, this->avFormatContext->filename, AVIO_FLAG_WRITE) < 0)
59 {
60 vtkGenericWarningMacro (<< "Could not open " << this->Writer->GetFileName() << "." );
61 return 0;
62 }
63 this->openedFile = 1;
64
65- av_write_header(this->avFormatContext);
66+ avformat_write_header(this->avFormatContext, NULL);
67 return 1;
68 }
69
70@@ -343,7 +336,7 @@
71 pkt.stream_index = this->avStream->index;
72 if (cc->coded_frame->key_frame) //treat keyframes well
73 {
74- pkt.flags |= PKT_FLAG_KEY;
75+ pkt.flags |= AV_PKT_FLAG_KEY;
76 }
77 pkt.duration = 0; //presentation duration in time_base units or 0 if NA
78 pkt.pos = -1; //byte position in stream or -1 if NA
79@@ -391,7 +384,7 @@
80 #ifdef VTK_FFMPEG_OLD_URL_FCLOSE
81 url_fclose(&this->avFormatContext->pb);
82 #else
83- url_fclose(this->avFormatContext->pb);
84+ avio_close(this->avFormatContext->pb);
85 #endif
86 this->openedFile = 0;
87 }
This page took 0.068201 seconds and 4 git commands to generate.