diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-10-06 21:52:42 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-10-06 21:52:42 +0000 |
commit | 2e29bd1fe0c87addc57755fb9812569e75cd4e39 (patch) | |
tree | ef23e232f9d63823f44bb6c4ffd604989cc222a0 /src/xine-engine | |
parent | c3a7991dd5e1b7a1013afd4e2c154fc870553c1c (diff) | |
download | xine-lib-2e29bd1fe0c87addc57755fb9812569e75cd4e39.tar.gz xine-lib-2e29bd1fe0c87addc57755fb9812569e75cd4e39.tar.bz2 |
- add XvMC support
- bump vo and post interface versions
obs: video_out_xvmc.c needs some more work, see todo.
CVS patchset: 5459
CVS date: 2003/10/06 21:52:42
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/post.c | 33 | ||||
-rw-r--r-- | src/xine-engine/post.h | 4 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 3 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 72 |
4 files changed, 99 insertions, 13 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index a57f9748f..1b1f70308 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: post.c,v 1.14 2003/08/15 14:38:04 mroi Exp $ + * $Id: post.c,v 1.15 2003/10/06 21:52:44 miguelfreitas Exp $ */ /* @@ -91,7 +91,6 @@ static int post_video_set_property(xine_video_port_t *port_gen, int property, in return port->original_port->set_property(port->original_port, property, value); } - post_video_port_t *post_intercept_video_port(post_plugin_t *post, xine_video_port_t *original) { post_video_port_t *post_port = (post_video_port_t *)malloc(sizeof(post_video_port_t)); @@ -158,6 +157,33 @@ static void post_frame_dispose(vo_frame_t *vo_img) { vo_img->dispose(vo_img); } +static void post_frame_proc_macro_block(int x, + int y, + int mb_type, + int motion_type, + int (*mv_field_sel)[2], + int *dmvector, + int cbp, + int dct_type, + vo_frame_t *current_frame, + vo_frame_t *forward_ref_frame, + vo_frame_t *backward_ref_frame, + int picture_structure, + int second_field, + int (*f_mot_pmv)[2], + int (*b_mot_pmv)[2]) { + post_video_port_t *port = (post_video_port_t *)current_frame->port; + post_restore_video_frame(current_frame, port); + post_restore_video_frame(forward_ref_frame, port); + post_restore_video_frame(backward_ref_frame, port); + current_frame->proc_macro_block(x, y, mb_type, motion_type, mv_field_sel, + dmvector, cbp, dct_type, current_frame, + forward_ref_frame, backward_ref_frame, + picture_structure, second_field, + f_mot_pmv, b_mot_pmv); +} + + void post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) { port->original_frame.port = frame->port; @@ -167,6 +193,7 @@ void post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) { port->original_frame.draw = frame->draw; port->original_frame.lock = frame->lock; port->original_frame.dispose = frame->dispose; + port->original_frame.proc_macro_block = frame->proc_macro_block; frame->port = &port->port; frame->free = post_frame_free; @@ -175,6 +202,7 @@ void post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) { frame->draw = post_frame_draw; frame->lock = post_frame_lock; frame->dispose = post_frame_dispose; + frame->proc_macro_block = post_frame_proc_macro_block; } void post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) { @@ -185,6 +213,7 @@ void post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) { frame->draw = port->original_frame.draw; frame->lock = port->original_frame.lock; frame->dispose = port->original_frame.dispose; + frame->proc_macro_block = port->original_frame.proc_macro_block; } diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h index e29f12cdd..8cd658e7a 100644 --- a/src/xine-engine/post.h +++ b/src/xine-engine/post.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: post.h,v 1.11 2003/08/15 14:38:04 mroi Exp $ + * $Id: post.h,v 1.12 2003/10/06 21:52:45 miguelfreitas Exp $ * * post plugin definitions * @@ -38,7 +38,7 @@ # include <xine/xineutils.h> #endif -#define POST_PLUGIN_IFACE_VERSION 4 +#define POST_PLUGIN_IFACE_VERSION 5 typedef struct post_class_s post_class_t; diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 62dda64be..5c8b12c82 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.c,v 1.171 2003/09/13 16:15:38 miguelfreitas Exp $ + * $Id: video_out.c,v 1.172 2003/10/06 21:52:45 miguelfreitas Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -298,6 +298,7 @@ static vo_frame_t *vo_get_frame (xine_video_port_t *this_gen, img->progressive_frame = 0; img->repeat_first_field = 0; img->top_field_first = 1; + img->macroblocks = NULL; extra_info_reset ( img->extra_info ); /* let driver ensure this image has the right format */ diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 957b8aef7..c4cdb2d03 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out.h,v 1.96 2003/08/15 14:35:09 mroi Exp $ + * $Id: video_out.h,v 1.97 2003/10/06 21:52:45 miguelfreitas Exp $ * * * xine version of video_out.h @@ -70,6 +70,13 @@ typedef struct extra_info_s extra_info_t; * adaption of the post plugin decoration layer. Be sure to look into * src/xine-engine/post.[ch]. */ + +typedef struct xine_macroblock_s { + short *blockptr; // pointer to current dct block + short *blockbaseptr; // pointer to base of dct block array in blocks + short xvmc_accel; // type of acceleration supported +} xine_macroblocks_t; + struct vo_frame_s { /* * member functions @@ -97,6 +104,23 @@ struct vo_frame_s { /* free memory/resources for this frame */ void (*dispose) (vo_frame_t *vo_img); + + /* XvMC routine for rendering macroblocks */ + void (*proc_macro_block)(int x, + int y, + int mb_type, + int motion_type, + int (*mv_field_sel)[2], + int *dmvector, + int cbp, + int dct_type, + vo_frame_t *current_frame, + vo_frame_t *forward_ref_frame, + vo_frame_t *backward_ref_frame, + int picture_structure, + int second_field, + int (*f_mot_pmv)[2], + int (*b_mot_pmv)[2]); /* * public variables to decoders and vo drivers @@ -119,6 +143,7 @@ struct vo_frame_s { * that reason, this flag should be interpreted as a "hint". */ int progressive_frame; + int picture_coding_type; /* pan/scan offset */ int pan_scan_x; @@ -136,6 +161,9 @@ struct vo_frame_s { int flags; /* remember the frame flags */ int copy_called; /* track use of copy() method */ + /* used to carry macroblocks information for XvMC acceleration */ + xine_macroblocks_t *macroblocks; + /* "backward" references to where this frame originates from */ xine_video_port_t *port; vo_driver_t *driver; @@ -151,7 +179,6 @@ struct vo_frame_s { int id; /* debugging - track this frame */ int is_first; - }; /* @@ -248,11 +275,12 @@ struct xine_video_port_s { /* get_frame flags */ -#define VO_TOP_FIELD 1 -#define VO_BOTTOM_FIELD 2 -#define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD) -#define VO_PAN_SCAN_FLAG 4 -#define VO_INTERLACED_FLAG 8 +#define VO_TOP_FIELD 1 +#define VO_BOTTOM_FIELD 2 +#define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD) +#define VO_PAN_SCAN_FLAG 4 +#define VO_INTERLACED_FLAG 8 +#define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (used by XvMC) */ /* video driver capabilities */ @@ -269,6 +297,34 @@ struct xine_video_port_s { #define VO_CAP_CONTRAST 0x00000080 /* driver can set CONTRAST value */ #define VO_CAP_COLORKEY 0x00000100 /* driver can set COLORKEY value */ #define VO_CAP_AUTOPAINT_COLORKEY 0x00000200 /* driver can set AUTOPAINT_COLORKEY value */ +#define VO_CAP_XVMC_MOCOMP 0x00000400 /* driver can set XvMC motion compensation */ +#define VO_CAP_XVMC_IDCT 0x00000800 /* driver can use XvMC idct acceleration */ + +/* macroblock modes */ +#define XINE_MACROBLOCK_INTRA 1 +#define XINE_MACROBLOCK_PATTERN 2 +#define XINE_MACROBLOCK_MOTION_BACKWARD 4 +#define XINE_MACROBLOCK_MOTION_FORWARD 8 +#define XINE_MACROBLOCK_QUANT 16 +#define XINE_MACROBLOCK_DCT_TYPE_INTERLACED 32 + +/* motion types */ +#define XINE_MC_FIELD 1 +#define XINE_MC_FRAME 2 +#define XINE_MC_16X8 2 +#define XINE_MC_DMV 3 + +/* picture coding type */ +#define XINE_PICT_I_TYPE 1 +#define XINE_PICT_P_TYPE 2 +#define XINE_PICT_B_TYPE 3 +#define XINE_PICT_D_TYPE 4 + +/* xvmc acceleration types */ +#define XINE_VO_MOTION_ACCEL 1 +#define XINE_VO_IDCT_ACCEL 2 +#define XINE_VO_SIGNED_INTRA 4 + /* * vo_driver_s contains the functions every display driver @@ -279,7 +335,7 @@ struct xine_video_port_s { * from generic vo functions. */ -#define VIDEO_OUT_DRIVER_IFACE_VERSION 16 +#define VIDEO_OUT_DRIVER_IFACE_VERSION 17 struct vo_driver_s { |