[MPlayer-dev-eng] vo development and swscaler

Samuel Garcia sam at xmos.com
Mon Mar 30 19:06:50 CEST 2009


Hi All,

I am developing a udp "video" driver for MPlayer, and I am getting very 
confused by color spaces.

The driver is advertising supporting only RGB24 with the following code:

static int query_format(uint32_t flags)
{
    int caps = VFCAP_CSP_SUPPORTED | VFCAP_ACCEPT_STRIDE;
              
  switch(flags)
  {
    case (IMGFMT_RGB24):
      return caps;
    default:
      mp_msg(MSGT_VO, MSGL_V, "xudp: colorspace fail %X \n", flags);
      return 0;
  }
}
static int control(uint32_t request, void *data, ...) {
  mp_image_t *mpi = (mp_image_t *)data;
    switch (request) {
        case VOCTRL_QUERY_FORMAT:
       return query_format(*((uint32_t*)data));
    case VOCTRL_DRAW_IMAGE:
      {
          if (mpi)
          {
            handle_frame( mpi );
            nsleep(10000000);
          }
          else
          {
              printf("VOCTRL_DRAW_IMAGE ->DEAD\n");
            }
          return VO_TRUE;
        }
        break;
        default:
          return VO_NOTIMPL;       
    }
}

This seems to work fine for video files of the correct resolution, if 
the software scaler is called. My mplayer command line currently looks 
like this:
mplayer.exe -vf rotate=left,scale=16:32 -v -loop 0 -vo 
xudp:noinit:tilewidth=16:tileheight=32

However, if I try to scale down a video, say from 32:64 to 16:32, I get 
wierd results from the colors. For example, a black screen with a red 
line down it, scales down to a smudged white line. It is as if the 
swscaler does not understand the color space correctly.

Thanks for any help,
Sam



More information about the MPlayer-dev-eng mailing list