Subversion Repositories Kolibri OS

Rev

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