Ticket #51578: ffmpeg3_compat.patch
File ffmpeg3_compat.patch, 2.2 KB (added by jjstickel (Jonathan Stickel), 8 years ago) |
---|
-
VTK/IO/FFMPEG/vtkFFMPEGWriter.cxx
int vtkFFMPEGWriterInternal::Start() 191 191 c->height = this->Dim[1]; 192 192 if (this->Writer->GetCompression()) 193 193 { 194 c->pix_fmt = PIX_FMT_YUVJ422P;194 c->pix_fmt = AV_PIX_FMT_YUVJ422P; 195 195 } 196 196 else 197 197 { 198 c->pix_fmt = PIX_FMT_BGR24;198 c->pix_fmt = AV_PIX_FMT_BGR24; 199 199 } 200 200 201 201 //to do playback at actual recorded rate, this will need more work see also below … … int vtkFFMPEGWriterInternal::Start() 274 274 #endif 275 275 276 276 //for the output of the writer's input... 277 this->rgbInput = av codec_alloc_frame();277 this->rgbInput = av_frame_alloc(); 278 278 if (!this->rgbInput) 279 279 { 280 280 vtkGenericWarningMacro (<< "Could not make rgbInput avframe." ); 281 281 return 0; 282 282 } 283 int RGBsize = avpicture_get_size( PIX_FMT_RGB24, c->width, c->height);283 int RGBsize = avpicture_get_size(AV_PIX_FMT_RGB24, c->width, c->height); 284 284 unsigned char *rgb = (unsigned char *)av_malloc(sizeof(unsigned char) * RGBsize); 285 285 if (!rgb) 286 286 { … … int vtkFFMPEGWriterInternal::Start() 288 288 return 0; 289 289 } 290 290 //The rgb buffer should get deleted when this->rgbInput is. 291 avpicture_fill((AVPicture *)this->rgbInput, rgb, PIX_FMT_RGB24, c->width, c->height);291 avpicture_fill((AVPicture *)this->rgbInput, rgb, AV_PIX_FMT_RGB24, c->width, c->height); 292 292 293 293 //and for the output to the codec's input. 294 this->yuvOutput = av codec_alloc_frame();294 this->yuvOutput = av_frame_alloc(); 295 295 if (!this->yuvOutput) 296 296 { 297 297 vtkGenericWarningMacro (<< "Could not make yuvOutput avframe." ); … … int vtkFFMPEGWriterInternal::Write(vtkImageData *id) 349 349 //convert that to YUV for input to the codec 350 350 #ifdef VTK_FFMPEG_HAS_IMG_CONVERT 351 351 img_convert((AVPicture *)this->yuvOutput, cc->pix_fmt, 352 (AVPicture *)this->rgbInput, PIX_FMT_RGB24,352 (AVPicture *)this->rgbInput, AV_PIX_FMT_RGB24, 353 353 cc->width, cc->height); 354 354 #else 355 355 //convert that to YUV for input to the codec 356 356 SwsContext* convert_ctx = sws_getContext( 357 cc->width, cc->height, PIX_FMT_RGB24,357 cc->width, cc->height, AV_PIX_FMT_RGB24, 358 358 cc->width, cc->height, cc->pix_fmt, 359 359 SWS_BICUBIC, NULL, NULL, NULL); 360 360