2009-02-08 03:27:30 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2003-08-25 21:41:10 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "mp_msg.h"
|
|
|
|
#include "video_out.h"
|
|
|
|
#include "video_out_internal.h"
|
|
|
|
#include "osdep/timer.h"
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <X11/Xatom.h>
|
2003-08-25 21:41:10 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SHM
|
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/shm.h>
|
|
|
|
#include <X11/extensions/XShm.h>
|
|
|
|
#endif
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
#include <X11/extensions/Xv.h>
|
|
|
|
#include <X11/extensions/Xvlib.h>
|
|
|
|
#include <X11/extensions/XvMClib.h>
|
|
|
|
|
|
|
|
#include "x11_common.h"
|
2009-02-20 18:39:02 +00:00
|
|
|
#include "libavcodec/avcodec.h"
|
2009-02-14 17:18:55 +00:00
|
|
|
#include "libavcodec/xvmc.h"
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
#include "sub.h"
|
|
|
|
#include "aspect.h"
|
|
|
|
|
2005-02-20 22:43:25 +00:00
|
|
|
#include "subopt-helper.h"
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2007-03-06 15:34:54 +00:00
|
|
|
#include "libavutil/common.h"
|
|
|
|
|
2007-09-25 16:34:23 +00:00
|
|
|
//no chance for xinerama to be supported in the near future
|
2008-08-04 06:16:23 +00:00
|
|
|
#undef CONFIG_XINERAMA
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-15 17:55:57 +00:00
|
|
|
#undef NDEBUG
|
2003-07-01 21:51:57 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
2007-03-26 15:53:23 +00:00
|
|
|
#if LIBAVCODEC_BUILD < ((51<<16)+(40<<8)+2)
|
2009-03-15 09:47:09 +00:00
|
|
|
#error You need at least libavcodec v51.40.2
|
2007-03-26 15:53:23 +00:00
|
|
|
#endif
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
static int benchmark;
|
2005-02-20 22:43:25 +00:00
|
|
|
static int use_sleep;
|
2005-04-10 16:30:53 +00:00
|
|
|
static int first_frame;//draw colorkey on first frame
|
2003-08-25 21:41:10 +00:00
|
|
|
static int use_queue;
|
2005-02-20 22:43:25 +00:00
|
|
|
static int xv_port_request = 0;
|
2009-02-15 17:55:57 +00:00
|
|
|
static int xv_adaptor = -1;
|
2006-10-15 18:27:34 +00:00
|
|
|
static int bob_deinterlace;
|
|
|
|
static int top_field_first;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
static int image_width,image_height;
|
2007-02-19 11:38:19 +00:00
|
|
|
static int image_format;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
#define NO_SUBPICTURE 0
|
|
|
|
#define OVERLAY_SUBPICTURE 1
|
|
|
|
#define BLEND_SUBPICTURE 2
|
|
|
|
#define BACKEND_SUBPICTURE 3
|
|
|
|
|
|
|
|
static int subpicture_mode;
|
|
|
|
static int subpicture_alloc;
|
|
|
|
static XvMCSubpicture subpicture;
|
|
|
|
static XvImageFormatValues subpicture_info;
|
|
|
|
static int subpicture_clear_color;//transparent color for the subpicture or color key for overlay
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
static XvMCSurfaceInfo surface_info;
|
|
|
|
static XvMCContext ctx;
|
|
|
|
static XvMCBlockArray data_blocks;
|
|
|
|
static XvMCMacroBlockArray mv_blocks;
|
|
|
|
|
|
|
|
#define MAX_SURFACES 8
|
|
|
|
static int number_of_surfaces=0;
|
|
|
|
static XvMCSurface surface_array[MAX_SURFACES];
|
2009-02-15 17:49:42 +00:00
|
|
|
static struct xvmc_pix_fmt *surface_render;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-15 17:49:42 +00:00
|
|
|
static struct xvmc_pix_fmt *p_render_surface_to_show = NULL;
|
|
|
|
static struct xvmc_pix_fmt *p_render_surface_visible = NULL;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
//display queue, kinda render ahead
|
2009-02-15 17:49:42 +00:00
|
|
|
static struct xvmc_pix_fmt *show_queue[MAX_SURFACES];
|
2003-08-25 21:41:10 +00:00
|
|
|
static int free_element;
|
|
|
|
|
|
|
|
|
|
|
|
static void (*draw_osd_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
|
|
|
|
static void (*clear_osd_fnc)(int x0,int y0, int w,int h);
|
|
|
|
static void (*init_osd_fnc)(void);
|
|
|
|
|
|
|
|
static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
|
|
|
|
static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
|
|
|
|
static void clear_osd_subpic(int x0,int y0, int w,int h);
|
|
|
|
static void init_osd_yuv_pal(void);
|
|
|
|
|
|
|
|
|
|
|
|
static const struct{
|
2009-02-20 22:13:31 +00:00
|
|
|
int id;//id as xvimages or as mplayer RGB|{8,15,16,24,32}
|
2010-03-28 16:58:27 +00:00
|
|
|
void (* init_func_ptr)(void);
|
2009-02-20 22:13:31 +00:00
|
|
|
void (* draw_func_ptr)();
|
|
|
|
void (* clear_func_ptr)();
|
|
|
|
} osd_render[]={
|
|
|
|
{0x34344149,init_osd_yuv_pal,draw_osd_AI44,clear_osd_subpic},
|
|
|
|
{0x34344941,init_osd_yuv_pal,draw_osd_IA44,clear_osd_subpic},
|
|
|
|
{0,NULL,NULL,NULL}
|
|
|
|
};
|
2003-08-25 21:41:10 +00:00
|
|
|
|
|
|
|
static void xvmc_free(void);
|
2007-02-19 11:38:19 +00:00
|
|
|
static void xvmc_clean_surfaces(void);
|
2009-01-05 14:48:03 +00:00
|
|
|
static int count_free_surfaces(void);
|
2009-02-15 17:49:42 +00:00
|
|
|
static struct xvmc_pix_fmt *find_free_surface(void);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2007-12-02 14:06:03 +00:00
|
|
|
static const vo_info_t info = {
|
2009-02-20 22:13:31 +00:00
|
|
|
"XVideo Motion Compensation",
|
|
|
|
"xvmc",
|
|
|
|
"Ivan Kalvachev <iive@users.sf.net>",
|
|
|
|
""
|
2003-07-01 21:51:57 +00:00
|
|
|
};
|
|
|
|
|
2007-12-02 14:39:15 +00:00
|
|
|
const LIBVO_EXTERN(xvmc);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
//shm stuff from vo_xv
|
|
|
|
#ifdef HAVE_SHM
|
|
|
|
static XShmSegmentInfo Shminfo;
|
|
|
|
static int Shmem_Flag;
|
|
|
|
#endif
|
|
|
|
XvImage * xvimage;
|
|
|
|
|
|
|
|
|
|
|
|
static void allocate_xvimage(int xvimage_width,int xvimage_height,int xv_format)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* allocate XvImages. FIXME: no error checking, without
|
|
|
|
* mit-shm this will bomb... trzing to fix ::atmos
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_SHM
|
2009-02-20 22:13:31 +00:00
|
|
|
if ( mLocalDisplay && XShmQueryExtension( mDisplay ) ) Shmem_Flag = 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Shmem_Flag = 0;
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN, "Shared memory not supported\nReverting to normal Xv\n" );
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
if ( Shmem_Flag )
|
|
|
|
{
|
|
|
|
xvimage = (XvImage *) XvShmCreateImage(mDisplay, xv_port, xv_format,
|
2003-08-25 21:41:10 +00:00
|
|
|
NULL, xvimage_width, xvimage_height, &Shminfo);
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
Shminfo.shmid = shmget(IPC_PRIVATE, xvimage->data_size, IPC_CREAT | 0777);
|
|
|
|
Shminfo.shmaddr = (char *) shmat(Shminfo.shmid, 0, 0);
|
|
|
|
Shminfo.readOnly = False;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
xvimage->data = Shminfo.shmaddr;
|
|
|
|
XShmAttach(mDisplay, &Shminfo);
|
|
|
|
XSync(mDisplay, False);
|
|
|
|
shmctl(Shminfo.shmid, IPC_RMID, 0);
|
|
|
|
}
|
|
|
|
else
|
2003-08-25 21:41:10 +00:00
|
|
|
#endif
|
2009-02-20 22:13:31 +00:00
|
|
|
{
|
|
|
|
xvimage = (XvImage *) XvCreateImage(mDisplay, xv_port, xv_format, NULL, xvimage_width, xvimage_height);
|
|
|
|
xvimage->data = malloc(xvimage->data_size);
|
|
|
|
XSync(mDisplay,False);
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
// memset(xvimage->data,128,xvimage->data_size);
|
2009-02-20 22:13:31 +00:00
|
|
|
return;
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
2009-01-05 14:48:03 +00:00
|
|
|
static void deallocate_xvimage(void)
|
2003-08-25 21:41:10 +00:00
|
|
|
{
|
|
|
|
#ifdef HAVE_SHM
|
2009-02-20 22:13:31 +00:00
|
|
|
if ( Shmem_Flag )
|
|
|
|
{
|
|
|
|
XShmDetach( mDisplay,&Shminfo );
|
|
|
|
shmdt( Shminfo.shmaddr );
|
|
|
|
}
|
|
|
|
else
|
2003-08-25 21:41:10 +00:00
|
|
|
#endif
|
2009-02-20 22:13:31 +00:00
|
|
|
{
|
|
|
|
free(xvimage->data);
|
|
|
|
}
|
|
|
|
XFree(xvimage);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
XSync(mDisplay, False);
|
|
|
|
return;
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
//end of vo_xv shm/xvimage code
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
static int xvmc_check_surface_format(uint32_t format, XvMCSurfaceInfo * surf_info){
|
2009-02-20 22:13:31 +00:00
|
|
|
if ( format == IMGFMT_XVMC_IDCT_MPEG2 ){
|
|
|
|
if( surf_info->mc_type != (XVMC_IDCT|XVMC_MPEG_2) ) return -1;
|
|
|
|
if( surf_info->chroma_format != XVMC_CHROMA_FORMAT_420 ) return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if ( format == IMGFMT_XVMC_MOCO_MPEG2 ){
|
|
|
|
if(surf_info->mc_type != XVMC_MPEG_2) return -1;
|
|
|
|
if(surf_info->chroma_format != XVMC_CHROMA_FORMAT_420) return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
return -1;//fail
|
|
|
|
}
|
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
//print all info needed to add new format
|
|
|
|
static void print_xvimage_format_values(XvImageFormatValues *xifv){
|
2009-02-20 22:49:09 +00:00
|
|
|
int i;
|
2009-03-15 20:02:45 +00:00
|
|
|
const int msgl=MSGL_DBG4;
|
2009-02-20 22:49:09 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl,"Format_ID = 0x%X\n",xifv->id);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," type = ");
|
|
|
|
if(xifv->type == XvRGB) mp_msg(MSGT_VO,msgl,"RGB\n");
|
|
|
|
else if(xifv->type == XvYUV) mp_msg(MSGT_VO,msgl,"YUV\n");
|
|
|
|
else mp_msg(MSGT_VO,msgl,"Unknown\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," byte_order = ");
|
|
|
|
if(xifv->byte_order == LSBFirst) mp_msg(MSGT_VO,msgl,"LSB First\n");
|
|
|
|
else if(xifv->type == MSBFirst) mp_msg(MSGT_VO,msgl,"MSB First\n");
|
|
|
|
else mp_msg(MSGT_VO,msgl,"Unknown\n");//yes Linux support other types too
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," guid = ");
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0;i<16;i++)
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl,"%02X ",(unsigned char)xifv->guid[i]);
|
|
|
|
mp_msg(MSGT_VO,msgl,"\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," bits_per_pixel = %d\n",xifv->bits_per_pixel);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," format = ");
|
|
|
|
if(xifv->format == XvPacked) mp_msg(MSGT_VO,msgl,"XvPacked\n");
|
|
|
|
else if(xifv->format == XvPlanar) mp_msg(MSGT_VO,msgl,"XvPlanar\n");
|
|
|
|
else mp_msg(MSGT_VO,msgl,"Unknown\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," num_planes = %d\n",xifv->num_planes);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
|
|
|
if(xifv->type == XvRGB){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," red_mask = %0X\n", xifv->red_mask);
|
|
|
|
mp_msg(MSGT_VO,msgl," green_mask = %0X\n",xifv->green_mask);
|
|
|
|
mp_msg(MSGT_VO,msgl," blue_mask = %0X\n", xifv->blue_mask);
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
if(xifv->type == XvYUV){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," y_sample_bits = %d\n u_sample_bits = %d\n v_sample_bits = %d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
xifv->y_sample_bits,xifv->u_sample_bits,xifv->v_sample_bits);
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," horz_y_period = %d\n horz_u_period = %d\n horz_v_period = %d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
xifv->horz_y_period,xifv->horz_u_period,xifv->horz_v_period);
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," vert_y_period = %d\n vert_u_period = %d\n vert_v_period = %d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
xifv->vert_y_period,xifv->vert_u_period,xifv->vert_v_period);
|
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," component_order = ");
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0;i<32;i++)
|
|
|
|
if(xifv->component_order[i]>=32)
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl,"%c",xifv->component_order[i]);
|
|
|
|
mp_msg(MSGT_VO,msgl,"\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl," scanline = ");
|
|
|
|
if(xifv->scanline_order == XvTopToBottom) mp_msg(MSGT_VO,msgl,"XvTopToBottom\n");
|
|
|
|
else if(xifv->scanline_order == XvBottomToTop) mp_msg(MSGT_VO,msgl,"XvBottomToTop\n");
|
|
|
|
else mp_msg(MSGT_VO,msgl,"Unknown\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,msgl,"\n");
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
// WARNING This function may changes xv_port and surface_info!
|
2003-08-25 21:41:10 +00:00
|
|
|
static int xvmc_find_surface_by_format(int format,int width,int height,
|
2009-02-20 22:13:31 +00:00
|
|
|
XvMCSurfaceInfo * surf_info,int query){
|
2009-02-20 22:49:09 +00:00
|
|
|
int rez;
|
|
|
|
XvAdaptorInfo * ai;
|
|
|
|
int num_adaptors,i;
|
|
|
|
unsigned long p;
|
|
|
|
int s,mc_surf_num;
|
|
|
|
XvMCSurfaceInfo * mc_surf_list;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rez = XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay),&num_adaptors,&ai);
|
|
|
|
if( rez != Success ) return -1;
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG3,"vo_xvmc: Querying %d adaptors\n",num_adaptors);
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0; i<num_adaptors; i++)
|
|
|
|
{
|
|
|
|
/* check if adaptor number has been specified */
|
|
|
|
if (xv_adaptor != -1 && xv_adaptor != i)
|
2009-02-15 17:55:57 +00:00
|
|
|
continue;
|
2010-08-03 15:55:17 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG3,"vo_xvmc: Querying adaptor #%d\n",i);
|
2009-02-20 22:13:31 +00:00
|
|
|
if( ai[i].type == 0 ) continue;// we need at least dummy type!
|
2003-07-01 21:51:57 +00:00
|
|
|
//probing ports
|
2009-02-20 22:13:31 +00:00
|
|
|
for(p=ai[i].base_id; p<ai[i].base_id+ai[i].num_ports; p++)
|
|
|
|
{
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG3,"vo_xvmc: probing port #%ld\n",p);
|
2009-02-20 22:13:31 +00:00
|
|
|
mc_surf_list = XvMCListSurfaceTypes(mDisplay,p,&mc_surf_num);
|
|
|
|
if( mc_surf_list == NULL || mc_surf_num == 0){
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG3,"vo_xvmc: No XvMC supported. \n");
|
2009-02-20 22:13:31 +00:00
|
|
|
continue;
|
|
|
|
}
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG3,"vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num);
|
2003-07-01 21:51:57 +00:00
|
|
|
//we have XvMC list!
|
2009-02-20 22:13:31 +00:00
|
|
|
for(s=0; s<mc_surf_num; s++)
|
2005-02-20 22:43:25 +00:00
|
|
|
{
|
2009-02-20 22:13:31 +00:00
|
|
|
if( width > mc_surf_list[s].max_width ) continue;
|
|
|
|
if( height > mc_surf_list[s].max_height ) continue;
|
|
|
|
if( xvmc_check_surface_format(format,&mc_surf_list[s])<0 ) continue;
|
|
|
|
//we have match!
|
|
|
|
/* respect the users wish */
|
|
|
|
if ( xv_port_request != 0 && xv_port_request != p )
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!query){
|
|
|
|
rez = XvGrabPort(mDisplay,p,CurrentTime);
|
|
|
|
if(rez != Success){
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG3,"vo_xvmc: Fail to grab port %ld\n",p);
|
2009-02-20 22:13:31 +00:00
|
|
|
continue;
|
|
|
|
}
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: Using Xv Adaptor #%d (%s)\n", i, ai[i].name);
|
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: Port %ld grabed\n",p);
|
2009-02-20 22:13:31 +00:00
|
|
|
xv_port = p;
|
|
|
|
}
|
|
|
|
goto surface_found;
|
|
|
|
}//for mc surf
|
|
|
|
XFree(mc_surf_list);//if mc_surf_num==0 is list==NULL ?
|
|
|
|
}//for ports
|
|
|
|
}//for adaptors
|
|
|
|
XvFreeAdaptorInfo(ai);
|
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
if(!query) mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: Could not find free matching surface. Sorry.\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
return 0;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
// somebody know cleaner way to escape from 3 internal loops?
|
|
|
|
surface_found:
|
2009-02-20 22:13:31 +00:00
|
|
|
XvFreeAdaptorInfo(ai);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
memcpy(surf_info,&mc_surf_list[s],sizeof(XvMCSurfaceInfo));
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO, query?MSGL_INFO:MSGL_DBG3,
|
|
|
|
"vo_xvmc: Found matching surface with id=%X on %ld port at %d adapter\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
mc_surf_list[s].surface_type_id,p,i);
|
|
|
|
return mc_surf_list[s].surface_type_id;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t xvmc_draw_image(mp_image_t *mpi){
|
2009-02-20 22:13:31 +00:00
|
|
|
struct xvmc_pix_fmt *rndr;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
assert(mpi!=NULL);
|
|
|
|
assert(mpi->flags &MP_IMGFLAG_DIRECT);
|
2003-07-01 21:51:57 +00:00
|
|
|
// assert(mpi->flags &MP_IMGFLAGS_DRAWBACK);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr = (struct xvmc_pix_fmt*)mpi->priv; //there is copy in plane[2]
|
|
|
|
assert( rndr != NULL );
|
|
|
|
assert( rndr->xvmc_id == AV_XVMC_ID );
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: draw_image(show rndr=%p)\n",rndr);
|
2003-07-01 21:51:57 +00:00
|
|
|
// the surface have passed vf system without been skiped, it will be displayed
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr->state |= AV_XVMC_STATE_DISPLAY_PENDING;
|
|
|
|
p_render_surface_to_show = rndr;
|
|
|
|
top_field_first = mpi->fields & MP_IMGFIELD_TOP_FIRST;
|
|
|
|
return VO_TRUE;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int preinit(const char *arg){
|
2009-02-20 22:49:09 +00:00
|
|
|
int xv_version,xv_release,xv_request_base,xv_event_base,xv_error_base;
|
|
|
|
int mc_eventBase,mc_errorBase;
|
|
|
|
int mc_ver,mc_rev;
|
|
|
|
strarg_t ck_src_arg = { 0, NULL };
|
|
|
|
strarg_t ck_method_arg = { 0, NULL };
|
2009-03-07 08:51:40 +00:00
|
|
|
const opt_t subopts [] =
|
2009-02-20 22:49:09 +00:00
|
|
|
{
|
2009-02-20 22:13:31 +00:00
|
|
|
/* name arg type arg var test */
|
2010-01-01 13:18:49 +00:00
|
|
|
{ "port", OPT_ARG_INT, &xv_port_request, int_pos },
|
|
|
|
{ "adaptor", OPT_ARG_INT, &xv_adaptor, int_non_neg },
|
2009-02-20 22:13:31 +00:00
|
|
|
{ "ck", OPT_ARG_STR, &ck_src_arg, xv_test_ck },
|
|
|
|
{ "ck-method", OPT_ARG_STR, &ck_method_arg, xv_test_ckm },
|
|
|
|
{ "benchmark", OPT_ARG_BOOL, &benchmark, NULL },
|
|
|
|
{ "sleep", OPT_ARG_BOOL, &use_sleep, NULL },
|
|
|
|
{ "queue", OPT_ARG_BOOL, &use_queue, NULL },
|
|
|
|
{ "bobdeint", OPT_ARG_BOOL, &bob_deinterlace, NULL },
|
|
|
|
{ NULL }
|
2009-02-20 22:49:09 +00:00
|
|
|
};
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
//Obtain display handler
|
|
|
|
if (!vo_init()) return -1;//vo_xv
|
|
|
|
|
|
|
|
//XvMC is subdivision of XVideo
|
|
|
|
if (Success != XvQueryExtension(mDisplay,&xv_version,&xv_release,&xv_request_base,
|
|
|
|
&xv_event_base,&xv_error_base) ){
|
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"Sorry, Xv(MC) not supported by this X11 version/driver\n");
|
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"********** Try with -vo x11 or -vo sdl ***********\n");
|
|
|
|
return -1;
|
|
|
|
}
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: X-Video extension %d.%d\n",xv_version,xv_release);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
|
|
|
if( True != XvMCQueryExtension(mDisplay,&mc_eventBase,&mc_errorBase) ){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: No X-Video MotionCompensation Extension on %s\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
XDisplayName(NULL));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(Success == XvMCQueryVersion(mDisplay, &mc_ver, &mc_rev) ){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: X-Video MotionCompensation Extension version %i.%i\n",
|
2009-02-15 17:55:57 +00:00
|
|
|
mc_ver,mc_rev);
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
else{
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: Error querying version info!\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
surface_render = NULL;
|
|
|
|
xv_port = 0;
|
|
|
|
number_of_surfaces = 0;
|
|
|
|
subpicture_alloc = 0;
|
|
|
|
|
|
|
|
benchmark = 0; //disable PutImageto allow faster display than screen refresh
|
|
|
|
use_sleep = 0;
|
|
|
|
use_queue = 0;
|
|
|
|
bob_deinterlace = 0;
|
|
|
|
|
|
|
|
/* parse suboptions */
|
|
|
|
if ( subopt_parse( arg, subopts ) != 0 )
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
xv_setup_colorkeyhandling( ck_method_arg.str, ck_src_arg.str );
|
|
|
|
|
|
|
|
return 0;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2007-02-18 20:19:47 +00:00
|
|
|
static int config(uint32_t width, uint32_t height,
|
2009-02-15 17:55:57 +00:00
|
|
|
uint32_t d_width, uint32_t d_height,
|
|
|
|
uint32_t flags, char *title, uint32_t format){
|
2009-02-20 22:49:09 +00:00
|
|
|
int i,mode_id,rez;
|
|
|
|
int numblocks,blocks_per_macroblock;//bpmb we have 6,8,12
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2007-02-18 20:19:47 +00:00
|
|
|
//from vo_xv
|
2009-02-20 22:49:09 +00:00
|
|
|
XVisualInfo vinfo;
|
|
|
|
XSetWindowAttributes xswa;
|
|
|
|
XWindowAttributes attribs;
|
|
|
|
unsigned long xswamask;
|
|
|
|
int depth;
|
2008-08-04 06:16:23 +00:00
|
|
|
#ifdef CONFIG_XF86VM
|
2009-02-20 22:49:09 +00:00
|
|
|
int vm = flags & VOFLAG_MODESWITCHING;
|
2007-02-18 20:19:47 +00:00
|
|
|
#endif
|
|
|
|
//end of vo_xv
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( !IMGFMT_IS_XVMC(format) )
|
|
|
|
{
|
|
|
|
assert(0);//should never happen, abort on debug or
|
|
|
|
return 1;//return error on relese
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
// Find free port that supports MC, by querying adaptors
|
2009-02-20 22:13:31 +00:00
|
|
|
if( xv_port != 0 || number_of_surfaces != 0 ){
|
|
|
|
if( height==image_height && width==image_width && image_format==format){
|
|
|
|
xvmc_clean_surfaces();
|
|
|
|
goto skip_surface_allocation;
|
|
|
|
}
|
|
|
|
xvmc_free();
|
|
|
|
};
|
|
|
|
numblocks=((width+15)/16)*((height+15)/16);
|
2003-07-01 21:51:57 +00:00
|
|
|
// Find Supported Surface Type
|
2009-02-20 22:13:31 +00:00
|
|
|
mode_id = xvmc_find_surface_by_format(format,width,height,&surface_info,0);//false=1 to grab port, not query
|
|
|
|
if ( mode_id == 0 )
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
rez = XvMCCreateContext(mDisplay, xv_port,mode_id,width,height,XVMC_DIRECT,&ctx);
|
|
|
|
if( rez != Success ){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: XvMCCreateContext failed with error %d\n",rez);
|
2009-02-20 22:13:31 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if( ctx.flags & XVMC_DIRECT ){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: Allocated Direct Context\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}else{
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: Allocated Indirect Context!\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
blocks_per_macroblock = 6;
|
|
|
|
if(surface_info.chroma_format == XVMC_CHROMA_FORMAT_422)
|
|
|
|
blocks_per_macroblock = 8;
|
|
|
|
if(surface_info.chroma_format == XVMC_CHROMA_FORMAT_444)
|
|
|
|
blocks_per_macroblock = 12;
|
|
|
|
|
|
|
|
rez = XvMCCreateBlocks(mDisplay,&ctx,numblocks*blocks_per_macroblock,&data_blocks);
|
|
|
|
if( rez != Success ){
|
|
|
|
XvMCDestroyContext(mDisplay,&ctx);
|
|
|
|
return -1;
|
|
|
|
}
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: data_blocks allocated\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
|
|
|
|
rez = XvMCCreateMacroBlocks(mDisplay,&ctx,numblocks,&mv_blocks);
|
|
|
|
if( rez != Success ){
|
|
|
|
XvMCDestroyBlocks(mDisplay,&data_blocks);
|
|
|
|
XvMCDestroyContext(mDisplay,&ctx);
|
|
|
|
return -1;
|
|
|
|
}
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: mv_blocks allocated\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
|
|
|
|
if(surface_render==NULL)
|
|
|
|
surface_render = malloc(MAX_SURFACES * sizeof(struct xvmc_pix_fmt)); //easy mem debug
|
|
|
|
memset(surface_render, 0, MAX_SURFACES * sizeof(struct xvmc_pix_fmt));
|
|
|
|
|
|
|
|
for(i=0; i<MAX_SURFACES; i++){
|
|
|
|
rez=XvMCCreateSurface(mDisplay,&ctx,&surface_array[i]);
|
|
|
|
if( rez != Success )
|
|
|
|
break;
|
|
|
|
surface_render[i].xvmc_id = AV_XVMC_ID;
|
|
|
|
surface_render[i].data_blocks = data_blocks.blocks;
|
|
|
|
surface_render[i].mv_blocks = mv_blocks.macro_blocks;
|
|
|
|
surface_render[i].allocated_mv_blocks = numblocks;
|
|
|
|
surface_render[i].allocated_data_blocks = numblocks*blocks_per_macroblock;
|
|
|
|
surface_render[i].idct = (surface_info.mc_type & XVMC_IDCT) == XVMC_IDCT;
|
|
|
|
surface_render[i].unsigned_intra = (surface_info.flags & XVMC_INTRA_UNSIGNED) == XVMC_INTRA_UNSIGNED;
|
|
|
|
surface_render[i].p_surface = &surface_array[i];
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: surface[%d] = %p .rndr=%p\n",
|
|
|
|
i,&surface_array[i], &surface_render[i]);
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
number_of_surfaces = i;
|
|
|
|
if( number_of_surfaces < 4 ){// +2 I or P and +2 for B (to avoid visible motion drawing)
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: Unable to allocate at least 4 Surfaces\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
uninit();
|
|
|
|
return -1;
|
|
|
|
}
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: Motion Compensation context allocated - %d surfaces\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
number_of_surfaces);
|
|
|
|
|
|
|
|
//debug
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: idct=%d unsigned_intra=%d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
(surface_info.mc_type & XVMC_IDCT) == XVMC_IDCT,
|
|
|
|
(surface_info.flags & XVMC_INTRA_UNSIGNED) == XVMC_INTRA_UNSIGNED);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
// Find way to display OSD & subtitle
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: looking for OSD support\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
subpicture_mode = NO_SUBPICTURE;
|
|
|
|
if(surface_info.flags & XVMC_OVERLAID_SURFACE)
|
|
|
|
subpicture_mode = OVERLAY_SUBPICTURE;
|
|
|
|
|
|
|
|
if(surface_info.subpicture_max_width != 0 &&
|
|
|
|
surface_info.subpicture_max_height != 0 ){
|
|
|
|
int s,k,num_subpic;
|
|
|
|
|
|
|
|
XvImageFormatValues * xvfmv;
|
|
|
|
xvfmv = XvMCListSubpictureTypes(mDisplay, xv_port,
|
|
|
|
surface_info.surface_type_id, &num_subpic);
|
|
|
|
|
|
|
|
if(num_subpic != 0 && xvfmv != NULL){
|
|
|
|
if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){//Print all subpicture types for debug
|
|
|
|
for(s=0;s<num_subpic;s++)
|
|
|
|
print_xvimage_format_values(&xvfmv[s]);
|
|
|
|
}
|
|
|
|
|
|
|
|
for(s=0;s<num_subpic;s++){
|
|
|
|
for(k=0;osd_render[k].draw_func_ptr!=NULL;k++){
|
|
|
|
if(xvfmv[s].id == osd_render[k].id)
|
|
|
|
{
|
|
|
|
init_osd_fnc = osd_render[k].init_func_ptr;
|
|
|
|
draw_osd_fnc = osd_render[k].draw_func_ptr;
|
|
|
|
clear_osd_fnc = osd_render[k].clear_func_ptr;
|
|
|
|
|
|
|
|
subpicture_mode = BLEND_SUBPICTURE;
|
|
|
|
subpicture_info = xvfmv[s];
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO," Subpicture id 0x%08X\n",subpicture_info.id);
|
2009-02-20 22:13:31 +00:00
|
|
|
goto found_subpic;
|
|
|
|
}
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
found_subpic:
|
2009-02-20 22:13:31 +00:00
|
|
|
XFree(xvfmv);
|
|
|
|
}
|
|
|
|
//Blend2 supicture is always possible, blend1 only at backend
|
|
|
|
if( (subpicture_mode == BLEND_SUBPICTURE) &&
|
|
|
|
(surface_info.flags & XVMC_BACKEND_SUBPICTURE) )
|
|
|
|
{
|
|
|
|
subpicture_mode = BACKEND_SUBPICTURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(subpicture_mode){
|
|
|
|
case NO_SUBPICTURE:
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: No OSD support for this mode\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
break;
|
|
|
|
case OVERLAY_SUBPICTURE:
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: OSD support via color key tricks\n");
|
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: not yet implemented:(\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
break;
|
|
|
|
case BLEND_SUBPICTURE:
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: OSD support by additional frontend rendering\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
break;
|
|
|
|
case BACKEND_SUBPICTURE:
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: OSD support by backend rendering (fast)\n");
|
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: Please send feedback to confirm that it works,otherwise send bugreport!\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2005-02-20 22:43:25 +00:00
|
|
|
//take keycolor value and choose method for handling it
|
2009-02-20 22:13:31 +00:00
|
|
|
if ( !vo_xv_init_colorkey() )
|
|
|
|
{
|
|
|
|
return -1; // bail out, colorkey setup failed
|
|
|
|
}
|
2005-02-20 22:43:25 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
vo_xv_enable_vsync();//it won't break anything
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
//taken from vo_xv
|
2009-02-20 22:13:31 +00:00
|
|
|
image_height = height;
|
|
|
|
image_width = width;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2007-02-19 11:38:19 +00:00
|
|
|
skip_surface_allocation:
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
{
|
2008-08-04 06:16:23 +00:00
|
|
|
#ifdef CONFIG_XF86VM
|
2009-02-20 22:13:31 +00:00
|
|
|
if ( vm )
|
|
|
|
{
|
|
|
|
vo_vm_switch();
|
|
|
|
}
|
|
|
|
// else
|
2003-07-01 21:51:57 +00:00
|
|
|
#endif
|
2009-02-20 22:13:31 +00:00
|
|
|
XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &attribs);
|
|
|
|
depth=attribs.depth;
|
|
|
|
if (depth != 15 && depth != 16 && depth != 24 && depth != 32) depth = 24;
|
|
|
|
XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &vinfo);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
xswa.background_pixel = 0;
|
|
|
|
if (xv_ck_info.method == CK_METHOD_BACKGROUND)
|
|
|
|
xswa.background_pixel = xv_colorkey;
|
|
|
|
xswa.border_pixel = 0;
|
|
|
|
xswamask = CWBackPixel | CWBorderPixel;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height, flags,
|
|
|
|
CopyFromParent, "xvmc", title);
|
|
|
|
XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2008-08-04 06:16:23 +00:00
|
|
|
#ifdef CONFIG_XF86VM
|
2009-02-20 22:13:31 +00:00
|
|
|
if ( vm )
|
|
|
|
{
|
|
|
|
/* Grab the mouse pointer in our window */
|
|
|
|
if(vo_grabpointer)
|
|
|
|
XGrabPointer(mDisplay, vo_window, True, 0,
|
|
|
|
GrabModeAsync, GrabModeAsync,
|
|
|
|
vo_window, None, CurrentTime );
|
|
|
|
XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime);
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
#endif
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
//end vo_xv
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
/* store image dimesions for displaying */
|
|
|
|
p_render_surface_visible = NULL;
|
|
|
|
p_render_surface_to_show = NULL;
|
2007-02-18 20:19:47 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
free_element = 0;
|
|
|
|
first_frame = 1;
|
2007-02-18 20:19:47 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
image_format=format;
|
|
|
|
return 0;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int draw_frame(uint8_t *srcp[]){
|
2009-02-20 22:13:31 +00:00
|
|
|
assert(0);
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
2009-01-05 14:48:03 +00:00
|
|
|
static void init_osd_yuv_pal(void) {
|
2009-02-20 22:13:31 +00:00
|
|
|
char * palette;
|
|
|
|
int rez;
|
|
|
|
int i,j;
|
|
|
|
int snum,seb;
|
|
|
|
int Y,U,V;
|
|
|
|
|
|
|
|
subpicture_clear_color = 0;
|
|
|
|
|
|
|
|
if(subpicture.num_palette_entries > 0){
|
|
|
|
|
|
|
|
snum = subpicture.num_palette_entries;
|
|
|
|
seb = subpicture.entry_bytes;
|
|
|
|
palette = malloc(snum*seb);//check fail
|
|
|
|
if(palette == NULL) return;
|
|
|
|
for(i=0; i<snum; i++){
|
|
|
|
// 0-black max-white the other are gradients
|
|
|
|
Y = i*(1 << subpicture_info.y_sample_bits)/snum;//snum=2;->(0),(1*(1<<1)/2)
|
|
|
|
U = 1 << (subpicture_info.u_sample_bits - 1);
|
|
|
|
V = 1 << (subpicture_info.v_sample_bits - 1);
|
|
|
|
for(j=0; j<seb; j++)
|
|
|
|
switch(subpicture.component_order[j]){
|
|
|
|
case 'U': palette[i*seb+j] = U; break;
|
|
|
|
case 'V': palette[i*seb+j] = V; break;
|
|
|
|
case 'Y':
|
|
|
|
default:
|
|
|
|
palette[i*seb+j] = Y; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rez = XvMCSetSubpicturePalette(mDisplay, &subpicture, palette);
|
|
|
|
if(rez!=Success){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: Setting palette failed.\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
free(palette);
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void clear_osd_subpic(int x0, int y0, int w, int h){
|
2009-02-20 22:49:09 +00:00
|
|
|
int rez;
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rez=XvMCClearSubpicture(mDisplay, &subpicture,
|
|
|
|
x0, y0, w,h,
|
|
|
|
subpicture_clear_color);
|
|
|
|
if(rez != Success)
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: XvMCClearSubpicture failed!\n");
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
2009-01-05 14:48:03 +00:00
|
|
|
static void OSD_init(void) {
|
2009-02-20 22:49:09 +00:00
|
|
|
unsigned short osd_height, osd_width;
|
|
|
|
int rez;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(subpicture_alloc){
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: destroying subpicture\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
XvMCDestroySubpicture(mDisplay,&subpicture);
|
|
|
|
deallocate_xvimage();
|
|
|
|
subpicture_alloc = 0;
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
|
|
|
|
/* if(surface_info.flags & XVMC_SUBPICTURE_INDEPENDENT_SCALING){
|
|
|
|
osd_width = vo_dwidth;
|
|
|
|
osd_height = vo_dheight;
|
|
|
|
}else*/
|
2009-02-20 22:13:31 +00:00
|
|
|
{
|
|
|
|
osd_width = image_width;
|
|
|
|
osd_height = image_height;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(osd_width > surface_info.subpicture_max_width)
|
|
|
|
osd_width = surface_info.subpicture_max_width;
|
|
|
|
if(osd_height > surface_info.subpicture_max_height)
|
|
|
|
osd_height = surface_info.subpicture_max_height;
|
|
|
|
if(osd_width == 0 || osd_height == 0)
|
|
|
|
return;//if called before window size is known
|
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: creating subpicture (%d,%d) format %X\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
osd_width,osd_height,subpicture_info.id);
|
|
|
|
|
|
|
|
rez = XvMCCreateSubpicture(mDisplay,&ctx,&subpicture,
|
|
|
|
osd_width,osd_height,subpicture_info.id);
|
|
|
|
if(rez != Success){
|
|
|
|
subpicture_mode = NO_SUBPICTURE;
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: Create Subpicture failed, OSD disabled\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){
|
|
|
|
int i;
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: Created Subpicture:\n");
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4," xvimage_id=0x%X\n",subpicture.xvimage_id);
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4," width=%d\n",subpicture.width);
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4," height=%d\n",subpicture.height);
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4," num_palette_entries=0x%X\n",subpicture.num_palette_entries);
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4," entry_bytes=0x%X\n",subpicture.entry_bytes);
|
|
|
|
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4," component_order=\"");
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0; i<4; i++)
|
|
|
|
if(subpicture.component_order[i] >= 32)
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"%c", subpicture.component_order[i]);
|
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"\"\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//call init for the surface type
|
|
|
|
init_osd_fnc();//init palete,clear color etc ...
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: clearing subpicture\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
clear_osd_fnc(0, 0, subpicture.width, subpicture.height);
|
|
|
|
|
|
|
|
allocate_xvimage(subpicture.width, subpicture.height, subpicture_info.id);
|
|
|
|
subpicture_alloc = 1;
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
|
2009-02-20 22:49:09 +00:00
|
|
|
int ox,oy;
|
|
|
|
int rez;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
|
|
|
for(ox=0; ox<w; ox++){
|
|
|
|
for(oy=0; oy<h; oy++){
|
|
|
|
xvimage->data[oy*xvimage->width+ox] = (src[oy*stride+ox]>>4) | ((0-srca[oy*stride+ox])&0xf0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rez = XvMCCompositeSubpicture(mDisplay, &subpicture, xvimage, 0, 0,
|
|
|
|
w,h,x0,y0);
|
|
|
|
if(rez != Success){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: composite subpicture failed\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
assert(0);
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
|
2009-02-20 22:49:09 +00:00
|
|
|
int ox,oy;
|
|
|
|
int rez;
|
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
|
|
|
for(ox=0; ox<w; ox++){
|
|
|
|
for(oy=0; oy<h; oy++){
|
|
|
|
xvimage->data[oy*xvimage->width+ox] = (src[oy*stride+ox]&0xf0) | (((0-srca[oy*stride+ox])>>4)&0xf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rez = XvMCCompositeSubpicture(mDisplay, &subpicture, xvimage, 0, 0,
|
|
|
|
w,h,x0,y0);
|
|
|
|
if(rez != Success){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: composite subpicture failed\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
assert(0);
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void draw_osd(void){
|
2009-02-20 22:49:09 +00:00
|
|
|
struct xvmc_pix_fmt *osd_rndr;
|
|
|
|
int osd_has_changed;
|
|
|
|
int have_osd_to_draw;
|
|
|
|
int rez;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: draw_osd ,OSD_mode=%d, surface_to_show=%p\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
subpicture_mode,p_render_surface_to_show);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(subpicture_mode == BLEND_SUBPICTURE ||
|
|
|
|
subpicture_mode == BACKEND_SUBPICTURE ){
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(!subpicture_alloc) //allocate subpicture when dimensions are known
|
|
|
|
OSD_init();
|
|
|
|
if(!subpicture_alloc)
|
|
|
|
return;//dimensions still unknown.
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
osd_has_changed = vo_update_osd(subpicture.width, subpicture.height);
|
|
|
|
have_osd_to_draw = vo_osd_check_range_update(0, 0, subpicture.width,
|
2009-02-15 17:55:57 +00:00
|
|
|
subpicture.height);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(!have_osd_to_draw)
|
|
|
|
return;//nothing to draw,no subpic, no blend
|
|
|
|
|
|
|
|
if(osd_has_changed){
|
|
|
|
//vo_remove_text(subpicture.width, subpicture.height,clear_osd_fnc)
|
|
|
|
clear_osd_fnc(0,0,subpicture.width,subpicture.height);
|
|
|
|
vo_draw_text(subpicture.width, subpicture.height, draw_osd_fnc);
|
|
|
|
}
|
|
|
|
XvMCSyncSubpicture(mDisplay,&subpicture);//todo usleeep wait!
|
|
|
|
|
|
|
|
if(subpicture_mode == BLEND_SUBPICTURE){
|
|
|
|
osd_rndr = find_free_surface();
|
|
|
|
if(osd_rndr == NULL)
|
|
|
|
return;// no free surface to draw OSD in
|
|
|
|
|
|
|
|
rez = XvMCBlendSubpicture2(mDisplay,
|
|
|
|
p_render_surface_to_show->p_surface, osd_rndr->p_surface,
|
|
|
|
&subpicture,
|
|
|
|
0, 0, subpicture.width, subpicture.height,
|
|
|
|
0, 0, image_width, image_height);
|
|
|
|
if(rez!=Success){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: BlendSubpicture failed rez=%d\n",rez);
|
2009-02-20 22:13:31 +00:00
|
|
|
assert(0);
|
|
|
|
return;
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
// XvMCFlushSurface(mDisplay,osd_rndr->p_surface);//fixme- should I?
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
//When replaceing the surface with osd one, save the flags too!
|
|
|
|
osd_rndr->picture_structure = p_render_surface_to_show->picture_structure;
|
2003-08-25 21:41:10 +00:00
|
|
|
//add more if needed osd_rndr-> = p_render_surface_to_show->;
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
p_render_surface_to_show->state &= ~AV_XVMC_STATE_DISPLAY_PENDING;
|
|
|
|
p_render_surface_to_show->state |= AV_XVMC_STATE_OSD_SOURCE;
|
|
|
|
p_render_surface_to_show->p_osd_target_surface_render = osd_rndr;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
p_render_surface_to_show = osd_rndr;
|
|
|
|
p_render_surface_to_show->state = AV_XVMC_STATE_DISPLAY_PENDING;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc:draw_osd: surface_to_show changed to %p\n",osd_rndr);
|
2009-02-20 22:13:31 +00:00
|
|
|
}//endof if(BLEND)
|
|
|
|
if(subpicture_mode == BACKEND_SUBPICTURE){
|
|
|
|
rez = XvMCBlendSubpicture(mDisplay,
|
|
|
|
p_render_surface_to_show->p_surface,
|
|
|
|
&subpicture,
|
|
|
|
0, 0, subpicture.width, subpicture.height,
|
|
|
|
0, 0, image_width, image_height);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2009-02-15 17:55:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
}//if(BLEND||BACKEND)
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2003-07-21 21:02:34 +00:00
|
|
|
static void xvmc_sync_surface(XvMCSurface * srf){
|
2009-02-20 22:49:09 +00:00
|
|
|
int status,rez;
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rez = XvMCGetSurfaceStatus(mDisplay,srf,&status);
|
|
|
|
assert(rez==Success);
|
|
|
|
if((status & XVMC_RENDERING) == 0)
|
|
|
|
return;//surface is already complete
|
|
|
|
if(use_sleep){
|
|
|
|
rez = XvMCFlushSurface(mDisplay, srf);
|
|
|
|
assert(rez==Success);
|
|
|
|
|
|
|
|
do{
|
|
|
|
usec_sleep(1000);//1ms (may be 20ms on linux)
|
|
|
|
XvMCGetSurfaceStatus(mDisplay,srf,&status);
|
|
|
|
} while (status & XVMC_RENDERING);
|
|
|
|
return;//done
|
|
|
|
}
|
|
|
|
|
|
|
|
XvMCSyncSurface(mDisplay, srf);
|
2003-07-21 21:02:34 +00:00
|
|
|
}
|
|
|
|
|
2009-02-15 17:49:42 +00:00
|
|
|
static void put_xvmc_image(struct xvmc_pix_fmt *p_render_surface,
|
2009-02-15 17:55:57 +00:00
|
|
|
int draw_ck){
|
2009-02-20 22:49:09 +00:00
|
|
|
int rez;
|
|
|
|
struct vo_rect src_rect, dst_rect;
|
|
|
|
int i;
|
2005-04-07 16:59:34 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(p_render_surface == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
calc_src_dst_rects(image_width, image_height, &src_rect, &dst_rect, NULL, NULL);
|
|
|
|
|
|
|
|
if(draw_ck)
|
|
|
|
vo_xv_draw_colorkey(dst_rect.left, dst_rect.top, dst_rect.width, dst_rect.height);
|
|
|
|
|
|
|
|
if(benchmark)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 1; i <= bob_deinterlace + 1; i++) {
|
|
|
|
int field = top_field_first ? i : i ^ 3;
|
|
|
|
rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
|
|
|
|
vo_window,
|
|
|
|
src_rect.left, src_rect.top, src_rect.width, src_rect.height,
|
|
|
|
dst_rect.left, dst_rect.top, dst_rect.width, dst_rect.height,
|
|
|
|
bob_deinterlace ? field : 3);
|
|
|
|
if(rez != Success){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: PutSurface failer, critical error %d!\n",rez);
|
2009-02-20 22:13:31 +00:00
|
|
|
assert(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
XFlush(mDisplay);
|
2005-04-07 16:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void flip_page(void){
|
2009-02-20 22:49:09 +00:00
|
|
|
int i,cfs;
|
2005-04-07 16:59:34 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show);
|
2005-04-07 16:59:34 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(p_render_surface_to_show == NULL) return;
|
|
|
|
assert( p_render_surface_to_show->xvmc_id == AV_XVMC_ID );
|
2003-07-21 21:02:34 +00:00
|
|
|
//fixme assert( p_render_surface_to_show != p_render_surface_visible);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(use_queue){
|
|
|
|
// fill the queue until only n free surfaces remain
|
|
|
|
// after that start displaying
|
|
|
|
cfs = count_free_surfaces();
|
|
|
|
show_queue[free_element++] = p_render_surface_to_show;
|
|
|
|
if(cfs > 3){//well have 3 free surfaces after add queue
|
|
|
|
if(free_element > 1)//a little voodoo magic
|
|
|
|
xvmc_sync_surface(show_queue[0]->p_surface);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
p_render_surface_to_show=show_queue[0];
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG5,"vo_xvmc: flip_queue free_element=%d\n",free_element);
|
2009-02-20 22:13:31 +00:00
|
|
|
free_element--;
|
|
|
|
for(i=0; i<free_element; i++){
|
|
|
|
show_queue[i] = show_queue[i+1];
|
|
|
|
}
|
|
|
|
show_queue[free_element] = NULL;
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
// make sure the rendering is done
|
2009-02-20 22:13:31 +00:00
|
|
|
xvmc_sync_surface(p_render_surface_to_show->p_surface);
|
2003-07-21 21:02:34 +00:00
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
//the visible surface won't be displayed anymore, mark it as free
|
2009-02-20 22:13:31 +00:00
|
|
|
if(p_render_surface_visible != NULL)
|
|
|
|
p_render_surface_visible->state &= ~AV_XVMC_STATE_DISPLAY_PENDING;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-14 17:18:55 +00:00
|
|
|
//!!fixme assert(p_render_surface_to_show->state & AV_XVMC_STATE_DISPLAY_PENDING);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
//show it, displaying is always vsynced, so skip it for benchmark
|
|
|
|
put_xvmc_image(p_render_surface_to_show,first_frame);
|
|
|
|
first_frame=0;//make sure we won't draw it anymore
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
p_render_surface_visible = p_render_surface_to_show;
|
|
|
|
p_render_surface_to_show = NULL;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void check_events(void){
|
2009-02-20 22:49:09 +00:00
|
|
|
int e=vo_x11_check_events(mDisplay);
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(e&VO_EVENT_RESIZE)
|
|
|
|
{
|
|
|
|
e |= VO_EVENT_EXPOSE;
|
|
|
|
}
|
|
|
|
if ( e & VO_EVENT_EXPOSE )
|
|
|
|
{
|
|
|
|
put_xvmc_image(p_render_surface_visible,1);
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void xvmc_free(void){
|
2009-02-20 22:49:09 +00:00
|
|
|
int i;
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( subpicture_alloc ){
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
XvMCDestroySubpicture(mDisplay,&subpicture);
|
|
|
|
deallocate_xvimage();
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
subpicture_alloc = 0;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: subpicture destroyed\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( number_of_surfaces ){
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
XvMCDestroyMacroBlocks(mDisplay,&mv_blocks);
|
|
|
|
XvMCDestroyBlocks(mDisplay,&data_blocks);
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0; i<number_of_surfaces; i++)
|
|
|
|
{
|
|
|
|
XvMCHideSurface(mDisplay,&surface_array[i]);//it doesn't hurt, I hope
|
|
|
|
XvMCDestroySurface(mDisplay,&surface_array[i]);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( (surface_render[i].state != 0) &&
|
|
|
|
(p_render_surface_visible != &surface_render[i]) )
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc::uninit surface_render[%d].status=%d\n",i,
|
2009-02-20 22:13:31 +00:00
|
|
|
surface_render[i].state);
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
memset(surface_render, 0, MAX_SURFACES * sizeof(struct xvmc_pix_fmt)); //for debugging
|
|
|
|
free(surface_render);surface_render=NULL;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
XvMCDestroyContext(mDisplay,&ctx);
|
|
|
|
number_of_surfaces = 0;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: Context sucessfuly freed\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( xv_port !=0 ){
|
|
|
|
XvUngrabPort(mDisplay,xv_port,CurrentTime);
|
|
|
|
xv_port = 0;
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: xv_port sucessfuly ungrabed\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void uninit(void){
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: uninit called\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
xvmc_free();
|
2003-07-01 21:51:57 +00:00
|
|
|
//from vo_xv
|
2008-08-04 06:16:23 +00:00
|
|
|
#ifdef CONFIG_XF86VM
|
2009-02-20 22:13:31 +00:00
|
|
|
vo_vm_close();
|
2005-04-18 14:35:11 +00:00
|
|
|
#endif
|
2009-02-20 22:13:31 +00:00
|
|
|
vo_x11_uninit();
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int query_format(uint32_t format){
|
2009-02-20 22:49:09 +00:00
|
|
|
uint32_t flags;
|
|
|
|
XvMCSurfaceInfo qsurface_info;
|
|
|
|
int mode_id;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: query_format=%X\n",format);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(!IMGFMT_IS_XVMC(format)) return 0;// no caps supported
|
2010-08-03 15:55:17 +00:00
|
|
|
mode_id = xvmc_find_surface_by_format(format, 16, 16, &qsurface_info, 1);//true=1 - querying
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( mode_id == 0 ) return 0;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
flags = VFCAP_CSP_SUPPORTED |
|
|
|
|
VFCAP_CSP_SUPPORTED_BY_HW |
|
|
|
|
VFCAP_ACCEPT_STRIDE;
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if( (qsurface_info.subpicture_max_width != 0) &&
|
|
|
|
(qsurface_info.subpicture_max_height != 0) )
|
|
|
|
flags|=VFCAP_OSD;
|
|
|
|
return flags;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int draw_slice(uint8_t *image[], int stride[],
|
2009-02-15 17:55:57 +00:00
|
|
|
int w, int h, int x, int y){
|
2009-02-20 22:49:09 +00:00
|
|
|
struct xvmc_pix_fmt *rndr;
|
|
|
|
int rez;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: draw_slice y=%d\n",y);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr = (struct xvmc_pix_fmt*)image[2]; //this is copy of priv-ate
|
|
|
|
assert( rndr != NULL );
|
|
|
|
assert( rndr->xvmc_id == AV_XVMC_ID );
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rez = XvMCRenderSurface(mDisplay,&ctx,rndr->picture_structure,
|
|
|
|
rndr->p_surface,
|
|
|
|
rndr->p_past_surface,
|
|
|
|
rndr->p_future_surface,
|
|
|
|
rndr->flags,
|
|
|
|
rndr->filled_mv_blocks_num,rndr->start_mv_blocks_num,
|
|
|
|
&mv_blocks,&data_blocks);
|
|
|
|
if(rez != Success)
|
|
|
|
{
|
|
|
|
int i;
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc::slice: RenderSirface returned %d\n",rez);
|
2009-02-20 22:13:31 +00:00
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc::slice: pict=%d,flags=%x,start_blocks=%d,num_blocks=%d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr->picture_structure,rndr->flags,rndr->start_mv_blocks_num,
|
|
|
|
rndr->filled_mv_blocks_num);
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc::slice: this_surf=%p, past_surf=%p, future_surf=%p\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr->p_surface,rndr->p_past_surface,rndr->p_future_surface);
|
|
|
|
|
|
|
|
for(i=0; i<rndr->filled_mv_blocks_num; i++){
|
|
|
|
XvMCMacroBlock* testblock;
|
|
|
|
testblock = &mv_blocks.macro_blocks[i];
|
|
|
|
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc::slice: mv_block - x=%d,y=%d,mb_type=0x%x,mv_type=0x%x,mv_field_select=%d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
testblock->x,testblock->y,testblock->macroblock_type,
|
|
|
|
testblock->motion_type,testblock->motion_vertical_field_select);
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc::slice: dct_type=%d,data_index=0x%x,cbp=%d,pad0=%d\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
testblock->dct_type,testblock->index,testblock->coded_block_pattern,
|
|
|
|
testblock->pad0);
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc::slice: PMV[0][0][0/1]=(%d,%d)\n",
|
2009-02-20 22:13:31 +00:00
|
|
|
testblock->PMV[0][0][0],testblock->PMV[0][0][1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assert(rez==Success);
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: flush surface\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
rez = XvMCFlushSurface(mDisplay, rndr->p_surface);
|
|
|
|
assert(rez==Success);
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
// rndr->start_mv_blocks_num += rndr->filled_mv_blocks_num;
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr->start_mv_blocks_num = 0;
|
|
|
|
rndr->filled_mv_blocks_num = 0;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr->next_free_data_block_num = 0;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
return VO_TRUE;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
//XvMCHide hides the surface on next retrace, so
|
|
|
|
//check if the surface is not still displaying
|
2009-02-15 17:49:42 +00:00
|
|
|
static void check_osd_source(struct xvmc_pix_fmt *src_rndr) {
|
2009-02-20 22:49:09 +00:00
|
|
|
struct xvmc_pix_fmt *osd_rndr;
|
|
|
|
int stat;
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
//If this is source surface, check does the OSD rendering is compleate
|
|
|
|
if(src_rndr->state & AV_XVMC_STATE_OSD_SOURCE){
|
2010-08-03 15:55:17 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: OSD surface=%p querying\n",src_rndr);
|
2009-02-20 22:13:31 +00:00
|
|
|
osd_rndr = src_rndr->p_osd_target_surface_render;
|
|
|
|
XvMCGetSurfaceStatus(mDisplay, osd_rndr->p_surface, &stat);
|
|
|
|
if(!(stat & XVMC_RENDERING))
|
2009-02-14 17:18:55 +00:00
|
|
|
src_rndr->state &= ~AV_XVMC_STATE_OSD_SOURCE;
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
2009-01-05 14:48:03 +00:00
|
|
|
static int count_free_surfaces(void) {
|
2009-02-20 22:49:09 +00:00
|
|
|
int i,num;
|
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
num=0;
|
|
|
|
for(i=0; i<number_of_surfaces; i++){
|
|
|
|
check_osd_source(&surface_render[i]);
|
|
|
|
if(surface_render[i].state == 0)
|
|
|
|
num++;
|
|
|
|
}
|
|
|
|
return num;
|
2003-08-25 21:41:10 +00:00
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-15 17:49:42 +00:00
|
|
|
static struct xvmc_pix_fmt *find_free_surface(void) {
|
2009-02-20 22:49:09 +00:00
|
|
|
int i,t;
|
|
|
|
int stat;
|
|
|
|
struct xvmc_pix_fmt *visible_rndr;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
visible_rndr = NULL;
|
|
|
|
for(i=0; i<number_of_surfaces; i++){
|
|
|
|
|
|
|
|
check_osd_source(&surface_render[i]);
|
|
|
|
if( surface_render[i].state == 0){
|
|
|
|
XvMCGetSurfaceStatus(mDisplay, surface_render[i].p_surface,&stat);
|
|
|
|
if( (stat & XVMC_DISPLAYING) == 0 )
|
|
|
|
return &surface_render[i];
|
|
|
|
visible_rndr = &surface_render[i];// remember it, use as last resort
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//all surfaces are busy, but there is one that will be free
|
|
|
|
//on next monitor retrace, we just have to wait
|
|
|
|
if(visible_rndr != NULL){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_INFO,"vo_xvmc: waiting retrace\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
for(t=0;t<1000;t++){
|
|
|
|
usec_sleep(1000);//1ms
|
|
|
|
XvMCGetSurfaceStatus(mDisplay, visible_rndr->p_surface,&stat);
|
|
|
|
if( (stat & XVMC_DISPLAYING) == 0 )
|
|
|
|
return visible_rndr;
|
|
|
|
}
|
|
|
|
}
|
2003-08-25 21:41:10 +00:00
|
|
|
//todo remove when stable
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: no free surfaces, this should not happen in g1\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0;i<number_of_surfaces;i++)
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: surface[%d].state=%d\n",i,surface_render[i].state);
|
2009-02-20 22:13:31 +00:00
|
|
|
return NULL;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2007-02-19 11:38:19 +00:00
|
|
|
static void xvmc_clean_surfaces(void){
|
2009-02-20 22:49:09 +00:00
|
|
|
int i;
|
2007-02-19 11:38:19 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
for(i=0; i<number_of_surfaces; i++){
|
2007-02-19 11:38:19 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
surface_render[i].state&=!( AV_XVMC_STATE_DISPLAY_PENDING |
|
|
|
|
AV_XVMC_STATE_OSD_SOURCE |
|
|
|
|
0);
|
|
|
|
surface_render[i].p_osd_target_surface_render=NULL;
|
|
|
|
if(surface_render[i].state != 0){
|
|
|
|
mp_msg(MSGT_VO,MSGL_WARN,"vo_xvmc: surface[%d].state=%d\n",
|
2007-02-19 11:38:19 +00:00
|
|
|
i,surface_render[i].state);
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
free_element=0;//clean up the queue
|
2007-02-19 11:38:19 +00:00
|
|
|
}
|
|
|
|
|
2003-07-01 21:51:57 +00:00
|
|
|
static uint32_t get_image(mp_image_t *mpi){
|
2009-02-20 22:13:31 +00:00
|
|
|
struct xvmc_pix_fmt *rndr;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr = find_free_surface();
|
2003-08-25 21:41:10 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
if(rndr == NULL){
|
2009-02-20 23:46:24 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_ERR,"vo_xvmc: get_image failed\n");
|
2009-02-20 22:13:31 +00:00
|
|
|
return VO_FALSE;
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
|
2003-08-25 21:41:10 +00:00
|
|
|
assert(rndr->start_mv_blocks_num == 0);
|
|
|
|
assert(rndr->filled_mv_blocks_num == 0);
|
|
|
|
assert(rndr->next_free_data_block_num == 0);
|
2003-07-21 21:02:34 +00:00
|
|
|
|
2009-02-20 22:13:31 +00:00
|
|
|
mpi->flags |= MP_IMGFLAG_DIRECT;
|
2003-07-01 21:51:57 +00:00
|
|
|
//keep strides 0 to avoid field manipulations
|
2009-02-20 22:13:31 +00:00
|
|
|
mpi->stride[0] = 0;
|
|
|
|
mpi->stride[1] = 0;
|
|
|
|
mpi->stride[2] = 0;
|
2003-07-01 21:51:57 +00:00
|
|
|
|
|
|
|
// these are shared!! so watch out
|
|
|
|
// do call RenderSurface before overwriting
|
2009-02-20 22:13:31 +00:00
|
|
|
mpi->planes[0] = (char*)data_blocks.blocks;
|
|
|
|
mpi->planes[1] = (char*)mv_blocks.macro_blocks;
|
|
|
|
mpi->priv =
|
|
|
|
mpi->planes[2] = (char*)rndr;
|
|
|
|
|
|
|
|
rndr->picture_structure = 0;
|
|
|
|
rndr->flags = 0;
|
|
|
|
rndr->state = 0;
|
|
|
|
rndr->start_mv_blocks_num = 0;
|
|
|
|
rndr->filled_mv_blocks_num = 0;
|
|
|
|
rndr->next_free_data_block_num = 0;
|
|
|
|
|
2009-02-20 23:18:28 +00:00
|
|
|
mp_msg(MSGT_VO,MSGL_DBG4,"vo_xvmc: get_image: rndr=%p (surface=%p) \n",
|
2009-02-20 22:13:31 +00:00
|
|
|
rndr,rndr->p_surface);
|
2009-02-15 17:55:57 +00:00
|
|
|
return VO_TRUE;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
|
|
|
|
2008-04-02 16:38:34 +00:00
|
|
|
static int control(uint32_t request, void *data)
|
2003-07-01 21:51:57 +00:00
|
|
|
{
|
2009-02-20 22:13:31 +00:00
|
|
|
switch (request){
|
|
|
|
case VOCTRL_GET_DEINTERLACE:
|
|
|
|
*(int*)data = bob_deinterlace;
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_SET_DEINTERLACE:
|
|
|
|
bob_deinterlace = *(int*)data;
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_QUERY_FORMAT:
|
|
|
|
return query_format(*((uint32_t*)data));
|
|
|
|
case VOCTRL_DRAW_IMAGE:
|
|
|
|
return xvmc_draw_image((mp_image_t *)data);
|
|
|
|
case VOCTRL_GET_IMAGE:
|
|
|
|
return get_image((mp_image_t *)data);
|
|
|
|
//vo_xv
|
|
|
|
case VOCTRL_ONTOP:
|
|
|
|
vo_x11_ontop();
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_FULLSCREEN:
|
|
|
|
vo_x11_fullscreen();
|
|
|
|
// indended, fallthrough to update panscan on fullscreen/windowed switch
|
|
|
|
case VOCTRL_SET_PANSCAN:
|
|
|
|
if ( ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) || ( !vo_fs && vo_panscan_amount ) )
|
2003-07-01 21:51:57 +00:00
|
|
|
{
|
2009-02-20 22:13:31 +00:00
|
|
|
int old_y = vo_panscan_y;
|
|
|
|
panscan_calc();
|
|
|
|
|
|
|
|
if(old_y != vo_panscan_y)
|
|
|
|
{
|
|
|
|
//this also draws the colorkey
|
|
|
|
put_xvmc_image(p_render_surface_visible,1);
|
|
|
|
}
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|
2009-02-20 22:13:31 +00:00
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_GET_PANSCAN:
|
|
|
|
if ( !vo_config_count || !vo_fs ) return VO_FALSE;
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_SET_EQUALIZER:
|
|
|
|
{
|
2009-02-21 15:39:30 +00:00
|
|
|
struct voctrl_set_equalizer_args *args = data;
|
|
|
|
return vo_xv_set_eq(xv_port, args->name, args->value);
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case VOCTRL_GET_EQUALIZER:
|
|
|
|
{
|
2009-02-21 15:39:30 +00:00
|
|
|
struct voctrl_get_equalizer_args *args = data;
|
|
|
|
return vo_xv_get_eq(xv_port, args->name, args->valueptr);
|
2009-02-20 22:13:31 +00:00
|
|
|
}
|
|
|
|
case VOCTRL_UPDATE_SCREENINFO:
|
|
|
|
update_xinerama_info();
|
|
|
|
return VO_TRUE;
|
|
|
|
}
|
2009-02-20 22:49:09 +00:00
|
|
|
return VO_NOTIMPL;
|
2003-07-01 21:51:57 +00:00
|
|
|
}
|