Subversion Repositories Kolibri OS

Rev

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