* include/video_output.h, ALL: changed api for vout_Request()/vout_Create() to be...
[vlc.git] / src / video_output / vout_pictures.c
index a7ff57f..b3be49e 100644 (file)
@@ -286,24 +286,18 @@ void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
 picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
                                                        subpicture_t *p_subpic )
 {
-    video_format_t fmt;
     int i_scale_width, i_scale_height;
 
     if( p_pic == NULL )
     {
         /* XXX: subtitles */
-
         return NULL;
     }
 
-    fmt.i_aspect = p_vout->output.i_aspect;
-    fmt.i_chroma = p_vout->output.i_chroma;
-    fmt.i_width = p_vout->output.i_width;
-    fmt.i_height = p_vout->output.i_height;
-    fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width;
-    fmt.i_sar_den = VOUT_ASPECT_FACTOR;
-    i_scale_width = p_vout->output.i_width * 1000 / p_vout->render.i_width;
-    i_scale_height = p_vout->output.i_height * 1000 / p_vout->render.i_height;
+    i_scale_width = p_vout->fmt_out.i_visible_width * 1000 /
+        p_vout->fmt_in.i_visible_width;
+    i_scale_height = p_vout->fmt_out.i_visible_height * 1000 /
+        p_vout->fmt_in.i_visible_height;
 
     if( p_pic->i_type == DIRECT_PICTURE )
     {
@@ -320,7 +314,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
                  * subtitles. */
                 vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic );
 
-                spu_RenderSubpictures( p_vout->p_spu, &fmt,
+                spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out,
                                        PP_OUTPUTPICTURE[0], p_pic, p_subpic,
                                        i_scale_width, i_scale_height );
 
@@ -336,8 +330,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
         /* Picture is in a direct buffer but isn't used by the
          * decoder. We can safely render subtitles on it and
          * display it. */
-        spu_RenderSubpictures( p_vout->p_spu, &fmt, p_pic, p_pic, p_subpic,
-                               i_scale_width, i_scale_height );
+        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, p_pic, p_pic,
+                               p_subpic, i_scale_width, i_scale_height );
 
         return p_pic;
     }
@@ -355,8 +349,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
                 return NULL;
 
         vout_CopyPicture( p_vout, PP_OUTPUTPICTURE[0], p_pic );
-        spu_RenderSubpictures( p_vout->p_spu, &fmt, PP_OUTPUTPICTURE[0],
-                               p_pic, p_subpic, i_scale_width, i_scale_height);
+        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out,
+                               PP_OUTPUTPICTURE[0], p_pic,
+                               p_subpic, i_scale_width, i_scale_height );
 
         if( PP_OUTPUTPICTURE[0]->pf_unlock )
             PP_OUTPUTPICTURE[0]->pf_unlock( p_vout, PP_OUTPUTPICTURE[0] );
@@ -378,10 +373,10 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
         if( p_tmp_pic->i_status == FREE_PICTURE )
         {
             vout_AllocatePicture( VLC_OBJECT(p_vout),
-                                  p_tmp_pic, p_vout->output.i_chroma,
-                                  p_vout->output.i_width,
-                                  p_vout->output.i_height,
-                                  p_vout->output.i_aspect );
+                                  p_tmp_pic, p_vout->fmt_out.i_chroma,
+                                  p_vout->fmt_out.i_width,
+                                  p_vout->fmt_out.i_height,
+                                  p_vout->fmt_out.i_aspect );
             p_tmp_pic->i_type = MEMORY_PICTURE;
             p_tmp_pic->i_status = RESERVED_PICTURE;
         }
@@ -390,7 +385,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
         p_vout->chroma.pf_convert( p_vout, p_pic, p_tmp_pic );
 
         /* Render subpictures on the first direct buffer */
-        spu_RenderSubpictures( p_vout->p_spu, &fmt, p_tmp_pic,
+        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out, p_tmp_pic,
                                p_tmp_pic, p_subpic,
                                i_scale_width, i_scale_height );
 
@@ -410,9 +405,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
         p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
 
         /* Render subpictures on the first direct buffer */
-        spu_RenderSubpictures( p_vout->p_spu, &fmt, &p_vout->p_picture[0],
-                               &p_vout->p_picture[0], p_subpic,
-                               i_scale_width, i_scale_height );
+        spu_RenderSubpictures( p_vout->p_spu, &p_vout->fmt_out,
+                               &p_vout->p_picture[0], &p_vout->p_picture[0],
+                               p_subpic, i_scale_width, i_scale_height );
     }
 
     if( p_vout->p_picture[0].pf_unlock )
@@ -435,7 +430,6 @@ void vout_PlacePicture( vout_thread_t *p_vout,
     if( (i_width <= 0) || (i_height <=0) )
     {
         *pi_width = *pi_height = *pi_x = *pi_y = 0;
-
         return;
     }