summaryrefslogtreecommitdiff
path: root/client/player.cc
diff options
context:
space:
mode:
authordeva <deva>2006-04-12 13:41:45 +0000
committerdeva <deva>2006-04-12 13:41:45 +0000
commit6da7cc9bd16bb16f03bf0695b79cb41f9f23f58f (patch)
treea8f94dd7ff7e10a308d0ce0787a8070a621c4fa6 /client/player.cc
parentc9a7d3ecf5a5e979c4503dbf1f072898ffd72574 (diff)
*** empty log message ***
Diffstat (limited to 'client/player.cc')
-rw-r--r--client/player.cc32
1 files changed, 27 insertions, 5 deletions
diff --git a/client/player.cc b/client/player.cc
index a8f6152..5ee0ccd 100644
--- a/client/player.cc
+++ b/client/player.cc
@@ -54,13 +54,35 @@ void Player::show_frame()
fprintf(stderr, "Frame!%d\n", num++);
frame = decoder->getFrame();
- if(!frame) return;
-
- dvdecoder.decode(frame);
- free(frame);
+ if(frame) {
+ dvdecoder.decode(frame);
+ free(frame);
+ }
render.width = widget->width();
render.height = widget->height();
render.display(WIDTH, HEIGHT);
-
}
+
+//Hmm ... is this how it should work?
+void Player::getScreenShot(QImage *image)
+{
+ double R, G, B;
+ double Y, U, V;
+
+ char *yuv = render.getDisplayData();
+
+ for(int x = 0; x < WIDTH; x++) {
+ for(int y = 0; y < HEIGHT; y++) {
+ Y = yuv[(x + y * WIDTH)];
+ U = yuv[(x + y * WIDTH)];
+ V = yuv[(x + y * WIDTH)];
+
+ R = Y + 1.4075 * (V - 128);
+ G = Y - (0.3455 * (U - 128)) - (0.7169 * (V - 128));
+ B = Y + 1.7790 * (U - 128);
+ // QRgb qRgb((unsigned int)R,(unsigned int)G,(unsigned int)B);
+ image->setPixel(x, y, qRgb((unsigned int)R,(unsigned int)G,(unsigned int)B));
+ }
+ }
+ }