[MPlayer-cvslog] r34907 - trunk/libvo/vo_gl.c
reimar
subversion at mplayerhq.hu
Wed May 16 16:27:54 CEST 2012
Author: reimar
Date: Wed May 16 16:27:54 2012
New Revision: 34907
Log:
vo_gl: collect some frame statistics for DR.
Modified:
trunk/libvo/vo_gl.c
Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c Tue May 15 23:53:41 2012 (r34906)
+++ trunk/libvo/vo_gl.c Wed May 16 16:27:54 2012 (r34907)
@@ -166,6 +166,9 @@ static int ass_border_x, ass_border_y;
static unsigned int slice_height = 1;
+// performance statistics
+static int imgcnt, dr_imgcnt, dr_rejectcnt;
+
static void redraw(void);
static void resize(int x,int y){
@@ -444,6 +447,8 @@ skip_upload:
*/
static void uninitGl(void) {
int i = 0;
+ mp_msg(MSGT_VO, MSGL_V, "Drawn %i frames, %i using DR, DR refused %i\n",
+ imgcnt, dr_imgcnt, dr_rejectcnt);
if (mpglDeletePrograms && fragprog)
mpglDeletePrograms(1, &fragprog);
fragprog = 0;
@@ -908,6 +913,7 @@ static int draw_slice(uint8_t *src[], in
static uint32_t get_image(mp_image_t *mpi) {
int needed_size;
+ dr_rejectcnt++;
if (!mpglGenBuffers || !mpglBindBuffer || !mpglBufferData || !mpglMapBuffer) {
if (!err_shown)
mp_msg(MSGT_VO, MSGL_ERR, "[gl] extensions missing for dr\n"
@@ -994,6 +1000,7 @@ static uint32_t get_image(mp_image_t *mp
}
}
mpi->flags |= MP_IMGFLAG_DIRECT;
+ dr_rejectcnt--;
return VO_TRUE;
}
@@ -1015,8 +1022,10 @@ static uint32_t draw_image(mp_image_t *m
unsigned char *planes[3];
mp_image_t mpi2 = *mpi;
int w = mpi->w, h = mpi->h;
+ imgcnt++;
if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)
goto skip_upload;
+ dr_imgcnt += !!(mpi->flags & MP_IMGFLAG_DIRECT);
mpi2.flags = 0; mpi2.type = MP_IMGTYPE_TEMP;
mpi2.width = mpi2.w; mpi2.height = mpi2.h;
if (force_pbo && !(mpi->flags & MP_IMGFLAG_DIRECT) && !gl_bufferptr && get_image(&mpi2) == VO_TRUE) {
@@ -1325,6 +1334,7 @@ static int preinit_internal(const char *
"Use -vo gl:nomanyfmts if playback fails.\n");
mp_msg(MSGT_VO, MSGL_V, "[gl] Using %d as slice height "
"(0 means image height).\n", slice_height);
+ imgcnt = dr_imgcnt = dr_rejectcnt = 0;
return 0;
More information about the MPlayer-cvslog
mailing list