⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdl-friptv.diff

📁 linux下实现视频播放的播放器
💻 DIFF
📖 第 1 页 / 共 2 页
字号:
+ * If possible, retrieves the current scanline. If this+ * operation is supported and succeeds, the scanline is written to the+ * value pointed to by the parameter and 1 is returned. If unsupported or+ * unsuccessful, the pointed to value is not touched and 0 is returned.+ * If vblank is in progress, 2 is returned.+ */+int SDL_GetScanline(int *scanline)+{+	SDL_VideoDevice *video = current_video;+	SDL_VideoDevice *this  = current_video;++	if (video && video->GetScanline) {+		return video->GetScanline(this, scanline);+	} else {+		return 0;+	}+}++/*  * Check to see if a particular video mode is supported.  * It returns 0 if the requested mode is not supported under any bit depth,  * or returns the bits-per-pixel of the closest available mode with the@@ -778,7 +841,7 @@ 	/* If we're running OpenGL, make the context current */ 	if ( (video->screen->flags & SDL_OPENGL) && 	      video->GL_MakeCurrent ) {-		if ( video->GL_MakeCurrent(this) < 0 ) {+		if ( video->GL_MakeCurrent(this, 0) < 0 ) { 			return(NULL); 		} 	}@@ -1505,6 +1568,19 @@ 	return retval; } +/* Make GL context current */+void SDL_GL_MakeCurrent(int release)+{+	SDL_VideoDevice *video = current_video;+	SDL_VideoDevice *this = current_video;++	if (( video->screen->flags & SDL_OPENGL ) && video->GL_MakeCurrent ) {+		video->GL_MakeCurrent(this, release);+	} else {+		SDL_SetError("OpenGL video mode has not been set");+	}+}+ /* Perform a GL buffer swap on the current GL context */ void SDL_GL_SwapBuffers(void) {diff -urN SDL-1.2/src/video/SDL_yuv_sw.c SDL-1.2-iptv/src/video/SDL_yuv_sw.c--- SDL-1.2/src/video/SDL_yuv_sw.c	2007-12-03 14:03:42.000000000 +0100+++ SDL-1.2-iptv/src/video/SDL_yuv_sw.c	2008-01-24 23:21:01.000000000 +0100@@ -1085,13 +1085,14 @@ 		if ( display->format->BytesPerPixel == 4 ) { #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES 			/* inline assembly functions */-			if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&+/*			if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && 			                     (Gmask == 0x0000FF00) && 				             (Bmask == 0x000000FF) &&  			                     (width & 15) == 0) {-/*printf("Using MMX 32-bit dither\n");*/+/*printf("Using MMX 32-bit dither\n"); 				swdata->Display1X = ColorRGBDitherYV12MMX1X;-			} else {+			} else */+			{ /*printf("Using C 32-bit dither\n");*/ 				swdata->Display1X = Color32DitherYV12Mod1X; 			}diff -urN SDL-1.2/src/video/ataricommon/SDL_atarigl.c SDL-1.2-iptv/src/video/ataricommon/SDL_atarigl.c--- SDL-1.2/src/video/ataricommon/SDL_atarigl.c	2007-12-03 14:03:32.000000000 +0100+++ SDL-1.2-iptv/src/video/ataricommon/SDL_atarigl.c	2008-01-20 22:22:13.000000000 +0100@@ -306,7 +306,7 @@ #endif } -int SDL_AtariGL_MakeCurrent(_THIS)+int SDL_AtariGL_MakeCurrent(_THIS, int release) { #if SDL_VIDEO_OPENGL 	SDL_Surface *surface;diff -urN SDL-1.2/src/video/ataricommon/SDL_atarigl_c.h SDL-1.2-iptv/src/video/ataricommon/SDL_atarigl_c.h--- SDL-1.2/src/video/ataricommon/SDL_atarigl_c.h	2007-12-03 14:03:32.000000000 +0100+++ SDL-1.2-iptv/src/video/ataricommon/SDL_atarigl_c.h	2008-01-20 22:22:05.000000000 +0100@@ -103,7 +103,7 @@ extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path); extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc); extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);-extern int SDL_AtariGL_MakeCurrent(_THIS);+extern int SDL_AtariGL_MakeCurrent(_THIS, int release); extern void SDL_AtariGL_SwapBuffers(_THIS);  #endif /* _SDL_ATARIGL_H_ */diff -urN SDL-1.2/src/video/bwindow/SDL_sysvideo.cc SDL-1.2-iptv/src/video/bwindow/SDL_sysvideo.cc--- SDL-1.2/src/video/bwindow/SDL_sysvideo.cc	2007-12-03 14:03:40.000000000 +0100+++ SDL-1.2-iptv/src/video/bwindow/SDL_sysvideo.cc	2008-01-20 22:23:09.000000000 +0100@@ -64,7 +64,7 @@ static int BE_GL_LoadLibrary(_THIS, const char *path); static void* BE_GL_GetProcAddress(_THIS, const char *proc); static int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);-static int BE_GL_MakeCurrent(_THIS);+static int BE_GL_MakeCurrent(_THIS, int release); static void BE_GL_SwapBuffers(_THIS); #endif @@ -760,7 +760,7 @@ 	return 0; } -int BE_GL_MakeCurrent(_THIS)+int BE_GL_MakeCurrent(_THIS, int release) { 	/* FIXME: should we glview->unlock and then glview->lock()? */ 	return 0;diff -urN SDL-1.2/src/video/maccommon/SDL_macgl.c SDL-1.2-iptv/src/video/maccommon/SDL_macgl.c--- SDL-1.2/src/video/maccommon/SDL_macgl.c	2007-12-03 14:03:30.000000000 +0100+++ SDL-1.2-iptv/src/video/maccommon/SDL_macgl.c	2008-01-20 22:24:00.000000000 +0100@@ -148,7 +148,7 @@ #if SDL_VIDEO_OPENGL  /* Make the current context active */-int Mac_GL_MakeCurrent(_THIS)+int Mac_GL_MakeCurrent(_THIS, int release) { 	int retval; diff -urN SDL-1.2/src/video/maccommon/SDL_macgl_c.h SDL-1.2-iptv/src/video/maccommon/SDL_macgl_c.h--- SDL-1.2/src/video/maccommon/SDL_macgl_c.h	2007-12-03 14:03:30.000000000 +0100+++ SDL-1.2-iptv/src/video/maccommon/SDL_macgl_c.h	2008-01-20 22:23:52.000000000 +0100@@ -37,7 +37,7 @@ extern int Mac_GL_Init(_THIS); extern void Mac_GL_Quit(_THIS); #if SDL_VIDEO_OPENGL-extern int Mac_GL_MakeCurrent(_THIS);+extern int Mac_GL_MakeCurrent(_THIS, int release); extern int Mac_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void Mac_GL_SwapBuffers(_THIS); extern int Mac_GL_LoadLibrary(_THIS, const char *location);diff -urN SDL-1.2/src/video/photon/SDL_ph_gl.c SDL-1.2-iptv/src/video/photon/SDL_ph_gl.c--- SDL-1.2/src/video/photon/SDL_ph_gl.c	2007-12-03 14:03:26.000000000 +0100+++ SDL-1.2-iptv/src/video/photon/SDL_ph_gl.c	2008-01-20 22:31:19.000000000 +0100@@ -160,7 +160,7 @@ #endif /* 6.3.0 */  #if (_NTO_VERSION < 630)-int ph_GL_MakeCurrent(_THIS)+int ph_GL_MakeCurrent(_THIS, int release) {     PgSetRegion(PtWidgetRid(window)); @@ -172,7 +172,7 @@     return 0; } #else-int ph_GL_MakeCurrent(_THIS)+int ph_GL_MakeCurrent(_THIS, int release) {     PgSetRegion(PtWidgetRid(window)); diff -urN SDL-1.2/src/video/photon/SDL_ph_gl.h SDL-1.2-iptv/src/video/photon/SDL_ph_gl.h--- SDL-1.2/src/video/photon/SDL_ph_gl.h	2007-12-03 14:03:26.000000000 +0100+++ SDL-1.2-iptv/src/video/photon/SDL_ph_gl.h	2008-01-20 22:24:54.000000000 +0100@@ -33,7 +33,7 @@     int   ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);     int   ph_GL_LoadLibrary(_THIS, const char* path);     void* ph_GL_GetProcAddress(_THIS, const char* proc);-    int   ph_GL_MakeCurrent(_THIS);+    int   ph_GL_MakeCurrent(_THIS, int release);      int   ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags); #endif /* SDL_VIDEO_OPENGL */diff -urN SDL-1.2/src/video/quartz/SDL_QuartzGL.m SDL-1.2-iptv/src/video/quartz/SDL_QuartzGL.m--- SDL-1.2/src/video/quartz/SDL_QuartzGL.m	2007-12-03 14:03:28.000000000 +0100+++ SDL-1.2-iptv/src/video/quartz/SDL_QuartzGL.m	2008-01-20 22:30:49.000000000 +0100@@ -217,7 +217,7 @@      GLenum attr = 0; -    QZ_GL_MakeCurrent (this);+    QZ_GL_MakeCurrent (this, 0);      switch (attrib) {         case SDL_GL_RED_SIZE: attr = GL_RED_BITS;   break;@@ -271,7 +271,7 @@     return 0; } -int    QZ_GL_MakeCurrent    (_THIS) {+int    QZ_GL_MakeCurrent    (_THIS, int release) {     [ gl_context makeCurrentContext ];     return 0; }diff -urN SDL-1.2/src/video/quartz/SDL_QuartzVideo.h SDL-1.2-iptv/src/video/quartz/SDL_QuartzVideo.h--- SDL-1.2/src/video/quartz/SDL_QuartzVideo.h	2007-12-03 14:03:28.000000000 +0100+++ SDL-1.2-iptv/src/video/quartz/SDL_QuartzVideo.h	2008-01-20 22:30:32.000000000 +0100@@ -190,7 +190,7 @@ void   QZ_TearDownOpenGL    (_THIS); void*  QZ_GL_GetProcAddress (_THIS, const char *proc); int    QZ_GL_GetAttribute   (_THIS, SDL_GLattr attrib, int* value);-int    QZ_GL_MakeCurrent    (_THIS);+int    QZ_GL_MakeCurrent    (_THIS, int release); void   QZ_GL_SwapBuffers    (_THIS); int    QZ_GL_LoadLibrary    (_THIS, const char *location); diff -urN SDL-1.2/src/video/wincommon/SDL_syswm.c SDL-1.2-iptv/src/video/wincommon/SDL_syswm.c--- SDL-1.2/src/video/wincommon/SDL_syswm.c	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/wincommon/SDL_syswm.c	2007-12-03 14:57:04.000000000 +0100@@ -295,3 +295,15 @@ 		return(-1); 	} }++int WIN_GetDesktopMode(_THIS, int *width, int *height)+{+	DEVMODE dm;+	if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm)) {+		*width = dm.dmPelsWidth;+		*height = dm.dmPelsHeight;+		return 1;+	} else {+		return 0;+	}+}diff -urN SDL-1.2/src/video/wincommon/SDL_syswm_c.h SDL-1.2-iptv/src/video/wincommon/SDL_syswm_c.h--- SDL-1.2/src/video/wincommon/SDL_syswm_c.h	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/wincommon/SDL_syswm_c.h	2007-12-03 14:57:04.000000000 +0100@@ -32,4 +32,4 @@ extern int WIN_IconifyWindow(_THIS); extern SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode); extern int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info);-+extern int WIN_GetDesktopMode(_THIS, int *width, int *height);diff -urN SDL-1.2/src/video/wincommon/SDL_wingl.c SDL-1.2-iptv/src/video/wincommon/SDL_wingl.c--- SDL-1.2/src/video/wincommon/SDL_wingl.c	2007-12-03 14:03:24.000000000 +0100+++ SDL-1.2-iptv/src/video/wincommon/SDL_wingl.c	2008-01-20 22:27:53.000000000 +0100@@ -325,7 +325,7 @@ 		SDL_SetError("Unable to create GL context"); 		return(-1); 	}-	if ( WIN_GL_MakeCurrent(this) < 0 ) {+	if ( WIN_GL_MakeCurrent(this, 0) < 0 ) { 		return(-1); 	} 	gl_active = 1;@@ -395,11 +395,12 @@ #if SDL_VIDEO_OPENGL  /* Make the current context active */-int WIN_GL_MakeCurrent(_THIS)+int WIN_GL_MakeCurrent(_THIS, int release) { 	int retval;  	retval = 0;+	if( release ) return this->gl_data->wglMakeCurrent(NULL, NULL); 	if ( ! this->gl_data->wglMakeCurrent(GL_hdc, GL_hrc) ) { 		SDL_SetError("Unable to make GL context current"); 		retval = -1;diff -urN SDL-1.2/src/video/wincommon/SDL_wingl_c.h SDL-1.2-iptv/src/video/wincommon/SDL_wingl_c.h--- SDL-1.2/src/video/wincommon/SDL_wingl_c.h	2007-12-03 14:03:24.000000000 +0100+++ SDL-1.2-iptv/src/video/wincommon/SDL_wingl_c.h	2008-01-20 22:29:33.000000000 +0100@@ -65,7 +65,7 @@ extern int WIN_GL_SetupWindow(_THIS); extern void WIN_GL_ShutDown(_THIS); #if SDL_VIDEO_OPENGL-extern int WIN_GL_MakeCurrent(_THIS);+extern int WIN_GL_MakeCurrent(_THIS, int release); extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void WIN_GL_SwapBuffers(_THIS); extern void WIN_GL_UnloadLibrary(_THIS);diff -urN SDL-1.2/src/video/windib/SDL_dibvideo.c SDL-1.2-iptv/src/video/windib/SDL_dibvideo.c--- SDL-1.2/src/video/windib/SDL_dibvideo.c	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/windib/SDL_dibvideo.c	2007-12-03 14:57:04.000000000 +0100@@ -142,6 +142,7 @@ 	/* Set the function pointers */ 	device->VideoInit = DIB_VideoInit; 	device->ListModes = DIB_ListModes;+	device->GetDesktopMode = WIN_GetDesktopMode; 	device->SetVideoMode = DIB_SetVideoMode; 	device->UpdateMouse = WIN_UpdateMouse; 	device->SetColors = DIB_SetColors;diff -urN SDL-1.2/src/video/windx5/SDL_dx5video.c SDL-1.2-iptv/src/video/windx5/SDL_dx5video.c--- SDL-1.2/src/video/windx5/SDL_dx5video.c	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/windx5/SDL_dx5video.c	2008-02-24 23:42:22.000000000 +0100@@ -583,6 +583,8 @@ 	/* Set the function pointers */ 	device->VideoInit = DX5_VideoInit; 	device->ListModes = DX5_ListModes;+	device->GetDesktopMode = WIN_GetDesktopMode;+	device->GetScanline = DX5_GetScanline; 	device->SetVideoMode = DX5_SetVideoMode; 	device->UpdateMouse = WIN_UpdateMouse; 	device->CreateYUVOverlay = DX5_CreateYUVOverlay;@@ -1496,7 +1498,7 @@ 			} 		} 		dd_surface3 = NULL;-#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */+#if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */ 		if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { 			video->flags |= SDL_HWSURFACE; 		} else {@@ -2516,3 +2518,22 @@ { 	SDL_UpdateRect(SDL_PublicSurface, 0, 0, 0, 0); }++/* Get the current drawing scanline of the user's display. */+int DX5_GetScanline(_THIS, int *p)+{+	DWORD scanline;+	HRESULT res;++	if ( ddraw2 ) {+		res = IDirectDraw2_GetScanLine(ddraw2, &scanline);+		if ( ( res == DD_OK ) && ( p ) ) {+			*p = scanline;+			return 1;+		} else if ( res == DDERR_VERTICALBLANKINPROGRESS ) {+			return 2;+		}+	}++	return 0;+}diff -urN SDL-1.2/src/video/windx5/SDL_dx5video.h SDL-1.2-iptv/src/video/windx5/SDL_dx5video.h--- SDL-1.2/src/video/windx5/SDL_dx5video.h	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/windx5/SDL_dx5video.h	2007-12-03 14:57:04.000000000 +0100@@ -58,4 +58,6 @@ /* DirectDraw error reporting function */ extern void SetDDerror(const char *function, int code); +extern int DX5_GetScanline(SDL_VideoDevice *this, int *p);+ #endif /* _SDL_dx5video_h */diff -urN SDL-1.2/src/video/x11/SDL_x11gl.c SDL-1.2-iptv/src/video/x11/SDL_x11gl.c--- SDL-1.2/src/video/x11/SDL_x11gl.c	2007-12-03 14:03:41.000000000 +0100+++ SDL-1.2-iptv/src/video/x11/SDL_x11gl.c	2008-01-20 22:28:19.000000000 +0100@@ -266,7 +266,7 @@ 		SDL_SetError("Could not create GL context"); 		return(-1); 	}-	if ( X11_GL_MakeCurrent(this) < 0 ) {+	if ( X11_GL_MakeCurrent(this, 0) < 0 ) { 		return(-1); 	} 	gl_active = 1;@@ -315,7 +315,7 @@ #if SDL_VIDEO_OPENGL_GLX  /* Make the current context active */-int X11_GL_MakeCurrent(_THIS)+int X11_GL_MakeCurrent(_THIS, int release) { 	int retval; 	diff -urN SDL-1.2/src/video/x11/SDL_x11gl_c.h SDL-1.2-iptv/src/video/x11/SDL_x11gl_c.h--- SDL-1.2/src/video/x11/SDL_x11gl_c.h	2007-12-03 14:03:41.000000000 +0100+++ SDL-1.2-iptv/src/video/x11/SDL_x11gl_c.h	2008-01-20 22:29:10.000000000 +0100@@ -89,7 +89,7 @@ extern int X11_GL_CreateContext(_THIS); extern void X11_GL_Shutdown(_THIS); #if SDL_VIDEO_OPENGL_GLX-extern int X11_GL_MakeCurrent(_THIS);+extern int X11_GL_MakeCurrent(_THIS, int release); extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); extern void X11_GL_SwapBuffers(_THIS); extern int X11_GL_LoadLibrary(_THIS, const char* path);diff -urN SDL-1.2/src/video/x11/SDL_x11modes.c SDL-1.2-iptv/src/video/x11/SDL_x11modes.c--- SDL-1.2/src/video/x11/SDL_x11modes.c	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/x11/SDL_x11modes.c	2007-12-03 14:57:04.000000000 +0100@@ -892,6 +892,13 @@ #endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ } +int X11_GetDesktopMode(_THIS, int *width, int *height)+{+	*width = DisplayWidth(SDL_Display, SDL_Screen);+	*height = DisplayHeight(SDL_Display, SDL_Screen);+	return 1;+}+ int X11_ResizeFullScreen(_THIS) {     int x = 0, y = 0;diff -urN SDL-1.2/src/video/x11/SDL_x11modes_c.h SDL-1.2-iptv/src/video/x11/SDL_x11modes_c.h--- SDL-1.2/src/video/x11/SDL_x11modes_c.h	2008-01-20 21:42:05.000000000 +0100+++ SDL-1.2-iptv/src/video/x11/SDL_x11modes_c.h	2007-12-03 14:57:04.000000000 +0100@@ -35,6 +35,7 @@ extern int X11_GetVideoModes(_THIS); extern SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); extern void X11_FreeVideoModes(_THIS);+extern int X11_GetDesktopMode(_THIS, int *width, int *height); extern int X11_ResizeFullScreen(_THIS); extern void X11_WaitMapped(_THIS, Window win); extern void X11_WaitUnmapped(_THIS, Window win);diff -urN SDL-1.2/src/video/xbios/SDL_xbios.c SDL-1.2-iptv/src/video/xbios/SDL_xbios.c--- SDL-1.2/src/video/xbios/SDL_xbios.c	2007-12-03 14:03:22.000000000 +0100+++ SDL-1.2-iptv/src/video/xbios/SDL_xbios.c	2008-01-20 22:28:38.000000000 +0100@@ -947,7 +947,7 @@ { 	SDL_AtariGL_SwapBuffers(this); 	XBIOS_FlipHWSurface(this, this->screen);-	SDL_AtariGL_MakeCurrent(this);+	SDL_AtariGL_MakeCurrent(this, 0); }  #endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -