00001 // -*- Mode: c++ -*- 00002 00003 #ifndef _OSD_CHROMAKEY_H_ 00004 #define _OSD_CHROMAKEY_H_ 00005 00006 #include "videoout_xv.h" 00007 00008 class ChromaKeyOSD 00009 { 00010 public: 00011 ChromaKeyOSD(VideoOutputXv *vo) : 00012 videoOutput(vo), current(-1), revision(-1) 00013 { 00014 bzero(vf, 2 * sizeof(VideoFrame)); 00015 bzero(img, 2 * sizeof(XImage*)); 00016 bzero(shm_infos, 2 * sizeof(XShmSegmentInfo)); 00017 } 00018 00019 bool ProcessOSD(OSD *osd); 00020 void AllocImage(int i); 00021 void FreeImage(int i); 00022 void Clear(int i); 00023 void Reset(void) { current = -1; revision = -1; } 00024 00025 XImage *GetImage() { return (current < 0) ? NULL : img[current]; } 00026 00027 private: 00028 void Reinit(int i); 00029 00030 VideoOutputXv *videoOutput; 00031 int current; 00032 int revision; 00033 VideoFrame vf[2]; 00034 XImage *img[2]; 00035 XShmSegmentInfo shm_infos[2]; 00036 }; 00037 00038 #endif // _OSD_CHROMAKEY_H_
1.5.5