00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __IVIDEO_CODEC_H__
00020 #define __IVIDEO_CODEC_H__
00021
00022
00023
00024
00025
00026 #include "csutil/scf.h"
00027
00028 struct iMaterialHandle;
00029 struct iFile;
00030 struct iStream;
00031 struct iVideoStream;
00032 struct iAudioStream;
00033 struct iCodec;
00034
00038 enum csStreamFormatCap
00039 {
00043 CS_POS_BY_FRAME = 1,
00047 CS_POS_BY_TIME = 2,
00051 CS_DECODE_SPAN = 4,
00055 CS_DYNAMIC_FRAMESIZE = 8
00056 };
00057
00058 #define CS_STREAMTYPE_AUDIO 1
00059 #define CS_STREAMTYPE_VIDEO 2
00060 #define CS_STREAMTYPE_MIDI 3
00061 #define CS_STREAMTYPE_TEXT 4
00062
00066 struct csStreamDescription
00067 {
00071 UShort type;
00075 char codec[64];
00079 const char *name;
00080 };
00081
00085 struct csVideoStreamDescription : public csStreamDescription
00086 {
00090 SByte colordepth;
00094 SLong framecount;
00098 int width, height;
00102 float framerate;
00106 SLong duration;
00107 };
00108
00112 struct csAudioStreamDescription : public csStreamDescription
00113 {
00114 UShort formattag;
00115 UShort channels;
00116 ULong samplespersecond;
00117 UShort bitspersample;
00121 ULong duration;
00122 };
00123
00124 SCF_VERSION (iStreamIterator, 0, 0, 1);
00125 struct iStreamIterator : public iBase
00126 {
00127 virtual bool HasNext () = 0;
00128 virtual iStream *GetNext () = 0;
00129 };
00130
00131 SCF_VERSION (iStreamFormat, 0, 0, 1);
00132
00136 struct iStreamFormat : public iBase
00137 {
00141 virtual void GetCaps (csStreamFormatCap &caps) = 0;
00145 virtual iStreamIterator* GetStreamIterator () = 0;
00149 virtual void Select (iAudioStream *pAudio, iVideoStream *pVideo) = 0;
00156 virtual void NextFrame () = 0;
00160 virtual bool Load (iFile *pVideoData) = 0;
00166 virtual void Unload () = 0;
00167 };
00168
00169 SCF_VERSION (iStream, 0, 0, 1);
00170
00174 struct iStream : public iBase
00175 {
00179 virtual void GetStreamDescription (csStreamDescription &desc) = 0;
00185 virtual bool GotoFrame (ULong frameindex) = 0;
00189 virtual bool GotoTime (ULong timeindex) = 0;
00194 virtual bool SetPlayMethod (bool bTimeSynced) = 0;
00199 virtual void NextFrame () = 0;
00200 };
00201
00202 SCF_VERSION (iVideoStream, 0, 0, 1);
00203
00207 struct iVideoStream : public iStream
00208 {
00212 virtual void GetStreamDescription (csVideoStreamDescription &desc) = 0;
00216 virtual bool SetRect (int x, int y, int w, int h) = 0;
00221 virtual bool SetFXMode (UInt mode) = 0;
00225 virtual iMaterialHandle* NextFrameGetMaterial () = 0;
00226
00227 };
00228
00229 SCF_VERSION (iAudioStream, 0, 0, 1);
00230
00234 struct iAudioStream : public iStream
00235 {
00239 virtual void GetStreamDescription (csAudioStreamDescription &desc) = 0;
00240 };
00241
00250 #define CS_CODECFORMAT_RGB_CHANNEL 1
00251 #define CS_CODECFORMAT_RGBA_CHANNEL 2
00252 #define CS_CODECFORMAT_YUV_CHANNEL 3
00253 #define CS_CODECFORMAT_RGB_INTERLEAVED 4
00254 #define CS_CODECFORMAT_RGBA_INTERLEAVED 5
00255 #define CS_CODECFORMAT_YUV_INTERLEAVED 6
00256
00258 #define CS_CODECFORMAT_PCM
00259
00263 struct csCodecDescription
00264 {
00268 char codec[64];
00272 bool bEncode;
00276 bool bDecode;
00280 UShort decodeoutput;
00284 UShort encodeinput;
00285 };
00286
00287 #endif // __IVIDEO_CODEC_H__