From 6190ad7c794c2e64039651b76c0ee024a1914e24 Mon Sep 17 00:00:00 2001 From: Mike Melanson Date: Fri, 4 Oct 2002 04:55:43 +0000 Subject: added support for raw YV12 data CVS patchset: 2780 CVS date: 2002/10/04 04:55:43 --- src/libxinevdec/yuv.c | 19 +++++++++++++++++-- src/xine-engine/buffer.h | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index a6e2d3d71..f93c8a610 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.7 2002/09/13 03:03:42 tmmm Exp $ + * $Id: yuv.c,v 1.8 2002/10/04 04:55:44 tmmm Exp $ */ #include @@ -135,7 +135,21 @@ static void yuv_decode_data (video_decoder_t *this_gen, if (buf->decoder_flags & BUF_FLAG_FRAME_END) { - if (buf->type == BUF_VIDEO_YVU9) { + if (buf->type == BUF_VIDEO_YV12) { + + img = this->video_out->get_frame (this->video_out, + this->width, this->height, + 42, XINE_IMGFMT_YV12, VO_BOTH_FIELDS); + + xine_fast_memcpy(img->base[0], this->buf, this->width * this->height); + xine_fast_memcpy(img->base[1], this->buf + this->width * this->height, + (this->width * this->height) / 4); + xine_fast_memcpy(img->base[2], + this->buf + (this->width * this->height) + + ((this->width * this->height) / 4), + (this->width * this->height) / 4); + + } else if (buf->type == BUF_VIDEO_YVU9) { img = this->video_out->get_frame (this->video_out, this->width, this->height, @@ -303,6 +317,7 @@ static void *init_video_decoder_plugin (xine_t *xine, void *data) { */ static uint32_t video_types[] = { + BUF_VIDEO_YV12, BUF_VIDEO_YVU9, BUF_VIDEO_GREY, 0 diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 3ecbfc7c9..e1683c122 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.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: buffer.h,v 1.69 2002/09/13 18:25:23 guenter Exp $ + * $Id: buffer.h,v 1.70 2002/10/04 04:55:43 tmmm Exp $ * * * contents: @@ -128,6 +128,7 @@ extern "C" { #define BUF_VIDEO_GREY 0x022E0000 #define BUF_VIDEO_XXAN 0x022F0000 #define BUF_VIDEO_WC3 0x02300000 +#define BUF_VIDEO_YV12 0x02310000 /* audio buffer types: (please keep in sync with buffer_types.c) */ -- cgit v1.2.3