aboutsummaryrefslogtreecommitdiff
blob: df06e64627acdb9552add09dd518a8a9a8d26f03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- opencv-1.0.0/otherlibs/highgui/cvcap_ffmpeg.cpp.org Tue May  8 11:31:09 2007
+++ opencv-1.0.0/otherlibs/highgui/cvcap_ffmpeg.cpp Tue May  8 12:31:54 2007

43a44
> #define __STDC_CONSTANT_MACROS
46a48,51
> #include <ffmpeg/avcodec.h>
> #include <ffmpeg/swscale.h>
> #include <sys/types.h> /* size_t */
> #include <sys/errno.h>
54a60,61
> static struct SwsContext *img_convert_ctx;
> 
217,229c224,238
< #if LIBAVFORMAT_BUILD > 4628
<     img_convert( (AVPicture*)&capture->rgb_picture, PIX_FMT_BGR24,
<                  (AVPicture*)capture->picture,
<                  capture->video_st->codec->pix_fmt,
<                  capture->video_st->codec->width,
<                  capture->video_st->codec->height );
< #else
<     img_convert( (AVPicture*)&capture->rgb_picture, PIX_FMT_BGR24,
<                  (AVPicture*)capture->picture,
<                  capture->video_st->codec.pix_fmt,
<                  capture->video_st->codec.width,
<                  capture->video_st->codec.height );
< #endif
---
> 
>     img_convert_ctx = sws_getContext(capture->video_st->codec->width,
> 				     capture->video_st->codec->height,
> 				     capture->video_st->codec->pix_fmt,
> 				     capture->video_st->codec->width,
> 				     capture->video_st->codec->height,
> 				     PIX_FMT_BGR24,
> 				     SWS_BICUBIC,
> 				     NULL, NULL, NULL);
>     
>     sws_scale(img_convert_ctx, capture->picture->data, 
> 	      capture->picture->linesize, 0,
> 	      capture->video_st->codec->height, 
> 	      capture->rgb_picture.data, capture->rgb_picture.linesize);
>     
716,718c725,738
< 		if( img_convert((AVPicture *)mywriter->picture, c->pix_fmt,
< 					(AVPicture *)mywriter->rgb_picture, PIX_FMT_BGR24, 
< 					image->width, image->height) < 0){
---
> 		img_convert_ctx = sws_getContext(image->width,
> 						 image->height,
> 						 PIX_FMT_BGR24,
> 						 c->width,
> 						 c->height,
> 						 c->pix_fmt,
> 						 SWS_BICUBIC,
> 						 NULL, NULL, NULL);
> 		
> 		if ( sws_scale(img_convert_ctx, mywriter->rgb_picture->data, 
> 			       mywriter->rgb_picture->linesize, 0,
> 			       image->height, 
> 			       mywriter->picture->data, mywriter->picture->linesize) < 0 )
> 		{