diff options
Diffstat (limited to 'client/player.cc')
-rw-r--r-- | client/player.cc | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/client/player.cc b/client/player.cc index f44842c..fad7df4 100644 --- a/client/player.cc +++ b/client/player.cc @@ -26,6 +26,45 @@ */ #include "player.h" +static unsigned char yuv[720*576*4]; +static int num = 0; + +Player::Player(VideoWidget *w) +{ + widget = w; + + render.init(widget, 720, 576);//widget->getWidth(), widget->getHeight() + + connect(this, SIGNAL(timeout()), this, SLOT(show_frame())); + + for(int x = 1; x < 720; x++) + for(int y = 1; y < 576; y++) { + yuv[x + y * 576 * 1] = x % 720 * 255; + yuv[x + y * 576 * 2] = y % 576 * 255; + yuv[x + y * 576 * 3] = (unsigned char)x % y; + } +} + +Player::~Player() +{ + render.end(); +} + +void Player::show_frame() +{ + fprintf(stderr, "Frame!%d\n", num++); + render.width = widget->getWidth(); + render.height = widget->getHeight(); + render.display(yuv, 720, 576);//widget->width(), widget->height()); +} + + + + + + +#if 0 + #define DBG(x) fprintf(stderr, x) #include "info.h" @@ -284,7 +323,7 @@ void Player::run() // From: // http://cvs.sourceforge.net/viewcvs.py/libmpeg2/MSSG/display_x11.c?rev=1.2 -#if 0 +//#if 0 #ifdef HAVE_XV xv_port = 0; if (Success == XvQueryExtension(mydisplay,&ver,&rel,&req,&ev,&err)) { |