Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages
codec.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2001 by Norman Kraemer 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 __CS_IVIDEO_CODEC_H__ 00020 #define __CS_IVIDEO_CODEC_H__ 00021 00024 /* 00025 * This is an interface for playing video. 00026 */ 00027 00028 #include "csutil/scf.h" 00029 00030 struct iFile; 00031 struct iStream; 00032 struct iVideoStream; 00033 struct iAudioStream; 00034 struct iCodec; 00035 struct iTextureHandle; 00036 00040 enum csStreamFormatCap 00041 { 00045 CS_POS_BY_FRAME = 1, 00049 CS_POS_BY_TIME = 2, 00053 CS_DECODE_SPAN = 4, 00057 CS_DYNAMIC_FRAMESIZE = 8 00058 }; 00059 00060 #define CS_STREAMTYPE_AUDIO 1 00061 #define CS_STREAMTYPE_VIDEO 2 00062 #define CS_STREAMTYPE_MIDI 3 00063 #define CS_STREAMTYPE_TEXT 4 00064 00068 struct csStreamDescription 00069 { 00073 uint16 type; 00077 char codec[64]; 00081 const char *name; 00082 }; 00083 00087 struct csVideoStreamDescription : public csStreamDescription 00088 { 00092 int8 colordepth; 00096 int32 framecount; 00100 int width, height; 00104 float framerate; 00108 int32 duration; 00109 }; 00110 00114 struct csAudioStreamDescription : public csStreamDescription 00115 { 00116 uint16 formattag; 00117 uint16 channels; 00118 uint32 samplespersecond; 00119 uint16 bitspersample; 00123 uint32 duration; 00124 }; 00125 00126 SCF_VERSION (iStreamIterator, 0, 0, 1); 00127 struct iStreamIterator : public iBase 00128 { 00129 virtual bool HasNext () = 0; 00130 virtual iStream *Next () = 0; 00131 }; 00132 00133 SCF_VERSION (iStreamFormat, 0, 0, 1); 00134 00138 struct iStreamFormat : public iBase 00139 { 00143 virtual void GetCaps (csStreamFormatCap &caps) = 0; 00147 virtual iStreamIterator* GetStreamIterator () = 0; 00151 virtual void Select (iAudioStream *pAudio, iVideoStream *pVideo) = 0; 00158 virtual void NextFrame () = 0; 00162 virtual bool Load (iFile *pVideoData) = 0; 00168 virtual void Unload () = 0; 00169 }; 00170 00171 SCF_VERSION (iStream, 0, 0, 1); 00172 00176 struct iStream : public iBase 00177 { 00181 virtual void GetStreamDescription (csStreamDescription &desc) = 0; 00187 virtual bool GotoFrame (uint32 frameindex) = 0; 00191 virtual bool GotoTime (uint32 timeindex) = 0; 00196 virtual bool SetPlayMethod (bool bTimeSynced) = 0; 00201 virtual void NextFrame () = 0; 00202 }; 00203 00204 SCF_VERSION (iVideoStream, 0, 0, 1); 00205 00209 struct iVideoStream : public iStream 00210 { 00214 virtual void GetStreamDescription (csVideoStreamDescription &desc) = 0; 00218 virtual bool SetRect (int x, int y, int w, int h) = 0; 00223 virtual bool SetFXMode (uint mode) = 0; 00227 virtual iTextureHandle* NextFrameGetTexture () = 0; 00228 00229 }; 00230 00231 SCF_VERSION (iAudioStream, 0, 0, 1); 00232 00236 struct iAudioStream : public iStream 00237 { 00241 virtual void GetStreamDescription (csAudioStreamDescription &desc) = 0; 00242 }; 00243 00252 #define CS_CODECFORMAT_RGB_CHANNEL 1 00253 #define CS_CODECFORMAT_RGBA_CHANNEL 2 00254 #define CS_CODECFORMAT_YUV_CHANNEL 3 00255 #define CS_CODECFORMAT_RGB_INTERLEAVED 4 00256 #define CS_CODECFORMAT_RGBA_INTERLEAVED 5 00257 #define CS_CODECFORMAT_YUV_INTERLEAVED 6 00258 00260 #define CS_CODECFORMAT_PCM 00261 00265 struct csCodecDescription 00266 { 00270 char codec[64]; 00274 bool bEncode; 00278 bool bDecode; 00282 uint16 decodeoutput; 00286 uint16 encodeinput; 00287 }; 00288 00289 #endif // __CS_IVIDEO_CODEC_H__
Generated for Crystal Space by doxygen 1.4.4