diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-12-22 18:21:41 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-12-22 18:21:41 +0000 |
commit | 1822c266c552a76cdbe75288515b5abfa9a41d5d (patch) | |
tree | 7c522487d3c1bdb54ec1d3fcb1220f6cc1abddd9 /mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_video_decode.h | |
parent | 71e7b0bb663197c4bbc4aad55082dd6424e0fb33 (diff) | |
download | usdx-1822c266c552a76cdbe75288515b5abfa9a41d5d.tar.gz usdx-1822c266c552a76cdbe75288515b5abfa9a41d5d.tar.xz usdx-1822c266c552a76cdbe75288515b5abfa9a41d5d.zip |
support for video pixel format selection
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2767 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_video_decode.h | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_video_decode.h b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_video_decode.h index 9b0df889..addf2a82 100644 --- a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_video_decode.h +++ b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_video_decode.h @@ -32,25 +32,6 @@ //#define DEBUG_DISPLAY //#define DEBUG_FRAMES -// use BGR-format for accelerated colorspace conversion with swscale -#ifdef USE_SWSCALE -# define PIXEL_FMT_BGR -#endif - -#define PIXEL_FMT_BGR - -#ifdef PIXEL_FMT_BGR -# define PIXEL_FMT_FFMPEG PIX_FMT_BGR24 -# define PIXEL_FMT_SIZE 3 -// looks strange on linux -//# define PIXEL_FMT_FFMPEG PIX_FMT_BGR32; -//# define PIXEL_FMT_SIZE 4; -#else -// looks strange on linux: -# define PIXEL_FMT_FFMPEG PIX_FMT_RGB24 -# define PIXEL_FMT_SIZE 3 -#endif - extern const videoDecoderInfo_t videoDecoderInfo; class FFmpegVideoDecodeStream : public VideoDecodeStream { @@ -68,6 +49,9 @@ private: AVFrame *_avFrame; AVFrame *_avFrameRGB; + + videoFrameFormat_t _frameFormat; + enum PixelFormat _pixelFormat; uint8_t *_frameBuffer; //**< stores a FFmpeg video frame bool _frameTexValid; //**< if true, fFrameTex contains the current frame @@ -87,7 +71,7 @@ private: bool decodeFrame(); void synchronizeTime(AVFrame *frame, double &pts); - bool _open(const IPath &filename); + bool _open(const IPath &filename, videoFrameFormat_t format); void close(); public: @@ -95,7 +79,7 @@ public: close(); } - static FFmpegVideoDecodeStream* open(const IPath &filename); + static FFmpegVideoDecodeStream* open(const IPath &filename, videoFrameFormat_t format); virtual void setLoop(bool enable); virtual bool getLoop(); @@ -105,8 +89,9 @@ public: virtual int getFrameWidth(); virtual int getFrameHeight(); - virtual double getFrameAspect(); + virtual videoFrameFormat_t getFrameFormat(); + virtual uint8_t* getFrame(long double time); }; |