[Mplayer-cvslog] CVS: main/libvo video_out.h,1.48,1.49 vo_yuv4mpeg.c,1.13,1.14

Arpi of Ize arpi at mplayerhq.hu
Sat Dec 14 18:12:43 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv7984/libvo

Modified Files:
	video_out.h vo_yuv4mpeg.c 
Log Message:
notice vo driver about skipped/dropped frames
patch by Alvaro Lopes <alvieboy at alvie.com>


Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- video_out.h	11 Nov 2002 15:20:25 -0000	1.48
+++ video_out.h	14 Dec 2002 17:12:40 -0000	1.49
@@ -49,7 +49,10 @@
 /* equalizer controls */
 #define VOCTRL_SET_EQUALIZER 17
 #define VOCTRL_GET_EQUALIZER 18
-// ... 20
+//#define VOCTRL_GUI_NOWINDOW 19
+/* Frame duplication */
+#define VOCTRL_DUPLICATE_FRAME 20
+// ... 21
 
 
 #define VO_TRUE		1

Index: vo_yuv4mpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_yuv4mpeg.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- vo_yuv4mpeg.c	11 Nov 2002 15:20:26 -0000	1.13
+++ vo_yuv4mpeg.c	14 Dec 2002 17:12:40 -0000	1.14
@@ -222,6 +222,56 @@
 		perror("yuv4mpeg: Error writing image to output!");
 }
 
+static int write_last_frame(void)
+{
+
+    uint8_t *upper_y, *upper_u, *upper_v, *rgb_buffer_lower;
+    int rgb_stride, uv_stride, field_height;
+    unsigned int i, low_ofs;
+
+    fprintf(yuv_out, "FRAME\n");
+
+    if (using_format != IMGFMT_YV12)
+    {
+	rgb_stride = image_width * 3;
+	uv_stride = image_width / 2;
+
+	if (Y4M_IS_INTERLACED)
+	{
+	    field_height = image_height / 2;
+
+	    upper_y = image;
+	    upper_u = upper_y + image_width * field_height;
+	    upper_v = upper_u + image_width * field_height / 4;
+	    low_ofs = image_width * field_height * 3 / 2;
+	    rgb_buffer_lower = rgb_buffer + rgb_stride * field_height;
+
+	    /* Write Y plane */
+	    for(i = 0; i < field_height; i++)
+	    {
+		vo_y4m_write(upper_y + image_width * i,           image_width);
+		vo_y4m_write(upper_y + image_width * i + low_ofs, image_width);
+	    }
+
+	    /* Write U and V plane */
+	    for(i = 0; i < field_height / 2; i++)
+	    {
+		vo_y4m_write(upper_u + uv_stride * i,           uv_stride);
+		vo_y4m_write(upper_u + uv_stride * i + low_ofs, uv_stride);
+	    }
+	    for(i = 0; i < field_height / 2; i++)
+	    {
+		vo_y4m_write(upper_v + uv_stride * i,           uv_stride);
+		vo_y4m_write(upper_v + uv_stride * i + low_ofs, uv_stride);
+	    }
+	    return VO_TRUE; /* Image written; We have to stop here */
+	}
+    }
+    /* Write progressive frame */
+    vo_y4m_write(image, write_bytes);
+    return VO_TRUE;
+}
+
 static void flip_page (void)
 {
 	uint8_t *upper_y, *upper_u, *upper_v, *rgb_buffer_lower;
@@ -455,6 +505,8 @@
   switch (request) {
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
+  case VOCTRL_DUPLICATE_FRAME:
+    return write_last_frame();
   }
   return VO_NOTIMPL;
 }




More information about the MPlayer-cvslog mailing list