diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-05-29 17:15:55 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-05-29 17:20:44 +0300 |
commit | 1888e57af7e1ce51517ad9bdc2d201eaf84a98d2 (patch) | |
tree | f1c87c4a44a38ee5d2adc35719beec3c3213c723 | |
parent | ba5f104836b487d70b0ab107fb7a1325566504ad (diff) | |
download | mpv-1888e57af7e1ce51517ad9bdc2d201eaf84a98d2.tar.bz2 mpv-1888e57af7e1ce51517ad9bdc2d201eaf84a98d2.tar.xz |
cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"
Change 'struct vf_instance' pointer arguments to more standard style
as in the subject. Also some other minor formatting fixes.
Patch by Diego Biurrun.
95 files changed, 401 insertions, 390 deletions
diff --git a/DOCS/tech/libmpcodecs.txt b/DOCS/tech/libmpcodecs.txt index 5015f5dcc0..b7378e8f2c 100644 --- a/DOCS/tech/libmpcodecs.txt +++ b/DOCS/tech/libmpcodecs.txt @@ -153,7 +153,7 @@ vf_info_t* info; const char *name; // short name of the filter, must be FILTERNAME const char *author; // name and email/URL of the author(s) const char *comment; // comment, URL to papers describing algorithm etc. - int (*open)(struct vf_instance* vf,char* args); + int (*open)(struct vf_instance *vf,char* args); // pointer to the open() function: Sample: @@ -203,7 +203,7 @@ NOTE: All these are optional, their function pointer is either NULL or points to a default implementation. If you implement them, don't forget to set vf->FUNCNAME in your open() ! - int (*query_format)(struct vf_instance* vf, unsigned int fmt); + int (*query_format)(struct vf_instance *vf, unsigned int fmt); The query_format() function is called one or more times before the config(), to find out the capabilities and/or support status of a given colorspace (fmt). @@ -216,7 +216,7 @@ next filter will accept at least one of your possible output colorspaces! Sample: -static int query_format(struct vf_instance* vf, unsigned int fmt) +static int query_format(struct vf_instance *vf, unsigned int fmt) { switch(fmt){ case IMGFMT_YV12: @@ -232,7 +232,7 @@ For the more complex case, when you have an N -> M colorspace mapping matrix, see vf_scale or vf_rgb2bgr for examples. - int (*config)(struct vf_instance* vf, + int (*config)(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt); @@ -257,7 +257,7 @@ Its parameters are already well-known from libvo: Sample: -static int config(struct vf_instance* vf, +static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { @@ -272,12 +272,12 @@ static int config(struct vf_instance* vf, return vf_next_config(vf,vf->priv->w,vf->priv->h,d_width,d_height,flags,outfmt); } - void (*uninit)(struct vf_instance* vf); + void (*uninit)(struct vf_instance *vf); Okay, uninit() is the simplest, it's called at the end. You can free your private buffers etc here. - int (*put_image)(struct vf_instance* vf, mp_image_t *mpi); + int (*put_image)(struct vf_instance *vf, mp_image_t *mpi); Ah, put_image(). This is the main filter function, it should convert/filter/ transform the image data from one format/size/color/whatever to another. @@ -332,7 +332,7 @@ image: Ok, the rest is for advanced functionality only: - int (*control)(struct vf_instance* vf, int request, void* data); + int (*control)(struct vf_instance *vf, int request, void* data); You can control the filter at runtime from MPlayer/MEncoder/dec_video: #define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */ @@ -343,7 +343,7 @@ You can control the filter at runtime from MPlayer/MEncoder/dec_video: #define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */ - void (*get_image)(struct vf_instance* vf, mp_image_t *mpi); + void (*get_image)(struct vf_instance *vf, mp_image_t *mpi); This is for direct rendering support, works the same way as in libvo drivers. It makes in-place pixel modifications possible. @@ -359,7 +359,7 @@ order, while put_image is called for display) so the only safe place to save it is in the mpi struct itself: mpi->priv=(void*)dmpi; - void (*draw_slice)(struct vf_instance* vf, unsigned char** src, + void (*draw_slice)(struct vf_instance *vf, unsigned char** src, int* stride, int w,int h, int x, int y); It's the good old draw_slice callback, already known from libvo. @@ -2433,7 +2433,7 @@ static struct { static int set_property_command(MPContext *mpctx, mp_cmd_t *cmd) { int i, r; - m_option_t* prop; + m_option_t *prop; const char *pname; // look for the command diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index 336261d233..d068c39e5b 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -53,9 +53,9 @@ struct vf_priv_s { int passthrough; }; -static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts); +static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts); -void vf_menu_pause_update(struct vf_instance* vf) { +void vf_menu_pause_update(struct vf_instance *vf) { const struct vo *video_out = mpctx_get_video_out(vf->priv->current->ctx); if(pause_mpi) { put_image(vf,pause_mpi, MP_NOPTS_VALUE); @@ -121,7 +121,7 @@ static int cmd_filter(mp_cmd_t* cmd, void *ctx) return 0; } -static void get_image(struct vf_instance* vf, mp_image_t *mpi){ +static void get_image(struct vf_instance *vf, mp_image_t *mpi){ mp_image_t *dmpi; if(mpi->type == MP_IMGTYPE_TEMP && (!(mpi->flags&MP_IMGFLAG_PRESERVE)) ) { @@ -138,7 +138,7 @@ static int key_cb(int code) { return menu_read_key(st_priv->current,code); } -static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){ +static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi = NULL; if (vf->priv->passthrough) { @@ -214,7 +214,7 @@ static void uninit(vf_instance_t *vf) { } } -static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height, +static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { #ifdef CONFIG_FREETYPE // here is the right place to get screen dimensions @@ -228,7 +228,7 @@ static int config(struct vf_instance* vf, int width, int height, int d_width, in return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } -static int query_format(struct vf_instance* vf, unsigned int fmt){ +static int query_format(struct vf_instance *vf, unsigned int fmt){ return vf_next_query_format(vf, fmt); } diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c index fd258e12f9..aef29b1e13 100644 --- a/libmpcodecs/ad_liba52.c +++ b/libmpcodecs/ad_liba52.c @@ -73,7 +73,8 @@ static const ad_info_t info = LIBAD_EXTERN(liba52) -static int a52_fillbuff(sh_audio_t *sh_audio){ +static int a52_fillbuff(sh_audio_t *sh_audio) +{ int length=0; int flags=0; int sample_rate=0; @@ -137,7 +138,8 @@ int channels=0; return (flags&A52_LFE) ? (channels+1) : channels; } -static sample_t dynrng_call (sample_t c, void *data) { +static sample_t dynrng_call (sample_t c, void *data) +{ // fprintf(stderr, "(%lf, %lf): %lf\n", (double)c, (double)a52_drc_level, (double)pow((double)c, a52_drc_level)); return pow((double)c, a52_drc_level); } diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index 060d95d437..29e78d69af 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -127,18 +127,18 @@ static int init(sh_audio_t * sh_audio) return 1; } -static int preinit(sh_audio_t * sh) +static int preinit(sh_audio_t *sh) { sh->audio_out_minsize = 2048; return 1; } -static void uninit(sh_audio_t * sh) +static void uninit(sh_audio_t *sh) { talloc_free(sh->context); } -static int control(sh_audio_t * sh, int cmd, void *arg, ...) +static int control(sh_audio_t *sh, int cmd, void *arg, ...) { struct ad_pcm_context *ctx = sh->context; int skip; @@ -155,7 +155,7 @@ static int control(sh_audio_t * sh, int cmd, void *arg, ...) return CONTROL_UNKNOWN; } -static int decode_audio(sh_audio_t * sh_audio, unsigned char *buf, int minlen, +static int decode_audio(sh_audio_t *sh_audio, unsigned char *buf, int minlen, int maxlen) { int len = sh_audio->channels * sh_audio->samplesize; diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index d6b5a82ccd..6bee762ed2 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -707,7 +707,8 @@ typedef struct dp_hdr_s { uint32_t chunktab; // offset to chunk offset array } dp_hdr_t; -static void swap_palette(void *pal) { +static void swap_palette(void *pal) +{ int i; uint32_t *p = pal; for (i = 0; i < AVPALETTE_COUNT; i++) diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index febfa04a45..4cd7cd778d 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -342,9 +342,9 @@ struct vf_priv_s { #define mux_v (vf->priv->mux) #define lavc_venc_context (vf->priv->context) -static int encode_frame(struct vf_instance* vf, AVFrame *pic, double pts); +static int encode_frame(struct vf_instance *vf, AVFrame *pic, double pts); -static int config(struct vf_instance* vf, +static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ int size, i; @@ -713,7 +713,7 @@ static int config(struct vf_instance* vf, return 1; } -static int control(struct vf_instance* vf, int request, void* data){ +static int control(struct vf_instance *vf, int request, void* data){ switch(request){ case VFCTRL_FLUSH_FRAMES: @@ -725,7 +725,7 @@ static int control(struct vf_instance* vf, int request, void* data){ } } -static int query_format(struct vf_instance* vf, unsigned int fmt){ +static int query_format(struct vf_instance *vf, unsigned int fmt){ switch(fmt){ case IMGFMT_YV12: case IMGFMT_IYUV: @@ -762,7 +762,7 @@ static double psnr(double d){ return -10.0*log(d)/log(10); } -static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){ +static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ AVFrame *pic= vf->priv->pic; pic->data[0]=mpi->planes[0]; @@ -785,7 +785,7 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){ return encode_frame(vf, pic, pts) >= 0; } |