diff options
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/aspect.h | 4 | ||||
-rw-r--r-- | libvo/fastmemcpy.h | 4 | ||||
-rw-r--r-- | libvo/gl_common.c | 16 | ||||
-rw-r--r-- | libvo/osd.h | 16 | ||||
-rw-r--r-- | libvo/sub.c | 4 | ||||
-rw-r--r-- | libvo/sub.h | 3 | ||||
-rw-r--r-- | libvo/video_out.h | 6 | ||||
-rw-r--r-- | libvo/vo_aa.c | 2 | ||||
-rw-r--r-- | libvo/vo_direct3d.c | 2 | ||||
-rw-r--r-- | libvo/vo_gl.c | 34 | ||||
-rw-r--r-- | libvo/vo_winvidix.c | 2 | ||||
-rw-r--r-- | libvo/vo_xvidix.c | 2 | ||||
-rw-r--r-- | libvo/w32_common.c | 16 | ||||
-rw-r--r-- | libvo/w32_common.h | 18 |
14 files changed, 66 insertions, 63 deletions
diff --git a/libvo/aspect.h b/libvo/aspect.h index b803b99490..5fa313d7ff 100644 --- a/libvo/aspect.h +++ b/libvo/aspect.h @@ -3,8 +3,8 @@ /* Stuff for correct aspect scaling. */ struct vo; -extern void panscan_init(struct vo *vo); -extern void panscan_calc(struct vo *vo); +void panscan_init(struct vo *vo); +void panscan_calc(struct vo *vo); void aspect_save_orig(struct vo *vo, int orgw, int orgh); diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index 3ac32e3a71..be0b752558 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -28,8 +28,8 @@ /* || defined(HAVE_SSE) || defined(HAVE_SSE2) */ #include <stddef.h> -extern void * fast_memcpy(void * to, const void * from, size_t len); -extern void * mem2agpcpy(void * to, const void * from, size_t len); +void * fast_memcpy(void * to, const void * from, size_t len); +void * mem2agpcpy(void * to, const void * from, size_t len); #else /* HAVE_MMX/MMX2/3DNOW/SSE/SSE2 */ #define mem2agpcpy(a,b,c) memcpy(a,b,c) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index cd75bdb706..0df3e2e74a 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -187,10 +187,10 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt, int dummy1; GLenum dummy2; GLint dummy3; - if (bpp == NULL) bpp = &dummy1; - if (gl_texfmt == NULL) gl_texfmt = &dummy3; - if (gl_format == NULL) gl_format = &dummy2; - if (gl_type == NULL) gl_type = &dummy2; + if (!bpp) bpp = &dummy1; + if (!gl_texfmt) gl_texfmt = &dummy3; + if (!gl_format) gl_format = &dummy2; + if (!gl_type) gl_type = &dummy2; *bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt); *gl_texfmt = 3; @@ -572,7 +572,7 @@ static void glSetupYUVCombiners(float uvcos, float uvsin) { if (i < 2) mp_msg(MSGT_VO, MSGL_ERR, "[gl] 2 general combiners needed for YUV combiner support (found %i)\n", i); - glGetIntegerv (GL_MAX_TEXTURE_UNITS, &i); + glGetIntegerv(GL_MAX_TEXTURE_UNITS, &i); if (i < 3) mp_msg(MSGT_VO, MSGL_ERR, "[gl] 3 texture units needed for YUV combiner support (found %i)\n", i); @@ -1469,7 +1469,7 @@ int setGlWindow(int *vinfo, HGLRC *context, HWND win) // set context if (!wglMakeCurrent(windc, new_context)) { - mp_msg (MSGT_VO, MSGL_FATAL, "[gl] Could not set GL context!\n"); + mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Could not set GL context!\n"); if (!keep_context) { wglDeleteContext(new_context); } @@ -1598,9 +1598,9 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) // set context if (!glXMakeCurrent(mDisplay, vo_window, new_context)) { - mp_msg (MSGT_VO, MSGL_FATAL, "[gl] Could not set GLX context!\n"); + mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Could not set GLX context!\n"); if (!keep_context) { - glXDestroyContext (mDisplay, new_context); + glXDestroyContext(mDisplay, new_context); XFree(new_vinfo); } return SET_WINDOW_FAILED; diff --git a/libvo/osd.h b/libvo/osd.h index c376d8d49c..897f79faa3 100644 --- a/libvo/osd.h +++ b/libvo/osd.h @@ -5,14 +5,14 @@ // Generic alpha renderers for all YUV modes and RGB depths. // These are "reference implementations", should be optimized later (MMX, etc) -extern void vo_draw_alpha_init(void); // build tables +void vo_draw_alpha_init(void); // build tables -extern void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +void vo_draw_alpha_yv12(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); +void vo_draw_alpha_yuy2(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); +void vo_draw_alpha_uyvy(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); +void vo_draw_alpha_rgb24(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); +void vo_draw_alpha_rgb32(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); +void vo_draw_alpha_rgb15(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); +void vo_draw_alpha_rgb16(int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase, int dststride); #endif /* MPLAYER_OSD_H */ diff --git a/libvo/sub.c b/libvo/sub.c index c7d3fb516e..423a3f84d9 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -640,8 +640,6 @@ inline static void vo_update_text_progbar(mp_osd_obj_t* obj,int dxs,int dys){ subtitle* vo_sub=NULL; -// vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) - inline static void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj,int dxs,int dys){ unsigned char *t; int c,i,j,l,x,y,font,prevc,counter; @@ -1036,7 +1034,7 @@ void *vo_vobsub=NULL; static int draw_alpha_init_flag=0; -extern void vo_draw_alpha_init(void); +void vo_draw_alpha_init(void); mp_osd_obj_t* vo_osd_list=NULL; diff --git a/libvo/sub.h b/libvo/sub.h index a1e7acd3c4..879e81e33a 100644 --- a/libvo/sub.h +++ b/libvo/sub.h @@ -107,9 +107,6 @@ extern int spu_alignment; extern int spu_aamode; extern float spu_gaussvar; -//extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); -//extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); -//extern void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); void osd_draw_text(struct osd_state *osd, int dxs, int dys, void (*draw_alpha)(void *ctx, int x0, int y0, int w, int h, unsigned char* src, unsigned char *srca, diff --git a/libvo/video_out.h b/libvo/video_out.h index 7ad09a74a8..cc9544f4fb 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -291,9 +291,9 @@ typedef struct { float max; } range_t; -extern float range_max(range_t *r); -extern int in_range(range_t *r, float f); -extern range_t *str2range(char *s); +float range_max(range_t *r); +int in_range(range_t *r, float f); +range_t *str2range(char *s); extern char *monitor_hfreq_str; extern char *monitor_vfreq_str; extern char *monitor_dotclock_str; diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index 3b3d5f8f50..1be77fd93e 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -234,7 +234,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, /* nothing will change its size, be we need some values initialized */ resize(); - /* now init out own 'font' (to use vo_draw_text_sub without edit them) */ + /* now init our own 'font' */ if(!vo_font_save) vo_font_save = vo_font; if(vo_font == vo_font_save) { vo_font=malloc(sizeof(font_desc_t));//if(!desc) return NULL; diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index 4e3dc875cb..b631f22f14 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -202,7 +202,7 @@ static int create_d3d_surfaces(void) priv->d3d_device, priv->src_width, priv->src_height, priv->movie_src_fmt, D3DPOOL_DEFAULT, &priv->d3d_surface, NULL))) { mp_msg(MSGT_VO, MSGL_ERR, - "<vo_direct3d><INFO>IDirect3D9_CreateOffscreenPlainSurface Failed.\n"); + "<vo_direct3d><INFO>IDirect3D9_CreateOffscreenPlainSurface Failed.\n"); return 0; } diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index b478a803ad..792376c8bb 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -140,8 +140,8 @@ static void resize(int x,int y){ panscan_calc(); new_w += vo_panscan_x; new_h += vo_panscan_y; - scale_x = (GLdouble) new_w / (GLdouble) x; - scale_y = (GLdouble) new_h / (GLdouble) y; + scale_x = (GLdouble)new_w / (GLdouble)x; + scale_y = (GLdouble)new_h / (GLdouble)y; glScaled(scale_x, scale_y, 1); ass_border_x = (vo_screenwidth - new_w) / 2; ass_border_y = (vo_screenheight - new_h) / 2; @@ -270,7 +270,7 @@ static void genEOSD(mp_eosd_images_t *imgs) { int tinytexcur = 0; int smalltexcur = 0; GLuint *curtex; - GLint scale_type = (scaled_osd) ? GL_LINEAR : GL_NEAREST; + GLint scale_type = scaled_osd ? GL_LINEAR : GL_NEAREST; ass_image_t *img = imgs->imgs; ass_image_t *i; @@ -521,7 +521,7 @@ static void create_osd_texture(int x0, int y0, int w, int h, { // initialize to 8 to avoid special-casing on alignment int sx = 8, sy = 8; - GLint scale_type = (scaled_osd) ? GL_LINEAR : GL_NEAREST; + GLint scale_type = scaled_osd ? GL_LINEAR : GL_NEAREST; if (w <= 0 || h <= 0 || stride < w) { mp_msg(MSGT_VO, MSGL_V, "Invalid dimensions OSD for part!\n"); @@ -587,8 +587,8 @@ static void draw_osd(void) if (vo_osd_changed(0)) { int osd_h, osd_w; clearOSD(); - osd_w = (scaled_osd) ? image_width : vo_dwidth; - osd_h = (scaled_osd) ? image_height : vo_dheight; + osd_w = scaled_osd ? image_width : vo_dwidth; + osd_h = scaled_osd ? image_height : vo_dheight; vo_draw_text(osd_w, osd_h, create_osd_texture); } if (vo_doublebuffering) do_render_osd(); @@ -635,7 +635,7 @@ static void do_render_osd(void) { glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList); } // set rendering parameters back to defaults - glDisable (GL_BLEND); + glDisable(GL_BLEND); if (!scaled_osd) glPopMatrix(); BindTexture(gl_target, 0); @@ -664,7 +664,7 @@ static void redraw(void) { //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num) static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) { - mpi_flipped = (stride[0] < 0); + mpi_flipped = stride[0] < 0; glUploadTex(gl_target, gl_format, gl_type, src[0], stride[0], x, y, w, h, slice_height); if (image_format == IMGFMT_YV12) { @@ -705,7 +705,7 @@ static uint32_t get_image(mp_image_t *mpi) { gl_bufferptr = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); mpi->planes[0] = gl_bufferptr; BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - if (mpi->planes[0] == NULL) { + if (!mpi->planes[0]) { if (!err_shown) mp_msg(MSGT_VO, MSGL_ERR, "[gl] could not acquire buffer for dr\n" "Expect a _major_ speed penalty\n"); @@ -768,7 +768,7 @@ static uint32_t draw_image(mp_image_t *mpi) { } stride[0] = mpi->stride[0]; stride[1] = mpi->stride[1]; stride[2] = mpi->stride[2]; planes[0] = mpi->planes[0]; planes[1] = mpi->planes[1]; planes[2] = mpi->planes[2]; - mpi_flipped = (stride[0] < 0); + mpi_flipped = stride[0] < 0; if (mpi->flags & MP_IMGFLAG_DIRECT) { intptr_t base = (intptr_t)planes[0]; if (mpi_flipped) @@ -825,7 +825,7 @@ query_format(uint32_t format) VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE; if (use_osd) caps |= VFCAP_OSD | VFCAP_EOSD | (scaled_osd ? 0 : VFCAP_EOSD_UNSCALED); - if ((format == IMGFMT_RGB24) || (format == IMGFMT_RGBA)) + if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA) return caps; if (use_yuv && format == IMGFMT_YV12) return caps; @@ -843,7 +843,7 @@ query_format(uint32_t format) static void uninit(void) { - if ( !vo_config_count ) return; + if (!vo_config_count) return; uninitGl(); releaseGlContext(&gl_vinfo, &gl_context); if (custom_prog) free(custom_prog); @@ -960,11 +960,11 @@ static int preinit(const char *arg) gl_target = GL_TEXTURE_2D; yuvconvtype = use_yuv | lscale << YUV_LUM_SCALER_SHIFT | cscale << YUV_CHROM_SCALER_SHIFT; if (many_fmts) - mp_msg (MSGT_VO, MSGL_INFO, "[gl] using extended formats. " + mp_msg(MSGT_VO, MSGL_INFO, "[gl] using extended formats. " "Use -vo gl:nomanyfmts if playback fails.\n"); - mp_msg (MSGT_VO, MSGL_V, "[gl] Using %d as slice height " + mp_msg(MSGT_VO, MSGL_V, "[gl] Using %d as slice height " "(0 means image height).\n", slice_height); - if( !vo_init() ) return -1; // Can't open X11 + if (!vo_init()) return -1; // Can't open X11 return 0; } @@ -997,7 +997,7 @@ static int control(uint32_t request, void *data) int_pause = (request == VOCTRL_PAUSE); return VO_TRUE; case VOCTRL_QUERY_FORMAT: - return query_format(*((uint32_t*)data)); + return query_format(*(uint32_t*)data); case VOCTRL_GET_IMAGE: return get_image(data); case VOCTRL_DRAW_IMAGE: @@ -1039,7 +1039,7 @@ static int control(uint32_t request, void *data) return VO_TRUE; case VOCTRL_SET_PANSCAN: if (!use_aspect) return VO_NOTIMPL; - resize (vo_dwidth, vo_dheight); + resize(vo_dwidth, vo_dheight); return VO_TRUE; case VOCTRL_GET_EQUALIZER: if (image_format == IMGFMT_YV12) { diff --git a/libvo/vo_winvidix.c b/libvo/vo_winvidix.c index 2a8959fa5c..d5aae17f34 100644 --- a/libvo/vo_winvidix.c +++ b/libvo/vo_winvidix.c @@ -55,7 +55,7 @@ static float window_aspect; static vidix_grkey_t gr_key; -extern void set_video_eq( int cap ); +void set_video_eq(int cap); static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c index 49c656ecb3..f8528348a6 100644 --- a/libvo/vo_xvidix.c +++ b/libvo/vo_xvidix.c @@ -68,7 +68,7 @@ static uint32_t window_width, window_height; static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth, drwDepth, drwcX, drwcY, dwidth, dheight; -extern void set_video_eq(int cap); +void set_video_eq(int cap); static void set_window(int force_update) diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 7f25182387..c2502d3f47 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -178,6 +178,11 @@ int vo_w32_check_events(void) { } if (WinID >= 0) { RECT r; + GetClientRect(vo_window, &r); + if (r.right != vo_dwidth || r.bottom != vo_dheight) { + vo_dwidth = r.right; vo_dheight = r.bottom; + event_flags |= VO_EVENT_RESIZE; + } GetClientRect(WinID, &r); if (r.right != vo_dwidth || r.bottom != vo_dheight) MoveWindow(vo_window, 0, 0, r.right, r.bottom, FALSE); @@ -383,10 +388,13 @@ int vo_w32_config(uint32_t width, uint32_t height, uint32_t flags) { o_dwidth = width; o_dheight = height; - prev_width = vo_dwidth = width; - prev_height = vo_dheight = height; - prev_x = vo_dx; - prev_y = vo_dy; + if (WinID < 0) { + // the desired size is ignored in wid mode, it always matches the window size. + prev_width = vo_dwidth = width; + prev_height = vo_dheight = height; + prev_x = vo_dx; + prev_y = vo_dy; + } vo_fs = flags & VOFLAG_FULLSCREEN; vo_vm = flags & VOFLAG_MODESWITCHING; diff --git a/libvo/w32_common.h b/libvo/w32_common.h index 219e7d454d..41c0712470 100644 --- a/libvo/w32_common.h +++ b/libvo/w32_common.h @@ -7,14 +7,14 @@ extern HWND vo_w32_window; extern int vo_vm; -extern int vo_w32_init(void); -extern void vo_w32_uninit(void); -extern void vo_w32_ontop(void); -extern void vo_w32_border(void); -extern void vo_w32_fullscreen(void); -extern int vo_w32_check_events(void); -extern int vo_w32_config(uint32_t, uint32_t, uint32_t); -extern void destroyRenderingContext(void); -extern void w32_update_xinerama_info(void); +int vo_w32_init(void); +void vo_w32_uninit(void); +void vo_w32_ontop(void); +void vo_w32_border(void); +void vo_w32_fullscreen(void); +int vo_w32_check_events(void); +int vo_w32_config(uint32_t, uint32_t, uint32_t); +void destroyRenderingContext(void); +void w32_update_xinerama_info(void); #endif /* MPLAYER_W32_COMMON_H */ |