From 451678d3aadf81b6f39f2f0e7957f4bf704bf9af Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 30 Mar 2006 08:03:29 +0000 Subject: *** empty log message *** --- client/player.cc | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/player.cc b/client/player.cc index 9a02152..c891941 100644 --- a/client/player.cc +++ b/client/player.cc @@ -29,6 +29,18 @@ #include "info.h" #include +#define DV_FOURCC_YV12 0x32315659 /* 4:2:0 Planar mode: Y + V + U (3 planes) */ +#define DV_FOURCC_YUY2 0x32595559 /* 4:2:2 Packed mode: Y0+U0+Y1+V0 (1 plane) */ + +#include +#include +#include +#include +#include +#include +#include +#include + Player::Player(VideoWidget *v) { video = v; @@ -109,6 +121,8 @@ Player::Player(VideoWidget *v) if(port == 0) { MIaV::info->error("Unable to find suitable port."); return; + } else { + MIaV::info->info("Using port %d.", port); } } @@ -117,9 +131,41 @@ Player::~Player() //XCloseDisplay(dpy); // Close the Display } +extern XvImage *XvShmCreateImage(Display*, XvPortID, int, char*, int, int, XShmSegmentInfo*); void Player::run() { - XvPutStill(display, port, drawable, gc, 0, 0, 320, 200, 0, 0, 320, 200); + XShmSegmentInfo yuv_shminfo; + yuv_shminfo.shmid = shmget(IPC_PRIVATE, + 720*576*4, //yuv_image->data_size, + IPC_CREAT | 0777); + // yuv_shminfo.shmaddr = shmat(yuv_shminfo.shmid, 0, 0); + yuv_shminfo.readOnly = False; + + char pixels[720*576*4][4]; + XvImage* xv_image = XvShmCreateImage(display, port, + DV_FOURCC_YUY2, // DV_FOURCC_YV12 + pixels[0], + 720, 576,// dv_dpy->width, dv_dpy->height, + &yuv_shminfo); + int swidth = 720; + int sheight = 576; + int lxoff = 0; + int lyoff = 0; + int lwidth = swidth; + int lheight = sheight; + + XvShmPutImage(display, port, + drawable, gc, + xv_image, + 0, 0, + swidth, sheight, + lxoff, lyoff, + lwidth, lheight, + True); + + XFlush(display); + + // XvPutStill(display, port, drawable, gc, 0, 0, 320, 200, 0, 0, 320, 200); } -- cgit v1.2.3