comparison libmenu/vf_menu.c @ 21803:3acc4b00bcc6

allows OSD menu to be displayed when using MPEG PES video out
author ben
date Thu, 04 Jan 2007 16:46:15 +0000
parents 87c339558bc1
children 85f8a5ce6e91
comparison
equal deleted inserted replaced
21802:fa9422a466e5 21803:3acc4b00bcc6
35 int attribute_used menu_startup = 0; 35 int attribute_used menu_startup = 0;
36 36
37 struct vf_priv_s { 37 struct vf_priv_s {
38 menu_t* root; 38 menu_t* root;
39 menu_t* current; 39 menu_t* current;
40 int passthrough;
40 }; 41 };
41 42
42 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts); 43 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts);
43 44
44 static mp_image_t* alloc_mpi(int w, int h, uint32_t fmt) { 45 static mp_image_t* alloc_mpi(int w, int h, uint32_t fmt) {
176 177
177 178
178 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ 179 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
179 mp_image_t *dmpi = NULL; 180 mp_image_t *dmpi = NULL;
180 181
182 if (vf->priv->passthrough) {
183 dmpi=vf_get_image(vf->next, IMGFMT_MPEGPES, MP_IMGTYPE_EXPORT,
184 0, mpi->w, mpi->h);
185 dmpi->planes[0]=mpi->planes[0];
186 return vf_next_put_image(vf,dmpi, pts);
187 }
188
181 if(vf->priv->current->show 189 if(vf->priv->current->show
182 || (vf->priv->current->parent && vf->priv->current->parent->show)) { 190 || (vf->priv->current->parent && vf->priv->current->parent->show)) {
183 // Close all menu who requested it 191 // Close all menu who requested it
184 while(vf->priv->current->cl && vf->priv->current != vf->priv->root) { 192 while(vf->priv->current->cl && vf->priv->current != vf->priv->root) {
185 menu_t* m = vf->priv->current; 193 menu_t* m = vf->priv->current;
255 if (force_load_font) { 263 if (force_load_font) {
256 force_load_font = 0; 264 force_load_font = 0;
257 load_font_ft(width,height); 265 load_font_ft(width,height);
258 } 266 }
259 #endif 267 #endif
268 if(outfmt == IMGFMT_MPEGPES)
269 vf->priv->passthrough = 1;
260 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); 270 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
261 } 271 }
272
273 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
274 return (vf_next_query_format(vf,fmt));
275 }
276
262 static int open(vf_instance_t *vf, char* args){ 277 static int open(vf_instance_t *vf, char* args){
263 if(!st_priv) { 278 if(!st_priv) {
264 st_priv = calloc(1,sizeof(struct vf_priv_s)); 279 st_priv = calloc(1,sizeof(struct vf_priv_s));
265 st_priv->root = st_priv->current = menu_open(args); 280 st_priv->root = st_priv->current = menu_open(args);
266 if(!st_priv->current) { 281 if(!st_priv->current) {
271 st_priv->root->show = menu_startup; 286 st_priv->root->show = menu_startup;
272 mp_input_add_cmd_filter((mp_input_cmd_filter)cmd_filter,st_priv); 287 mp_input_add_cmd_filter((mp_input_cmd_filter)cmd_filter,st_priv);
273 } 288 }
274 289
275 vf->config = config; 290 vf->config = config;
291 vf->query_format=query_format;
276 vf->put_image = put_image; 292 vf->put_image = put_image;
277 vf->get_image = get_image; 293 vf->get_image = get_image;
278 vf->uninit=uninit; 294 vf->uninit=uninit;
279 vf->priv=st_priv; 295 vf->priv=st_priv;
280 go2pause=0; 296 go2pause=0;