Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

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