Subversion Repositories Kolibri OS

Rev

Rev 2415 | 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
    bitmap_t  *last_bitmap;
2427 Serge 41
42
 
2349 Serge 43
    int        target;
44
2415 Serge 45
 
46
    enum{
2349 Serge 47
      EMPTY, INIT }state;
48
    enum win_state win_state;
2415 Serge 49
2349 Serge 50
 
51
};
52
53
 
2427 Serge 54
{  CLOSED=0, STOP, PLAY_RESTART, PLAY, PAUSE, REWIND };
55
56
 
57
58
 
2349 Serge 59
{
60
    volatile uint32_t   lock;
1696 serge 61
    char               *buffer;
62
    volatile uint32_t   count;
63
}astream_t;
64
65
 
66
{
67
  unsigned int  code;
68
  unsigned int  sender;
69
  unsigned int  stream;
70
  unsigned int  offset;
71
  unsigned int  size;
72
  unsigned int  unused[2];
73
}SND_EVENT;
74
75
 
2349 Serge 76
{
77
  unsigned      handle;
78
  unsigned      io_code;
79
  void          *input;
80
  int           inp_size;
81
  void          *output;
82
  int           out_size;
83
}ioctl_t;
84
85
 
86
    AVPacketList *first_pkt;
87
    AVPacketList *last_pkt;
88
    int size;
89
    int count;
90
    volatile uint32_t lock;
91
} queue_t;
92
93
 
94
int get_packet(queue_t *q, AVPacket *pkt);
95
96
 
97
 
1696 serge 98
extern AVRational video_time_base;
99
100
 
2349 Serge 101
                        uint32_t ctx_format, uint32_t flags);
102
103
 
104
void render_adjust_size(render_t *render, window_t *win);
2415 Serge 105
int render_set_size(render_t *render, int width, int height);
106
void render_draw_client(render_t *render);
107
2349 Serge 108
 
2415 Serge 109
 
1696 serge 110
int audio_thread(void *param);
2349 Serge 111
112
 
1696 serge 113
int video_thread(void *param);
2349 Serge 114
115
 
116
int decode_audio(AVCodecContext  *ctx, queue_t *qa);
117
118
 
2427 Serge 119
1696 serge 120
 
121
 
2349 Serge 122
1696 serge 123
 
2349 Serge 124
1696 serge 125
 
2349 Serge 126
{
1696 serge 127
    *val = 0;
128
}
129
130
 
131
{
132
    __asm__ __volatile__ (
133
    "int $0x40"
134
    ::"a"(68),"b"(14),"c"(event));
135
}
136
137
 
138
{
139
    uint32_t val;
140
    __asm__ __volatile__(
141
    "int $0x40"
142
    :"=a"(val)
143
    :"a"(17));
144
    return val>>8;
145
};
146
147
 
148
{
149
    __asm__ __volatile__(
150
    "int $0x40"
151
    ::"a"(68), "b"(1));
152
};
153
154
 
155
{
156
    __asm__ __volatile__(
157
    "int $0x40"
158
    ::"a"(5), "b"(time));
159
};
160
2349 Serge 161
 
162
 
163
 
164
 
165
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
166
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
167
168
 
169
170
 
171
int lock_bitmap(bitmap_t *bitmap);
2415 Serge 172
int resize_bitmap(bitmap_t *bitmap);
2349 Serge 173
int blit_bitmap(bitmap_t *bitmap, int dst_x, int dst_y,
174
                int w, int h);
175
176
 
177