diff options
author | Robin KAY <komadori@users.sourceforge.net> | 2003-10-22 20:38:09 +0000 |
---|---|---|
committer | Robin KAY <komadori@users.sourceforge.net> | 2003-10-22 20:38:09 +0000 |
commit | 51616b96cd2793085ae314fecde90ac9a0735a04 (patch) | |
tree | 0b39e50ada1882338f37d0225729a201c755e61c /src/xine-engine | |
parent | 35decc993a98b994662fcdca0fc537398d64a03d (diff) | |
download | xine-lib-51616b96cd2793085ae314fecde90ac9a0735a04.tar.gz xine-lib-51616b96cd2793085ae314fecde90ac9a0735a04.tar.bz2 |
Replace copy member in vo_frame_t with proc_frame and proc_slice. Increase video_out API version to 18.
CVS patchset: 5574
CVS date: 2003/10/22 20:38:09
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/post.c | 22 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 23 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 16 |
3 files changed, 36 insertions, 25 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index 1b1f70308..bbccf1187 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.15 2003/10/06 21:52:44 miguelfreitas Exp $ + * $Id: post.c,v 1.16 2003/10/22 20:38:10 komadori Exp $ */ /* @@ -125,10 +125,17 @@ static void post_frame_free(vo_frame_t *vo_img) { vo_img->free(vo_img); } -static void post_frame_copy(vo_frame_t *vo_img, uint8_t **src) { +static void post_frame_proc_slice(vo_frame_t *vo_img, uint8_t **src) { post_video_port_t *port = (post_video_port_t *)vo_img->port; vo_img->port = port->original_port; - port->original_frame.copy(vo_img, src); + port->original_frame.proc_slice(vo_img, src); + vo_img->port = &port->port; +} + +static void post_frame_proc_frame(vo_frame_t *vo_img, uint8_t **src) { + post_video_port_t *port = (post_video_port_t *)vo_img->port; + vo_img->port = port->original_port; + port->original_frame.proc_frame(vo_img, src); vo_img->port = &port->port; } @@ -188,7 +195,8 @@ static void post_frame_proc_macro_block(int x, void post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) { port->original_frame.port = frame->port; port->original_frame.free = frame->free; - port->original_frame.copy = frame->copy; + port->original_frame.proc_slice = frame->proc_slice; + port->original_frame.proc_frame = frame->proc_frame; port->original_frame.field = frame->field; port->original_frame.draw = frame->draw; port->original_frame.lock = frame->lock; @@ -197,7 +205,8 @@ void post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) { frame->port = &port->port; frame->free = post_frame_free; - frame->copy = frame->copy ? post_frame_copy : NULL; /* this one can be NULL */ + frame->proc_slice = frame->proc_slice ? post_frame_proc_slice : NULL; + frame->proc_frame = frame->proc_frame ? post_frame_proc_frame : NULL; frame->field = post_frame_field; frame->draw = post_frame_draw; frame->lock = post_frame_lock; @@ -208,7 +217,8 @@ void post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) { void post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) { frame->port = port->original_port; frame->free = port->original_frame.free; - frame->copy = port->original_frame.copy; + frame->proc_slice = port->original_frame.proc_slice; + frame->proc_frame = port->original_frame.proc_frame; frame->field = port->original_frame.field; frame->draw = port->original_frame.draw; frame->lock = port->original_frame.lock; diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index d4d712dfc..f91cf15f3 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.173 2003/10/08 02:32:04 miguelfreitas Exp $ + * $Id: video_out.c,v 1.174 2003/10/22 20:38:10 komadori Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -221,9 +221,12 @@ static void vo_frame_dec_lock (vo_frame_t *img) { /* call vo_driver->copy method for the entire frame */ static void vo_frame_driver_copy(vo_frame_t *img) -{ - if (img->format == XINE_IMGFMT_YV12) { - if (img->copy) { +{ + if (img->proc_frame) { + img->proc_frame(img, img->base); + } + else if (img->proc_slice) { + if (img->format == XINE_IMGFMT_YV12) { int height = img->height; uint8_t* src[3]; @@ -231,21 +234,19 @@ static void vo_frame_driver_copy(vo_frame_t *img) src[1] = img->base[1]; src[2] = img->base[2]; while ((height -= 16) > -16) { - img->copy(img, src); + img->proc_slice(img, src); src[0] += 16 * img->pitches[0]; src[1] += 8 * img->pitches[1]; src[2] += 8 * img->pitches[2]; } - } - } else { - if (img->copy) { + } else { int height = img->height; uint8_t* src[3]; src[0] = img->base[0]; while ((height -= 16) > -16) { - img->copy(img, src); + img->proc_slice(img, src); src[0] += 16 * img->pitches[0]; } } @@ -391,7 +392,7 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { if (!img->bad_frame) { /* do not call copy() for frames that will be dropped */ - if( !frames_to_skip && img->copy && !img->copy_called ) + if( !frames_to_skip && !img->copy_called ) vo_frame_driver_copy(img); /* @@ -791,7 +792,7 @@ static void overlay_and_display_frame (vos_t *this, /* no, this is not were copy() is usually called. * it's just to catch special cases like late or duplicated frames. */ - if( img->copy && !img->copy_called ) + if(!img->copy_called ) vo_frame_driver_copy(img); pthread_mutex_lock( &img->stream->current_extra_info_lock ); diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index c4cdb2d03..3e132ac94 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.97 2003/10/06 21:52:45 miguelfreitas Exp $ + * $Id: video_out.h,v 1.98 2003/10/22 20:38:10 komadori Exp $ * * * xine version of video_out.h @@ -84,10 +84,14 @@ struct vo_frame_s { /* this frame is no longer used by the decoder, video driver, etc */ void (*free) (vo_frame_t *vo_img); - + + /* tell video driver to copy/convert the whole of this frame, may be NULL */ + /* this function MUST set the variable copy_called above */ + void (*proc_frame) (vo_frame_t *vo_img, uint8_t **src); + /* tell video driver to copy/convert a slice of this frame, may be NULL */ /* this function MUST set the variable copy_called above */ - void (*copy) (vo_frame_t *vo_img, uint8_t **src); + void (*proc_slice) (vo_frame_t *vo_img, uint8_t **src); /* tell video driver that the decoder starts a new field */ void (*field) (vo_frame_t *vo_img, int which_field); @@ -284,10 +288,6 @@ struct xine_video_port_s { /* video driver capabilities */ -/* driver copies image (i.e. converts it to - rgb buffers in the private fields of image buffer) */ -#define VO_CAP_COPIES_IMAGE 0x00000001 - #define VO_CAP_YV12 0x00000002 /* driver can handle YUV 4:2:0 pictures */ #define VO_CAP_YUY2 0x00000004 /* driver can handle YUY2 pictures */ @@ -335,7 +335,7 @@ struct xine_video_port_s { * from generic vo functions. */ -#define VIDEO_OUT_DRIVER_IFACE_VERSION 17 +#define VIDEO_OUT_DRIVER_IFACE_VERSION 18 struct vo_driver_s { |