diff options
author | ivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-08-05 01:24:37 +0000 |
---|---|---|
committer | ivo <ivo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-08-05 01:24:37 +0000 |
commit | cd55954e4e8cfe7c5653fc9df1d6ecdf2533dd00 (patch) | |
tree | dc84e22e112201b3911edd0a1b6ddac9b2012f59 /libvo | |
parent | 205db1107439080dcd0915e862ae15b3289f400d (diff) | |
download | mpv-cd55954e4e8cfe7c5653fc9df1d6ecdf2533dd00.tar.bz2 mpv-cd55954e4e8cfe7c5653fc9df1d6ecdf2533dd00.tar.xz |
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
return values can be negative (VO_ERROR, VO_NOTAVAIL and VO_NOTIMPL), so it's
changed to int now.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16172 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
46 files changed, 261 insertions, 261 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c index 1189e6a8f7..52b6e2c340 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -102,7 +102,7 @@ draw_slice_g400(uint8_t *image[], int stride[], int w,int h,int x,int y) } -static uint32_t +static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) { @@ -135,7 +135,7 @@ vo_mga_flip_page(void) } -static uint32_t +static int draw_frame(uint8_t *src[]) { printf("!!! mga::draw_frame() called !!!\n"); @@ -195,7 +195,7 @@ draw_image(mp_image_t *mpi){ return VO_TRUE; } -static uint32_t +static int query_format(uint32_t format) { switch(format){ @@ -229,7 +229,7 @@ static void mga_fullscreen() printf( "Error in mga_vid_config ioctl (wrong mga_vid.o version?)" ); } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { case VOCTRL_QUERY_FORMAT: @@ -418,7 +418,7 @@ static int mga_uninit(){ return 0; } -static uint32_t preinit(const char *vo_subdevice) +static int preinit(const char *vo_subdevice) { const char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid"; sws_rgb2rgb_init(get_sws_cpuflags()); diff --git a/libvo/video_out.h b/libvo/video_out.h index 1ed670eb3e..83de798f5b 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -105,7 +105,7 @@ typedef struct vo_functions_s * arg - currently it's vo_subdevice * returns: zero on successful initialization, non-zero on error. */ - uint32_t (*preinit)(const char *arg); + int (*preinit)(const char *arg); /* * Initialize (means CONFIGURE) the display driver. * params: @@ -116,21 +116,21 @@ typedef struct vo_functions_s * format: fourcc of pixel format * returns : zero on successful initialization, non-zero on error. */ - uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width, + int (*config)(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format); /* * Control interface */ - uint32_t (*control)(uint32_t request, void *data, ...); + int (*control)(uint32_t request, void *data, ...); /* * Display a new RGB/BGR frame of the video to the screen. * params: * src[0] - pointer to the image */ - uint32_t (*draw_frame)(uint8_t *src[]); + int (*draw_frame)(uint8_t *src[]); /* * Draw a planar YUV slice to the buffer: @@ -140,7 +140,7 @@ typedef struct vo_functions_s * w,h = width*height of area to be copied (in Y pixels) * x,y = position at the destination image (in Y pixels) */ - uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y); + int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y); /* * Draws OSD to the screen buffer diff --git a/libvo/video_out_internal.h b/libvo/video_out_internal.h index e395d211ab..c01467ba17 100644 --- a/libvo/video_out_internal.h +++ b/libvo/video_out_internal.h @@ -26,18 +26,18 @@ #include "libmpcodecs/mp_image.h" #include "geometry.h" -static uint32_t control(uint32_t request, void *data, ...); -static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, +static int control(uint32_t request, void *data, ...); +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format); -static uint32_t draw_frame(uint8_t *src[]); -static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y); +static int draw_frame(uint8_t *src[]); +static int draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y); static void draw_osd(void); static void flip_page(void); static void check_events(void); static void uninit(void); -static uint32_t query_format(uint32_t format); -static uint32_t preinit(const char *); +static int query_format(uint32_t format); +static int preinit(const char *); #define LIBVO_EXTERN(x) vo_functions_t video_out_##x =\ {\ diff --git a/libvo/vo_3dfx.c b/libvo/vo_3dfx.c index 26d50fe8d1..47b1570f00 100644 --- a/libvo/vo_3dfx.c +++ b/libvo/vo_3dfx.c @@ -304,7 +304,7 @@ update_target(void) targetoffset = vidpage0offset + (dispy*screenwidth + dispx)*screendepth; } -static uint32_t +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) { int fd; @@ -414,7 +414,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin return 0; } -static uint32_t +static int draw_frame(uint8_t *src[]) { LOG("video_out_3dfx: starting display_frame\n"); @@ -427,7 +427,7 @@ draw_frame(uint8_t *src[]) return 0; } -static uint32_t +static int //draw_slice(uint8_t *src[], uint32_t slice_num) draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) { @@ -452,7 +452,7 @@ flip_page(void) screen_to_screen_stretch_blt(targetoffset, vidpage2offset, dispwidth, dispheight); } -static uint32_t +static int query_format(uint32_t format) { /* does this supports scaling? up & down? */ @@ -476,7 +476,7 @@ static void check_events(void) { } -static uint32_t preinit(const char *arg) +static int preinit(const char *arg) { if(arg) { @@ -486,7 +486,7 @@ static uint32_t preinit(const char *arg) return 0; } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { case VOCTRL_QUERY_FORMAT: diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index e89f7e4855..b75d174eec 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -227,7 +227,7 @@ printosdprogbar(){ osdpercent(1,1,0,255,vo_osd_progbar_value, __sub_osd_names[vo_osd_progbar_type], ""); } } -static uint32_t +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { @@ -314,7 +314,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, return 0; } -static uint32_t +static int query_format(uint32_t format) { /* * ...are we able to... ? @@ -343,7 +343,7 @@ query_format(uint32_t format) { return 0; } -static uint32_t +static int draw_frame(uint8_t *src[]) { int stride[3] = { 0 , 0 , 0 }; @@ -372,7 +372,7 @@ draw_frame(uint8_t *src[]) { return 0; } -static uint32_t +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) { @@ -679,7 +679,7 @@ static int parse_suboptions(const char *arg) { return retval; } -static uint32_t preinit(const char *arg) +static int preinit(const char *arg) { char * hidis = NULL; struct stat sbuf; @@ -744,7 +744,7 @@ static uint32_t preinit(const char *arg) return 0; } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { case VOCTRL_QUERY_FORMAT: diff --git a/libvo/vo_bl.c b/libvo/vo_bl.c index 527d16a080..817ddbb931 100644 --- a/libvo/vo_bl.c +++ b/libvo/vo_bl.c @@ -213,7 +213,7 @@ static bl_properties_t bls[NO_BLS] = { &bml_init, &bml_write_frame, &bml_close, &udp_init, &udp_send, &udp_close } }; -static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { void * ptr; @@ -293,11 +293,11 @@ static void flip_page (void) { return; } -static uint32_t draw_frame(uint8_t * src[]) { +static int draw_frame(uint8_t * src[]) { return 0; } -static uint32_t query_format(uint32_t format) { +static int query_format(uint32_t format) { if (format == bl->img_format) return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW; return 0; @@ -320,7 +320,7 @@ static void uninit(void) { static void check_events(void) { } -static uint32_t draw_slice(uint8_t *srcimg[], int stride[], +static int draw_slice(uint8_t *srcimg[], int stride[], int wf, int hf, int xf, int yf) { int i, j, w, h, x, y; uint8_t *dst; @@ -339,7 +339,7 @@ static uint32_t draw_slice(uint8_t *srcimg[], int stride[], return 0; } -static uint32_t preinit(const char *arg) { +static int preinit(const char *arg) { char *p, *q; int end = 0, i; char txt[256]; @@ -465,7 +465,7 @@ static uint32_t preinit(const char *arg) { return 0; } -static uint32_t control(uint32_t request, void *data, ...) { +static int control(uint32_t request, void *data, ...) { switch (request) { case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); diff --git a/libvo/vo_caca.c b/libvo/vo_caca.c index 05ee4fd57e..29d57c8ad2 100644 --- a/libvo/vo_caca.c +++ b/libvo/vo_caca.c @@ -136,7 +136,7 @@ static int resize () return 0; } -static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { image_height = height; @@ -149,13 +149,13 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, return resize (); } -static uint32_t draw_frame(uint8_t *src[]) +static int draw_frame(uint8_t *src[]) { caca_draw_bitmap(0, 0, screen_w, screen_h, cbitmap, src[0]); return 0; } -static uint32_t draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) { return 0; } @@ -284,7 +284,7 @@ static void draw_osd(void) #endif } -static uint32_t preinit(const char *arg) +static int preinit(const char *arg) { if (arg) { @@ -307,7 +307,7 @@ static uint32_t preinit(const char *arg) return 0; } -static uint32_t query_format(uint32_t format) +static int query_format(uint32_t format) { if (format == IMGFMT_BGR24) return @@ -319,7 +319,7 @@ static uint32_t query_format(uint32_t format) return 0; } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch(request) { diff --git a/libvo/vo_cvidix.c b/libvo/vo_cvidix.c index 27393a5477..0baef76f74 100644 --- a/libvo/vo_cvidix.c +++ b/libvo/vo_cvidix.c @@ -75,7 +75,7 @@ static uint32_t setup_vidix(){ return 0; } -static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){ +static int config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){ vo_fs = flags & VOFLAG_FULLSCREEN; if(!vo_config_count){ if(vo_screenwidth && vo_screenheight){ @@ -116,7 +116,7 @@ static void flip_page(void){ return; } -static uint32_t draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){ +static int draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){ UNUSED(src); UNUSED(stride); UNUSED(w); @@ -127,13 +127,13 @@ static uint32_t draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int return -1; } -static uint32_t draw_frame(uint8_t *src[]){ +static int draw_frame(uint8_t *src[]){ UNUSED(src); mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix draw_frame!\n"); return -1; } -static uint32_t query_format(uint32_t format){ +static int query_format(uint32_t format){ return(vidix_query_fourcc(format)); } @@ -146,7 +146,7 @@ static void uninit(void){ } } -static uint32_t preinit(const char *arg){ +static int preinit(const char *arg){ if(arg)vidix_name = strdup(arg); else { mp_msg(MSGT_VO, MSGL_INFO, "vo_cvidix: No vidix driver name provided, probing available ones (-v option for details)!\n"); @@ -156,7 +156,7 @@ static uint32_t preinit(const char *arg){ return 0; } -static uint32_t control(uint32_t request, void *data, ...){ +static int control(uint32_t request, void *data, ...){ switch (request) { case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index dbb9848091..f36f113b4a 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -226,7 +226,7 @@ get_layer_by_name( DFBDisplayLayerID id, static void uninit( void ); -static uint32_t +static int preinit( const char *arg ) { DFBResult res; @@ -544,7 +544,7 @@ static void release_config( void ) bufs[2] = NULL; } -static uint32_t +static int config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, @@ -856,7 +856,7 @@ config( uint32_t width, uint32_t height, return 0; } -static uint32_t +static int query_format( uint32_t format ) { switch (format) { @@ -996,13 +996,13 @@ draw_alpha( int x0, int y0, subframe->Unlock( subframe ); } -static uint32_t +static int draw_frame( uint8_t * src[] ) { return -1; } -static uint32_t +static int draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) { void *dst; @@ -1343,7 +1343,7 @@ get_equalizer( char *data, int *value ) return VO_TRUE; } -static uint32_t +static int control( uint32_t request, void *data, ... ) { switch (request) { diff --git a/libvo/vo_dga.c b/libvo/vo_dga.c index 5632e7f142..905945efb9 100644 --- a/libvo/vo_dga.c +++ b/libvo/vo_dga.c @@ -283,7 +283,7 @@ static void fillblock(char *strt, int yoff, int lines, int val) //--------------------------------------------------------- -static uint32_t draw_frame(uint8_t * src[]) +static int draw_frame(uint8_t * src[]) { int vp_skip = vo_dga_vp_skip; @@ -352,7 +352,7 @@ static void flip_page(void) //--------------------------------------------------------- -static uint32_t draw_slice(uint8_t * src[], int stride[], +static int draw_slice(uint8_t * src[], int stride[], int w, int h, int x, int y) { return 0; @@ -360,7 +360,7 @@ static uint32_t draw_slice(uint8_t * src[], int stride[], //--------------------------------------------------------- -static uint32_t query_format(uint32_t format) +static int query_format(uint32_t format) { if ((format & IMGFMT_BGR_MASK) == IMGFMT_BGR && @@ -516,7 +516,7 @@ static void init_video_buffers(uint8_t * buffer_base, } } -static uint32_t config(uint32_t width, uint32_t height, +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { @@ -863,7 +863,7 @@ static uint32_t config(uint32_t width, uint32_t height, static int dga_depths_init = 0; -static uint32_t preinit(const char *arg) +static int preinit(const char *arg) { if (arg) { @@ -974,7 +974,7 @@ static uint32_t get_image(mp_image_t * mpi) return (VO_FALSE); } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c index 6744a6d983..3a38eb7408 100644 --- a/libvo/vo_directfb2.c +++ b/libvo/vo_directfb2.c @@ -169,7 +169,7 @@ static int check_mode(void *arg) { return get_mode(arg) != 0; } -static uint32_t preinit(const char *arg) +static int preinit(const char *arg) { DFBResult ret; strarg_t mode_str = {0, NULL}; @@ -408,7 +408,7 @@ DFBEnumerationResult test_format_callback( unsigned int id, return DFENUM_OK; } -static uint32_t query_format(uint32_t format) +static int query_format(uint32_t format) { int ret = VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD; // osd should be removed in future -> will be handled outside... enum1_t params; @@ -484,7 +484,7 @@ return DFENUM_OK; #define CONFIG_ERROR -1 -static uint32_t config(uint32_t s_width, uint32_t s_height, uint32_t d_width, +static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { @@ -1206,7 +1206,7 @@ static uint32_t get_image(mp_image_t *mpi) return VO_FALSE; } -static uint32_t draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) +static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) { int i; unsigned int pitch; @@ -1416,7 +1416,7 @@ static uint32_t put_image(mp_image_t *mpi){ -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { case VOCTRL_QUERY_FORMAT: @@ -1453,7 +1453,7 @@ static uint32_t control(uint32_t request, void *data, ...) // unused function -static uint32_t draw_frame(uint8_t *src[]) +static int draw_frame(uint8_t *src[]) { return -1; } diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c index 6cd50e14a9..f8cf5cff1b 100644 --- a/libvo/vo_directx.c +++ b/libvo/vo_directx.c @@ -185,7 +185,7 @@ static void draw_osd(void) vo_draw_text(image_width,image_height,draw_alpha); } -static uint32_t +static int query_format(uint32_t format) { uint32_t i=0; @@ -1004,7 +1004,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l } -static uint32_t preinit(const char *arg) +static int preinit(const char *arg) { HINSTANCE hInstance = GetModuleHandle(NULL); char exedir[MAX_PATH]; @@ -1070,7 +1070,7 @@ static uint32_t preinit(const char *arg) return 0; } -static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y ) +static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y ) { uint8_t *s; uint8_t *d; @@ -1142,7 +1142,7 @@ static void flip_page(void) image = ddsdsf.lpSurface; } -static uint32_t draw_frame(uint8_t *src[]) +static int draw_frame(uint8_t *src[]) { memcpy( image, *src, dstride * image_height ); return 0; @@ -1244,7 +1244,7 @@ static uint32_t put_image(mp_image_t *mpi){ return VO_TRUE; } -static uint32_t +static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t options, char *title, uint32_t format) { RECT rd; @@ -1444,7 +1444,7 @@ static uint32_t color_ctrl_get(char *what, int *value) return r; } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index 4d3a84af66..89d6933721 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -647,7 +647,7 @@ static void dxr2_set_overlay_window(void) { } -static uint32_t config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uint32_t flags, char *title, uint32_t format) +static int config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uint32_t flags, char *title, uint32_t format) { int arg; dxr2_threeArg_t arg3; @@ -879,7 +879,7 @@ static void draw_osd(void) } } -static uint32_t draw_frame(uint8_t * src[]) +static int draw_frame(uint8_t * src[]) { vo_mpegpes_t *p=(vo_mpegpes_t *)src[0]; if(p->id == 0x1E0) {// Video @@ -895,13 +895,13 @@ static void flip_page (void) sub_vo->flip_page(); } -static uint32_t draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0 ) +static int draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0 ) { return 0; } -static uint32_t query_format(uint32_t format) +static int query_format(uint32_t format) { if (format==IMGFMT_MPEGPES) return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_TIMER|VFCAP_SPU; @@ -951,7 +951,7 @@ static void check_events(void) #endif } -static uint32_t preinit(const char *arg) { +static int preinit(const char *arg) { int uCodeFD = -1; int uCodeSize; dxr2_uCode_t* uCode; @@ -1052,7 +1052,7 @@ static uint32_t preinit(const char *arg) { return 0; } -static uint32_t control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data, ...) { switch (request) { case VOCTRL_QUERY_FORMAT: diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index 92ccc4028d..0ead3f99ca 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -270,7 +270,7 @@ static overlay_t *overlay_data; /* Functions for working with the em8300's internal clock */ /* |