00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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