@@ -103,15 +103,9 @@ class FFmpegSourceVideoProvider final : public VideoProvider, FFmpegSourceProvid
103
103
104
104
int GetFrameCount () const override { return VideoInfo->NumFrames ; }
105
105
106
- #if FFMS_VERSION >= ((2 << 24) | (24 << 16) | (0 << 8) | 0)
107
106
int GetWidth () const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90 ) ? Height : Width; }
108
107
int GetHeight () const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90 ) ? Width : Height; }
109
108
double GetDAR () const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90 ) ? 1 / DAR : DAR; }
110
- #else
111
- int GetWidth () const override { return Width; }
112
- int GetHeight () const override { return Height; }
113
- double GetDAR () const override { return DAR; }
114
- #endif
115
109
116
110
agi::vfr::Framerate GetFPS () const override { return Timecodes; }
117
111
std::string GetColorSpace () const override { return ColorSpace; }
@@ -230,10 +224,6 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
230
224
231
225
// set thread count
232
226
int Threads = OPT_GET (" Provider/Video/FFmpegSource/Decoding Threads" )->GetInt ();
233
- #if FFMS_VERSION < ((2 << 24) | (30 << 16) | (0 << 8) | 0)
234
- if (FFMS_GetVersion () < ((2 << 24 ) | (17 << 16 ) | (2 << 8 ) | 1 ) && FFMS_GetSourceType (Index) == FFMS_SOURCE_LAVF)
235
- Threads = 1 ;
236
- #endif
237
227
238
228
// set seekmode
239
229
// TODO: give this its own option?
@@ -323,7 +313,7 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
323
313
out.width = Width;
324
314
out.height = Height;
325
315
out.pitch = frame->Linesize [0 ];
326
- # if FFMS_VERSION >= ((2 << 24) | (31 << 16) | (0 << 8) | 0)
316
+
327
317
// Handle flip
328
318
if (VideoInfo->Flip > 0 )
329
319
for (int x = 0 ; x < Height; ++x)
@@ -336,8 +326,7 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
336
326
for (int y = 0 ; y < Width; ++y)
337
327
for (int ch = 0 ; ch < 4 ; ++ch)
338
328
std::swap (out.data [frame->Linesize [0 ] * x + 4 * y + ch], out.data [frame->Linesize [0 ] * (Height - 1 - x) + 4 * y + ch]);
339
- #endif
340
- #if FFMS_VERSION >= ((2 << 24) | (24 << 16) | (0 << 8) | 0)
329
+
341
330
// Handle rotation
342
331
if (VideoInfo->Rotation % 360 == 180 || VideoInfo->Rotation % 360 == -180 ) {
343
332
std::vector<unsigned char > data (std::move (out.data ));
@@ -370,7 +359,6 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
370
359
out.height = Width;
371
360
out.pitch = 4 * Height;
372
361
}
373
- #endif
374
362
}
375
363
}
376
364
0 commit comments