00001 // -*- Mode: c++ -*- 00002 00003 #ifdef USING_XVMC 00004 00005 #ifndef __OSD_XVMC_H__ 00006 #define __OSD_XVMC_H__ 00007 00008 #include "videooutbase.h" 00009 #include <X11/Xatom.h> 00010 #include <X11/Xutil.h> 00011 #include <X11/extensions/Xvlib.h> 00012 #include <X11/extensions/XShm.h> 00013 #include <X11/extensions/Xv.h> 00014 #include "XvMCSurfaceTypes.h" 00015 00016 class XvMCOSD 00017 { 00018 public: 00019 XvMCOSD() { ; } // dummy 00020 00021 XvMCOSD(Display *XJ_disp, int xv_port, 00022 int surface_type_id, int xvmc_surf_flags); 00023 00024 void CreateBuffer(XvMCContext &xvmc_ctx, int XJ_width, int XJ_height); 00025 void DeleteBuffer(); 00026 void CompositeOSD(VideoFrame* frame, VideoFrame* osdframe=NULL); 00027 00028 VideoFrame *OSDFrame() 00029 { 00030 tmpframe.codec = 00031 (GUID_IA44_PACKED == osd_subpict_info.id) ? FMT_IA44 : FMT_AI44; 00032 tmpframe.buf = (unsigned char*) (osd_xv_image->data); 00033 return &tmpframe; 00034 } 00035 00036 void SetRevision(int rev) { revision = rev; } 00037 00038 int GetRevision() { return revision; } 00039 bool NeedFrame(); 00040 bool IsValid(); 00041 public: 00042 // XvMC OSD info 00043 Display *XJ_disp; 00044 int XJ_width, XJ_height; 00045 int xv_port; 00046 XShmSegmentInfo XJ_osd_shm_info; 00047 unsigned char *osd_palette; 00048 XvImage *osd_xv_image; 00049 XvMCSubpicture osd_subpict; 00050 XvImageFormatValues osd_subpict_info; 00051 int osd_subpict_mode; 00052 int osd_subpict_clear_color; 00053 bool osd_subpict_alloc; 00054 00055 VideoFrame tmpframe; 00056 int revision; 00057 }; 00058 00059 #endif // __OSD_XVMC_H__ 00060 00061 #endif // USING_XVMC
1.5.5