summaryrefslogtreecommitdiff
path: root/client/player.cc
diff options
context:
space:
mode:
authordeva <deva>2006-04-19 14:13:11 +0000
committerdeva <deva>2006-04-19 14:13:11 +0000
commit1b68dd554e2e238f499ebfd12c222263fe050bd2 (patch)
treefa9fe9e22b232db22a7bf3d45f7d5a4b6825ed7c /client/player.cc
parenta6aaea79af5c166bcaad26edf6e0f8354f4d2b0b (diff)
*** empty log message ***
Diffstat (limited to 'client/player.cc')
-rw-r--r--client/player.cc13
1 files changed, 5 insertions, 8 deletions
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);
}