annotate xacodec.h @ 4218:3931c41f740a

Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend) Added lots of comments, should be pretty easy to understand most of the internals now Added lots of brackets to if's for's while's etc, this is not a cosmetical thing but rather due to the fact I got some very odd bugs with else's since I didn't properly use brackets (and it's the K&R standard to have brackets everywhere) Fixed some bugs that would occur when disabling libmp1e Switched to default to the new naming scheme of device nodes, the driver will slowly switch over to this state, if it can't find devices under the new name it will try the old naming scheme I stopped opening devices in non-blocking mode, it would break the new syncengine which tries to burst data to the device (alot of times meaning it will fill the fifo pretty fast which would previously result in jerkyness on fast machines) The device now sets the initial state of the pts and speed (probably not needed, but assumption is the mother of all fuckups =) Keep the control interface open during the entire duration of the libvo device, we might need this to flush video buffers on seeking (currently not implemented, therefore seeking is broken) This is beta stuff to the driver, I will get some users to test it for me and do my best to fix seeking as soon as possible...
author mswitch
date Thu, 17 Jan 2002 10:33:47 +0000
parents fc124f9db88e
children ebe660cf5752
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2372
0959af64c098 needs to be hacked
alex
parents:
diff changeset
1 typedef struct
0959af64c098 needs to be hacked
alex
parents:
diff changeset
2 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
3 unsigned int what;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
4 unsigned int id;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
5 int (*iq_func)(); /* init/query function */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
6 unsigned int (*dec_func)(); /* opt decode function */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
7 } XAVID_FUNC_HDR;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
8
0959af64c098 needs to be hacked
alex
parents:
diff changeset
9 #define XAVID_WHAT_NO_MORE 0x0000
0959af64c098 needs to be hacked
alex
parents:
diff changeset
10 #define XAVID_AVI_QUERY 0x0001
0959af64c098 needs to be hacked
alex
parents:
diff changeset
11 #define XAVID_QT_QUERY 0x0002
0959af64c098 needs to be hacked
alex
parents:
diff changeset
12 #define XAVID_DEC_FUNC 0x0100
0959af64c098 needs to be hacked
alex
parents:
diff changeset
13
0959af64c098 needs to be hacked
alex
parents:
diff changeset
14 #define XAVID_API_REV 0x0003
0959af64c098 needs to be hacked
alex
parents:
diff changeset
15
0959af64c098 needs to be hacked
alex
parents:
diff changeset
16 typedef struct
0959af64c098 needs to be hacked
alex
parents:
diff changeset
17 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
18 unsigned int api_rev;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
19 char *desc;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
20 char *rev;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
21 char *copyright;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
22 char *mod_author;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
23 char *authors;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
24 unsigned int num_funcs;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
25 XAVID_FUNC_HDR *funcs;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
26 } XAVID_MOD_HDR;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
27
0959af64c098 needs to be hacked
alex
parents:
diff changeset
28 /* XA CODEC .. */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
29 typedef struct
0959af64c098 needs to be hacked
alex
parents:
diff changeset
30 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
31 void *anim_hdr;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
32 unsigned long compression;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
33 unsigned long x, y;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
34 unsigned long depth;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
35 void *extra;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
36 unsigned long xapi_rev;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
37 unsigned long (*decoder)();
0959af64c098 needs to be hacked
alex
parents:
diff changeset
38 char *description;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
39 unsigned long avi_ctab_flag;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
40 unsigned long (*avi_read_ext)();
0959af64c098 needs to be hacked
alex
parents:
diff changeset
41 } XA_CODEC_HDR;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
42
0959af64c098 needs to be hacked
alex
parents:
diff changeset
43 #define CODEC_SUPPORTED 1
0959af64c098 needs to be hacked
alex
parents:
diff changeset
44 #define CODEC_UNKNOWN 0
0959af64c098 needs to be hacked
alex
parents:
diff changeset
45 #define CODEC_UNSUPPORTED -1
0959af64c098 needs to be hacked
alex
parents:
diff changeset
46
0959af64c098 needs to be hacked
alex
parents:
diff changeset
47 /* fuckin colormap structures for xanim */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
48 typedef struct
0959af64c098 needs to be hacked
alex
parents:
diff changeset
49 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
50 unsigned short red;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
51 unsigned short green;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
52 unsigned short blue;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
53 unsigned short gray;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
54 } ColorReg;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
55
0959af64c098 needs to be hacked
alex
parents:
diff changeset
56 typedef struct XA_ACTION_STRUCT
0959af64c098 needs to be hacked
alex
parents:
diff changeset
57 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
58 int type;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
59 int cmap_rev;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
60 unsigned char *data;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
61 struct XA_ACTION_STRUCT *next;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
62 struct XA_CHDR_STRUCT *chdr;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
63 ColorReg *h_cmap;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
64 unsigned int *map;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
65 struct XA_ACTION_STRUCT *next_same_chdr;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
66 } XA_ACTION;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
67
0959af64c098 needs to be hacked
alex
parents:
diff changeset
68 typedef struct XA_CHDR_STRUCT
0959af64c098 needs to be hacked
alex
parents:
diff changeset
69 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
70 unsigned int rev;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
71 ColorReg *cmap;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
72 unsigned int csize, coff;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
73 unsigned int *map;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
74 unsigned int msize, moff;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
75 struct XA_CHDR_STRUCT *next;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
76 XA_ACTION *acts;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
77 struct XA_CHDR_STRUCT *new_chdr;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
78 } XA_CHDR;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
79
0959af64c098 needs to be hacked
alex
parents:
diff changeset
80 typedef struct
0959af64c098 needs to be hacked
alex
parents:
diff changeset
81 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
82 unsigned int cmd;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
83 unsigned int skip_flag;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
84 unsigned int imagex, imagey; /* image buffer size */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
85 unsigned int imaged; /* image depth */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
86 XA_CHDR *chdr; /* color map header */
0959af64c098 needs to be hacked
alex
parents:
diff changeset
87 unsigned int map_flag;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
88 unsigned int *map;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
89 unsigned int xs, ys;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
90 unsigned int xe, ye;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
91 unsigned int special;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
92 void *extra;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
93 } XA_DEC_INFO;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
94
0959af64c098 needs to be hacked
alex
parents:
diff changeset
95 typedef struct
0959af64c098 needs to be hacked
alex
parents:
diff changeset
96 {
0959af64c098 needs to be hacked
alex
parents:
diff changeset
97 unsigned int file_num;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
98 unsigned int anim_type;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
99 unsigned int imagex;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
100 unsigned int imagey;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
101 unsigned int imagec;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
102 unsigned int imaged;
0959af64c098 needs to be hacked
alex
parents:
diff changeset
103 } XA_ANIM_HDR;
2384
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
104
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
105 // Added by A'rpi
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
106 typedef struct {
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
107 unsigned int out_fmt;
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
108 int bpp;
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
109 int width,height;
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
110 unsigned char* planes[3];
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
111 int stride[3];
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
112 unsigned char *mem;
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
113 } xacodec_image_t;
814166bee8fd 3ivx YV12 direct rendering (one lss memcpy)
arpi
parents: 2372
diff changeset
114
2563
fc124f9db88e more cleanup, warnings fixed
arpi
parents: 2384
diff changeset
115 int xacodec_init_video(sh_video_t *vidinfo, int out_format);
fc124f9db88e more cleanup, warnings fixed
arpi
parents: 2384
diff changeset
116 xacodec_image_t* xacodec_decode_frame(uint8_t *frame, int frame_size, int skip_flag);
fc124f9db88e more cleanup, warnings fixed
arpi
parents: 2384
diff changeset
117 int xacodec_exit();
fc124f9db88e more cleanup, warnings fixed
arpi
parents: 2384
diff changeset
118