mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
simplified function prototypes to avoid casts but keep external API compatibility
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22883 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
17c0394061
commit
ea7f7fd9f1
140
vidix/vidixlib.c
140
vidix/vidixlib.c
@ -78,11 +78,8 @@ VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose)
|
||||
return ctx;
|
||||
}
|
||||
|
||||
void vdlClose(VDL_HANDLE stream)
|
||||
void vdlClose(VDL_HANDLE ctx)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) stream;
|
||||
if (ctx->drv->destroy)
|
||||
ctx->drv->destroy ();
|
||||
|
||||
@ -90,11 +87,8 @@ void vdlClose(VDL_HANDLE stream)
|
||||
free (ctx);
|
||||
}
|
||||
|
||||
int vdlGetCapability(VDL_HANDLE handle, vidix_capability_t *cap)
|
||||
int vdlGetCapability(VDL_HANDLE ctx, vidix_capability_t *cap)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
return ctx->drv->get_caps (cap);
|
||||
}
|
||||
|
||||
@ -110,157 +104,79 @@ static uint32_t normalize_fourcc(uint32_t fourcc)
|
||||
else return fourcc;
|
||||
}
|
||||
|
||||
int vdlQueryFourcc(VDL_HANDLE handle,vidix_fourcc_t *f)
|
||||
int vdlQueryFourcc(VDL_HANDLE ctx,vidix_fourcc_t *f)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
f->fourcc = normalize_fourcc(f->fourcc);
|
||||
return ctx->drv->query_fourcc (f);
|
||||
}
|
||||
|
||||
int vdlConfigPlayback(VDL_HANDLE handle,vidix_playback_t *p)
|
||||
int vdlConfigPlayback(VDL_HANDLE ctx,vidix_playback_t *p)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
p->fourcc = normalize_fourcc(p->fourcc);
|
||||
return ctx->drv->config_playback (p);
|
||||
}
|
||||
|
||||
int vdlPlaybackOn(VDL_HANDLE handle)
|
||||
int vdlPlaybackOn(VDL_HANDLE ctx)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
return ctx->drv->playback_on ();
|
||||
}
|
||||
|
||||
int vdlPlaybackOff(VDL_HANDLE handle)
|
||||
int vdlPlaybackOff(VDL_HANDLE ctx)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
return ctx->drv->playback_off ();
|
||||
}
|
||||
|
||||
int vdlPlaybackFrameSelect(VDL_HANDLE handle, unsigned frame_idx )
|
||||
int vdlPlaybackFrameSelect(VDL_HANDLE ctx, unsigned frame_idx )
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->frame_sel)
|
||||
return ctx->drv->frame_sel (frame_idx);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->frame_sel) ? ctx->drv->frame_sel (frame_idx) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlPlaybackGetEq(VDL_HANDLE handle, vidix_video_eq_t * e)
|
||||
int vdlPlaybackGetEq(VDL_HANDLE ctx, vidix_video_eq_t * e)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->get_eq)
|
||||
return ctx->drv->get_eq (e);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->get_eq) ? ctx->drv->get_eq (e) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlPlaybackSetEq(VDL_HANDLE handle, const vidix_video_eq_t * e)
|
||||
int vdlPlaybackSetEq(VDL_HANDLE ctx, const vidix_video_eq_t * e)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->set_eq)
|
||||
return ctx->drv->set_eq (e);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->set_eq) ? ctx->drv->set_eq (e) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlPlaybackCopyFrame(VDL_HANDLE handle, const vidix_dma_t * f)
|
||||
int vdlPlaybackCopyFrame(VDL_HANDLE ctx, const vidix_dma_t * f)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->copy_frame)
|
||||
return ctx->drv->copy_frame (f);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->copy_frame) ? ctx->drv->copy_frame (f) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlGetGrKeys(VDL_HANDLE handle, vidix_grkey_t * k)
|
||||
int vdlGetGrKeys(VDL_HANDLE ctx, vidix_grkey_t * k)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->get_gkey)
|
||||
return ctx->drv->get_gkey (k);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->get_gkey) ? ctx->drv->get_gkey (k) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlSetGrKeys(VDL_HANDLE handle, const vidix_grkey_t * k)
|
||||
int vdlSetGrKeys(VDL_HANDLE ctx, const vidix_grkey_t * k)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->set_gkey)
|
||||
return ctx->drv->set_gkey (k);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->set_gkey) ? ctx->drv->set_gkey (k) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlPlaybackGetDeint(VDL_HANDLE handle, vidix_deinterlace_t * d)
|
||||
int vdlPlaybackGetDeint(VDL_HANDLE ctx, vidix_deinterlace_t * d)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->get_deint)
|
||||
return ctx->drv->get_deint (d);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->get_deint) ? ctx->drv->get_deint (d) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlPlaybackSetDeint(VDL_HANDLE handle, const vidix_deinterlace_t * d)
|
||||
int vdlPlaybackSetDeint(VDL_HANDLE ctx, const vidix_deinterlace_t * d)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->set_deint)
|
||||
return ctx->drv->set_deint (d);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->set_deint) ? ctx->drv->set_deint (d) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlQueryNumOemEffects(VDL_HANDLE handle, unsigned * number )
|
||||
int vdlQueryNumOemEffects(VDL_HANDLE ctx, unsigned * number )
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->get_num_fx)
|
||||
return ctx->drv->get_num_fx (number);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->get_num_fx) ? ctx->drv->get_num_fx (number) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlGetOemEffect(VDL_HANDLE handle, vidix_oem_fx_t * f)
|
||||
int vdlGetOemEffect(VDL_HANDLE ctx, vidix_oem_fx_t * f)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->get_fx)
|
||||
return ctx->drv->get_fx (f);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->get_fx) ? ctx->drv->get_fx (f) : ENOSYS;
|
||||
}
|
||||
|
||||
int vdlSetOemEffect(VDL_HANDLE handle, const vidix_oem_fx_t * f)
|
||||
int vdlSetOemEffect(VDL_HANDLE ctx, const vidix_oem_fx_t * f)
|
||||
{
|
||||
VDXContext *ctx;
|
||||
|
||||
ctx = (VDXContext *) handle;
|
||||
if (ctx->drv->set_fx)
|
||||
return ctx->drv->set_fx (f);
|
||||
|
||||
return ENOSYS;
|
||||
return (ctx->drv->set_fx) ? ctx->drv->set_fx (f) : ENOSYS;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ typedef struct VDXContext {
|
||||
/* might be filled in by much more info later on */
|
||||
} VDXContext;
|
||||
|
||||
typedef void * VDL_HANDLE;
|
||||
typedef VDXContext * VDL_HANDLE;
|
||||
|
||||
/* returns library version */
|
||||
unsigned vdlGetVersion( void );
|
||||
@ -70,7 +70,7 @@ unsigned vdlGetVersion( void );
|
||||
*/
|
||||
VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose);
|
||||
/* Closes stream and corresponded driver. */
|
||||
void vdlClose(VDL_HANDLE stream);
|
||||
void vdlClose(VDL_HANDLE ctx);
|
||||
|
||||
/* Queries driver capabilities. Return 0 if ok else errno */
|
||||
int vdlGetCapability(VDL_HANDLE, vidix_capability_t *);
|
||||
|
Loading…
Reference in New Issue
Block a user