![]()
|
codec.h00001 /* 00002 Copyright (C) 2001 by Norman Krämer 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __IVIDEO_CODEC_H__ 00020 #define __IVIDEO_CODEC_H__ 00021 00022 /* 00023 * This is an interface for playing video. 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 uint16 type; 00075 char codec[64]; 00079 const char *name; 00080 }; 00081 00085 struct csVideoStreamDescription : public csStreamDescription 00086 { 00090 int8 colordepth; 00094 int32 framecount; 00098 int width, height; 00102 float framerate; 00106 int32 duration; 00107 }; 00108 00112 struct csAudioStreamDescription : public csStreamDescription 00113 { 00114 uint16 formattag; 00115 uint16 channels; 00116 uint32 samplespersecond; 00117 uint16 bitspersample; 00121 uint32 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 (uint32 frameindex) = 0; 00189 virtual bool GotoTime (uint32 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 uint16 decodeoutput; 00284 uint16 encodeinput; 00285 }; 00286 00287 #endif // __IVIDEO_CODEC_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |