[MPlayer-cvslog] CVS: main/libvo vo_macosx.h, 1.5, 1.6 vo_macosx.m, 1.17, 1.18

Nicolas Plourde CVS syncmail at mplayerhq.hu
Wed Jun 15 23:49:52 CEST 2005


CVS change done by Nicolas Plourde CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv16667/libvo

Modified Files:
	vo_macosx.h vo_macosx.m 
Log Message:
new texture frame

Index: vo_macosx.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_macosx.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vo_macosx.h	15 Jun 2005 14:48:33 -0000	1.5
+++ vo_macosx.h	15 Jun 2005 21:49:50 -0000	1.6
@@ -23,6 +23,7 @@
 	CVPixelBufferRef currentFrameBuffer;
 	CVOpenGLTextureCacheRef textureCache;
 	CVOpenGLTextureRef texture;
+	NSRect textureFrame;
 	
     GLfloat	lowerLeft[2]; 
     GLfloat lowerRight[2]; 

Index: vo_macosx.m
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_macosx.m,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vo_macosx.m	15 Jun 2005 16:54:43 -0000	1.17
+++ vo_macosx.m	15 Jun 2005 21:49:50 -0000	1.18
@@ -41,7 +41,6 @@
 static uint32_t image_depth;
 static uint32_t image_bytes;
 static uint32_t image_format;
-static NSRect image_rec;
 
 //vo
 extern int vo_rootwin;
@@ -532,7 +531,7 @@
 	glMatrixMode(GL_MODELVIEW);
 	glLoadIdentity();
 	
-	//set image_rec
+	//set texture frame
 	if(vo_keepaspect)
 	{
 		aspect( (int *)&d_width, (int *)&d_height, A_NOZOOM);
@@ -544,23 +543,17 @@
 		if((d_height*aspectX)>(frame.size.height))
 		{
 			padding = (frame.size.width - d_width*aspectY)/2;
-			image_rec.origin.x = padding;
-			image_rec.origin.y = 0;
-			image_rec.size.width = d_width*aspectY+padding;
-			image_rec.size.height = d_height*aspectY;
+			textureFrame = NSMakeRect(padding, 0, d_width*aspectY+padding, d_height*aspectY);
 		}
 		else
 		{
 			padding = ((frame.size.height) - d_height*aspectX)/2;
-			image_rec.origin.x = 0;
-			image_rec.origin.y = padding;
-			image_rec.size.width = d_width*aspectX;
-			image_rec.size.height = d_height*aspectX+padding;
+			textureFrame = NSMakeRect(0, padding, d_width*aspectX, d_height*aspectX+padding);
 		}
 	}
 	else
 	{
-		image_rec = frame;
+		textureFrame = frame;
 	}
 }
 
@@ -576,10 +569,10 @@
 	
 	glColor3f(1,1,1);
 	glBegin(GL_QUADS);
-	glTexCoord2f(upperLeft[0], upperLeft[1]); glVertex2i(	image_rec.origin.x-(vo_panscan_x >> 1), image_rec.origin.y-(vo_panscan_y >> 1));
-	glTexCoord2f(lowerLeft[0], lowerLeft[1]); glVertex2i(	image_rec.origin.x-(vo_panscan_x >> 1), image_rec.size.height+(vo_panscan_y >> 1));
-	glTexCoord2f(lowerRight[0], lowerRight[1]); glVertex2i(	image_rec.size.width+(vo_panscan_x >> 1), image_rec.size.height+(vo_panscan_y >> 1));
-	glTexCoord2f(upperRight[0], upperRight[1]); glVertex2i(	image_rec.size.width+(vo_panscan_x >> 1), image_rec.origin.y-(vo_panscan_y >> 1));
+	glTexCoord2f(upperLeft[0], upperLeft[1]); glVertex2i(	textureFrame.origin.x-(vo_panscan_x >> 1), textureFrame.origin.y-(vo_panscan_y >> 1));
+	glTexCoord2f(lowerLeft[0], lowerLeft[1]); glVertex2i(	textureFrame.origin.x-(vo_panscan_x >> 1), textureFrame.size.height+(vo_panscan_y >> 1));
+	glTexCoord2f(lowerRight[0], lowerRight[1]); glVertex2i(	textureFrame.size.width+(vo_panscan_x >> 1), textureFrame.size.height+(vo_panscan_y >> 1));
+	glTexCoord2f(upperRight[0], upperRight[1]); glVertex2i(	textureFrame.size.width+(vo_panscan_x >> 1), textureFrame.origin.y-(vo_panscan_y >> 1));
 	glEnd();
 	glDisable(CVOpenGLTextureGetTarget(texture));
 	




More information about the MPlayer-cvslog mailing list