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_core.cpp | |
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_core.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp index d33af650..79f353e1 100644 --- a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp +++ b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp @@ -187,6 +187,26 @@ bool MediaCore_FFmpeg::convertFFmpegToAudioFormat(SampleFormat ffmpegFormat, aud return true; } +bool MediaCore_FFmpeg::convertVideoFrameFormatToFFmpeg(videoFrameFormat_t format, enum PixelFormat *ffmpegFormat) const { + switch (format) { + case FRAME_FORMAT_RGB: + *ffmpegFormat = PIX_FMT_RGB24; + break; + case FRAME_FORMAT_RGBA: + *ffmpegFormat = PIX_FMT_RGB32; //PIX_FMT_RGBA; + break; + case FRAME_FORMAT_BGR: + *ffmpegFormat = PIX_FMT_BGR24; + break; + case FRAME_FORMAT_BGRA: + *ffmpegFormat = PIX_FMT_BGR32; //PIX_FMT_BGRA; + break; + default: + return false; + } + return true; +} + /** * UTF-8 Filename wrapper based on: * http://www.mail-archive.com/libav-user@mplayerhq.hu/msg02460.html |