diff options
Diffstat (limited to 'libvo/vosub_vidix.c')
-rw-r--r-- | libvo/vosub_vidix.c | 90 |
1 files changed, 41 insertions, 49 deletions
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c index a6f261130b..9b3c941c4d 100644 --- a/libvo/vosub_vidix.c +++ b/libvo/vosub_vidix.c @@ -44,6 +44,7 @@ #include "video_out.h" #include "sub.h" #include "vosub_vidix.h" +#include "old_vo_wrapper.h" #include "libmpcodecs/vfcap.h" #include "libmpcodecs/mp_image.h" @@ -59,7 +60,7 @@ static int video_on=0; static vidix_capability_t vidix_cap; static vidix_playback_t vidix_play; static vidix_fourcc_t vidix_fourcc; -static vo_functions_t * vo_server; +static struct vo_old_functions *vo_server; static vidix_yuv_t dstrides; /*static uint32_t (*server_control)(uint32_t request, void *data, ...);*/ @@ -68,7 +69,7 @@ int vidix_start(void) int err; if((err=vdlPlaybackOn(vidix_handler))!=0) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_CantStartPlayback,strerror(err)); + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Can't start playback: %s\n",strerror(err)); return -1; } video_on=1; @@ -80,7 +81,7 @@ int vidix_stop(void) int err; if((err=vdlPlaybackOff(vidix_handler))!=0) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_CantStopPlayback,strerror(err)); + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Can't stop playback: %s\n",strerror(err)); return -1; } video_on=0; @@ -96,7 +97,7 @@ void vidix_term( void ) // vo_server->control=server_control; } -static uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,int y) +static int vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,int y) { uint8_t *src; uint8_t *dest; @@ -160,7 +161,7 @@ static uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h return -1; } -static uint32_t vidix_draw_slice_410(uint8_t *image[], int stride[], int w,int h,int x,int y) +static int vidix_draw_slice_410(uint8_t *image[], int stride[], int w,int h,int x,int y) { uint8_t *src; uint8_t *dest; @@ -178,7 +179,7 @@ static uint32_t vidix_draw_slice_410(uint8_t *image[], int stride[], int w,int h if (vidix_play.flags & VID_PLAY_INTERLEAVED_UV) { - mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_SUB_VIDIX_InterleavedUvForYuv410pNotSupported); + mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_SUB_VIDIX] Interleaved UV for YUV410P not supported.\n"); } else { @@ -206,7 +207,7 @@ static uint32_t vidix_draw_slice_410(uint8_t *image[], int stride[], int w,int h return -1; } -static uint32_t vidix_draw_slice_packed(uint8_t *image[], int stride[], int w,int h,int x,int y) +static int vidix_draw_slice_packed(uint8_t *image[], int stride[], int w,int h,int x,int y) { uint8_t *src; uint8_t *dest; @@ -223,7 +224,7 @@ static uint32_t vidix_draw_slice_packed(uint8_t *image[], int stride[], int w,in return 0; } -static uint32_t vidix_draw_slice_nv12(uint8_t *image[], int stride[], int w,int h,int x,int y) +static int vidix_draw_slice_nv12(uint8_t *image[], int stride[], int w,int h,int x,int y) { uint8_t *src; uint8_t *dest; @@ -251,9 +252,9 @@ static uint32_t vidix_draw_slice_nv12(uint8_t *image[], int stride[], int w,int return 0; } -static uint32_t vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) +static int vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) { - mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawsliceWasCalled); + mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_SUB_VIDIX] Dummy vidix_draw_slice() was called.\n"); return -1; } @@ -269,9 +270,9 @@ static uint32_t vidix_draw_image(mp_image_t *mpi){ return VO_TRUE; } -static uint32_t vidix_draw_frame(uint8_t *image[]) +static int vidix_draw_frame(uint8_t *image[]) { - mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawframeWasCalled); + mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_SUB_VIDIX] Dummy vidix_draw_frame() was called.\n"); return -1; } @@ -391,7 +392,7 @@ int vidix_init(unsigned src_width,unsigned src_height, if(vidix_query_fourcc(format) == 0) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_UnsupportedFourccForThisVidixDriver, + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Unsupported FourCC for this VIDIX driver: %x (%s).\n", format,vo_format_name(format)); return -1; } @@ -401,7 +402,7 @@ int vidix_init(unsigned src_width,unsigned src_height, ((vidix_cap.maxheight != -1) && (vid_h > vidix_cap.maxheight)) || ((vidix_cap.minwidth != -1 ) && (vid_h < vidix_cap.minheight))) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedResolution, + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d.\n", vid_w, vid_h, vidix_cap.minwidth, vidix_cap.minheight, vidix_cap.maxwidth, vidix_cap.maxheight); return -1; @@ -423,19 +424,19 @@ int vidix_init(unsigned src_width,unsigned src_height, } if(err) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedColorDepth + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Video server has unsupported color depth by vidix (%d).\n" ,vidix_fourcc.depth); return -1; } if((dst_width > src_width || dst_height > src_height) && (vidix_cap.flags & FLAG_UPSCALER) != FLAG_UPSCALER) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_DriverCantUpscaleImage, + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] VIDIX driver can't upscale image (%d%d -> %d%d).\n", src_width, src_height, dst_width, dst_height); return -1; } if((dst_width > src_width || dst_height > src_height) && (vidix_cap.flags & FLAG_DOWNSCALER) != FLAG_DOWNSCALER) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_DriverCantDownscaleImage, + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] VIDIX driver can't downscale image (%d%d -> %d%d).\n", src_width, src_height, dst_width, dst_height); return -1; } @@ -463,7 +464,7 @@ int vidix_init(unsigned src_width,unsigned src_height, if((err=vdlConfigPlayback(vidix_handler,&vidix_play))!=0) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_CantConfigurePlayback,strerror(err)); + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Can't configure playback: %s.\n",strerror(err)); return -1; } if ( mp_msg_test(MSGT_VO,MSGL_V) ) { @@ -576,7 +577,7 @@ static uint32_t vidix_get_image(mp_image_t *mpi) return VO_FALSE; } -uint32_t vidix_control(uint32_t request, void *data, ...) +uint32_t vidix_control(uint32_t request, void *data) { switch (request) { case VOCTRL_QUERY_FORMAT: @@ -596,36 +597,31 @@ uint32_t vidix_control(uint32_t request, void *data, ...) return VO_TRUE; case VOCTRL_SET_EQUALIZER: { - va_list ap; - int value; vidix_video_eq_t info; if(!video_on) return VO_FALSE; - va_start(ap, data); - value = va_arg(ap, int); - va_end(ap); -// printf("vidix seteq %s -> %d \n",data,value); + struct voctrl_set_equalizer_args *args = data; /* vidix eq ranges are -1000..1000 */ - if (!strcasecmp(data, "brightness")) + if (!strcasecmp(args->name, "brightness")) { - info.brightness = value*10; + info.brightness = args->value*10; info.cap = VEQ_CAP_BRIGHTNESS; } - else if (!strcasecmp(data, "contrast")) + else if (!strcasecmp(args->name, "contrast")) { - info.contrast = value*10; + info.contrast = args->value*10; info.cap = VEQ_CAP_CONTRAST; } - else if (!strcasecmp(data, "saturation")) + else if (!strcasecmp(args->name, "saturation")) { - info.saturation = value*10; + info.saturation = args->value*10; info.cap = VEQ_CAP_SATURATION; } - else if (!strcasecmp(data, "hue")) + else if (!strcasecmp(args->name, "hue")) { - info.hue = value*10; + info.hue = args->value*10; info.cap = VEQ_CAP_HUE; } @@ -635,38 +631,34 @@ uint32_t vidix_control(uint32_t request, void *data, ...) } case VOCTRL_GET_EQUALIZER: { - va_list ap; - int *value; vidix_video_eq_t info; if(!video_on) return VO_FALSE; if (vdlPlaybackGetEq(vidix_handler, &info) != 0) return VO_FALSE; - va_start(ap, data); - value = va_arg(ap, int*); - va_end(ap); + struct voctrl_get_equalizer_args *args = data; /* vidix eq ranges are -1000..1000 */ - if (!strcasecmp(data, "brightness")) + if (!strcasecmp(args->name, "brightness")) { if (info.cap & VEQ_CAP_BRIGHTNESS) - *value = info.brightness/10; + *args->valueptr = info.brightness/10; } - else if (!strcasecmp(data, "contrast")) + else if (!strcasecmp(args->name, "contrast")) { if (info.cap & VEQ_CAP_CONTRAST) - *value = info.contrast/10; + *args->valueptr = info.contrast/10; } - else if (!strcasecmp(data, "saturation")) + else if (!strcasecmp(args->name, "saturation")) { if (info.cap & VEQ_CAP_SATURATION) - *value = info.saturation/10; + *args->valueptr = info.saturation/10; } - else if (!strcasecmp(data, "hue")) + else if (!strcasecmp(args->name, "hue")) { if (info.cap & VEQ_CAP_HUE) - *value = info.hue/10; + *args->valueptr = info.hue/10; } return VO_TRUE; @@ -677,7 +669,7 @@ uint32_t vidix_control(uint32_t request, void *data, ...) // return server_control(request,data); //VO_NOTIMPL; } -int vidix_preinit(const char *drvname,vo_functions_t *server) +int vidix_preinit(const char *drvname, struct vo_old_functions *server) { int err; if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) { @@ -689,12 +681,12 @@ int vidix_preinit(const char *drvname,vo_functions_t *server) if(vidix_handler == NULL) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_CouldntFindWorkingVidixDriver); + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Couldn't find working VIDIX driver.\n"); return -1; } if((err=vdlGetCapability(vidix_handler,&vidix_cap)) != 0) { - mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_CouldntGetCapability,strerror(err)); + mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Couldn't get capability: %s.\n",strerror(err)); return -1; } mp_msg(MSGT_VO,MSGL_V, "[VO_SUB_VIDIX] Description: %s.\n", vidix_cap.name); |