[Redbutton-devel] SF.net SVN: redbutton: [232] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-03-01 12:09:48
|
Revision: 232
http://svn.sourceforge.net/redbutton/?rev=232&view=rev
Author: skilvington
Date: 2007-03-01 04:09:42 -0800 (Thu, 01 Mar 2007)
Log Message:
-----------
centre video within its VideoClass
Modified Paths:
--------------
redbutton-browser/trunk/MHEGStreamPlayer.c
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2007-02-26 16:07:56 UTC (rev 231)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2007-03-01 12:09:42 UTC (rev 232)
@@ -512,6 +512,8 @@
int out_y;
unsigned int out_width;
unsigned int out_height;
+ unsigned int vid_width;
+ unsigned int vid_height;
VideoFrame *vf;
double buffered;
double last_pts;
@@ -650,17 +652,24 @@
if(p->have_audio)
set_avsync_base(p, last_pts, last_time);
}
- /* origin of VideoClass */
+ /* origin and size of VideoClass */
pthread_mutex_lock(&p->video->inst.bbox_lock);
out_x = p->video->inst.Position.x_position;
out_y = p->video->inst.Position.y_position;
+ vid_width = p->video->inst.BoxSize.x_length;
+ vid_height = p->video->inst.BoxSize.y_length;
pthread_mutex_unlock(&p->video->inst.bbox_lock);
/* scale if fullscreen */
if(d->fullscreen)
{
out_x = (out_x * d->xres) / MHEG_XRES;
out_y = (out_y * d->yres) / MHEG_YRES;
+ vid_width = (vid_width * d->xres) / MHEG_XRES;
+ vid_height = (vid_height * d->yres) / MHEG_YRES;
}
+ /* if the frame is smaller or larger than the VideoClass, centre it */
+ out_x += (vid_width - out_width) / 2;
+ out_y += (vid_height - out_height) / 2;
/* draw the current frame */
MHEGVideoOutput_drawFrame(&vo, out_x, out_y);
/* redraw objects above the video */
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-02-26 16:07:56 UTC (rev 231)
+++ redbutton-browser/trunk/TODO 2007-03-01 12:09:42 UTC (rev 232)
@@ -1,7 +1,11 @@
+aspect ratio
+
+
VideoDecodeOffset
-if video size != VideoClass size, centre and draw a smaller transparent hole
+if video size != VideoClass size, draw a smaller transparent hole
+or fill the frame edges with black
clear overlay on boot/retune/launch/etc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|