# HG changeset patch # User diego # Date 1230915969 0 # Node ID b2e17894b4d0bc074148ff792307ea789758e993 # Parent 4ff9739122510a189b46b70393a05c5ed1eedab7 Sync with latest round of xvmc changes in FFmpeg. diff -r 4ff973912251 -r b2e17894b4d0 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Fri Jan 02 16:13:22 2009 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Fri Jan 02 17:06:09 2009 +0000 @@ -939,7 +939,7 @@ sh_video_t * sh = avctx->opaque; vd_ffmpeg_ctx *ctx = sh->context; mp_image_t* mpi=NULL; - xvmc_render_state_t * render; + struct xvmc_render_state * render; int flags= MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE| MP_IMGFLAG_DRAW_CALLBACK; @@ -1018,7 +1018,7 @@ pic->type= FF_BUFFER_TYPE_USER; - render=(xvmc_render_state_t*)mpi->priv;//same as data[2] + render=(struct xvmc_render_state*)mpi->priv;//same as data[2] if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) ) mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::mc_get_buffer (render=%p)\n",render); assert(render != 0); @@ -1032,7 +1032,7 @@ mp_image_t* mpi= pic->opaque; sh_video_t * sh = avctx->opaque; vd_ffmpeg_ctx *ctx = sh->context; - xvmc_render_state_t * render; + struct xvmc_render_state * render; int i; @@ -1045,7 +1045,7 @@ //printf("R%X %X\n", pic->linesize[0], pic->data[0]); //mark the surface as not requared for prediction - render=(xvmc_render_state_t*)pic->data[2];//same as mpi->priv + render=(struct xvmc_render_state*)pic->data[2];//same as mpi->priv if( mp_msg_test(MSGT_DECVIDEO,MSGL_DBG5) ) mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::mc_release_buffer (render=%p)\n",render); assert(render!=NULL); diff -r 4ff973912251 -r b2e17894b4d0 libvo/vo_xvmc.c --- a/libvo/vo_xvmc.c Fri Jan 02 16:13:22 2009 +0000 +++ b/libvo/vo_xvmc.c Fri Jan 02 17:06:09 2009 +0000 @@ -84,13 +84,13 @@ #define MAX_SURFACES 8 static int number_of_surfaces=0; static XvMCSurface surface_array[MAX_SURFACES]; -static xvmc_render_state_t * surface_render; +static struct xvmc_render_state * surface_render; -static xvmc_render_state_t * p_render_surface_to_show=NULL; -static xvmc_render_state_t * p_render_surface_visible=NULL; +static struct xvmc_render_state * p_render_surface_to_show=NULL; +static struct xvmc_render_state * p_render_surface_visible=NULL; //display queue, kinda render ahead -static xvmc_render_state_t * show_queue[MAX_SURFACES]; +static struct xvmc_render_state * show_queue[MAX_SURFACES]; static int free_element; @@ -118,7 +118,7 @@ static void xvmc_free(void); static void xvmc_clean_surfaces(void); static int count_free_surfaces(); -static xvmc_render_state_t * find_free_surface(); +static struct xvmc_render_state * find_free_surface(); static const vo_info_t info = { "XVideo Motion Compensation", @@ -346,13 +346,13 @@ } static uint32_t xvmc_draw_image(mp_image_t *mpi){ -xvmc_render_state_t * rndr; + struct xvmc_render_state * rndr; assert(mpi!=NULL); assert(mpi->flags &MP_IMGFLAG_DIRECT); // assert(mpi->flags &MP_IMGFLAGS_DRAWBACK); - rndr = (xvmc_render_state_t*)mpi->priv;//there is copy in plane[2] + rndr = (struct xvmc_render_state*)mpi->priv;//there is copy in plane[2] assert( rndr != NULL ); assert( rndr->magic == MP_XVMC_RENDER_MAGIC ); if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) @@ -520,8 +520,8 @@ printf("vo_xvmc: mv_blocks allocated\n"); if(surface_render==NULL) - surface_render=malloc(MAX_SURFACES*sizeof(xvmc_render_state_t));//easy mem debug - memset(surface_render,0,MAX_SURFACES*sizeof(xvmc_render_state_t)); + surface_render=malloc(MAX_SURFACES*sizeof(struct xvmc_render_state));//easy mem debug + memset(surface_render,0,MAX_SURFACES*sizeof(struct xvmc_render_state)); for(i=0; imagic == MP_XVMC_RENDER_MAGIC ); @@ -1187,8 +1188,8 @@ //XvMCHide hides the surface on next retrace, so //check if the surface is not still displaying -static void check_osd_source(xvmc_render_state_t * src_rndr){ -xvmc_render_state_t * osd_rndr; +static void check_osd_source(struct xvmc_render_state * src_rndr){ +struct xvmc_render_state * osd_rndr; int stat; //If this is source surface, check does the OSD rendering is compleate if(src_rndr->state & MP_XVMC_STATE_OSD_SOURCE){ @@ -1211,10 +1212,10 @@ return num; } -static xvmc_render_state_t * find_free_surface(){ +static struct xvmc_render_state * find_free_surface(){ int i,t; int stat; -xvmc_render_state_t * visible_rndr; +struct xvmc_render_state * visible_rndr; visible_rndr = NULL; for(i=0; i #include @@ -9,47 +29,47 @@ #include -//the surface should be shown, video driver manipulates this +//the surface should be shown, the video driver manipulates this #define MP_XVMC_STATE_DISPLAY_PENDING 1 -//the surface is needed for prediction, codec manipulates this +//the surface is needed for prediction, the codec manipulates this #define MP_XVMC_STATE_PREDICTION 2 //this surface is needed for subpicture rendering #define MP_XVMC_STATE_OSD_SOURCE 4 // 1337 IDCT MCo #define MP_XVMC_RENDER_MAGIC 0x1DC711C0 -typedef struct{ -//these are not changed by the decoder! - int magic; +struct xvmc_render_state { + //these are not changed by the decoder! + int magic; - short * data_blocks; - XvMCMacroBlock * mv_blocks; - int total_number_of_mv_blocks; - int total_number_of_data_blocks; - int mc_type;//XVMC_MPEG1/2/4,XVMC_H263 without XVMC_IDCT - int idct;//Do we use IDCT acceleration? - int chroma_format;//420,422,444 - int unsigned_intra;//+-128 for intra pictures after clip - XvMCSurface* p_surface;//pointer to rendered surface, never changed + short * data_blocks; + XvMCMacroBlock * mv_blocks; + int total_number_of_mv_blocks; + int total_number_of_data_blocks; + int mc_type; //XVMC_MPEG1/2/4,XVMC_H263 without XVMC_IDCT + int idct; //Do we use IDCT acceleration? + int chroma_format; //420, 422, 444 + int unsigned_intra; //+-128 for intra pictures after clipping + XvMCSurface* p_surface; //pointer to rendered surface, never changed -//these are changed by decoder -//used by XvMCRenderSurface function - XvMCSurface* p_past_surface;//pointer to the past surface - XvMCSurface* p_future_surface;//pointer to the future prediction surface + //these are changed by the decoder + //used by the XvMCRenderSurface function + XvMCSurface* p_past_surface; //pointer to the past surface + XvMCSurface* p_future_surface; //pointer to the future prediction surface - unsigned int picture_structure;//top/bottom fields or frame! - unsigned int flags;//XVMC_SECOND_FIELD - 1'st or 2'd field in the sequence - unsigned int display_flags; //1,2 or 1+2 fields for XvMCPutSurface, + unsigned int picture_structure; //top/bottom fields or frame! + unsigned int flags; //XVMC_SECOND_FIELD - 1st or 2nd field in the sequence + unsigned int display_flags; //1,2 or 1+2 fields for XvMCPutSurface -//these are internal communication ones - int state;//0-free, 1 Waiting to Display, 2 Waiting for prediction - int start_mv_blocks_num;//offset in the array for the current slice, updated by vo - int filled_mv_blocks_num;//processed mv block in this slice, changed by decoder + //these are for internal communication + int state; //0 - free, 1 - waiting to display, 2 - waiting for prediction + int start_mv_blocks_num; //offset in the array for the current slice, updated by vo + int filled_mv_blocks_num; //processed mv block in this slice, changed by decoder - int next_free_data_block_num;//used in add_mv_block, pointer to next free block -//extensions - void * p_osd_target_surface_render;//pointer to the surface where subpicture is rendered + int next_free_data_block_num; //used in add_mv_block, pointer to next free block + //extensions + void * p_osd_target_surface_render; //pointer to the surface where subpicture is rendered -} xvmc_render_state_t; +}; -#endif /* MPLAYER_XVMC_RENDER_H */ +#endif /* AVCODEC_XVMC_RENDER_H */