From 1822c266c552a76cdbe75288515b5abfa9a41d5d Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 22 Dec 2010 18:21:41 +0000 Subject: 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 --- mediaplugin/src/mediaplugins/include/core/plugin_core.h | 15 ++++++++++++++- .../src/mediaplugins/include/core/plugin_video_decode.h | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'mediaplugin/src/mediaplugins/include/core') diff --git a/mediaplugin/src/mediaplugins/include/core/plugin_core.h b/mediaplugin/src/mediaplugins/include/core/plugin_core.h index acbe0f4a..c7d078b0 100644 --- a/mediaplugin/src/mediaplugins/include/core/plugin_core.h +++ b/mediaplugin/src/mediaplugins/include/core/plugin_core.h @@ -203,17 +203,30 @@ typedef struct audioConverterInfo_t { double PLUGIN_CALL (*getRatio)(audioConvertStream_t *stream); } audioConverterInfo_t; +typedef enum videoFrameFormat_t { + FRAME_FORMAT_UNKNOWN, + FRAME_FORMAT_RGB, // packed RGB 24bpp (R:8,G:8,B:8) + FRAME_FORMAT_RGBA, // packed RGBA 32bpp (R:8,G:8,B:8,A:8) + FRAME_FORMAT_BGR, // packed RGB 24bpp (B:8,G:8,R:8) + FRAME_FORMAT_BGRA, // packed BGRA 32bpp (B:8,G:8,R:8,A:8) +} videoFrameFormat_t; + +const int videoFrameFormatSize[5] = { + -1, 3, 4, 3, 4 +}; + typedef struct videoFrameInfo_t { int width; int height; double aspect; + videoFrameFormat_t format; } videoFrameInfo_t; typedef struct videoDecoderInfo_t { int priority; BOOL PLUGIN_CALL (*init)(); BOOL PLUGIN_CALL (*finalize)(); - videoDecodeStream_t* PLUGIN_CALL (*open)(const char *filename); + videoDecodeStream_t* PLUGIN_CALL (*open)(const char *filename, videoFrameFormat_t format); void PLUGIN_CALL (*close)(videoDecodeStream_t *stream); void PLUGIN_CALL (*setLoop)(videoDecodeStream_t *stream, BOOL enable); BOOL PLUGIN_CALL (*getLoop)(videoDecodeStream_t *stream); diff --git a/mediaplugin/src/mediaplugins/include/core/plugin_video_decode.h b/mediaplugin/src/mediaplugins/include/core/plugin_video_decode.h index 6403852f..a96daf6a 100644 --- a/mediaplugin/src/mediaplugins/include/core/plugin_video_decode.h +++ b/mediaplugin/src/mediaplugins/include/core/plugin_video_decode.h @@ -43,8 +43,9 @@ public: virtual int getFrameWidth() = 0; virtual int getFrameHeight() = 0; - virtual double getFrameAspect() = 0; + virtual videoFrameFormat_t getFrameFormat() = 0; + virtual uint8_t* getFrame(long double time) = 0; }; -- cgit v1.2.3