summaryrefslogtreecommitdiff
blob: 65c5bc38276ddca172973562c9678d690c99e82a (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
--- kino-1.3.4.orig/src/frame.cc	2011-07-17 14:54:59.089481638 +0200
+++ kino-1.3.4/src/frame.cc	2011-07-17 15:09:23.199481714 +0200
@@ -1063,7 +1063,12 @@
 	AVPicture dest;
 	int got_picture;
 
-	avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
+	AVPacket pkt;
+	av_init_packet(&pkt);
+	pkt.data = data;
+	pkt.size = GetFrameSize();
+
+	avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
 	if ( got_picture )
 	{
 		avpicture_fill( &dest, static_cast<uint8_t*>( rgb ), PIX_FMT_RGB24, GetWidth(), GetHeight() );
@@ -1123,7 +1128,12 @@
 	AVPicture output;
 	int got_picture;
 
-	avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
+	AVPacket pkt;
+	av_init_packet(&pkt);
+	pkt.data = data;
+	pkt.size = GetFrameSize();
+
+	avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
 	if ( got_picture )
 	{
 		avpicture_fill( &output, static_cast<uint8_t*>( yuv ), PIX_FMT_YUV422, GetWidth(), GetHeight() );
@@ -1156,7 +1166,12 @@
 	AVFrame *frame = avcodec_alloc_frame();
 	int got_picture;
 
-	avcodec_decode_video( libavcodec, frame, &got_picture, data, GetFrameSize() );
+        AVPacket pkt;
+        av_init_packet(&pkt);
+        pkt.data = data;
+        pkt.size = GetFrameSize();
+
+        avcodec_decode_video2( libavcodec, frame, &got_picture, &pkt );
 
 	int width = GetWidth(), height = GetHeight();
 
@@ -1319,12 +1334,12 @@
 #if defined(HAVE_LIBAVCODEC)
 	if ( avformatEncoder == NULL )
 	{
-		avformatEncoder = av_alloc_format_context();
+		avformatEncoder = avformat_alloc_context();
 		if ( avformatEncoder )
 		{
-			avformatEncoder->oformat = guess_format( "dv", NULL, NULL );
+			avformatEncoder->oformat = av_guess_format( "dv", NULL, NULL );
 			AVStream* vst = av_new_stream( avformatEncoder, 0 );
-			vst->codec->codec_type = CODEC_TYPE_VIDEO;
+			vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
 			vst->codec->codec_id = CODEC_ID_DVVIDEO;
 			vst->codec->bit_rate = 25000000;
			vst->start_time = 0;