changeset 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 fa9422a466e5
children 1796373d7925
files libmenu/vf_menu.c libmpcodecs/vf_expand.c
diffstat 2 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmenu/vf_menu.c	Thu Jan 04 16:30:06 2007 +0000
+++ b/libmenu/vf_menu.c	Thu Jan 04 16:46:15 2007 +0000
@@ -37,6 +37,7 @@
 struct vf_priv_s {
   menu_t* root;
   menu_t* current;
+  int passthrough;
 };
 
 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts);
@@ -178,6 +179,13 @@
 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
   mp_image_t *dmpi = NULL;
 
+  if (vf->priv->passthrough) {
+    dmpi=vf_get_image(vf->next, IMGFMT_MPEGPES, MP_IMGTYPE_EXPORT,
+                      0, mpi->w, mpi->h);
+    dmpi->planes[0]=mpi->planes[0];
+    return vf_next_put_image(vf,dmpi, pts);
+  }
+
   if(vf->priv->current->show 
   || (vf->priv->current->parent && vf->priv->current->parent->show)) {
   // Close all menu who requested it
@@ -257,8 +265,15 @@
     load_font_ft(width,height);
   }
 #endif
+  if(outfmt == IMGFMT_MPEGPES)
+    vf->priv->passthrough = 1;
   return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
+
+static int query_format(struct vf_instance_s* vf, unsigned int fmt){
+  return (vf_next_query_format(vf,fmt));
+}
+
 static int open(vf_instance_t *vf, char* args){
   if(!st_priv) {
     st_priv = calloc(1,sizeof(struct vf_priv_s));
@@ -273,6 +288,7 @@
   }
 
   vf->config = config;
+  vf->query_format=query_format;
   vf->put_image = put_image;
   vf->get_image = get_image;
   vf->uninit=uninit;
--- a/libmpcodecs/vf_expand.c	Thu Jan 04 16:30:06 2007 +0000
+++ b/libmpcodecs/vf_expand.c	Thu Jan 04 16:46:15 2007 +0000
@@ -31,6 +31,7 @@
     double aspect;
     int round;
     unsigned char* fb_ptr;
+    int passthrough;
     int first_slice;
 } vf_priv_dflt = {
   -1,-1,
@@ -39,6 +40,7 @@
   0.,
   1,
   NULL,
+  0,
   0
 };
 
@@ -170,6 +172,10 @@
 static int config(struct vf_instance_s* vf,
         int width, int height, int d_width, int d_height,
 	unsigned int flags, unsigned int outfmt){
+    if(outfmt == IMGFMT_MPEGPES) {
+      vf->priv->passthrough = 1;
+      return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
+    }
     if (outfmt == IMGFMT_IF09) return 0;
     // calculate the missing parameters:
 #if 0
@@ -332,6 +338,13 @@
 }
 
 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
+    if (vf->priv->passthrough) {
+      mp_image_t *dmpi = vf_get_image(vf->next, IMGFMT_MPEGPES,
+                                      MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h);
+      dmpi->planes[0]=mpi->planes[0];
+      return vf_next_put_image(vf,dmpi, pts);
+    }
+
     if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){
 	vf->dmpi=mpi->priv;
 	if(!vf->dmpi) { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; }
@@ -389,9 +402,14 @@
     return vf_next_control(vf,request,data);
 }
 
+static int query_format(struct vf_instance_s* vf, unsigned int fmt){
+  return (vf_next_query_format(vf,fmt));
+}
+
 static int open(vf_instance_t *vf, char* args){
     vf->config=config;
     vf->control=control;
+    vf->query_format=query_format;
     vf->start_slice=start_slice;
     vf->draw_slice=draw_slice;
     vf->get_image=get_image;