Main Page   Compound List   File List   Compound Members   File Members  

video_out.h

Go to the documentation of this file.
00001 /*
00002  *  video_out.h
00003  *  Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
00004  *
00005  *  This file is part of libvo, a video output library.
00006  *
00007  *  This library is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU Lesser General Public
00009  *  License as published by the Free Software Foundation; either
00010  *  version 2 of the License, or (at your option) any later version.
00011  *
00012  *  This library is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU Lesser General Public
00018  *  License along with this library; if not, write to the Free
00019  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020  *
00021  *  Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
00022  *
00023  */
00024 
00025 
00026 #ifndef __VIDEO_OUT_H__
00027 #define __VIDEO_OUT_H__
00028 
00039 typedef struct vo_frame_s vo_frame_t;
00040 
00041 
00045 typedef struct vo_instance_s vo_instance_t;
00046 
00047 
00054 struct vo_frame_s {
00055     uint8_t * base[3];
00057     void (* copy) (vo_frame_t * frame, uint8_t ** src);
00059     void (* field) (vo_frame_t * frame, int flags);
00061     void (* draw) (vo_frame_t * frame);
00063     vo_instance_t * instance;
00065 };
00066 
00067 
00077 typedef struct vo_overlay_s {
00078     vo_instance_t * instance;
00080         void (remove *) (void);
00082         int x;
00084         int y;
00086         int width;
00088         int height;
00090         void private;
00092 } vo_overlay_t;
00093 
00094 
00102 typedef char * vo_event_t;
00103 
00104 
00110 typedef char * vo_config_t;
00111 
00112 
00117 struct  vo_instance_s {
00118     vo_config_t * (* config_read) (vo_instance_t * instance);
00120     int (* config_set) (vo_instance_t * instance, config * vo_config_t);
00122     vo_event_t * (* event_check) (vo_instance_t * instance);
00124     int (* event_action) (vo_instance_t * instance, char * action);
00126     int (* setup) (vo_instance_t * instance, int width, int height);
00128     void (* close) (vo_instance_t * instance);
00130     vo_frame_t * (* get_frame) (vo_instance_t * instance, int flags);
00132     int (* overlay) (vo_overlay_t * overlay, int id); 
00138 };
00139 
00140 
00145 typedef vo_instance_t * vo_open_t (void);
00146 
00147 
00154 typedef struct vo_plugin_s {
00155     char * name;
00157     vo_open_t * open;
00159 } vo_plugin_t;
00160 
00161 
00166 void vo_accel (uint32_t accel);
00167 
00168 static inline vo_instance_t * vo_open (vo_open_t * open)
00169 {
00170     return open ();
00171 }
00172 
00173 static inline int vo_setup (vo_instance_t * instance, int width, int height)
00174 {
00175     return instance->setup (instance, width, height);
00176 }
00177 
00178 static inline void vo_close (vo_instance_t * instance)
00179 {
00180     if (instance->close)
00181         instance->close (instance);
00182 }
00183 
00184 #define VO_TOP_FIELD 1
00185 #define VO_BOTTOM_FIELD 2
00186 #define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD)
00187 #define VO_PREDICTION_FLAG 4
00188 
00189 static inline vo_frame_t * vo_get_frame (vo_instance_t * instance, int flags)
00190 {
00191     return instance->get_frame (instance, flags);
00192 }
00193 
00194 static inline void vo_field (vo_frame_t * frame, int flags)
00195 {
00196     if (frame->field)
00197         frame->field (frame, flags);
00198 }
00199 
00200 static inline void vo_draw (vo_frame_t * frame)
00201 {
00202     frame->draw (frame);
00203 }
00204 
00205 #endif

Generated at Sat Feb 24 12:06:27 2001 for libvo by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001