]> git.pld-linux.org Git - packages/ffms2.git/blob - ffmpeg3.patch
Release 2 (by relup.sh)
[packages/ffms2.git] / ffmpeg3.patch
1 --- ffms2-2.20/configure.ac~    2016-03-22 18:01:21.000000000 +0100
2 +++ ffms2-2.20/configure.ac     2016-03-22 18:02:57.590572584 +0100
3 @@ -156,7 +156,7 @@
4                  avcodec_register_all();
5                  swscale_version();
6                  #ifdef FFMS_USE_FFMPEG_COMPAT
7 -                int bogus = CODEC_ID_G2M;
8 +                int bogus = AV_CODEC_ID_G2M;
9                  (void) bogus;
10                  #endif
11              ]])], [eval $1=yes], [eval $1=no])
12 --- ffms2-2.20/src/core/videosource.h~  2014-06-20 17:09:10.000000000 +0200
13 +++ ffms2-2.20/src/core/videosource.h   2016-03-22 18:04:27.388385707 +0100
14 @@ -39,19 +39,19 @@
15  
16         int LastFrameHeight;
17         int LastFrameWidth;
18 -       PixelFormat LastFramePixelFormat;
19 +       AVPixelFormat LastFramePixelFormat;
20  
21         int TargetHeight;
22         int TargetWidth;
23 -       std::vector<PixelFormat> TargetPixelFormats;
24 +       std::vector<AVPixelFormat> TargetPixelFormats;
25         int TargetResizer;
26  
27 -       PixelFormat OutputFormat;
28 +       AVPixelFormat OutputFormat;
29         AVColorRange OutputColorRange;
30         AVColorSpace OutputColorSpace;
31  
32         bool InputFormatOverridden;
33 -       PixelFormat InputFormat;
34 +       AVPixelFormat InputFormat;
35         AVColorRange InputColorRange;
36         AVColorSpace InputColorSpace;
37  
38 @@ -89,9 +89,9 @@
39         virtual FFMS_Frame *GetFrame(int n) = 0;
40         void GetFrameCheck(int n);
41         FFMS_Frame *GetFrameByTime(double Time);
42 -       void SetOutputFormat(const PixelFormat *TargetFormats, int Width, int Height, int Resizer);
43 +       void SetOutputFormat(const AVPixelFormat *TargetFormats, int Width, int Height, int Resizer);
44         void ResetOutputFormat();
45 -       void SetInputFormat(int ColorSpace, int ColorRange, PixelFormat Format);
46 +       void SetInputFormat(int ColorSpace, int ColorRange, AVPixelFormat Format);
47         void ResetInputFormat();
48  };
49  
50 --- ffms2-2.20/src/core/videosource.cpp~        2014-06-20 17:09:10.000000000 +0200
51 +++ ffms2-2.20/src/core/videosource.cpp 2016-03-22 18:05:31.439198279 +0100
52 @@ -55,7 +55,7 @@
53         if (LastFrameWidth != CodecContext->width || LastFrameHeight != CodecContext->height || LastFramePixelFormat != CodecContext->pix_fmt) {
54                 if (TargetHeight > 0 && TargetWidth > 0 && !TargetPixelFormats.empty()) {
55                         if (!InputFormatOverridden) {
56 -                               InputFormat = PIX_FMT_NONE;
57 +                               InputFormat = AV_PIX_FMT_NONE;
58                                 InputColorSpace = AVCOL_SPC_UNSPECIFIED;
59                                 InputColorRange = AVCOL_RANGE_UNSPECIFIED;
60                         }
61 @@ -129,18 +129,18 @@
62  
63         LastFrameHeight = -1;
64         LastFrameWidth = -1;
65 -       LastFramePixelFormat = PIX_FMT_NONE;
66 +       LastFramePixelFormat = AV_PIX_FMT_NONE;
67  
68         TargetHeight = -1;
69         TargetWidth = -1;
70         TargetResizer = 0;
71  
72 -       OutputFormat = PIX_FMT_NONE;
73 +       OutputFormat = AV_PIX_FMT_NONE;
74         OutputColorSpace = AVCOL_SPC_UNSPECIFIED;
75         OutputColorRange = AVCOL_RANGE_UNSPECIFIED;
76  
77         InputFormatOverridden = false;
78 -       InputFormat = PIX_FMT_NONE;
79 +       InputFormat = AV_PIX_FMT_NONE;
80         InputColorSpace = AVCOL_SPC_UNSPECIFIED;
81         InputColorRange = AVCOL_RANGE_UNSPECIFIED;
82         if (Threads < 1)
83 @@ -151,7 +151,7 @@
84         LastDecodedFrame = av_frame_alloc();
85  
86         // Dummy allocations so the unallocated case doesn't have to be handled later
87 -       avpicture_alloc(&SWSFrame, PIX_FMT_GRAY8, 16, 16);
88 +       avpicture_alloc(&SWSFrame, AV_PIX_FMT_GRAY8, 16, 16);
89  
90         Index.AddRef();
91  }
92 @@ -172,33 +172,33 @@
93         return GetFrame(Frame);
94  }
95  
96 -static AVColorRange handle_jpeg(PixelFormat *format) {
97 +static AVColorRange handle_jpeg(AVPixelFormat *format) {
98         switch (*format) {
99 -               case PIX_FMT_YUVJ420P: *format = PIX_FMT_YUV420P; return AVCOL_RANGE_JPEG;
100 -               case PIX_FMT_YUVJ422P: *format = PIX_FMT_YUV422P; return AVCOL_RANGE_JPEG;
101 -               case PIX_FMT_YUVJ444P: *format = PIX_FMT_YUV444P; return AVCOL_RANGE_JPEG;
102 -               case PIX_FMT_YUVJ440P: *format = PIX_FMT_YUV440P; return AVCOL_RANGE_JPEG;
103 +               case AV_PIX_FMT_YUVJ420P: *format = AV_PIX_FMT_YUV420P; return AVCOL_RANGE_JPEG;
104 +               case AV_PIX_FMT_YUVJ422P: *format = AV_PIX_FMT_YUV422P; return AVCOL_RANGE_JPEG;
105 +               case AV_PIX_FMT_YUVJ444P: *format = AV_PIX_FMT_YUV444P; return AVCOL_RANGE_JPEG;
106 +               case AV_PIX_FMT_YUVJ440P: *format = AV_PIX_FMT_YUV440P; return AVCOL_RANGE_JPEG;
107                 default:                                          return AVCOL_RANGE_UNSPECIFIED;
108         }
109  }
110  
111 -void FFMS_VideoSource::SetOutputFormat(const PixelFormat *TargetFormats, int Width, int Height, int Resizer) {
112 +void FFMS_VideoSource::SetOutputFormat(const AVPixelFormat *TargetFormats, int Width, int Height, int Resizer) {
113         TargetWidth = Width;
114         TargetHeight = Height;
115         TargetResizer = Resizer;
116         TargetPixelFormats.clear();
117 -       while (*TargetFormats != PIX_FMT_NONE)
118 +       while (*TargetFormats != AV_PIX_FMT_NONE)
119                 TargetPixelFormats.push_back(*TargetFormats++);
120 -       OutputFormat = PIX_FMT_NONE;
121 +       OutputFormat = AV_PIX_FMT_NONE;
122  
123         ReAdjustOutputFormat();
124         OutputFrame(DecodeFrame);
125  }
126  
127 -void FFMS_VideoSource::SetInputFormat(int ColorSpace, int ColorRange, PixelFormat Format) {
128 +void FFMS_VideoSource::SetInputFormat(int ColorSpace, int ColorRange, AVPixelFormat Format) {
129         InputFormatOverridden = true;
130  
131 -       if (Format != PIX_FMT_NONE)
132 +       if (Format != AV_PIX_FMT_NONE)
133                 InputFormat = Format;
134         if (ColorRange != AVCOL_RANGE_UNSPECIFIED)
135                 InputColorRange = (AVColorRange)ColorRange;
136 @@ -212,7 +212,7 @@
137  }
138  
139  void FFMS_VideoSource::DetectInputFormat() {
140 -       if (InputFormat == PIX_FMT_NONE)
141 +       if (InputFormat == AV_PIX_FMT_NONE)
142                 InputFormat = CodecContext->pix_fmt;
143  
144         AVColorRange RangeFromFormat = handle_jpeg(&InputFormat);
145 @@ -239,7 +239,7 @@
146         DetectInputFormat();
147  
148         OutputFormat = FindBestPixelFormat(TargetPixelFormats, InputFormat);
149 -       if (OutputFormat == PIX_FMT_NONE) {
150 +       if (OutputFormat == AV_PIX_FMT_NONE) {
151                 ResetOutputFormat();
152                 throw FFMS_Exception(FFMS_ERROR_SCALING, FFMS_ERROR_INVALID_ARGUMENT,
153                         "No suitable output format found");
154 @@ -287,7 +287,7 @@
155         TargetHeight = -1;
156         TargetPixelFormats.clear();
157  
158 -       OutputFormat = PIX_FMT_NONE;
159 +       OutputFormat = AV_PIX_FMT_NONE;
160         OutputColorSpace = AVCOL_SPC_UNSPECIFIED;
161         OutputColorRange = AVCOL_RANGE_UNSPECIFIED;
162  
163 @@ -296,7 +296,7 @@
164  
165  void FFMS_VideoSource::ResetInputFormat() {
166         InputFormatOverridden = false;
167 -       InputFormat = PIX_FMT_NONE;
168 +       InputFormat = AV_PIX_FMT_NONE;
169         InputColorSpace = AVCOL_SPC_UNSPECIFIED;
170         InputColorRange = AVCOL_RANGE_UNSPECIFIED;
171  
172 @@ -318,9 +318,9 @@
173         VP.ColorSpace = CodecContext->colorspace;
174         VP.ColorRange = CodecContext->color_range;
175         // these pixfmt's are deprecated but still used
176 -       if (CodecContext->pix_fmt == PIX_FMT_YUVJ420P ||
177 -               CodecContext->pix_fmt == PIX_FMT_YUVJ422P ||
178 -               CodecContext->pix_fmt == PIX_FMT_YUVJ444P
179 +       if (CodecContext->pix_fmt == AV_PIX_FMT_YUVJ420P ||
180 +               CodecContext->pix_fmt == AV_PIX_FMT_YUVJ422P ||
181 +               CodecContext->pix_fmt == AV_PIX_FMT_YUVJ444P
182                 )
183                 VP.ColorRange = AVCOL_RANGE_JPEG;
184  
185 --- ffms2-2.20/src/core/videoutils.h~   2014-06-20 17:09:10.000000000 +0200
186 +++ ffms2-2.20/src/core/videoutils.h    2016-03-22 18:06:41.360081076 +0100
187 @@ -35,7 +35,7 @@
188  
189  // swscale and pp-related functions
190  int64_t GetSWSCPUFlags();
191 -SwsContext *GetSwsContext(int SrcW, int SrcH, PixelFormat SrcFormat, int SrcColorSpace, int SrcColorRange, int DstW, int DstH, PixelFormat DstFormat, int DstColorSpace, int DstColorRange, int64_t Flags);
192 +SwsContext *GetSwsContext(int SrcW, int SrcH, AVPixelFormat SrcFormat, int SrcColorSpace, int SrcColorRange, int DstW, int DstH, AVPixelFormat DstFormat, int DstColorSpace, int DstColorRange, int64_t Flags);
193  AVColorSpace GetAssumedColorSpace(int Width, int Height);
194  
195  // timebase-related functions
196 @@ -43,6 +43,6 @@
197  void CorrectTimebase(FFMS_VideoProperties *VP, FFMS_TrackTimeBase *TTimebase);
198  
199  // our implementation of avcodec_find_best_pix_fmt()
200 -PixelFormat FindBestPixelFormat(const std::vector<PixelFormat> &Dsts, PixelFormat Src);
201 +AVPixelFormat FindBestPixelFormat(const std::vector<AVPixelFormat> &Dsts, AVPixelFormat Src);
202  
203  void RegisterCustomParsers();
204 --- ffms2-2.20/src/core/videoutils.cpp~ 2014-06-20 17:09:10.000000000 +0200
205 +++ ffms2-2.20/src/core/videoutils.cpp  2016-03-22 18:07:35.707431208 +0100
206 @@ -29,7 +29,7 @@
207  #include <libavutil/opt.h>
208  }
209  
210 -SwsContext *GetSwsContext(int SrcW, int SrcH, PixelFormat SrcFormat, int SrcColorSpace, int SrcColorRange, int DstW, int DstH, PixelFormat DstFormat, int DstColorSpace, int DstColorRange, int64_t Flags) {
211 +SwsContext *GetSwsContext(int SrcW, int SrcH, AVPixelFormat SrcFormat, int SrcColorSpace, int SrcColorRange, int DstW, int DstH, AVPixelFormat DstFormat, int DstColorSpace, int DstColorRange, int64_t Flags) {
212         Flags |= SWS_FULL_CHR_H_INT | SWS_FULL_CHR_H_INP | SWS_ACCURATE_RND | SWS_BITEXACT;
213         SwsContext *Context = sws_alloc_context();
214         if (!Context) return 0;
215 @@ -123,10 +123,8 @@
216         cUNUSABLE
217  };
218  
219 -static BCSType GuessCSType(PixelFormat p) {
220 +static BCSType GuessCSType(AVPixelFormat p) {
221         // guessing the colorspace type from the name is kinda hackish but libav doesn't export this kind of metadata
222 -       if (av_pix_fmt_desc_get(p)->flags & PIX_FMT_HWACCEL)
223 -               return cUNUSABLE;
224         const char *n = av_get_pix_fmt_name(p);
225         if (strstr(n, "gray") || strstr(n, "mono") || strstr(n, "y400a"))
226                 return cGRAY;
227 @@ -138,7 +138,7 @@
228  }
229  
230  struct LossAttributes {
231 -       PixelFormat Format;
232 +       AVPixelFormat Format;
233         int ChromaUndersampling;
234         int ChromaOversampling;
235         int DepthDifference;
236 @@ -153,7 +153,7 @@
237         return depth + 1;
238  }
239  
240 -static LossAttributes CalculateLoss(PixelFormat Dst, PixelFormat Src) {
241 +static LossAttributes CalculateLoss(AVPixelFormat Dst, AVPixelFormat Src) {
242         const AVPixFmtDescriptor &SrcDesc = *av_pix_fmt_desc_get(Src);
243         const AVPixFmtDescriptor &DstDesc = *av_pix_fmt_desc_get(Dst);
244         BCSType SrcCS = GuessCSType(Src);
245 @@ -182,15 +182,15 @@
246         return Loss;
247  }
248  
249 -PixelFormat FindBestPixelFormat(const std::vector<PixelFormat> &Dsts, PixelFormat Src) {
250 +AVPixelFormat FindBestPixelFormat(const std::vector<AVPixelFormat> &Dsts, AVPixelFormat Src) {
251         // some trivial special cases to make sure there's as little conversion as possible
252         if (Dsts.empty())
253 -               return PIX_FMT_NONE;
254 +               return AV_PIX_FMT_NONE;
255         if (Dsts.size() == 1)
256                 return Dsts[0];
257  
258         // is the input in the output?
259 -       std::vector<PixelFormat>::const_iterator i = std::find(Dsts.begin(), Dsts.end(), Src);
260 +       std::vector<AVPixelFormat>::const_iterator i = std::find(Dsts.begin(), Dsts.end(), Src);
261         if (i != Dsts.end())
262                 return Src;
263  
264 --- ffms2-2.20/src/core/ffms.cpp~       2014-06-20 17:09:10.000000000 +0200
265 +++ ffms2-2.20/src/core/ffms.cpp        2016-03-22 18:08:09.401187196 +0100
266 @@ -216,7 +216,7 @@
267  FFMS_API(int) FFMS_SetOutputFormatV2(FFMS_VideoSource *V, const int *TargetFormats, int Width, int Height, int Resizer, FFMS_ErrorInfo *ErrorInfo) {
268         ClearErrorInfo(ErrorInfo);
269         try {
270 -               V->SetOutputFormat(reinterpret_cast<const PixelFormat *>(TargetFormats), Width, Height, Resizer);
271 +               V->SetOutputFormat(reinterpret_cast<const AVPixelFormat *>(TargetFormats), Width, Height, Resizer);
272         } catch (FFMS_Exception &e) {
273                 return e.CopyOut(ErrorInfo);
274         }
275 @@ -230,7 +230,7 @@
276  FFMS_API(int) FFMS_SetInputFormatV(FFMS_VideoSource *V, int ColorSpace, int ColorRange, int Format, FFMS_ErrorInfo *ErrorInfo) {
277         ClearErrorInfo(ErrorInfo);
278         try {
279 -               V->SetInputFormat(ColorSpace, ColorRange, static_cast<PixelFormat>(Format));
280 +               V->SetInputFormat(ColorSpace, ColorRange, static_cast<AVPixelFormat>(Format));
281         } catch (FFMS_Exception &e) {
282                 return e.CopyOut(ErrorInfo);
283         }
284 --- ffms2-2.20/src/vapoursynth/vapoursource.cpp~        2014-06-20 17:09:10.000000000 +0200
285 +++ ffms2-2.20/src/vapoursynth/vapoursource.cpp 2016-03-22 18:19:10.716042796 +0100
286 @@ -48,7 +48,7 @@
287  
288  static int GetNumPixFmts() {
289         int n = 0;
290 -       while (av_get_pix_fmt_name((PixelFormat)n))
291 +       while (av_get_pix_fmt_name((AVPixelFormat)n))
292                 n++;
293         return n;
294  }
295 @@ -63,7 +63,7 @@
296  static int GetColorFamily(const AVPixFmtDescriptor &desc) {
297         if (desc.nb_components == 1)
298                 return cmGray;
299 -       else if (desc.flags & PIX_FMT_RGB)
300 +       else if (desc.flags & AV_PIX_FMT_FLAG_RGB)
301                 return cmRGB;
302         else
303                 return cmYUV;
304 @@ -82,7 +82,7 @@
305                                 && desc.log2_chroma_h == f->subSamplingH)
306                                 return i;
307                 }
308 -               return PIX_FMT_NONE;
309 +               return AV_PIX_FMT_NONE;
310         } else {
311                 int colorfamily = cmYUV;
312                 if (av_pix_fmt_desc_get((AVPixelFormat) id)->nb_components == 1)
313 @@ -239,12 +239,12 @@
314         for (int i = 0; i < npixfmt; i++)
315                 if (IsRealPlanar(*av_pix_fmt_desc_get((AVPixelFormat) i)))
316                         TargetFormats.push_back(i);
317 -       TargetFormats.push_back(PIX_FMT_NONE);
318 +       TargetFormats.push_back(AV_PIX_FMT_NONE);
319  
320 -       int TargetPixelFormat = PIX_FMT_NONE;
321 +       int TargetPixelFormat = AV_PIX_FMT_NONE;
322         if (ConvertToFormat != pfNone) {
323                 TargetPixelFormat = formatConversion(ConvertToFormat, true, core, vsapi);
324 -               if (TargetPixelFormat == PIX_FMT_NONE)
325 +               if (TargetPixelFormat == AV_PIX_FMT_NONE)
326                         throw std::runtime_error(std::string("Source: Invalid output colorspace specified"));
327  
328                 TargetFormats.clear();
This page took 0.082148 seconds and 3 git commands to generate.