libctr1474.h

Go to the documentation of this file.
00001 /*
00002   Copyright 2007 Eurotech S.P.A. (Luca Calligaris)
00003   Copyright 2007 Christian Pellegrin <chripell@gmail.com> EVOL S.R.L.
00004 
00005   This software is released under the GPL v2. Please see the file
00006   COPYING in the top-level directory.
00007 */
00008 
00009 #ifndef _LIBCTR1474_H_
00010 #define _LIBCTR1474_H_  1
00011 
00012 #include "ethjpg2k.h"
00013 #include "adv202_hdr.h"
00014 #include "twa2835.h"
00015 
00022 struct ctr1474_ch {
00023   int fd;                       
00024   int ctrl_fd;                  
00026   unsigned char * b;            
00027   unsigned long bsize;          
00028   int last_isNtsc;              
00029   int cod_style;                
00030   int video_norm;               
00031   int initialized;              
00032 };
00033 
00034 
00037 #define TWA(p) ( (void *) p->ctrl_fd )
00038 
00054 typedef int (*ctr1474_frame_cb) (struct ethjpg2k_linux_hdr *hdr, unsigned char * data, unsigned long len);
00055 
00071 typedef void (*ctr1474_frame_in_cb) (unsigned char * data, unsigned long len, int *field);
00072 
00082 typedef int (*ctr1474_len_cb) (void);
00083 
00096 struct ctr1474_ch* simple_ctr1474(char *dev, char *cdev);
00097 
00112 int simple_ctr1474_board_init(struct ctr1474_ch *e, int isNtsc, char *b,
00113                             ETHJPG2K_FIRMWARE_DATA *fwdata,
00114                             ETHJPG2K_FIRMWARE_PARAMS *fwparams);
00115 
00127 void simple_ctr1474_board_noinit(struct ctr1474_ch *e, int isNtsc);
00128 
00137 int simple_ctr1474_encoder_run(struct ctr1474_ch* e, ctr1474_frame_cb cb);
00138 
00147 int simple_ctr1474_encoder_quality(struct ctr1474_ch* e, int q);
00148 
00165 int simple_ctr1474_decoder_run(struct ctr1474_ch* e, ctr1474_len_cb cbl, ctr1474_frame_in_cb cbf, int ad_hdr);
00166 
00167 
00172 void simple_ctr1474_free(struct ctr1474_ch* e);
00173 
00182 void simple_ctr1474_force_stop(struct ctr1474_ch* e);
00183 
00184 
00215 int simple_ctr1474_hipi(struct ctr1474_ch *enc, struct ctr1474_ch *dec,
00216                       char *fw, ETHJPG2K_FIRMWARE_DATA *fwdata, ETHJPG2K_FIRMWARE_PARAMS *fwparams,
00217                       int n,
00218                       char **in, int *ins,
00219                       char **out, int *outs);
00220 
00221 
00228 int simple_ctr1474_gpio_read(struct ctr1474_ch* e);
00229 
00238 int simple_ctr1474_pb(struct ctr1474_ch* e, int enable);
00239 
00248 int simple_ctr1474_gpio_write(struct ctr1474_ch* e, int data);
00249 
00258 int simple_ctr1474_led(struct ctr1474_ch* e, int data);
00259 
00268 int adv212_read_reg(struct ctr1474_ch *e, int addr);
00269 
00278 void adv212_write_reg(struct ctr1474_ch *e, int addr, int data);
00279 
00280 #endif

Generated on Sat Dec 20 08:27:54 2008 for CTR1474 by  doxygen 1.5.1