diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-11 23:31:44 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-07-11 23:31:44 +0000 |
commit | 6f8f8cd72c2be8bf0b2404b8a0e9034b25f7e882 (patch) | |
tree | 575329ed765de6dedf2d3972b088bf67569d6452 | |
parent | 9bb1534ad8e6e3becfe01407e71da3f14421bc69 (diff) | |
download | xine-lib-6f8f8cd72c2be8bf0b2404b8a0e9034b25f7e882.tar.gz xine-lib-6f8f8cd72c2be8bf0b2404b8a0e9034b25f7e882.tar.bz2 |
fixed playback of field picture based streams using XShm
CVS patchset: 273
CVS date: 2001/07/11 23:31:44
-rw-r--r-- | src/libmpeg2/decode.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_xshm.c | 46 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 4 |
3 files changed, 48 insertions, 4 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 92a9d6033..9e2a5b2f6 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -264,6 +264,8 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, picture->current_frame->bFrameBad = 0; picture->current_frame->PTS = mpeg2dec->pts; mpeg2dec->pts = 0; + picture->current_frame->field(picture->current_frame, + picture->picture_structure); } } diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index a33ee9922..061710973 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.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_xshm.c,v 1.16 2001/07/10 19:33:05 guenter Exp $ + * $Id: video_out_xshm.c,v 1.17 2001/07/11 23:31:44 guenter Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -71,6 +71,7 @@ typedef struct xshm_frame_s { XImage *image; uint8_t *rgb_dst; int stripe_inc; + int y_off, uv_off; XShmSegmentInfo shminfo; } xshm_frame_t; @@ -350,7 +351,9 @@ static void xshm_frame_copy (vo_frame_t *vo_img, uint8_t **src) { this->yuv2rgb->yuv2rgb_fun (this->yuv2rgb, frame->rgb_dst, - src[0], src[1], src[2]); + src[0]+frame->y_off, + src[1]+frame->uv_off, + src[2]+frame->uv_off); #ifdef DETAILED_TIMING cycles = rdtsc() - tsc; @@ -362,6 +365,45 @@ static void xshm_frame_copy (vo_frame_t *vo_img, uint8_t **src) { static void xshm_frame_field (vo_frame_t *vo_img, int which_field) { /* FIXME: implement */ + xshm_frame_t *frame = (xshm_frame_t *) vo_img ; + xshm_driver_t *this = (xshm_driver_t *) vo_img->instance->driver; + + switch (which_field) { + case 1: + frame->rgb_dst = frame->image->data; + frame->stripe_inc = 2*this->stripe_height * frame->image->bytes_per_line; + frame->y_off = 0; + frame->uv_off = 0; + yuv2rgb_setup (this->yuv2rgb, + this->delivered_width, + 16, + this->delivered_width*2, + this->delivered_width, + this->output_width, + this->stripe_height, + frame->image->bytes_per_line*2); + + break; + case 2: + frame->rgb_dst = frame->image->data + frame->image->bytes_per_line ; + frame->stripe_inc = 2*this->stripe_height * frame->image->bytes_per_line; + frame->y_off = 0; /* this->delivered_width; FIXME ?!*/ + frame->uv_off = 0; /* this->delivered_width/2; */ + yuv2rgb_setup (this->yuv2rgb, + this->delivered_width, + 16, + this->delivered_width*2, + this->delivered_width, + this->output_width, + this->stripe_height, + frame->image->bytes_per_line*2); + break; + case 3: + frame->rgb_dst = frame->image->data; + frame->y_off = 0; + frame->uv_off = 0; + break; + } } static void xshm_frame_dispose (vo_frame_t *vo_img) { diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 2bcb5d4ea..4a07aaeb2 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.33 2001/07/10 19:33:05 guenter Exp $ + * $Id: video_out.c,v 1.34 2001/07/11 23:31:45 guenter Exp $ * */ @@ -36,7 +36,7 @@ #include "utils.h" #include "monitor.h" -#define NUM_FRAME_BUFFERS 20 +#define NUM_FRAME_BUFFERS 15 struct img_buf_fifo_s { vo_frame_t *first; |