From 1b68dd554e2e238f499ebfd12c222263fe050bd2 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 19 Apr 2006 14:13:11 +0000 Subject: *** empty log message *** --- client/player.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'client/player.cc') diff --git a/client/player.cc b/client/player.cc index a7d0a7c..44e9cc9 100644 --- a/client/player.cc +++ b/client/player.cc @@ -29,14 +29,13 @@ #define WIDTH 720 #define HEIGHT 576 -Player::Player(QWidget *w, Decoder *d) +Player::Player(QWidget *w, Decoder *d) : + render(w, WIDTH, HEIGHT) { widget = w; decoder = d; dvdecoder = new LibDVWrapper(DV::ColorBest, DV::PAL, DV::YUV_422); - render.init(widget, WIDTH, HEIGHT); - connect(this, SIGNAL(timeout()), this, SLOT(show_frame())); dvdecoder->setOutputBuffer(render.getDisplayData()); @@ -44,7 +43,6 @@ Player::Player(QWidget *w, Decoder *d) Player::~Player() { - render.end(); delete dvdecoder; } @@ -53,9 +51,10 @@ void Player::show_frame() char *frame; frame = decoder->pframeAcquire(); // Acquire frame data - dvdecoder->decode(frame); + dvdecoder->decode(frame); // Decode the DV frame to YUV decoder->pframeRelease(); // Release frame data + // Scale the video in aspect: if((double)widget->width() / WIDTH < (double)widget->height() / HEIGHT) { render.width = widget->width(); render.height = (unsigned int)((double)render.width / (double)WIDTH * (double)HEIGHT); @@ -64,8 +63,6 @@ void Player::show_frame() render.width = (unsigned int)((double)render.height / (double)HEIGHT * (double)WIDTH); } - // render.width = widget->width(); - // render.height = widget->height(); - + // Display the YUV frame render.display(WIDTH, HEIGHT); } -- cgit v1.2.3