summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c17
-rw-r--r--libvo/jpeg_enc.c2
-rw-r--r--libvo/mga_common.c2
-rw-r--r--libvo/video_out.c4
-rw-r--r--libvo/vo_caca.c2
-rw-r--r--libvo/vo_corevideo.h (renamed from libvo/vo_macosx.h)4
-rw-r--r--libvo/vo_corevideo.m (renamed from libvo/vo_macosx.m)41
-rw-r--r--libvo/vo_directx.c12
-rw-r--r--libvo/vo_dxr2.c2
-rw-r--r--libvo/vo_quartz.c16
-rw-r--r--libvo/vo_tdfxfb.c2
-rw-r--r--libvo/vo_vdpau.c4
12 files changed, 53 insertions, 55 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index b65023f93e..950eb726f0 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1537,22 +1537,17 @@ void swapGlBuffers(void) {
* \brief find address of a linked function
* \param s name of function to find
* \return address of function or NULL if not found
- *
- * Copied from xine
*/
static void *getdladdr(const char *s) {
+ void *ret = NULL;
#ifdef HAVE_LIBDL
-#if defined(__sun) || defined(__sgi)
- static void *handle = NULL;
+ void *handle = dlopen(NULL, RTLD_LAZY);
if (!handle)
- handle = dlopen(NULL, RTLD_LAZY);
- return dlsym(handle, s);
-#else
- return dlsym(0, s);
-#endif
-#else
- return NULL;
+ return NULL;
+ ret = dlsym(handle, s);
+ dlclose(handle);
#endif
+ return ret;
}
/**
diff --git a/libvo/jpeg_enc.c b/libvo/jpeg_enc.c
index a0f76ee6d2..6cf00f7e56 100644
--- a/libvo/jpeg_enc.c
+++ b/libvo/jpeg_enc.c
@@ -484,7 +484,7 @@ int jpeg_enc_frame(jpeg_enc_t *j, unsigned char *y_data,
//if (j->s->mjpeg_write_tables == 1)
// j->s->mjpeg_write_tables = 0;
- return pbBufPtr(&(j->s->pb)) - j->s->pb.buf;
+ return put_bits_ptr(&(j->s->pb)) - j->s->pb.buf;
}
void jpeg_enc_uninit(jpeg_enc_t *j) {
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index 06d374f9fd..8c3bf74671 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -450,7 +450,7 @@ static int mga_init(int width,int height,unsigned int format){
return 0;
}
-static int mga_uninit(){
+static int mga_uninit(void){
if(f>=0){
ioctl( f,MGA_VID_OFF,0 );
munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames);
diff --git a/libvo/video_out.c b/libvo/video_out.c
index eb348dd086..73926c541e 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -116,7 +116,7 @@ extern struct vo_driver video_out_cvidix;
extern struct vo_driver video_out_tdfx_vid;
extern struct vo_driver video_out_xvr100;
extern struct vo_driver video_out_tga;
-extern struct vo_driver video_out_macosx;
+extern struct vo_driver video_out_corevideo;
extern struct vo_driver video_out_quartz;
extern struct vo_driver video_out_pnm;
extern struct vo_driver video_out_md5sum;
@@ -139,7 +139,7 @@ const struct vo_driver *video_out_drivers[] =
&video_out_kva,
#endif
#ifdef CONFIG_COREVIDEO
- &video_out_macosx,
+ &video_out_corevideo,
#endif
#ifdef CONFIG_QUARTZ
&video_out_quartz,
diff --git a/libvo/vo_caca.c b/libvo/vo_caca.c
index c9bdd19568..0702d86a2d 100644
--- a/libvo/vo_caca.c
+++ b/libvo/vo_caca.c
@@ -140,7 +140,7 @@ static void osdpercent(int duration, int min, int max, int val, const char *desc
posbar[screen_w] = '\0';
}
-static int resize ()
+static int resize(void)
{
screen_w = caca_get_width();
screen_h = caca_get_height();
diff --git a/libvo/vo_macosx.h b/libvo/vo_corevideo.h
index 7444bcbf5a..44c2ad8a89 100644
--- a/libvo/vo_macosx.h
+++ b/libvo/vo_corevideo.h
@@ -1,5 +1,5 @@
/*
- * MPlayer Mac OS X video output driver
+ * CoreVideo video output driver
*
* Copyright (c) 2005 Nicolas Plourde <nicolasplourde@gmail.com>
*
@@ -22,7 +22,7 @@
#import <Cocoa/Cocoa.h>
#import <QuartzCore/QuartzCore.h>
-#import <QuickTime/QuickTime.h>
+#import <Carbon/Carbon.h>
// MPlayer OS X VO Protocol
@protocol MPlayerOSXVOProto
diff --git a/libvo/vo_macosx.m b/libvo/vo_corevideo.m
index eaa08c3316..13c8794b1f 100644
--- a/libvo/vo_macosx.m
+++ b/libvo/vo_corevideo.m
@@ -1,5 +1,5 @@
/*
- * Mac OS X video output driver
+ * CoreVideo video output driver
* Copyright (c) 2005 Nicolas Plourde <nicolasplourde@gmail.com>
*
* This file is part of MPlayer.
@@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#import "vo_macosx.h"
+#import "vo_corevideo.h"
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/mman.h>
@@ -95,12 +95,12 @@ static BOOL isLeopardOrLater;
static vo_info_t info =
{
"Mac OS X Core Video",
- "macosx",
+ "corevideo",
"Nicolas Plourde <nicolas.plourde@gmail.com>",
""
};
-LIBVO_EXTERN(macosx)
+LIBVO_EXTERN(corevideo)
static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride)
{
@@ -120,13 +120,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
//init screen
screen_array = [NSScreen screens];
- if(screen_id < [screen_array count])
+ if(screen_id < (int)[screen_array count])
{
screen_handle = [screen_array objectAtIndex:(screen_id < 0 ? 0 : screen_id)];
}
else
{
- mp_msg(MSGT_VO, MSGL_FATAL, "Get device error: Device ID %d does not exist, falling back to main device.\n", screen_id);
+ mp_msg(MSGT_VO, MSGL_INFO, "[vo_corevideo] Device ID %d does not exist, falling back to main device\n", screen_id);
screen_handle = [screen_array objectAtIndex:0];
screen_id = -1;
}
@@ -177,8 +177,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
}
else
{
- mp_msg(MSGT_VO, MSGL_INFO, "VO: [macosx] writing output to a shared buffer "
- "named \"%s\".\n",buffer_name);
+ mp_msg(MSGT_VO, MSGL_INFO, "[vo_corevideo] writing output to a shared buffer "
+ "named \"%s\"\n",buffer_name);
movie_aspect = (float)d_width/(float)d_height;
@@ -187,7 +187,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
if (shm_fd == -1)
{
mp_msg(MSGT_VO, MSGL_FATAL,
- "vo_macosx: failed to open shared memory. Error: %s\n", strerror(errno));
+ "[vo_corevideo] failed to open shared memory. Error: %s\n", strerror(errno));
return 1;
}
@@ -195,7 +195,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
if (ftruncate(shm_fd, image_width*image_height*image_bytes) == -1)
{
mp_msg(MSGT_VO, MSGL_FATAL,
- "vo_macosx: failed to size shared memory, possibly already in use. Error: %s\n", strerror(errno));
+ "[vo_corevideo] failed to size shared memory, possibly already in use. Error: %s\n", strerror(errno));
shm_unlink(buffer_name);
return 1;
}
@@ -206,7 +206,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
if (image_data == MAP_FAILED)
{
mp_msg(MSGT_VO, MSGL_FATAL,
- "vo_macosx: failed to map shared memory. Error: %s\n", strerror(errno));
+ "[vo_corevideo] failed to map shared memory. Error: %s\n", strerror(errno));
shm_unlink(buffer_name);
return 1;
}
@@ -302,10 +302,10 @@ static void uninit(void)
mplayerosxProxy = nil;
if (munmap(image_data, image_width*image_height*image_bytes) == -1)
- mp_msg(MSGT_VO, MSGL_FATAL, "uninit: munmap failed. Error: %s\n", strerror(errno));
+ mp_msg(MSGT_VO, MSGL_FATAL, "[vo_corevideo] uninit: munmap failed. Error: %s\n", strerror(errno));
if (shm_unlink(buffer_name) == -1)
- mp_msg(MSGT_VO, MSGL_FATAL, "uninit: shm_unlink failed. Error: %s\n", strerror(errno));
+ mp_msg(MSGT_VO, MSGL_FATAL, "[vo_corevideo] uninit: shm_unlink failed. Error: %s\n", strerror(errno));
}
@@ -352,8 +352,8 @@ static int preinit(const char *arg)
if (subopt_parse(arg, subopts) != 0) {
mp_msg(MSGT_VO, MSGL_FATAL,
- "\n-vo macosx command line help:\n"
- "Example: mplayer -vo macosx:device_id=1:shared_buffer:buffer_name=mybuff\n"
+ "\n-vo corevideo command line help:\n"
+ "Example: mplayer -vo corevideo:device_id=1:shared_buffer:buffer_name=mybuff\n"
"\nOptions:\n"
" device_id=<0-...>\n"
" Set screen device ID for fullscreen.\n"
@@ -476,20 +476,20 @@ static int control(uint32_t request, void *data)
error = CVPixelBufferCreateWithBytes(NULL, image_width, image_height, pixelFormat, image_datas[0], image_width*image_bytes, NULL, NULL, NULL, &frameBuffers[0]);
if(error != kCVReturnSuccess)
- mp_msg(MSGT_VO, MSGL_ERR,"Failed to create Pixel Buffer(%d)\n", error);
+ mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create Pixel Buffer(%d)\n", error);
if (vo_doublebuffering) {
error = CVPixelBufferCreateWithBytes(NULL, image_width, image_height, pixelFormat, image_datas[1], image_width*image_bytes, NULL, NULL, NULL, &frameBuffers[1]);
if(error != kCVReturnSuccess)
- mp_msg(MSGT_VO, MSGL_ERR,"Failed to create Pixel Double Buffer(%d)\n", error);
+ mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create Pixel Double Buffer(%d)\n", error);
}
error = CVOpenGLTextureCacheCreate(NULL, 0, [glContext CGLContextObj], [[self pixelFormat] CGLPixelFormatObj], 0, &textureCache);
if(error != kCVReturnSuccess)
- mp_msg(MSGT_VO, MSGL_ERR,"Failed to create OpenGL texture Cache(%d)\n", error);
+ mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture Cache(%d)\n", error);
error = CVOpenGLTextureCacheCreateTextureFromImage(NULL, textureCache, frameBuffers[image_page], 0, &texture);
if(error != kCVReturnSuccess)
- mp_msg(MSGT_VO, MSGL_ERR,"Failed to create OpenGL texture(%d)\n", error);
+ mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture(%d)\n", error);
//show window
[window center];
@@ -834,9 +834,10 @@ static int control(uint32_t request, void *data)
{
CVReturn error = kCVReturnSuccess;
+ CVOpenGLTextureRelease(texture);
error = CVOpenGLTextureCacheCreateTextureFromImage(NULL, textureCache, frameBuffers[image_page], 0, &texture);
if(error != kCVReturnSuccess)
- mp_msg(MSGT_VO, MSGL_ERR,"Failed to create OpenGL texture(%d)\n", error);
+ mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture(%d)\n", error);
CVOpenGLTextureGetCleanTexCoords(texture, lowerLeft, lowerRight, upperRight, upperLeft);
}
diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c
index 7d4feaa5e5..32328ae4fd 100644
--- a/libvo/vo_directx.c
+++ b/libvo/vo_directx.c
@@ -198,7 +198,7 @@ query_format(uint32_t format)
return 0;
}
-static uint32_t Directx_CreatePrimarySurface()
+static uint32_t Directx_CreatePrimarySurface(void)
{
DDSURFACEDESC2 ddsd;
//cleanup
@@ -308,7 +308,7 @@ static uint32_t Directx_CreateOverlay(uint32_t imgfmt)
return 0;
}
-static uint32_t Directx_CreateBackpuffer()
+static uint32_t Directx_CreateBackpuffer(void)
{
DDSURFACEDESC2 ddsd;
//cleanup
@@ -414,7 +414,7 @@ static BOOL WINAPI EnumCallbackEx(GUID FAR *lpGUID, LPSTR lpDriverDescription, L
return 1; // list all adapters
}
-static uint32_t Directx_InitDirectDraw()
+static uint32_t Directx_InitDirectDraw(void)
{
HRESULT (WINAPI *OurDirectDrawCreateEx)(GUID *,LPVOID *, REFIID,IUnknown FAR *);
DDSURFACEDESC2 ddsd;
@@ -531,7 +531,7 @@ static void check_events(void)
}
}
-static uint32_t Directx_ManageDisplay()
+static uint32_t Directx_ManageDisplay(void)
{
HRESULT ddrval;
DDCAPS capsDrv;
@@ -761,7 +761,7 @@ static uint32_t Directx_ManageDisplay()
}
//find out supported overlay pixelformats
-static uint32_t Directx_CheckOverlayPixelformats()
+static uint32_t Directx_CheckOverlayPixelformats(void)
{
DDCAPS capsDrv;
HRESULT ddrval;
@@ -822,7 +822,7 @@ static uint32_t Directx_CheckOverlayPixelformats()
}
//find out the Pixelformat of the Primary Surface
-static uint32_t Directx_CheckPrimaryPixelformat()
+static uint32_t Directx_CheckPrimaryPixelformat(void)
{
uint32_t i=0;
uint32_t formatcount = 0;
diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c
index ccbef40b61..8e879bb553 100644
--- a/libvo/vo_dxr2.c
+++ b/libvo/vo_dxr2.c
@@ -203,7 +203,7 @@ int write_dxr2(const unsigned char *data, int len)
return w;
}
-static void flush_dxr2()
+static void flush_dxr2(void)
{
int w;
while (dxr2bufpos) {
diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c
index 97ca656b8d..4e2bbd0f3a 100644
--- a/libvo/vo_quartz.c
+++ b/libvo/vo_quartz.c
@@ -149,10 +149,10 @@ enum
static OSStatus KeyEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
static OSStatus MouseEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
static OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
-void window_resized();
-void window_ontop();
-void window_fullscreen();
-void window_panscan();
+void window_resized(void);
+void window_ontop(void);
+void window_fullscreen(void);
+void window_panscan(void);
static inline int convert_key(UInt32 key, UInt32 charcode)
{
@@ -1313,7 +1313,7 @@ static int control(uint32_t request, void *data)
return VO_NOTIMPL;
}
-void window_resized()
+void window_resized(void)
{
float aspectX;
float aspectY;
@@ -1394,7 +1394,7 @@ void window_resized()
QDEndCGContext(GetWindowPort(theWindow), &context);
}
-void window_ontop()
+void window_ontop(void)
{
if (!vo_quartz_fs)
{
@@ -1406,7 +1406,7 @@ void window_ontop()
SetWindowGroupLevel(winGroup, CGWindowLevelForKey(levelList[winLevel]));
}
-void window_fullscreen()
+void window_fullscreen(void)
{
// go fullscreen
if (vo_fs)
@@ -1491,7 +1491,7 @@ void window_fullscreen()
window_resized();
}
-void window_panscan()
+void window_panscan(void)
{
panscan_calc();
diff --git a/libvo/vo_tdfxfb.c b/libvo/vo_tdfxfb.c
index c40cae7b82..ddb4a189b8 100644
--- a/libvo/vo_tdfxfb.c
+++ b/libvo/vo_tdfxfb.c
@@ -202,7 +202,7 @@ static void uninit(void)
}
}
-static void clear_screen()
+static void clear_screen(void)
{
/* There needs to be some sort of delay here or else things seriously
* screw up. Causes the image to not be the right size on screen if
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index 2d3b269383..e0a2c40de0 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -574,7 +574,9 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
xswa.background_pixel = 0;
xswa.border_pixel = 0;
- xswamask = CWBackPixel | CWBorderPixel;
+ /* Do not use CWBackPixel: It leads to VDPAU errors after
+ aspect ratio changes. */
+ xswamask = CWBorderPixel;
vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height,
flags, CopyFromParent, "vdpau", title);