Subversion Repositories Kolibri OS

Rev

Rev 2349 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1696 serge 1
 
2
#define BLACK_MAGIC_VIDEO
3
4
 
2349 Serge 5
typedef unsigned int count_t;
6
7
 
1696 serge 8
{
9
    uint32_t    width;
2349 Serge 10
    uint32_t    height;
11
    uint32_t    pitch;
12
    uint32_t    handle;
13
    uint8_t    *data;
14
}bitmap_t;
15
16
 
17
18
 
2415 Serge 19
#define HAS_TOP         (1<<1)
20
#define HAS_RIGHT       (1<<2)
21
#define HAS_BOTTOM      (1<<3)
22
23
 
2349 Serge 24
{
25
    uint32_t   caps;
26
    uint32_t   ctx_width;
27
    uint32_t   ctx_height;
28
    uint32_t   win_width;
29
    uint32_t   win_height;
30
31
 
2415 Serge 32
    rect_t     rcvideo;
33
    rect_t     rcleft;
34
    rect_t     rctop;
35
    rect_t     rcright;
36
    rect_t     rcbottom;
37
38
 
39
    bitmap_t   bitmap[4];
2349 Serge 40
    uint32_t   ctx_format;
41
    int        target;
42
2415 Serge 43
 
44
    enum{
2349 Serge 45
      EMPTY, INIT }state;
46
    enum win_state win_state;
2415 Serge 47
2349 Serge 48
 
49
};
50
51
 
52
{
53
    volatile uint32_t   lock;
1696 serge 54
    char               *buffer;
55
    volatile uint32_t   count;
56
}astream_t;
57
58
 
59
{
60
  unsigned int  code;
61
  unsigned int  sender;
62
  unsigned int  stream;
63
  unsigned int  offset;
64
  unsigned int  size;
65
  unsigned int  unused[2];
66
}SND_EVENT;
67
68
 
2349 Serge 69
{
70
  unsigned      handle;
71
  unsigned      io_code;
72
  void          *input;
73
  int           inp_size;
74
  void          *output;
75
  int           out_size;
76
}ioctl_t;
77
78
 
79
    AVPacketList *first_pkt;
80
    AVPacketList *last_pkt;
81
    int size;
82
    int count;
83
    volatile uint32_t lock;
84
} queue_t;
85
86
 
87
int get_packet(queue_t *q, AVPacket *pkt);
88
89
 
90
 
1696 serge 91
extern AVRational video_time_base;
92
93
 
2349 Serge 94
                        uint32_t ctx_format, uint32_t flags);
95
96
 
97
void render_adjust_size(render_t *render, window_t *win);
2415 Serge 98
int render_set_size(render_t *render, int width, int height);
99
void render_draw_client(render_t *render);
100
2349 Serge 101
 
2415 Serge 102
 
1696 serge 103
int audio_thread(void *param);
2349 Serge 104
105
 
1696 serge 106
int video_thread(void *param);
2349 Serge 107
108
 
109
int decode_audio(AVCodecContext  *ctx, queue_t *qa);
110
111
 
1696 serge 112
113
 
114
 
2349 Serge 115
1696 serge 116
 
2349 Serge 117
1696 serge 118
 
2349 Serge 119
{
1696 serge 120
    *val = 0;
121
}
122
123
 
124
{
125
    __asm__ __volatile__ (
126
    "int $0x40"
127
    ::"a"(68),"b"(14),"c"(event));
128
}
129
130
 
131
{
132
    uint32_t val;
133
    __asm__ __volatile__(
134
    "int $0x40"
135
    :"=a"(val)
136
    :"a"(17));
137
    return val>>8;
138
};
139
140
 
141
{
142
    __asm__ __volatile__(
143
    "int $0x40"
144
    ::"a"(68), "b"(1));
145
};
146
147
 
148
{
149
    __asm__ __volatile__(
150
    "int $0x40"
151
    ::"a"(5), "b"(time));
152
};
153
2349 Serge 154
 
155
 
156
 
157
 
158
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
159
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
160
161
 
162
163
 
164
int lock_bitmap(bitmap_t *bitmap);
2415 Serge 165
int resize_bitmap(bitmap_t *bitmap);
2349 Serge 166
int blit_bitmap(bitmap_t *bitmap, int dst_x, int dst_y,
167
                int w, int h);
168
169
 
170