diff options
author | deva <deva> | 2006-04-19 13:30:10 +0000 |
---|---|---|
committer | deva <deva> | 2006-04-19 13:30:10 +0000 |
commit | a6aaea79af5c166bcaad26edf6e0f8354f4d2b0b (patch) | |
tree | b29dfe04a9dc8fe18ab2d5b336e04b1e8f1a67e2 /client/player.cc | |
parent | 108e71a9fb9b69fb58a1a4d72104527ef0165508 (diff) |
*** empty log message ***
Diffstat (limited to 'client/player.cc')
-rw-r--r-- | client/player.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/client/player.cc b/client/player.cc index cb62de8..a7d0a7c 100644 --- a/client/player.cc +++ b/client/player.cc @@ -29,22 +29,23 @@ #define WIDTH 720 #define HEIGHT 576 -Player::Player(QWidget *w, Decoder *d) : - dvdecoder(DV::ColorBest) +Player::Player(QWidget *w, Decoder *d) { 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()); + dvdecoder->setOutputBuffer(render.getDisplayData()); } Player::~Player() { render.end(); + delete dvdecoder; } void Player::show_frame() @@ -52,15 +53,19 @@ void Player::show_frame() char *frame; frame = decoder->pframeAcquire(); // Acquire frame data - dvdecoder.decode(frame); + dvdecoder->decode(frame); decoder->pframeRelease(); // Release frame data - if(widget->width() / 4 < widget->height() / 3) { + if((double)widget->width() / WIDTH < (double)widget->height() / HEIGHT) { render.width = widget->width(); - render.height = render.width / 4 * 3; + render.height = (unsigned int)((double)render.width / (double)WIDTH * (double)HEIGHT); } else { render.height = widget->height(); - render.width = render.height / 3 * 4; + render.width = (unsigned int)((double)render.height / (double)HEIGHT * (double)WIDTH); } - render.display(WIDTH / 2, HEIGHT / 2); + + // render.width = widget->width(); + // render.height = widget->height(); + + render.display(WIDTH, HEIGHT); } |