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
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
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)
29 vtkGenericWarningMacro (<< "Could not open the avi media file format.");
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;
40 c->bit_rate_tolerance = this->Writer->GetBitRateTolerance();
43 - //apply the chosen parameters
44 - if (av_set_parameters(this->avFormatContext, NULL) < 0)
46 - vtkGenericWarningMacro (<< "Invalid output format parameters." );
50 //manufacture a codec with the chosen parameters
51 AVCodec *codec = avcodec_find_encoder(c->codec_id);
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)
60 vtkGenericWarningMacro (<< "Could not open " << this->Writer->GetFileName() << "." );
65 - av_write_header(this->avFormatContext);
66 + avformat_write_header(this->avFormatContext, NULL);
71 pkt.stream_index = this->avStream->index;
72 if (cc->coded_frame->key_frame) //treat keyframes well
74 - pkt.flags |= PKT_FLAG_KEY;
75 + pkt.flags |= AV_PKT_FLAG_KEY;
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
80 #ifdef VTK_FFMPEG_OLD_URL_FCLOSE
81 url_fclose(&this->avFormatContext->pb);
83 - url_fclose(this->avFormatContext->pb);
84 + avio_close(this->avFormatContext->pb);