[Redbutton-devel] SF.net SVN: redbutton: [286] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-04-15 09:17:30
|
Revision: 286
http://svn.sourceforge.net/redbutton/?rev=286&view=rev
Author: skilvington
Date: 2007-04-15 02:17:28 -0700 (Sun, 15 Apr 2007)
Log Message:
-----------
add SetVideoDecodeOffset method to VideoClass
Modified Paths:
--------------
redbutton-browser/trunk/MHEGStreamPlayer.c
redbutton-browser/trunk/VideoClass.c
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2007-04-13 22:14:11 UTC (rev 285)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2007-04-15 09:17:28 UTC (rev 286)
@@ -510,6 +510,8 @@
MHEGVideoOutput vo;
int out_x;
int out_y;
+ int off_x;
+ int off_y;
unsigned int out_width;
unsigned int out_height;
unsigned int vid_width;
@@ -658,6 +660,9 @@
out_y = p->video->inst.Position.y_position;
vid_width = p->video->inst.BoxSize.x_length;
vid_height = p->video->inst.BoxSize.y_length;
+ /* VideoDecodeOffset position */
+ off_x = p->video->inst.VideoDecodeOffset.x_position;
+ off_y = p->video->inst.VideoDecodeOffset.y_position;
pthread_mutex_unlock(&p->video->inst.bbox_lock);
/* scale if fullscreen */
if(d->fullscreen)
@@ -666,12 +671,14 @@
out_y = (out_y * d->yres) / MHEG_YRES;
vid_width = (vid_width * d->xres) / MHEG_XRES;
vid_height = (vid_height * d->yres) / MHEG_YRES;
+ off_x = (off_x * d->xres) / MHEG_XRES;
+ off_y = (off_y * 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);
+ MHEGVideoOutput_drawFrame(&vo, out_x + off_x, out_y + off_y);
/* redraw objects above the video */
pthread_mutex_lock(&p->video->inst.bbox_lock);
MHEGDisplay_refresh(d, &p->video->inst.Position, &p->video->inst.BoxSize);
Modified: redbutton-browser/trunk/VideoClass.c
===================================================================
--- redbutton-browser/trunk/VideoClass.c 2007-04-13 22:14:11 UTC (rev 285)
+++ redbutton-browser/trunk/VideoClass.c 2007-04-15 09:17:28 UTC (rev 286)
@@ -360,8 +360,15 @@
{
verbose("VideoClass: %s; SetVideoDecodeOffset", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: VideoClass_SetVideoDecodeOffset not yet implemented\n");
+ pthread_mutex_lock(&t->inst.bbox_lock);
+ t->inst.VideoDecodeOffset.x_position = GenericInteger_getInteger(¶ms->new_x_offset, caller_gid);
+ t->inst.VideoDecodeOffset.y_position = GenericInteger_getInteger(¶ms->new_y_offset, caller_gid);
+ pthread_mutex_unlock(&t->inst.bbox_lock);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|