summaryrefslogtreecommitdiff
path: root/decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder.h')
-rw-r--r--decoder.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/decoder.h b/decoder.h
index f38870e..f503402 100644
--- a/decoder.h
+++ b/decoder.h
@@ -10,9 +10,20 @@
extern "C"
{
#ifdef HAVE_FFMPEG_STATIC
-# include <avcodec.h>
+ #include <avcodec.h>
+ #ifdef USE_SWSCALE
+ #include <swscale.h>
+ #endif
+#elif defined USE_NEW_FFMPEG_HEADERS
+ #include <libavcodec/avcodec.h>
+ #ifdef USE_SWSCALE
+ #include <libswscale/swscale.h>
+ #endif
#else
-# include <ffmpeg/avcodec.h>
+ #include <ffmpeg/avcodec.h>
+ #ifdef USE_SWSCALE
+ #include <ffmpeg/swscale.h>
+ #endif
#endif
}
@@ -22,19 +33,22 @@ private:
AVCodecContext * m_Context;
AVFrame * m_PicDecoded;
AVFrame * m_PicResample;
- AVFrame * m_PicConvert;
unsigned char * m_BufferResample;
+#ifndef USE_SWSCALE
+ AVFrame * m_PicConvert;
unsigned char * m_BufferConvert;
+#endif
int m_Width;
int m_Height;
public:
int Open();
int Close();
int Decode(unsigned char * data, int length);
- int Resample(int width, int height);
- int ConvertToRGB();
+ int Resample(int width, int height, bool ConvertToRGB);
AVFrame * PicResample() { return m_PicResample; }
+#ifndef USE_SWSCALE
AVFrame * PicConvert() { return m_PicConvert; }
+#endif
double AspectRatio();
};