View | Details | Raw Unified | Return to bug 214896 | Differences between
and this patch

Collapse All | Expand All

(-)mplayer2/files/patch-fmt-conversion.c (+204 lines)
Line 0 Link Here
1
--- fmt-conversion.c.orig	2013-07-09 16:33:12 UTC
2
+++ fmt-conversion.c
3
@@ -24,117 +24,117 @@
4
 
5
 static const struct {
6
     int fmt;
7
-    enum PixelFormat pix_fmt;
8
+    enum AVPixelFormat pix_fmt;
9
 } conversion_map[] = {
10
-    {IMGFMT_ARGB, PIX_FMT_ARGB},
11
-    {IMGFMT_BGRA, PIX_FMT_BGRA},
12
-    {IMGFMT_BGR24, PIX_FMT_BGR24},
13
-    {IMGFMT_BGR16BE, PIX_FMT_RGB565BE},
14
-    {IMGFMT_BGR16LE, PIX_FMT_RGB565LE},
15
-    {IMGFMT_BGR15BE, PIX_FMT_RGB555BE},
16
-    {IMGFMT_BGR15LE, PIX_FMT_RGB555LE},
17
-    {IMGFMT_BGR12BE, PIX_FMT_RGB444BE},
18
-    {IMGFMT_BGR12LE, PIX_FMT_RGB444LE},
19
-    {IMGFMT_BGR8,  PIX_FMT_RGB8},
20
-    {IMGFMT_BGR4,  PIX_FMT_RGB4},
21
-    {IMGFMT_BGR1,  PIX_FMT_MONOBLACK},
22
-    {IMGFMT_RGB1,  PIX_FMT_MONOBLACK},
23
-    {IMGFMT_RG4B,  PIX_FMT_BGR4_BYTE},
24
-    {IMGFMT_BG4B,  PIX_FMT_RGB4_BYTE},
25
-    {IMGFMT_RGB48LE, PIX_FMT_RGB48LE},
26
-    {IMGFMT_RGB48BE, PIX_FMT_RGB48BE},
27
-    {IMGFMT_ABGR, PIX_FMT_ABGR},
28
-    {IMGFMT_RGBA, PIX_FMT_RGBA},
29
-    {IMGFMT_RGB24, PIX_FMT_RGB24},
30
-    {IMGFMT_RGB16BE, PIX_FMT_BGR565BE},
31
-    {IMGFMT_RGB16LE, PIX_FMT_BGR565LE},
32
-    {IMGFMT_RGB15BE, PIX_FMT_BGR555BE},
33
-    {IMGFMT_RGB15LE, PIX_FMT_BGR555LE},
34
-    {IMGFMT_RGB12BE, PIX_FMT_BGR444BE},
35
-    {IMGFMT_RGB12LE, PIX_FMT_BGR444LE},
36
-    {IMGFMT_RGB8,  PIX_FMT_BGR8},
37
-    {IMGFMT_RGB4,  PIX_FMT_BGR4},
38
-    {IMGFMT_BGR8,  PIX_FMT_PAL8},
39
-    {IMGFMT_GBRP,  PIX_FMT_GBRP},
40
-    {IMGFMT_GBRP9, PIX_FMT_GBRP9},
41
-    {IMGFMT_GBRP10, PIX_FMT_GBRP10},
42
-    {IMGFMT_YUY2,  PIX_FMT_YUYV422},
43
-    {IMGFMT_UYVY,  PIX_FMT_UYVY422},
44
-    {IMGFMT_NV12,  PIX_FMT_NV12},
45
-    {IMGFMT_NV21,  PIX_FMT_NV21},
46
-    {IMGFMT_Y800,  PIX_FMT_GRAY8},
47
-    {IMGFMT_Y8,    PIX_FMT_GRAY8},
48
-    {IMGFMT_YVU9,  PIX_FMT_YUV410P},
49
-    {IMGFMT_IF09,  PIX_FMT_YUV410P},
50
-    {IMGFMT_YV12,  PIX_FMT_YUV420P},
51
-    {IMGFMT_I420,  PIX_FMT_YUV420P},
52
-    {IMGFMT_IYUV,  PIX_FMT_YUV420P},
53
-    {IMGFMT_411P,  PIX_FMT_YUV411P},
54
-    {IMGFMT_422P,  PIX_FMT_YUV422P},
55
-    {IMGFMT_444P,  PIX_FMT_YUV444P},
56
-    {IMGFMT_440P,  PIX_FMT_YUV440P},
57
+    {IMGFMT_ARGB, AV_PIX_FMT_ARGB},
58
+    {IMGFMT_BGRA, AV_PIX_FMT_BGRA},
59
+    {IMGFMT_BGR24, AV_PIX_FMT_BGR24},
60
+    {IMGFMT_BGR16BE, AV_PIX_FMT_RGB565BE},
61
+    {IMGFMT_BGR16LE, AV_PIX_FMT_RGB565LE},
62
+    {IMGFMT_BGR15BE, AV_PIX_FMT_RGB555BE},
63
+    {IMGFMT_BGR15LE, AV_PIX_FMT_RGB555LE},
64
+    {IMGFMT_BGR12BE, AV_PIX_FMT_RGB444BE},
65
+    {IMGFMT_BGR12LE, AV_PIX_FMT_RGB444LE},
66
+    {IMGFMT_BGR8,  AV_PIX_FMT_RGB8},
67
+    {IMGFMT_BGR4,  AV_PIX_FMT_RGB4},
68
+    {IMGFMT_BGR1,  AV_PIX_FMT_MONOBLACK},
69
+    {IMGFMT_RGB1,  AV_PIX_FMT_MONOBLACK},
70
+    {IMGFMT_RG4B,  AV_PIX_FMT_BGR4_BYTE},
71
+    {IMGFMT_BG4B,  AV_PIX_FMT_RGB4_BYTE},
72
+    {IMGFMT_RGB48LE, AV_PIX_FMT_RGB48LE},
73
+    {IMGFMT_RGB48BE, AV_PIX_FMT_RGB48BE},
74
+    {IMGFMT_ABGR, AV_PIX_FMT_ABGR},
75
+    {IMGFMT_RGBA, AV_PIX_FMT_RGBA},
76
+    {IMGFMT_RGB24, AV_PIX_FMT_RGB24},
77
+    {IMGFMT_RGB16BE, AV_PIX_FMT_BGR565BE},
78
+    {IMGFMT_RGB16LE, AV_PIX_FMT_BGR565LE},
79
+    {IMGFMT_RGB15BE, AV_PIX_FMT_BGR555BE},
80
+    {IMGFMT_RGB15LE, AV_PIX_FMT_BGR555LE},
81
+    {IMGFMT_RGB12BE, AV_PIX_FMT_BGR444BE},
82
+    {IMGFMT_RGB12LE, AV_PIX_FMT_BGR444LE},
83
+    {IMGFMT_RGB8,  AV_PIX_FMT_BGR8},
84
+    {IMGFMT_RGB4,  AV_PIX_FMT_BGR4},
85
+    {IMGFMT_BGR8,  AV_PIX_FMT_PAL8},
86
+    {IMGFMT_GBRP,  AV_PIX_FMT_GBRP},
87
+    {IMGFMT_GBRP9, AV_PIX_FMT_GBRP9},
88
+    {IMGFMT_GBRP10, AV_PIX_FMT_GBRP10},
89
+    {IMGFMT_YUY2,  AV_PIX_FMT_YUYV422},
90
+    {IMGFMT_UYVY,  AV_PIX_FMT_UYVY422},
91
+    {IMGFMT_NV12,  AV_PIX_FMT_NV12},
92
+    {IMGFMT_NV21,  AV_PIX_FMT_NV21},
93
+    {IMGFMT_Y800,  AV_PIX_FMT_GRAY8},
94
+    {IMGFMT_Y8,    AV_PIX_FMT_GRAY8},
95
+    {IMGFMT_YVU9,  AV_PIX_FMT_YUV410P},
96
+    {IMGFMT_IF09,  AV_PIX_FMT_YUV410P},
97
+    {IMGFMT_YV12,  AV_PIX_FMT_YUV420P},
98
+    {IMGFMT_I420,  AV_PIX_FMT_YUV420P},
99
+    {IMGFMT_IYUV,  AV_PIX_FMT_YUV420P},
100
+    {IMGFMT_411P,  AV_PIX_FMT_YUV411P},
101
+    {IMGFMT_422P,  AV_PIX_FMT_YUV422P},
102
+    {IMGFMT_444P,  AV_PIX_FMT_YUV444P},
103
+    {IMGFMT_440P,  AV_PIX_FMT_YUV440P},
104
 
105
-    {IMGFMT_420A,  PIX_FMT_YUVA420P},
106
+    {IMGFMT_420A,  AV_PIX_FMT_YUVA420P},
107
 
108
-    {IMGFMT_420P16_LE,  PIX_FMT_YUV420P16LE},
109
-    {IMGFMT_420P16_BE,  PIX_FMT_YUV420P16BE},
110
-    {IMGFMT_420P9_LE,   PIX_FMT_YUV420P9LE},
111
-    {IMGFMT_420P9_BE,   PIX_FMT_YUV420P9BE},
112
-    {IMGFMT_420P10_LE,  PIX_FMT_YUV420P10LE},
113
-    {IMGFMT_420P10_BE,  PIX_FMT_YUV420P10BE},
114
-    {IMGFMT_422P10_LE,  PIX_FMT_YUV422P10LE},
115
-    {IMGFMT_422P10_BE,  PIX_FMT_YUV422P10BE},
116
-    {IMGFMT_444P9_BE ,  PIX_FMT_YUV444P9BE},
117
-    {IMGFMT_444P9_LE ,  PIX_FMT_YUV444P9LE},
118
-    {IMGFMT_444P10_BE,  PIX_FMT_YUV444P10BE},
119
-    {IMGFMT_444P10_LE,  PIX_FMT_YUV444P10LE},
120
-    {IMGFMT_422P16_LE,  PIX_FMT_YUV422P16LE},
121
-    {IMGFMT_422P16_BE,  PIX_FMT_YUV422P16BE},
122
-    {IMGFMT_422P9_LE,   PIX_FMT_YUV422P9LE},
123
-    {IMGFMT_422P9_BE,   PIX_FMT_YUV422P9BE},
124
-    {IMGFMT_444P16_LE,  PIX_FMT_YUV444P16LE},
125
-    {IMGFMT_444P16_BE,  PIX_FMT_YUV444P16BE},
126
+    {IMGFMT_420P16_LE,  AV_PIX_FMT_YUV420P16LE},
127
+    {IMGFMT_420P16_BE,  AV_PIX_FMT_YUV420P16BE},
128
+    {IMGFMT_420P9_LE,   AV_PIX_FMT_YUV420P9LE},
129
+    {IMGFMT_420P9_BE,   AV_PIX_FMT_YUV420P9BE},
130
+    {IMGFMT_420P10_LE,  AV_PIX_FMT_YUV420P10LE},
131
+    {IMGFMT_420P10_BE,  AV_PIX_FMT_YUV420P10BE},
132
+    {IMGFMT_422P10_LE,  AV_PIX_FMT_YUV422P10LE},
133
+    {IMGFMT_422P10_BE,  AV_PIX_FMT_YUV422P10BE},
134
+    {IMGFMT_444P9_BE ,  AV_PIX_FMT_YUV444P9BE},
135
+    {IMGFMT_444P9_LE ,  AV_PIX_FMT_YUV444P9LE},
136
+    {IMGFMT_444P10_BE,  AV_PIX_FMT_YUV444P10BE},
137
+    {IMGFMT_444P10_LE,  AV_PIX_FMT_YUV444P10LE},
138
+    {IMGFMT_422P16_LE,  AV_PIX_FMT_YUV422P16LE},
139
+    {IMGFMT_422P16_BE,  AV_PIX_FMT_YUV422P16BE},
140
+    {IMGFMT_422P9_LE,   AV_PIX_FMT_YUV422P9LE},
141
+    {IMGFMT_422P9_BE,   AV_PIX_FMT_YUV422P9BE},
142
+    {IMGFMT_444P16_LE,  AV_PIX_FMT_YUV444P16LE},
143
+    {IMGFMT_444P16_BE,  AV_PIX_FMT_YUV444P16BE},
144
 
145
     // YUVJ are YUV formats that use the full Y range and not just
146
     // 16 - 235 (see colorspaces.txt).
147
     // Currently they are all treated the same way.
148
-    {IMGFMT_YV12,  PIX_FMT_YUVJ420P},
149
-    {IMGFMT_422P,  PIX_FMT_YUVJ422P},
150
-    {IMGFMT_444P,  PIX_FMT_YUVJ444P},
151
-    {IMGFMT_440P,  PIX_FMT_YUVJ440P},
152
+    {IMGFMT_YV12,  AV_PIX_FMT_YUVJ420P},
153
+    {IMGFMT_422P,  AV_PIX_FMT_YUVJ422P},
154
+    {IMGFMT_444P,  AV_PIX_FMT_YUVJ444P},
155
+    {IMGFMT_440P,  AV_PIX_FMT_YUVJ440P},
156
 
157
-    {IMGFMT_VDPAU_MPEG1,     PIX_FMT_VDPAU_MPEG1},
158
-    {IMGFMT_VDPAU_MPEG2,     PIX_FMT_VDPAU_MPEG2},
159
-    {IMGFMT_VDPAU_H264,      PIX_FMT_VDPAU_H264},
160
-    {IMGFMT_VDPAU_WMV3,      PIX_FMT_VDPAU_WMV3},
161
-    {IMGFMT_VDPAU_VC1,       PIX_FMT_VDPAU_VC1},
162
-    {IMGFMT_VDPAU_MPEG4,     PIX_FMT_VDPAU_MPEG4},
163
-    {0, PIX_FMT_NONE}
164
+    {IMGFMT_VDPAU_MPEG1,     AV_PIX_FMT_VDPAU_MPEG1},
165
+    {IMGFMT_VDPAU_MPEG2,     AV_PIX_FMT_VDPAU_MPEG2},
166
+    {IMGFMT_VDPAU_H264,      AV_PIX_FMT_VDPAU_H264},
167
+    {IMGFMT_VDPAU_WMV3,      AV_PIX_FMT_VDPAU_WMV3},
168
+    {IMGFMT_VDPAU_VC1,       AV_PIX_FMT_VDPAU_VC1},
169
+    {IMGFMT_VDPAU_MPEG4,     AV_PIX_FMT_VDPAU_MPEG4},
170
+    {0,                      AV_PIX_FMT_NONE}
171
 };
172
 
173
-enum PixelFormat imgfmt2pixfmt(int fmt)
174
+enum AVPixelFormat imgfmt2pixfmt(int fmt)
175
 {
176
     int i;
177
-    enum PixelFormat pix_fmt;
178
+    enum AVPixelFormat pix_fmt;
179
     for (i = 0; conversion_map[i].fmt; i++)
180
         if (conversion_map[i].fmt == fmt)
181
             break;
182
     pix_fmt = conversion_map[i].pix_fmt;
183
-    if (pix_fmt == PIX_FMT_NONE)
184
+    if (pix_fmt == AV_PIX_FMT_NONE)
185
         mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported format %s\n", vo_format_name(fmt));
186
     return pix_fmt;
187
 }
188
 
189
-int pixfmt2imgfmt(enum PixelFormat pix_fmt)
190
+int pixfmt2imgfmt(enum AVPixelFormat pix_fmt)
191
 {
192
     int i;
193
-    for (i = 0; conversion_map[i].pix_fmt != PIX_FMT_NONE; i++)
194
+    for (i = 0; conversion_map[i].pix_fmt != AV_PIX_FMT_NONE; i++)
195
         if (conversion_map[i].pix_fmt == pix_fmt)
196
             break;
197
     int fmt = conversion_map[i].fmt;
198
     if (!fmt) {
199
         const char *fmtname = av_get_pix_fmt_name(pix_fmt);
200
-        mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %s (%d)\n",
201
+        mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported AVPixelFormat %s (%d)\n",
202
                fmtname ? fmtname : "INVALID", pix_fmt);
203
     }
204
     return fmt;
(-)mplayer2/files/patch-fmt-conversion.h (+12 lines)
Line 0 Link Here
1
--- fmt-conversion.h.orig	2016-11-29 15:06:09 UTC
2
+++ fmt-conversion.h
3
@@ -22,7 +22,7 @@
4
 #include "libavutil/avutil.h"
5
 #include <libavutil/pixfmt.h>
6
 
7
-enum PixelFormat imgfmt2pixfmt(int fmt);
8
-int pixfmt2imgfmt(enum PixelFormat pix_fmt);
9
+enum AVPixelFormat imgfmt2pixfmt(int fmt);
10
+int pixfmt2imgfmt(enum AVPixelFormat pix_fmt);
11
 
12
 #endif /* MPLAYER_FMT_CONVERSION_H */
(-)mplayer2/files/patch-libaf_af__lavcac3enc.c (+28 lines)
Line 0 Link Here
1
--- libaf/af_lavcac3enc.c.orig	2013-07-09 16:33:12 UTC
2
+++ libaf/af_lavcac3enc.c
3
@@ -27,7 +27,6 @@
4
 #include <assert.h>
5
 
6
 #include <libavcodec/avcodec.h>
7
-#include <libavutil/audioconvert.h>
8
 #include <libavutil/error.h>
9
 #include <libavutil/intreadwrite.h>
10
 #include <libavutil/mem.h>
11
@@ -219,7 +218,7 @@ static void uninit(struct af_instance_s*
12
             av_free(s->lavc_actx);
13
         }
14
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
15
-        avcodec_free_frame(&s->frame);
16
+        av_frame_free(&s->frame);
17
 #else
18
         av_freep(&s->frame);
19
 #endif
20
@@ -398,7 +397,7 @@ static int af_open(af_instance_t* af){
21
         mp_tmsg(MSGT_AFILTER, MSGL_ERR, "Audio LAVC, couldn't allocate context!\n");
22
         return AF_ERROR;
23
     }
24
-    s->frame = avcodec_alloc_frame();
25
+    s->frame = av_frame_alloc();
26
     if (!s->frame)
27
         return AF_ERROR;
28
     const enum AVSampleFormat *fmts = s->lavc_acodec->sample_fmts;
(-)mplayer2/files/patch-libmpcodecs_ad__ffmpeg.c (+48 lines)
Line 0 Link Here
1
--- libmpcodecs/ad_ffmpeg.c.orig	2013-07-09 16:33:13 UTC
2
+++ libmpcodecs/ad_ffmpeg.c
3
@@ -23,9 +23,9 @@
4
 #include <assert.h>
5
 
6
 #include <libavcodec/avcodec.h>
7
-#include <libavutil/audioconvert.h>
8
 #include <libavutil/opt.h>
9
 #include <libavutil/samplefmt.h>
10
+#include <libavutil/channel_layout.h>
11
 
12
 #include "talloc.h"
13
 
14
@@ -206,6 +206,7 @@ static int init(sh_audio_t *sh_audio)
15
     struct MPOpts *opts = sh_audio->opts;
16
     AVCodecContext *lavc_context;
17
     AVCodec *lavc_codec;
18
+    int audio_output_channels;
19
 
20
     if (sh_audio->codec->dll) {
21
         lavc_codec = avcodec_find_decoder_by_name(sh_audio->codec->dll);
22
@@ -236,7 +237,7 @@ static int init(sh_audio_t *sh_audio)
23
     sh_audio->context = ctx;
24
     lavc_context = avcodec_alloc_context3(lavc_codec);
25
     ctx->avctx = lavc_context;
26
-    ctx->avframe = avcodec_alloc_frame();
27
+    ctx->avframe = av_frame_alloc();
28
 
29
     // Always try to set - option only exists for AC3 at the moment
30
     av_opt_set_double(lavc_context, "drc_scale", opts->drc_level,
31
@@ -250,7 +251,7 @@ static int init(sh_audio_t *sh_audio)
32
         lavc_context->block_align = sh_audio->wf->nBlockAlign;
33
         lavc_context->bits_per_coded_sample = sh_audio->wf->wBitsPerSample;
34
     }
35
-    lavc_context->request_channels = opts->audio_output_channels;
36
+    lavc_context->request_channel_layout = av_get_default_channel_layout(audio_output_channels);
37
     lavc_context->codec_tag = sh_audio->format; //FOURCC
38
     lavc_context->codec_type = AVMEDIA_TYPE_AUDIO;
39
     lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi
40
@@ -333,7 +334,7 @@ static void uninit(sh_audio_t *sh)
41
     avresample_free(&ctx->avr);
42
 #endif
43
 #if LIBAVCODEC_VERSION_INT >= (54 << 16 | 28 << 8)
44
-    avcodec_free_frame(&ctx->avframe);
45
+    av_frame_free(&ctx->avframe);
46
 #else
47
     av_free(ctx->avframe);
48
 #endif
(-)mplayer2/files/patch-libmpcodecs_dec__teletext.c (+37 lines)
Line 0 Link Here
1
--- libmpcodecs/dec_teletext.c.orig	2013-07-09 16:33:13 UTC
2
+++ libmpcodecs/dec_teletext.c
3
@@ -402,6 +402,25 @@ struct {
4
   { 0x00, LATIN,     "English"},
5
 };
6
 
7
+static const uint8_t reverse[256] = {
8
+0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
9
+0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
10
+0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
11
+0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
12
+0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
13
+0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
14
+0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
15
+0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
16
+0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
17
+0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
18
+0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
19
+0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
20
+0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
21
+0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
22
+0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
23
+0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
24
+};
25
+
26
 /**
27
  * \brief 24/18 Hamming code decoding
28
  * \param data bytes with hamming code (array must be at least 3 bytes long)
29
@@ -1549,7 +1568,7 @@ static void vbi_decode_dvb(priv_vbi_t *p
30
     /* Reverse bit order, skipping the first two bytes (field parity, line
31
        offset and framing code). */
32
     for (i = 0; i < sizeof(data); i++)
33
-        data[i] = av_reverse[buf[2 + i]];
34
+        data[i] = reverse[buf[2 + i]];
35
 
36
     vbi_decode_line(priv, data);
37
     if (priv->cache_reset)
(-)mplayer2/files/patch-libmpcodecs_vd__ffmpeg.c (+356 lines)
Line 0 Link Here
1
--- libmpcodecs/vd_ffmpeg.c.orig	2013-07-09 16:33:13 UTC
2
+++ libmpcodecs/vd_ffmpeg.c
3
@@ -25,6 +25,7 @@
4
 #include <libavutil/common.h>
5
 #include <libavutil/opt.h>
6
 #include <libavutil/intreadwrite.h>
7
+#include <libavutil/pixdesc.h>
8
 
9
 #include "talloc.h"
10
 #include "config.h"
11
@@ -61,7 +62,7 @@ static const vd_info_t info = {
12
 typedef struct {
13
     AVCodecContext *avctx;
14
     AVFrame *pic;
15
-    enum PixelFormat pix_fmt;
16
+    enum AVPixelFormat pix_fmt;
17
     int do_slices;
18
     int do_dr1;
19
     int vo_initialized;
20
@@ -77,13 +78,16 @@ typedef struct {
21
 
22
 #include "m_option.h"
23
 
24
-static int get_buffer(AVCodecContext *avctx, AVFrame *pic);
25
+static int get_buffer(AVCodecContext *avctx, AVFrame *pic, int isreference);
26
+static int mpcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame);
27
+static int get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags);
28
 static void release_buffer(AVCodecContext *avctx, AVFrame *pic);
29
+static void mpcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
30
 static void draw_slice(struct AVCodecContext *s, const AVFrame *src,
31
                        int offset[4], int y, int type, int height);
32
 
33
-static enum PixelFormat get_format(struct AVCodecContext *avctx,
34
-                                   const enum PixelFormat *pix_fmt);
35
+static enum AVPixelFormat get_format(struct AVCodecContext *avctx,
36
+                                   const enum AVPixelFormat *pix_fmt);
37
 static void uninit(struct sh_video *sh);
38
 
39
 const m_option_t lavc_decode_opts_conf[] = {
40
@@ -169,7 +173,7 @@ static int init(sh_video_t *sh)
41
         ctx->do_dr1 = 1;
42
     ctx->ip_count = ctx->b_count = 0;
43
 
44
-    ctx->pic = avcodec_alloc_frame();
45
+    ctx->pic = av_frame_alloc();
46
     ctx->avctx = avcodec_alloc_context3(lavc_codec);
47
     avctx = ctx->avctx;
48
     avctx->opaque = sh;
49
@@ -182,9 +186,7 @@ static int init(sh_video_t *sh)
50
         ctx->do_slices = true;
51
         lavc_param->threads    = 1;
52
         avctx->get_format      = get_format;
53
-        avctx->get_buffer      = get_buffer;
54
-        avctx->release_buffer  = release_buffer;
55
-        avctx->reget_buffer    = get_buffer;
56
+        avctx->get_buffer2      = get_buffer2;
57
         avctx->draw_horiz_band = draw_slice;
58
         if (lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
59
             mp_msg(MSGT_DECVIDEO, MSGL_V, "[VD_FFMPEG] VDPAU hardware "
60
@@ -212,10 +214,7 @@ static int init(sh_video_t *sh)
61
     }
62
 
63
     if (ctx->do_dr1) {
64
-        avctx->flags |= CODEC_FLAG_EMU_EDGE;
65
-        avctx->get_buffer = get_buffer;
66
-        avctx->release_buffer = release_buffer;
67
-        avctx->reget_buffer = get_buffer;
68
+        avctx->get_buffer2 = get_buffer2;
69
     }
70
 
71
     avctx->flags |= lavc_param->bitexact;
72
@@ -227,7 +226,6 @@ static int init(sh_video_t *sh)
73
         avctx->flags |= CODEC_FLAG_GRAY;
74
     avctx->flags2 |= lavc_param->fast;
75
     avctx->codec_tag = sh->format;
76
-    avctx->stream_codec_tag = sh->video.fccHandler;
77
     avctx->idct_algo = lavc_param->idct_algo;
78
     avctx->error_concealment = lavc_param->error_concealment;
79
     avctx->debug = lavc_param->debug;
80
@@ -357,7 +355,7 @@ static void uninit(sh_video_t *sh)
81
 
82
     av_freep(&avctx);
83
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
84
-    avcodec_free_frame(&ctx->pic);
85
+    av_frame_free(&ctx->pic);
86
 #else
87
     av_freep(&ctx->pic);
88
 #endif
89
@@ -423,7 +421,7 @@ static enum mp_csp_levels avcol_range_to
90
     }
91
 }
92
 
93
-static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt)
94
+static int init_vo(sh_video_t *sh, enum AVPixelFormat pix_fmt)
95
 {
96
     vd_ffmpeg_ctx *ctx = sh->context;
97
     AVCodecContext *avctx = ctx->avctx;
98
@@ -488,7 +486,7 @@ static int init_vo(sh_video_t *sh, enum 
99
     return 0;
100
 }
101
 
102
-static int get_buffer(AVCodecContext *avctx, AVFrame *pic)
103
+static int get_buffer(AVCodecContext *avctx, AVFrame *pic, int isreference)
104
 {
105
     sh_video_t *sh = avctx->opaque;
106
     vd_ffmpeg_ctx *ctx = sh->context;
107
@@ -499,29 +497,11 @@ static int get_buffer(AVCodecContext *av
108
     int width = avctx->width;
109
     int height = avctx->height;
110
     // special case to handle reget_buffer without buffer hints
111
-    if (pic->opaque && pic->data[0] && !pic->buffer_hints)
112
+    if (pic->opaque && pic->data[0])
113
         return 0;
114
     avcodec_align_dimensions(avctx, &width, &height);
115
 
116
-    if (pic->buffer_hints) {
117
-        mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Buffer hints: %u\n",
118
-               pic->buffer_hints);
119
-        type = MP_IMGTYPE_TEMP;
120
-        if (pic->buffer_hints & FF_BUFFER_HINTS_READABLE)
121
-            flags |= MP_IMGFLAG_READABLE;
122
-        if (pic->buffer_hints & FF_BUFFER_HINTS_PRESERVE) {
123
-            type = MP_IMGTYPE_STATIC;
124
-            flags |= MP_IMGFLAG_PRESERVE;
125
-        }
126
-        if (pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE) {
127
-            type = MP_IMGTYPE_STATIC;
128
-            flags |= MP_IMGFLAG_PRESERVE;
129
-        }
130
-        flags |= ctx->do_slices ? MP_IMGFLAG_DRAW_CALLBACK : 0;
131
-        mp_msg(MSGT_DECVIDEO, MSGL_DBG2,
132
-               type == MP_IMGTYPE_STATIC ? "using STATIC\n" : "using TEMP\n");
133
-    } else {
134
-        if (!pic->reference) {
135
+        if (!isreference) {
136
             ctx->b_count++;
137
             flags |= ctx->do_slices ? MP_IMGFLAG_DRAW_CALLBACK : 0;
138
         } else {
139
@@ -529,29 +509,25 @@ static int get_buffer(AVCodecContext *av
140
             flags |= MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE
141
                      | (ctx->do_slices ? MP_IMGFLAG_DRAW_CALLBACK : 0);
142
         }
143
-    }
144
 
145
     if (init_vo(sh, avctx->pix_fmt) < 0) {
146
-        avctx->release_buffer = avcodec_default_release_buffer;
147
-        avctx->get_buffer = avcodec_default_get_buffer;
148
-        avctx->reget_buffer = avcodec_default_reget_buffer;
149
+        avctx->get_buffer2 = avcodec_default_get_buffer2;
150
         if (pic->data[0])
151
-            release_buffer(avctx, pic);
152
-        return avctx->get_buffer(avctx, pic);
153
+            mpcodec_default_release_buffer(avctx, pic);
154
+        return avctx->get_buffer2(avctx, pic,0);
155
     }
156
 
157
     if (IMGFMT_IS_HWACCEL(ctx->best_csp))
158
         type =  MP_IMGTYPE_NUMBERED | (0xffff << 16);
159
-    else if (!pic->buffer_hints) {
160
+    else {
161
         if (ctx->b_count > 1 || ctx->ip_count > 2) {
162
             mp_tmsg(MSGT_DECVIDEO, MSGL_WARN, "[VD_FFMPEG] DRI failure.\n");
163
 
164
             ctx->do_dr1 = 0; //FIXME
165
-            avctx->get_buffer = avcodec_default_get_buffer;
166
-            avctx->reget_buffer = avcodec_default_reget_buffer;
167
+            avctx->get_buffer2 = avcodec_default_get_buffer2;
168
             if (pic->data[0])
169
-                release_buffer(avctx, pic);
170
-            return avctx->get_buffer(avctx, pic);
171
+                mpcodec_default_release_buffer(avctx, pic);
172
+            return avctx->get_buffer2(avctx, pic,0);
173
         }
174
 
175
         if (avctx->has_b_frames || ctx->b_count)
176
@@ -594,7 +570,6 @@ static int get_buffer(AVCodecContext *av
177
 
178
     pic->opaque = mpi;
179
 
180
-    pic->type = FF_BUFFER_TYPE_USER;
181
 
182
     /* The libavcodec reordered_opaque functionality is implemented by
183
      * a similar copy in avcodec_default_get_buffer() and without a
184
@@ -626,8 +601,8 @@ static void release_buffer(struct AVCode
185
         mpi->usage_count--;
186
     }
187
 
188
-    if (pic->type != FF_BUFFER_TYPE_USER) {
189
-        avcodec_default_release_buffer(avctx, pic);
190
+    if (pic->opaque == NULL) {
191
+        mpcodec_default_release_buffer(avctx, pic);
192
         return;
193
     }
194
 
195
@@ -822,13 +797,13 @@ static struct mp_image *decode(struct sh
196
     return mpi;
197
 }
198
 
199
-static enum PixelFormat get_format(struct AVCodecContext *avctx,
200
-                                   const enum PixelFormat *fmt)
201
+static enum AVPixelFormat get_format(struct AVCodecContext *avctx,
202
+                                   const enum AVPixelFormat *fmt)
203
 {
204
     sh_video_t *sh = avctx->opaque;
205
     int i;
206
 
207
-    for (i = 0; fmt[i] != PIX_FMT_NONE; i++) {
208
+    for (i = 0; fmt[i] != AV_PIX_FMT_NONE; i++) {
209
         int imgfmt = pixfmt2imgfmt(fmt[i]);
210
         if (!IMGFMT_IS_HWACCEL(imgfmt))
211
             continue;
212
@@ -886,3 +861,144 @@ const struct vd_functions mpcodecs_vd_ff
213
     .control = control,
214
     .decode2 = decode
215
 };
216
+
217
+/*
218
+FFWrapper
219
+*/
220
+static int mpcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
221
+{
222
+    return avcodec_default_get_buffer2(avctx, frame, 0);
223
+}
224
+
225
+static void mpcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
226
+{
227
+    av_frame_unref(pic);
228
+}
229
+
230
+typedef struct CompatReleaseBufPriv {
231
+    AVCodecContext avctx;
232
+    AVFrame frame;
233
+    uint8_t avframe_padding[1024]; // hack to allow linking to a avutil larger AVFrame
234
+} CompatReleaseBufPriv;
235
+
236
+static void compat_free_buffer(void *opaque, uint8_t *data)
237
+{
238
+    CompatReleaseBufPriv *priv = opaque;
239
+    release_buffer(&priv->avctx, &priv->frame);
240
+    av_freep(&priv);
241
+}
242
+
243
+static void compat_release_buffer(void *opaque, uint8_t *data)
244
+{
245
+    AVBufferRef *buf = opaque;
246
+    av_buffer_unref(&buf);
247
+}
248
+
249
+static int get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
250
+{
251
+    /*
252
+     * Wrap an old get_buffer()-allocated buffer in a bunch of AVBuffers.
253
+     * We wrap each plane in its own AVBuffer. Each of those has a reference to
254
+     * a dummy AVBuffer as its private data, unreffing it on free,
255
+     * When all the planes are freed, the dummy buffer's free callback calls
256
+     * release_buffer().
257
+     */
258
+    CompatReleaseBufPriv *priv = NULL;
259
+    AVBufferRef *dummy_buf = NULL;
260
+    int planes, i, ret;
261
+
262
+    ret = get_buffer(avctx, frame, flags & AV_GET_BUFFER_FLAG_REF);
263
+    if (ret < 0)
264
+        return ret;
265
+
266
+    /* return if the buffers are already set up
267
+     * this would happen e.g. when a custom get_buffer() calls
268
+     * avcodec_default_get_buffer
269
+     */
270
+    if (frame->buf[0])
271
+       goto end0;
272
+
273
+    priv = av_mallocz(sizeof(*priv));
274
+    if (!priv) {
275
+        ret = AVERROR(ENOMEM);
276
+        goto fail;
277
+    }
278
+    priv->avctx = *avctx;
279
+    priv->frame = *frame; 
280
+
281
+    dummy_buf = av_buffer_create(NULL, 0, compat_free_buffer, priv, 0);
282
+    if (!dummy_buf) {
283
+        ret = AVERROR(ENOMEM);
284
+        goto fail;
285
+    }
286
+
287
+#define WRAP_PLANE(ref_out, data, data_size)                            \
288
+do {                                                                    \
289
+    AVBufferRef *dummy_ref = av_buffer_ref(dummy_buf);                  \
290
+    if (!dummy_ref) {                                                   \
291
+        ret = AVERROR(ENOMEM);                                          \
292
+        goto fail;                                                      \
293
+    }                                                                   \
294
+    ref_out = av_buffer_create(data, data_size, compat_release_buffer,  \
295
+                               dummy_ref, 0);                           \
296
+    if (!ref_out) {                                                     \
297
+        av_buffer_unref(&dummy_ref);                                    \
298
+        av_frame_unref(frame);                                          \
299
+        ret = AVERROR(ENOMEM);                                          \
300
+        goto fail;                                                      \
301
+    }                                                                   \
302
+} while (0)
303
+
304
+    if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
305
+        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
306
+
307
+        planes = av_pix_fmt_count_planes(frame->format);
308
+        /* workaround for AVHWAccel plane count of 0, buf[0] is used as
309
+           check for allocated buffers: make libavcodec happy */
310
+        if (desc && desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
311
+            planes = 1;
312
+        if (!desc || planes <= 0) {
313
+            ret = AVERROR(EINVAL);
314
+            goto fail;
315
+        }
316
+
317
+        for (i = 0; i < planes; i++) {
318
+            int v_shift    = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
319
+            int plane_size = (frame->height >> v_shift) * frame->linesize[i];
320
+
321
+            WRAP_PLANE(frame->buf[i], frame->data[i], plane_size);
322
+        }
323
+    } else {
324
+        int planar = av_sample_fmt_is_planar(frame->format);
325
+        planes = planar ? avctx->channels : 1;
326
+
327
+        if (planes > FF_ARRAY_ELEMS(frame->buf)) {
328
+            frame->nb_extended_buf = planes - FF_ARRAY_ELEMS(frame->buf);
329
+            frame->extended_buf = av_malloc_array(sizeof(*frame->extended_buf),
330
+                                            frame->nb_extended_buf);
331
+            if (!frame->extended_buf) {
332
+                ret = AVERROR(ENOMEM);
333
+                goto fail;
334
+            }
335
+         }
336
+
337
+         for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
338
+             WRAP_PLANE(frame->extended_buf[i],
339
+                        frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
340
+                        frame->linesize[0]);
341
+    }
342
+    
343
+    av_buffer_unref(&dummy_buf);
344
+
345
+end0:
346
+    frame->width  = avctx->width;
347
+    frame->height = avctx->height;
348
+
349
+    return 0;
350
+
351
+fail:
352
+    release_buffer(avctx, frame);
353
+    av_freep(&priv);
354
+    av_buffer_unref(&dummy_buf);
355
+    return ret;
356
+}
(-)mplayer2/files/patch-libmpcodecs_vf__halfpack.c (+15 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_halfpack.c.orig	2013-07-09 16:33:16 UTC
2
+++ libmpcodecs/vf_halfpack.c
3
@@ -198,9 +198,9 @@ static int config(struct vf_instance *vf
4
 		sws_freeContext(vf->priv->ctx);
5
 		// get unscaled 422p -> yuy2 conversion
6
 		vf->priv->ctx =
7
-			sws_getContext(width, height / 2, PIX_FMT_YUV422P,
8
-			               width, height / 2, PIX_FMT_YUYV422,
9
-			               SWS_POINT | SWS_PRINT_INFO | get_sws_cpuflags(),
10
+			sws_getContext(width, height / 2, AV_PIX_FMT_YUV422P,
11
+			               width, height / 2, AV_PIX_FMT_YUYV422,
12
+			               SWS_POINT | SWS_PRINT_INFO,
13
 			               NULL, NULL, NULL);
14
 	}
15
 	/* FIXME - also support UYVY output? */
(-)mplayer2/files/patch-libmpcodecs_vf__lavc.c (+47 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_lavc.c.orig	2013-07-09 16:33:16 UTC
2
+++ libmpcodecs/vf_lavc.c
3
@@ -83,6 +83,8 @@ static int put_image(struct vf_instance 
4
     mp_image_t* dmpi;
5
     int out_size;
6
     AVFrame *pic= vf->priv->pic;
7
+    int ret, got_pkt;
8
+    AVPacket pkt;
9
 
10
     pic->data[0]=mpi->planes[0];
11
     pic->data[1]=mpi->planes[1];
12
@@ -91,10 +93,14 @@ static int put_image(struct vf_instance 
13
     pic->linesize[1]=mpi->stride[1];
14
     pic->linesize[2]=mpi->stride[2];
15
 
16
-    out_size = avcodec_encode_video(&lavc_venc_context,
17
-	vf->priv->outbuf, vf->priv->outbuf_size, pic);
18
+    av_init_packet(&pkt);
19
+    pkt.data = vf->priv->outbuf;
20
+    pkt.size = vf->priv->outbuf_size;
21
+    ret = avcodec_encode_video2(&lavc_venc_context, &pkt, pic, &got_pkt);
22
 
23
-    if(out_size<=0) return 1;
24
+    if(ret<=0) return 1;
25
+    if(!got_pkt) return 1;
26
+    out_size = pkt.size;
27
 
28
     dmpi=vf_get_image(vf->next,IMGFMT_MPEGPES,
29
 	MP_IMGTYPE_EXPORT, 0,
30
@@ -139,7 +145,7 @@ static int vf_open(vf_instance_t *vf, ch
31
     }
32
 
33
     vf->priv->context=avcodec_alloc_context3(vf->priv->codec);
34
-    vf->priv->pic = avcodec_alloc_frame();
35
+    vf->priv->pic = av_frame_alloc();
36
 
37
     // TODO: parse args ->
38
     if(args) sscanf(args, "%d:%f", &p_quality, &p_fps);
39
@@ -156,7 +162,7 @@ static int vf_open(vf_instance_t *vf, ch
40
     lavc_venc_context.time_base.num = 1000*1001;
41
     lavc_venc_context.time_base.den = (p_fps<1.0) ? 1000*1001*25 : (p_fps * lavc_venc_context.time_base.num);
42
     lavc_venc_context.gop_size = 0; // I-only
43
-    lavc_venc_context.pix_fmt= PIX_FMT_YUV420P;
44
+    lavc_venc_context.pix_fmt= AV_PIX_FMT_YUV420P;
45
 
46
     return 1;
47
 }
(-)mplayer2/files/patch-libmpcodecs_vf__lavcdeint.c (+155 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_lavcdeint.c.orig	2013-07-09 16:33:16 UTC
2
+++ libmpcodecs/vf_lavcdeint.c
3
@@ -27,135 +27,6 @@
4
 #include "img_format.h"
5
 #include "mp_image.h"
6
 #include "vf.h"
7
-#include "libavcodec/avcodec.h"
8
-
9
-
10
-struct vf_priv_s
11
-{
12
-  int       width, height;
13
-  int       pix_fmt;
14
-};
15
-
16
-/* Support for avcodec's built-in deinterlacer.
17
- * Based on vf_lavc.c
18
- */
19
-
20
-//===========================================================================//
21
-
22
-
23
-/* Convert mplayer's IMGFMT_* to avcodec's PIX_FMT_* for the supported
24
- * IMGFMT's, and return -1 if the deinterlacer doesn't support
25
- * that format (-1 because 0 is a valid PIX_FMT).
26
- */
27
-/* The deinterlacer supports planer 4:2:0, 4:2:2, and 4:4:4 YUV */
28
-static int
29
-imgfmt_to_pixfmt (int imgfmt)
30
-{
31
-  switch(imgfmt)
32
-    {
33
-      /* I hope I got all the supported formats */
34
-
35
-      /* 4:2:0 */
36
-    case IMGFMT_YV12:
37
-    case IMGFMT_I420:
38
-    case IMGFMT_IYUV:
39
-      return PIX_FMT_YUV420P;
40
-      break;
41
-
42
-#if 0
43
-      /* 4:2:2 */
44
-    case IMGFMT_UYVY:
45
-    case IMGFMT_UYNV:
46
-    case IMGFMT_Y422:
47
-    case IMGFMT_YUY2:
48
-    case IMGFMT_YUNV:
49
-    case IMGFMT_YVYU:
50
-    case IMGFMT_Y42T:
51
-    case IMGFMT_V422:
52
-    case IMGFMT_V655:
53
-      return PIX_FMT_YUV422P;
54
-      break;
55
-#endif
56
-
57
-      /* Are there any _planar_ YUV 4:4:4 formats? */
58
-
59
-    default:
60
-      return -1;
61
-    }
62
-}
63
-
64
-
65
-static int
66
-config (struct vf_instance *vf,
67
-        int width, int height, int d_width, int d_height,
68
-        unsigned int flags, unsigned int outfmt)
69
-{
70
-  struct vf_priv_s *priv = vf->priv;
71
-
72
-  priv->pix_fmt = imgfmt_to_pixfmt(outfmt);
73
-  if(priv->pix_fmt == -1)
74
-    return 0;
75
-
76
-  /* The deinterlacer will fail if this is false */
77
-  if ((width & 3) != 0 || (height & 3) != 0)
78
-    return 0;
79
-
80
-  /* If we get here, the deinterlacer is guaranteed not to fail */
81
-
82
-  priv->width  = width;
83
-  priv->height = height;
84
-
85
-  return vf_next_config(vf,
86
-			width, height,
87
-			d_width, d_height,
88
-			flags, outfmt);
89
-}
90
-
91
-static int
92
-put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
93
-{
94
-  struct vf_priv_s *priv = vf->priv;
95
-  mp_image_t* dmpi;
96
-  AVPicture pic;
97
-  AVPicture lavc_picture;
98
-
99
-  lavc_picture.data[0]     = mpi->planes[0];
100
-  lavc_picture.data[1]     = mpi->planes[1];
101
-  lavc_picture.data[2]     = mpi->planes[2];
102
-  lavc_picture.linesize[0] = mpi->stride[0];
103
-  lavc_picture.linesize[1] = mpi->stride[1];
104
-  lavc_picture.linesize[2] = mpi->stride[2];
105
-
106
-  dmpi = vf_get_image(vf->next, mpi->imgfmt,
107
-		      MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
108
-		      priv->width, priv->height);
109
-
110
-  pic.data[0]     = dmpi->planes[0];
111
-  pic.data[1]     = dmpi->planes[1];
112
-  pic.data[2]     = dmpi->planes[2];
113
-  pic.linesize[0] = dmpi->stride[0];
114
-  pic.linesize[1] = dmpi->stride[1];
115
-  pic.linesize[2] = dmpi->stride[2];
116
-
117
-  if (avpicture_deinterlace(&pic, &lavc_picture,
118
-			    priv->pix_fmt, priv->width, priv->height) < 0)
119
-    {
120
-      /* This should not happen -- see config() */
121
-      return 0;
122
-    }
123
-
124
-  return vf_next_put_image(vf, dmpi, pts);
125
-}
126
-
127
-
128
-static int
129
-query_format (struct vf_instance *vf, unsigned int fmt)
130
-{
131
-  if(imgfmt_to_pixfmt(fmt) == -1)
132
-    return 0;
133
-
134
-  return vf_next_query_format(vf,fmt);
135
-}
136
 
137
 
138
 static int
139
@@ -164,13 +35,10 @@ vf_open(vf_instance_t *vf, char *args)
140
   /* We don't have any args */
141
   (void) args;
142
 
143
-  vf->config       = config;
144
-  vf->put_image    = put_image;
145
-  vf->query_format = query_format;
146
-  vf->priv         = malloc(sizeof(struct vf_priv_s));
147
-  memset(vf->priv,0,sizeof(struct vf_priv_s));
148
+  mp_msg(MSGT_VFILTER,MSGL_FATAL, "lavcdeint has been removed, please use '-vf pp=fd' (same filter) or '-vf yadif'\n");
149
 
150
-  return 1;
151
+
152
+  return 0;
153
 }
154
 
155
 
(-)mplayer2/files/patch-libmpcodecs_vf__sab.c (+11 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_sab.c.orig	2016-11-29 23:52:42 UTC
2
+++ libmpcodecs/vf_sab.c
3
@@ -72,7 +72,7 @@ static int allocStuff(FilterParam *f, in
4
 	swsF.lumH= swsF.lumV= vec;
5
 	swsF.chrH= swsF.chrV= NULL;
6
 	f->preFilterContext= sws_getContext(
7
-		width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, get_sws_cpuflags()|SWS_POINT, &swsF, NULL, NULL);
8
+		width, height, AV_PIX_FMT_GRAY8, width, height, AV_PIX_FMT_GRAY8, SWS_POINT, &swsF, NULL, NULL);
9
 
10
 	sws_freeVec(vec);
11
 	vec = sws_getGaussianVec(f->strength, 5.0);
(-)mplayer2/files/patch-libmpcodecs_vf__scale.c (+78 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_scale.c.orig	2013-07-09 16:33:16 UTC
2
+++ libmpcodecs/vf_scale.c
3
@@ -201,7 +201,7 @@ static int config(struct vf_instance *vf
4
     int round_w=0, round_h=0;
5
     int i;
6
     SwsFilter *srcFilter, *dstFilter;
7
-    enum PixelFormat dfmt, sfmt;
8
+    enum AVPixelFormat dfmt, sfmt;
9
 
10
     vf->priv->colorspace = (struct mp_csp_details) {0};
11
 
12
@@ -210,7 +210,7 @@ static int config(struct vf_instance *vf
13
 	return 0;
14
     }
15
     sfmt = imgfmt2pixfmt(outfmt);
16
-    if (outfmt == IMGFMT_RGB8 || outfmt == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
17
+    if (outfmt == IMGFMT_RGB8 || outfmt == IMGFMT_BGR8) sfmt = AV_PIX_FMT_PAL8;
18
     dfmt = imgfmt2pixfmt(best);
19
 
20
     vo_flags=vf->next->query_format(vf->next,best);
21
@@ -319,13 +319,13 @@ static int config(struct vf_instance *vf
22
 	    sfmt,
23
 		  vf->priv->w, vf->priv->h >> vf->priv->interlaced,
24
 	    dfmt,
25
-	    int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
26
+	    int_sws_flags, srcFilter, dstFilter, vf->priv->param);
27
     if(vf->priv->interlaced){
28
         vf->priv->ctx2=sws_getContext(width, height >> 1,
29
 	    sfmt,
30
 		  vf->priv->w, vf->priv->h >> 1,
31
 	    dfmt,
32
-	    int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
33
+	    int_sws_flags, srcFilter, dstFilter, vf->priv->param);
34
     }
35
     if(!vf->priv->ctx){
36
 	// error...
37
@@ -612,7 +612,7 @@ error_out:
38
 //  supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800
39
 
40
 static int query_format(struct vf_instance *vf, unsigned int fmt){
41
-    if (!IMGFMT_IS_HWACCEL(fmt) && imgfmt2pixfmt(fmt) != PIX_FMT_NONE) {
42
+    if (!IMGFMT_IS_HWACCEL(fmt) && imgfmt2pixfmt(fmt) != AV_PIX_FMT_NONE) {
43
 	unsigned int best=find_best_out(vf, fmt);
44
 	int flags;
45
 	if(!best) return 0;	 // no matching out-fmt
46
@@ -661,14 +661,6 @@ int sws_chr_hshift= 0;
47
 float sws_chr_sharpen= 0.0;
48
 float sws_lum_sharpen= 0.0;
49
 
50
-int get_sws_cpuflags(void){
51
-    return
52
-          (gCpuCaps.hasMMX   ? SWS_CPU_CAPS_MMX   : 0)
53
-	| (gCpuCaps.hasMMX2  ? SWS_CPU_CAPS_MMX2  : 0)
54
-	| (gCpuCaps.has3DNow ? SWS_CPU_CAPS_3DNOW : 0)
55
-        | (gCpuCaps.hasAltiVec ? SWS_CPU_CAPS_ALTIVEC : 0);
56
-}
57
-
58
 void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam)
59
 {
60
 	static int firstTime=1;
61
@@ -717,14 +709,14 @@ static struct SwsContext *sws_getContext
62
 {
63
 	int flags;
64
 	SwsFilter *dstFilterParam, *srcFilterParam;
65
-	enum PixelFormat dfmt, sfmt;
66
+	enum AVPixelFormat dfmt, sfmt;
67
 
68
 	dfmt = imgfmt2pixfmt(dstFormat);
69
 	sfmt = imgfmt2pixfmt(srcFormat);
70
-	if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8;
71
+	if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = AV_PIX_FMT_PAL8;
72
 	sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
73
 
74
-	return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags | extraflags | get_sws_cpuflags(), srcFilterParam, dstFilterParam, NULL);
75
+	return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags, srcFilterParam, dstFilterParam, NULL);
76
 }
77
 
78
 struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat)
(-)mplayer2/files/patch-libmpcodecs_vf__scale.h (+10 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_scale.h.orig	2016-11-30 00:01:44 UTC
2
+++ libmpcodecs/vf_scale.h
3
@@ -19,7 +19,6 @@
4
 #ifndef MPLAYER_VF_SCALE_H
5
 #define MPLAYER_VF_SCALE_H
6
 
7
-int get_sws_cpuflags(void);
8
 struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
9
 struct SwsContext *sws_getContextFromCmdLine_hq(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
10
 
(-)mplayer2/files/patch-libmpcodecs_vf__screenshot.c (+14 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_screenshot.c.orig	2016-11-30 00:06:27 UTC
2
+++ libmpcodecs/vf_screenshot.c
3
@@ -167,9 +167,9 @@ static int control (vf_instance_t *vf, i
4
 
5
 static int query_format(struct vf_instance *vf, unsigned int fmt)
6
 {
7
-    enum PixelFormat av_format = imgfmt2pixfmt(fmt);
8
+    enum AVPixelFormat av_format = imgfmt2pixfmt(fmt);
9
 
10
-    if (av_format != PIX_FMT_NONE && sws_isSupportedInput(av_format))
11
+    if (av_format != AV_PIX_FMT_NONE && sws_isSupportedInput(av_format))
12
         return vf_next_query_format(vf, fmt);
13
     return 0;
14
 }
(-)mplayer2/files/patch-libmpcodecs_vf__smartblur.c (+11 lines)
Line 0 Link Here
1
--- libmpcodecs/vf_smartblur.c.orig	2016-11-30 00:10:36 UTC
2
+++ libmpcodecs/vf_smartblur.c
3
@@ -61,7 +61,7 @@ static int allocStuff(FilterParam *f, in
4
 	swsF.lumH= swsF.lumV= vec;
5
 	swsF.chrH= swsF.chrV= NULL;
6
 	f->filterContext= sws_getContext(
7
-		width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_BICUBIC | get_sws_cpuflags(), &swsF, NULL, NULL);
8
+		width, height, AV_PIX_FMT_GRAY8, width, height, AV_PIX_FMT_GRAY8, SWS_BICUBIC, &swsF, NULL, NULL);
9
 
10
 	sws_freeVec(vec);
11
 
(-)mplayer2/files/patch-libmpdemux_demux__lavf.c (-1 / +13 lines)
Lines 1-4 Link Here
1
--- libmpdemux/demux_lavf.c.orig	2016-03-16 10:57:42 UTC
1
--- libmpdemux/demux_lavf.c.orig	2013-07-09 16:33:16 UTC
2
+++ libmpdemux/demux_lavf.c
2
+++ libmpdemux/demux_lavf.c
3
@@ -159,6 +159,7 @@ static int lavf_check_file(demuxer_t *de
3
@@ -159,6 +159,7 @@ static int lavf_check_file(demuxer_t *de
4
     int probe_data_size = 0;
4
     int probe_data_size = 0;
Lines 16-18 Link Here
16
         priv->avif = av_probe_input_format2(&avpd, probe_data_size > 0, &score);
16
         priv->avif = av_probe_input_format2(&avpd, probe_data_size > 0, &score);
17
         read_size = FFMIN(2 * read_size, PROBE_BUF_SIZE - probe_data_size);
17
         read_size = FFMIN(2 * read_size, PROBE_BUF_SIZE - probe_data_size);
18
     } while ((demuxer->desc->type != DEMUXER_TYPE_LAVF_PREFERRED ||
18
     } while ((demuxer->desc->type != DEMUXER_TYPE_LAVF_PREFERRED ||
19
@@ -383,9 +385,9 @@ static void handle_stream(demuxer_t *dem
20
 
21
         if (codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
22
             switch (codec->pix_fmt) {
23
-            case PIX_FMT_RGB24:
24
+            case AV_PIX_FMT_RGB24:
25
                 codec->codec_tag = MKTAG(24, 'B', 'G', 'R');
26
-            case PIX_FMT_BGR24:
27
+            case AV_PIX_FMT_BGR24:
28
                 codec->codec_tag = MKTAG(24, 'R', 'G', 'B');
29
             }
30
             if (!codec->codec_tag)
(-)mplayer2/files/patch-libvo_vo__png.c (+41 lines)
Line 0 Link Here
1
--- libvo/vo_png.c.orig	2013-07-09 16:33:16 UTC
2
+++ libvo/vo_png.c
3
@@ -89,9 +89,10 @@ config(uint32_t width, uint32_t height, 
4
 static uint32_t draw_image(mp_image_t* mpi){
5
     AVFrame pic;
6
     int buffersize;
7
-    int res;
8
+    int res, got_pkt;
9
     char buf[100];
10
     FILE *outfile;
11
+    AVPacket pkt;
12
 
13
     // if -dr or -slices then do nothing:
14
     if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
15
@@ -111,16 +112,20 @@ static uint32_t draw_image(mp_image_t* m
16
         outbuffer = av_malloc(buffersize);
17
         outbuffer_size = buffersize;
18
     }
19
-    res = avcodec_encode_video(avctx, outbuffer, outbuffer_size, &pic);
20
+    av_init_packet(&pkt);
21
+    pkt.data = outbuffer;
22
+    pkt.size = outbuffer_size;
23
+    res = avcodec_encode_video2(avctx, &pkt, &got_pkt, &pic);
24
+    av_frame_free(&pic);
25
 
26
-    if(res < 0){
27
- 	    mp_msg(MSGT_VO,MSGL_WARN, "[VO_PNG] Error in create_png.\n");
28
-            fclose(outfile);
29
-	    return 1;
30
+    if (res < 0 || !got_pkt) {
31
+         mp_msg(MSGT_VO,MSGL_WARN, "[V0_PNG] Error in create_png.\n");
32
+    } else {
33
+         fwrite(outbuffer, pkt.size, 1, outfile);
34
     }
35
 
36
-    fwrite(outbuffer, res, 1, outfile);
37
     fclose(outfile);
38
+    av_free_packet(&pkt);  
39
 
40
     return VO_TRUE;
41
 }
(-)mplayer2/files/patch-screenshot.c (+90 lines)
Line 0 Link Here
1
--- screenshot.c.orig	2013-07-09 16:33:27 UTC
2
+++ screenshot.c
3
@@ -57,7 +57,7 @@ static int destroy_ctx(void *ptr)
4
 {
5
     struct screenshot_ctx *ctx = ptr;
6
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
7
-    avcodec_free_frame(&ctx->pic);
8
+    av_frame_free(&ctx->pic);
9
 #else
10
     av_free(ctx->pic);
11
 #endif
12
@@ -69,7 +69,7 @@ static screenshot_ctx *screenshot_get_ct
13
     if (!mpctx->screenshot_ctx) {
14
         struct screenshot_ctx *ctx = talloc_zero(mpctx, screenshot_ctx);
15
         talloc_set_destructor(ctx, destroy_ctx);
16
-        ctx->pic = avcodec_alloc_frame();
17
+        ctx->pic = av_frame_alloc();
18
         assert(ctx->pic);
19
         mpctx->screenshot_ctx = ctx;
20
     }
21
@@ -80,8 +80,12 @@ static int write_png(screenshot_ctx *ctx
22
 {
23
     char *fname = ctx->fname;
24
     FILE *fp = NULL;
25
-    void *outbuffer = NULL;
26
     int success = 0;
27
+    int got_pkt;
28
+    AVPacket pkt = {0};
29
+    int got_output = 0;
30
+
31
+    av_init_packet(&pkt);
32
 
33
     struct AVCodec *png_codec = avcodec_find_encoder(AV_CODEC_ID_PNG);
34
     AVCodecContext *avctx = NULL;
35
@@ -94,7 +98,7 @@ static int write_png(screenshot_ctx *ctx
36
     avctx->time_base = AV_TIME_BASE_Q;
37
     avctx->width = image->width;
38
     avctx->height = image->height;
39
-    avctx->pix_fmt = PIX_FMT_RGB24;
40
+    avctx->pix_fmt = AV_PIX_FMT_RGB24;
41
     avctx->compression_level = 0;
42
 
43
     if (avcodec_open2(avctx, png_codec, NULL) < 0) {
44
@@ -104,19 +108,14 @@ static int write_png(screenshot_ctx *ctx
45
         goto error_exit;
46
     }
47
 
48
-    size_t outbuffer_size = image->width * image->height * 3 * 2;
49
-    outbuffer = malloc(outbuffer_size);
50
-    if (!outbuffer)
51
-        goto error_exit;
52
-
53
     AVFrame *pic = ctx->pic;
54
-    avcodec_get_frame_defaults(pic);
55
+    av_frame_unref(pic);
56
     for (int n = 0; n < 4; n++) {
57
         pic->data[n] = image->planes[n];
58
         pic->linesize[n] = image->stride[n];
59
     }
60
-    int size = avcodec_encode_video(avctx, outbuffer, outbuffer_size, pic);
61
-    if (size < 1)
62
+    int ret = avcodec_encode_video2(avctx, &pkt, pic, &got_output);
63
+    if (ret < 0)
64
         goto error_exit;
65
 
66
     fp = fopen(fname, "wb");
67
@@ -126,20 +125,20 @@ static int write_png(screenshot_ctx *ctx
68
         goto error_exit;
69
     }
70
 
71
-    fwrite(outbuffer, size, 1, fp);
72
+    fwrite(pkt.data, pkt.size, 1, fp);
73
     fflush(fp);
74
 
75
     if (ferror(fp))
76
         goto error_exit;
77
 
78
-    success = 1;
79
+    success = !!got_output;
80
 error_exit:
81
     if (avctx)
82
         avcodec_close(avctx);
83
     av_free(avctx);
84
     if (fp)
85
         fclose(fp);
86
-    free(outbuffer);
87
+    av_free_packet(&pkt);
88
     return success;
89
 }
90
 
(-)mplayer2/files/patch-sub_spudec.c (+11 lines)
Line 0 Link Here
1
--- sub/spudec.c.orig	2016-11-30 00:23:04 UTC
2
+++ sub/spudec.c
3
@@ -861,7 +861,7 @@ static void sws_spu_image(unsigned char 
4
 		oldvar = spu_gaussvar;
5
 	}
6
 
7
-	ctx=sws_getContext(sw, sh, PIX_FMT_GRAY8, dw, dh, PIX_FMT_GRAY8, SWS_GAUSS, &filter, NULL, NULL);
8
+	ctx=sws_getContext(sw, sh, AV_PIX_FMT_GRAY8, dw, dh, AV_PIX_FMT_GRAY8, SWS_GAUSS, &filter, NULL, NULL);
9
 	sws_scale(ctx,&s1,&ss,0,sh,&d1,&ds);
10
 	for (i=ss*sh-1; i>=0; i--) if (!s2[i]) s2[i] = 255; //else s2[i] = 1;
11
 	sws_scale(ctx,(const uint8_t **)&s2,&ss,0,sh,&d2,&ds);

Return to bug 214896