?? grab-ng.h
字號(hào):
struct ng_attribute* ng_attr_byid(struct ng_attribute *attrs, int id);struct ng_attribute* ng_attr_byname(struct ng_attribute *attrs, char *name);const char* ng_attr_getstr(struct ng_attribute *attr, int value);int ng_attr_getint(struct ng_attribute *attr, char *value);void ng_attr_listchoices(struct ng_attribute *attr);int ng_attr_int2percent(struct ng_attribute *attr, int value);int ng_attr_percent2int(struct ng_attribute *attr, int percent);int ng_attr_parse_int(struct ng_attribute *attr, char *str);/* --------------------------------------------------------------------- */void ng_ratio_fixup(int *width, int *height, int *xoff, int *yoff);void ng_ratio_fixup2(int *width, int *height, int *xoff, int *yoff, int ratio_x, int ratio_y, int up);/* --------------------------------------------------------------------- *//* device informations */struct ng_devinfo { char device[32]; char name[64]; int flags;};/* --------------------------------------------------------------------- *//* capture/overlay interface driver */struct ng_vid_driver { const char *name; /* open/close */ void* (*open)(char *device); int (*close)(void *handle); /* attributes */ char* (*get_devname)(void *handle); int (*capabilities)(void *handle); struct ng_attribute* (*list_attrs)(void *handle); /* overlay */ int (*setupfb)(void *handle, struct ng_video_fmt *fmt, void *base); int (*overlay)(void *handle, struct ng_video_fmt *fmt, int x, int y, struct OVERLAY_CLIP *oc, int count, int aspect); /* capture */ int (*setformat)(void *handle, struct ng_video_fmt *fmt); int (*startvideo)(void *handle, int fps, unsigned int buffers); void (*stopvideo)(void *handle); struct ng_video_buf* (*nextframe)(void *handle); /* video frame */ struct ng_video_buf* (*getimage)(void *handle); /* single image */ /* tuner */ unsigned long (*getfreq)(void *handle); void (*setfreq)(void *handle, unsigned long freq); int (*is_tuned)(void *handle); struct list_head list;};/* --------------------------------------------------------------------- *//* sound driver */struct ng_dsp_driver { const char *name; void* (*open)(char *device, struct ng_audio_fmt *fmt, int record); void (*close)(void *handle); int (*fd)(void *handle); int (*startrec)(void *handle); struct ng_audio_buf* (*read)(void *handle, int64_t stopby); struct ng_audio_buf* (*write)(void *handle, struct ng_audio_buf *buf); int64_t (*latency)(void *handle); struct list_head list;};struct ng_mix_driver { const char *name; struct ng_devinfo* (*probe)(void); struct ng_devinfo* (*channels)(char *device); void* (*open)(char *device); struct ng_attribute* (*volctl)(void *handle, char *channel); void (*close)(void *handle); struct list_head list;};/* --------------------------------------------------------------------- *//* color space converters */struct ng_video_conv { unsigned int fmtid_in; unsigned int fmtid_out; void* (*init)(struct ng_video_fmt *out, void *priv); void (*frame)(void *handle, struct ng_video_buf *out, struct ng_video_buf *in); void (*fini)(void *handle); void *priv; struct list_head list;};struct ng_convert_handle { struct ng_video_fmt ifmt; struct ng_video_fmt ofmt; int isize; int osize; struct ng_video_conv *conv; void *chandle;};struct ng_convert_handle* ng_convert_alloc(struct ng_video_conv *conv, struct ng_video_fmt *i, struct ng_video_fmt *o);void ng_convert_init(struct ng_convert_handle *h);struct ng_video_buf* ng_convert_frame(struct ng_convert_handle *h, struct ng_video_buf *dest, struct ng_video_buf *buf);void ng_convert_fini(struct ng_convert_handle *h);struct ng_video_buf* ng_convert_single(struct ng_convert_handle *h, struct ng_video_buf *in);/* --------------------------------------------------------------------- *//* audio converters */struct ng_audio_conv { unsigned int fmtid_in; unsigned int fmtid_out; void* (*init)(void *priv); struct ng_audio_buf* (*frame)(void *handle, struct ng_audio_buf *in); void (*fini)(void *handle); void *priv; struct list_head list;};/* --------------------------------------------------------------------- *//* filters */struct ng_filter { char *name; int fmts; struct ng_attribute* attrs; void* (*init)(struct ng_video_fmt *fmt); struct ng_video_buf* (*frame)(void *handle, struct ng_video_buf *in); void (*fini)(void *handle); struct list_head list;};/* --------------------------------------------------------------------- *//* must be changed if we break compatibility */#define NG_PLUGIN_MAGIC 0x20030129extern struct list_head ng_conv;extern struct list_head ng_aconv;extern struct list_head ng_filters;extern struct list_head ng_writers;extern struct list_head ng_readers;extern struct list_head ng_vid_drivers;extern struct list_head ng_dsp_drivers;extern struct list_head ng_mix_drivers;int ng_conv_register(int magic, char *plugname, struct ng_video_conv *list, int count);int ng_aconv_register(int magic, char *plugname, struct ng_audio_conv *list, int count);int ng_filter_register(int magic, char *plugname, struct ng_filter *filter);int ng_writer_register(int magic, char *plugname, struct ng_writer *writer);int ng_reader_register(int magic, char *plugname, struct ng_reader *reader);int ng_vid_driver_register(int magic, char *plugname, struct ng_vid_driver *driver);int ng_dsp_driver_register(int magic, char *plugname, struct ng_dsp_driver *driver);int ng_mix_driver_register(int magic, char *plugname, struct ng_mix_driver *driver);struct ng_video_conv* ng_conv_find_to(unsigned int out, int *i);struct ng_video_conv* ng_conv_find_from(unsigned int out, int *i);struct ng_video_conv* ng_conv_find_match(unsigned int in, unsigned int out);const struct ng_vid_driver* ng_vid_open(char *device, char *driver, struct ng_video_fmt *screen, void *base, void **handle);const struct ng_dsp_driver* ng_dsp_open(char *device, struct ng_audio_fmt *fmt, int record, void **handle);struct ng_attribute* ng_mix_init(char *device, char *channel);struct ng_reader* ng_find_reader(char *filename);int64_t ng_tofday_to_timestamp(struct timeval *tv);int64_t ng_get_timestamp(void);void ng_check_clipping(int width, int height, int xadjust, int yadjust, struct OVERLAY_CLIP *oc, int *count);struct ng_video_buf* ng_filter_single(struct ng_filter *filter, struct ng_video_buf *in);/* --------------------------------------------------------------------- *///Qiao,2003.6.25,remove this function//void ng_init(void);void ng_lut_init(unsigned long red_mask, unsigned long green_mask, unsigned long blue_mask, unsigned int fmtid, int swap);void ng_rgb24_to_lut2(unsigned char *dest, unsigned char *src, int p);void ng_rgb24_to_lut4(unsigned char *dest, unsigned char *src, int p);/* --------------------------------------------------------------------- *//* internal stuff starts here */#ifdef NG_PRIVATE/* init functions */void ng_color_packed_init(void);void ng_color_yuv2rgb_init(void);void ng_writefile_init(void);/* for yuv2rgb using lookup tables (color_lut.c, color_yuv2rgb.c) */unsigned long ng_lut_red[256];unsigned long ng_lut_green[256];unsigned long ng_lut_blue[256];void ng_yuv422_to_lut2(unsigned char *dest, unsigned char *s, int p);void ng_yuv422_to_lut4(unsigned char *dest, unsigned char *s, int p);void ng_yuv420p_to_lut2(void *h, struct ng_video_buf *out, struct ng_video_buf *in);void ng_yuv420p_to_lut4(void *h, struct ng_video_buf *out, struct ng_video_buf *in);void ng_yuv422p_to_lut2(void *h, struct ng_video_buf *out, struct ng_video_buf *in);void ng_yuv422p_to_lut4(void *h, struct ng_video_buf *out, struct ng_video_buf *in);/* color_common.c stuff */void* ng_packed_init(struct ng_video_fmt *out, void *priv);void ng_packed_frame(void *handle, struct ng_video_buf *out, struct ng_video_buf *in);void* ng_conv_nop_init(struct ng_video_fmt *out, void *priv);void ng_conv_nop_fini(void *handle);#define NG_GENERIC_PACKED \ init: ng_packed_init, \ frame: ng_packed_frame, \ fini: ng_conv_nop_fini#endif /* NG_PRIVATE *//* --------------------------------------------------------------------- *//* * Local variables: * compile-command: "(cd ..; make)" * End: */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -