Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1696 | serge | 1 | |
2 | #include |
||
3 | #include |
||
4 | #include |
||
5 | #include |
||
2415 | Serge | 6 | #include "system.h" |
7 | #include "../winlib/winlib.h" |
||
2427 | Serge | 8 | #include "sound.h" |
2349 | Serge | 9 | #include "fplay.h" |
1696 | serge | 10 | |
11 | |||
2421 | Serge | 12 | |
1696 | serge | 13 | |
2427 | Serge | 14 | extern int res_pause_btn_pressed[]; |
15 | |||
16 | |||
17 | extern int res_play_btn_pressed[]; |
||
18 | |||
19 | |||
2693 | Serge | 20 | |
2427 | Serge | 21 | |
1696 | serge | 22 | { |
23 | AVPicture picture; |
||
2349 | Serge | 24 | double pts; |
1696 | serge | 25 | volatile int ready; |
26 | }vframe_t; |
||
27 | |||
28 | |||
2349 | Serge | 29 | |
1696 | serge | 30 | |
2349 | Serge | 31 | |
1696 | serge | 32 | |
33 | int dfx = 0; |
||
34 | |||
35 | |||
2415 | Serge | 36 | |
2349 | Serge | 37 | |
1696 | serge | 38 | int height; |
39 | |||
40 | |||
41 | AVFrame *Frame; |
||
42 | |||
43 | |||
2349 | Serge | 44 | |
45 | |||
46 | |||
47 | |||
2693 | Serge | 48 | { |
49 | int i; |
||
50 | |||
2349 | Serge | 51 | |
2693 | Serge | 52 | { |
53 | frames[i].pts = 0; |
||
54 | frames[i].ready = 0; |
||
55 | }; |
||
56 | vfx = 0; |
||
57 | dfx = 0; |
||
58 | }; |
||
59 | |||
60 | |||
1696 | serge | 61 | { |
62 | int i; |
||
63 | |||
64 | |||
65 | height = ctx->height; |
||
66 | |||
67 | |||
2421 | Serge | 68 | |
1696 | serge | 69 | |
70 | |||
2415 | Serge | 71 | |
2349 | Serge | 72 | |
2415 | Serge | 73 | ctx->pix_fmt, HW_BIT_BLIT|HW_TEX_BLIT); |
2349 | Serge | 74 | // render = create_render(ctx->width, ctx->height, |
2415 | Serge | 75 | // ctx->pix_fmt, 0); |
76 | // |
||
77 | if( main_render == NULL) |
||
78 | { |
||
2349 | Serge | 79 | printf("Cannot create render\n\r"); |
80 | return 0; |
||
81 | }; |
||
82 | |||
83 | |||
1696 | serge | 84 | if ( Frame == NULL ) |
85 | { |
||
86 | printf("Cannot alloc video frame\n\r"); |
||
2349 | Serge | 87 | return 0; |
1696 | serge | 88 | }; |
89 | |||
90 | |||
2349 | Serge | 91 | { |
1696 | serge | 92 | int ret; |
2349 | Serge | 93 | |
1696 | serge | 94 | |
2349 | Serge | 95 | // ctx->width, ctx->height, ctx->pix_fmt ); |
96 | |||
1696 | serge | 97 | |
2349 | Serge | 98 | ctx->width, ctx->height); |
99 | if ( ret != 0 ) |
||
100 | { |
||
1696 | serge | 101 | printf("Cannot alloc video buffer\n\r"); |
2349 | Serge | 102 | return 0; |
103 | }; |
||
104 | |||
1696 | serge | 105 | |
2349 | Serge | 106 | frames[i].ready = 0; |
107 | }; |
||
1696 | serge | 108 | |
109 | |||
2349 | Serge | 110 | |
1696 | serge | 111 | |
2349 | Serge | 112 | return 1; |
1696 | serge | 113 | }; |
114 | |||
115 | |||
2349 | Serge | 116 | { |
1696 | serge | 117 | AVPacket pkt; |
2349 | Serge | 118 | double pts; |
1696 | serge | 119 | int frameFinished; |
2415 | Serge | 120 | double current_clock; |
2427 | Serge | 121 | |
1696 | serge | 122 | |
2349 | Serge | 123 | return 1; |
124 | |||
1696 | serge | 125 | |
2349 | Serge | 126 | return 0; |
127 | |||
1696 | serge | 128 | |
2693 | Serge | 129 | |
1696 | serge | 130 | |
2427 | Serge | 131 | Frame->reordered_opaque != AV_NOPTS_VALUE) |
132 | pts = Frame->reordered_opaque; |
||
2693 | Serge | 133 | else if(pkt.dts != AV_NOPTS_VALUE) |
134 | pts= pkt.dts; |
||
2427 | Serge | 135 | else |
136 | pts= 0; |
||
137 | |||
2693 | Serge | 138 | |
139 | |||
2427 | Serge | 140 | |
2349 | Serge | 141 | |
2693 | Serge | 142 | { |
1696 | serge | 143 | frameFinished = 0; |
2427 | Serge | 144 | |
1696 | serge | 145 | |
2427 | Serge | 146 | |
1696 | serge | 147 | |
2427 | Serge | 148 | printf("video decoder error\n"); |
149 | |||
1696 | serge | 150 | |
2427 | Serge | 151 | { |
152 | AVPicture *dst_pic; |
||
153 | |||
154 | |||
155 | Frame->reordered_opaque != AV_NOPTS_VALUE) |
||
156 | pts = Frame->reordered_opaque; |
||
2693 | Serge | 157 | else if(pkt.dts != AV_NOPTS_VALUE) |
2427 | Serge | 158 | pts= pkt.dts; |
159 | else |
||
160 | pts= 0; |
||
161 | |||
162 | |||
2349 | Serge | 163 | // Frame, "best_effort_timestamp"); |
164 | |||
1696 | serge | 165 | |
2349 | Serge | 166 | // pts = 0; |
167 | |||
1696 | serge | 168 | |
2427 | Serge | 169 | |
2349 | Serge | 170 | |
2427 | Serge | 171 | |
2349 | Serge | 172 | |
2427 | Serge | 173 | (const uint8_t**)Frame->data, |
2415 | Serge | 174 | Frame->linesize, ctx->pix_fmt, ctx->width, ctx->height); |
2349 | Serge | 175 | |
176 | |||
2427 | Serge | 177 | // printf("pts %f\n", frames[dfx].pts); |
2693 | Serge | 178 | |
179 | |||
2427 | Serge | 180 | |
1696 | serge | 181 | |
2427 | Serge | 182 | dfx&= 3; |
183 | }; |
||
184 | }; |
||
1696 | serge | 185 | av_free_packet(&pkt); |
2349 | Serge | 186 | |
1696 | serge | 187 | |
2349 | Serge | 188 | } |
1696 | serge | 189 | |
190 | |||
2427 | Serge | 191 | //rect_t win_rect; |
192 | |||
1696 | serge | 193 | |
2693 | Serge | 194 | |
2415 | Serge | 195 | |
196 | { |
||
1696 | serge | 197 | window_t *win; |
2415 | Serge | 198 | |
1696 | serge | 199 | |
2415 | Serge | 200 | |
1696 | serge | 201 | |
2415 | Serge | 202 | { |
1696 | serge | 203 | case MSG_SIZE: |
2415 | Serge | 204 | //printf("MSG_SIZE\n"); |
205 | render_adjust_size(main_render, win); |
||
206 | break; |
||
1696 | serge | 207 | |
208 | |||
2415 | Serge | 209 | render_draw_client(main_render); |
210 | break; |
||
1696 | serge | 211 | |
212 | |||
2427 | Serge | 213 | if(player_state == PAUSE) |
214 | { |
||
215 | win->panel.play_btn->img_default = res_pause_btn; |
||
2693 | Serge | 216 | win->panel.play_btn->img_hilite = res_pause_btn; |
217 | win->panel.play_btn->img_pressed = res_pause_btn_pressed; |
||
218 | send_message(win->panel.play_btn, MSG_PAINT, 0, 0); |
||
2427 | Serge | 219 | player_state = PAUSE_2_PLAY; |
2693 | Serge | 220 | |
2427 | Serge | 221 | |
222 | else if(player_state == PLAY) |
||
223 | { |
||
224 | win->panel.play_btn->img_default = res_play_btn; |
||
2693 | Serge | 225 | win->panel.play_btn->img_hilite = res_play_btn; |
226 | win->panel.play_btn->img_pressed = res_play_btn_pressed; |
||
227 | send_message(win->panel.play_btn, MSG_PAINT, 0, 0); |
||
2427 | Serge | 228 | player_state = PAUSE; |
229 | } |
||
230 | break; |
||
231 | |||
232 | |||
2415 | Serge | 233 | switch((short)arg1) |
234 | { |
||
235 | case ID_PLAY: |
||
2427 | Serge | 236 | if(player_state == PAUSE) |
237 | { |
||
238 | win->panel.play_btn->img_default = res_pause_btn; |
||
2693 | Serge | 239 | win->panel.play_btn->img_hilite = res_pause_btn; |
240 | win->panel.play_btn->img_pressed = res_pause_btn_pressed; |
||
241 | player_state = PAUSE_2_PLAY; |
||
242 | } |
||
243 | else if(player_state == PLAY) |
||
244 | { |
||
245 | win->panel.play_btn->img_default = res_play_btn; |
||
2427 | Serge | 246 | win->panel.play_btn->img_hilite = res_play_btn; |
247 | win->panel.play_btn->img_pressed = res_play_btn_pressed; |
||
248 | player_state = PAUSE; |
||
249 | } |
||
250 | break; |
||
251 | |||
2693 | Serge | 252 | |
253 | if(player_state != REWIND) |
||
254 | { |
||
255 | progress_t *prg = (progress_t*)arg2; |
||
256 | |||
257 | |||
258 | (prg->max - prg->min)/prg->ctrl.w; |
||
259 | |||
260 | |||
261 | player_state = REWIND; |
||
262 | main_render->win->panel.prg->current = rewind_pos; |
||
263 | send_message(&main_render->win->panel.ctrl, MSG_PAINT, 0, 0); |
||
264 | }; |
||
265 | break; |
||
266 | |||
267 | |||
2427 | Serge | 268 | break; |
269 | } |
||
270 | break; |
||
2415 | Serge | 271 | |
1696 | serge | 272 | |
2415 | Serge | 273 | def_window_proc(ctrl,msg,arg1,arg2); |
274 | }; |
||
275 | return 0; |
||
276 | }; |
||
277 | |||
1696 | serge | 278 | |
2693 | Serge | 279 | |
280 | |||
2415 | Serge | 281 | { |
1696 | serge | 282 | double ctime; /* milliseconds */ |
2427 | Serge | 283 | double fdelay; /* milliseconds */ |
284 | |||
1696 | serge | 285 | |
2427 | Serge | 286 | |
287 | |||
288 | { |
||
2415 | Serge | 289 | render->win->win_command = WIN_CLOSED; |
290 | return; |
||
291 | } |
||
2427 | Serge | 292 | else if(player_state != PLAY) |
293 | { |
||
294 | yield(); |
||
295 | return; |
||
296 | }; |
||
2415 | Serge | 297 | |
1696 | serge | 298 | |
2693 | Serge | 299 | if(frames[vfx].ready == 1 ) |
2415 | Serge | 300 | { |
1696 | serge | 301 | int sys_time; |
2693 | Serge | 302 | |
303 | |||
2415 | Serge | 304 | fdelay = (frames[vfx].pts - ctime); |
305 | |||
1696 | serge | 306 | |
2427 | Serge | 307 | // frames[vfx].pts, ctime, fdelay); |
2693 | Serge | 308 | |
2349 | Serge | 309 | |
2693 | Serge | 310 | { |
2415 | Serge | 311 | delay(1); |
2693 | Serge | 312 | // yield(); |
2427 | Serge | 313 | return; |
2421 | Serge | 314 | }; |
1696 | serge | 315 | |
2415 | Serge | 316 | |
2693 | Serge | 317 | fdelay = (frames[vfx].pts - ctime); |
318 | |||
319 | |||
320 | |||
321 | |||
322 | // printf("systime %d pts %f time %f delay %f\n", |
||
323 | // sys_time*10, frames[vfx].pts, ctime, fdelay); |
||
324 | |||
325 | |||
2415 | Serge | 326 | main_render->win->panel.prg->current = frames[vfx].pts*1000; |
2693 | Serge | 327 | send_message(&render->win->panel.prg->ctrl, MSG_PAINT, 0, 0); |
328 | frames[vfx].ready = 0; |
||
2415 | Serge | 329 | vfx++; |
330 | vfx&= 3; |
||
331 | } |
||
2427 | Serge | 332 | else yield(); |
333 | |||
334 | |||
2693 | Serge | 335 | |
336 | |||
337 | { |
||
338 | ctime = get_master_clock(); |
||
339 | fdelay = (frames[vfx].pts - ctime); |
||
340 | |||
341 | |||
342 | // frames[vfx].pts, ctime, fdelay); |
||
343 | |||
344 | |||
345 | { |
||
346 | int next_vfx; |
||
347 | fdelay = 0; |
||
348 | next_vfx = (vfx+1) & 3; |
||
349 | if( frames[next_vfx].ready == 1 ) |
||
350 | { |
||
351 | if(frames[next_vfx].pts <= ctime) |
||
352 | { |
||
353 | frames[vfx].ready = 0; // skip this frame |
||
354 | vfx++; |
||
355 | vfx&= 3; |
||
356 | } |
||
357 | else |
||
358 | { |
||
359 | if( (frames[next_vfx].pts - ctime) < |
||
360 | ( ctime - frames[vfx].pts) ) |
||
361 | { |
||
362 | frames[vfx].ready = 0; // skip this frame |
||
363 | vfx++; |
||
364 | vfx&= 3; |
||
365 | fdelay = (frames[next_vfx].pts - ctime); |
||
366 | } |
||
367 | } |
||
368 | }; |
||
369 | }; |
||
370 | |||
371 | |||
372 | { |
||
373 | int val = fdelay; |
||
374 | printf("pts %f time %f delay %d\n", |
||
375 | frames[vfx].pts, ctime, val); |
||
376 | delay(val/10); |
||
377 | }; |
||
378 | |||
379 | |||
380 | fdelay = (frames[vfx].pts - ctime); |
||
381 | |||
382 | |||
383 | frames[vfx].pts, ctime, fdelay); |
||
384 | |||
385 | |||
386 | main_render->win->panel.prg->current = frames[vfx].pts; |
||
387 | // send_message(&render->win->panel.prg->ctrl, MSG_PAINT, 0, 0); |
||
388 | frames[vfx].ready = 0; |
||
389 | vfx++; |
||
390 | vfx&= 3; |
||
391 | } |
||
392 | else yield(); |
||
393 | #endif |
||
394 | |||
395 | |||
2415 | Serge | 396 | |
397 | |||
2427 | Serge | 398 | |
399 | |||
400 | |||
2415 | Serge | 401 | |
402 | |||
403 | { |
||
404 | window_t *MainWindow; |
||
405 | |||
406 | |||
407 | |||
408 | |||
409 | 10,10,width,height+29+55,MainWindowProc); |
||
2693 | Serge | 410 | |
2415 | Serge | 411 | |
2693 | Serge | 412 | // printf("MainWindow %x\n", MainWindow); |
2415 | Serge | 413 | |
414 | |||
415 | |||
416 | |||
417 | |||
2693 | Serge | 418 | |
419 | player_state = PAUSE_2_PLAY; |
||
420 | |||
421 | |||
2415 | Serge | 422 | |
423 | |||
424 | player_state = CLOSED; |
||
2427 | Serge | 425 | return 0; |
2349 | Serge | 426 | }; |
1696 | serge | 427 | |
428 | |||
2349 | Serge | 429 | |
430 | void draw_sw_picture(render_t *render, AVPicture *picture); |
||
431 | |||
432 | |||
433 | uint32_t ctx_format, uint32_t flags) |
||
434 | { |
||
435 | render_t *render; |
||
2415 | Serge | 436 | |
2349 | Serge | 437 | |
2415 | Serge | 438 | |
2349 | Serge | 439 | |
2415 | Serge | 440 | memset(render, 0, sizeof(render_t)); |
441 | |||
442 | |||
2349 | Serge | 443 | render->ctx_height = height; |
444 | render->ctx_format = ctx_format; |
||
445 | |||
446 | |||
447 | render->caps = InitPixlib(flags); |
||
448 | mutex_unlock(&driver_lock); |
||
449 | |||
450 | |||
451 | { |
||
452 | printf("FPlay render engine: Hardware acceleration disabled\n"); |
||
453 | render->draw = draw_sw_picture; |
||
454 | } |
||
455 | else |
||
456 | { |
||
457 | render->target = 0; |
||
458 | render->draw = draw_hw_picture; |
||
459 | }; |
||
460 | |||
461 | |||
462 | return render; |
||
463 | }; |
||
464 | |||
465 | |||
466 | { |
||
467 | int i; |
||
468 | |||
469 | |||
2415 | Serge | 470 | render->rcvideo.l = 0; |
471 | render->rcvideo.t = 0; |
||
472 | render->rcvideo.r = width; |
||
473 | render->rcvideo.b = height; |
||
474 | |||
2349 | Serge | 475 | |
2415 | Serge | 476 | { |
477 | int yoffs; |
||
478 | yoffs = (render->win_height-height)/2; |
||
479 | if(yoffs) |
||
480 | { |
||
481 | render->rctop.t = 0; |
||
482 | render->rctop.b = yoffs; |
||
483 | render->rcvideo.t = yoffs; |
||
484 | render->layout |= HAS_TOP; |
||
485 | } |
||
486 | |||
2349 | Serge | 487 | |
2415 | Serge | 488 | if(yoffs) |
489 | { |
||
490 | render->rcbottom.t = render->rcvideo.t+render->rcvideo.b; |
||
491 | render->rcbottom.b = yoffs; |
||
492 | render->layout |= HAS_BOTTOM; |
||
493 | } |
||
494 | } |
||
495 | |||
496 | |||
497 | { |
||
498 | int xoffs; |
||
499 | xoffs = (render->win_width-width)/2; |
||
500 | if(xoffs) |
||
501 | { |
||
502 | render->rcleft.r = xoffs; |
||
503 | render->rcvideo.l = xoffs; |
||
504 | render->layout |= HAS_LEFT; |
||
505 | } |
||
506 | xoffs = render->win_width-(render->rcvideo.l+render->rcvideo.r); |
||
507 | if(xoffs) |
||
508 | { |
||
509 | render->rcright.l = render->rcvideo.l+render->rcvideo.r; |
||
510 | render->rcright.r = xoffs; |
||
511 | render->layout |= HAS_RIGHT; |
||
512 | } |
||
513 | }; |
||
514 | |||
515 | |||
2349 | Serge | 516 | { |
517 | if(render->caps & HW_TEX_BLIT) |
||
518 | { |
||
519 | for( i=0; i < 4; i++) |
||
520 | { |
||
521 | render->bitmap[i].width = render->ctx_width; |
||
522 | render->bitmap[i].height = render->ctx_height; |
||
523 | |||
524 | |||
525 | { |
||
526 | player_state = CLOSED; |
||
2427 | Serge | 527 | /* |
2349 | Serge | 528 | * Epic fail. Need exit_thread() here |
529 | * |
||
530 | */ |
||
531 | return 0; |
||
532 | }; |
||
533 | } |
||
534 | } |
||
535 | else |
||
536 | { |
||
537 | render->bitmap[0].width = width; |
||
538 | render->bitmap[0].height = height; |
||
539 | |||
540 | |||
541 | return 0; |
||
542 | }; |
||
543 | render->state = INIT; |
||
544 | return 0; |
||
545 | }; |
||
546 | |||
547 | |||
548 | return 0; |
||
549 | |||
550 | |||
551 | render->bitmap[0].height = height; |
||
552 | resize_bitmap(&render->bitmap[0]); |
||
553 | |||
554 | |||
555 | }; |
||
556 | |||
557 | |||
2415 | Serge | 558 | { |
2349 | Serge | 559 | uint32_t right, bottom, new_w, new_h; |
560 | uint32_t s, sw, sh; |
||
561 | uint8_t state; |
||
562 | |||
563 | |||
564 | |||
2415 | Serge | 565 | bottom = win->h-CAPTION_HEIGHT-55; |
2693 | Serge | 566 | render->win_state = win->win_state; |
2415 | Serge | 567 | |
2349 | Serge | 568 | |
2415 | Serge | 569 | return; |
2349 | Serge | 570 | |
2415 | Serge | 571 | |
572 | return; |
||
2349 | Serge | 573 | |
574 | |||
575 | bottom == render->win_height) |
||
576 | return; |
||
577 | |||
578 | |||
579 | new_h = right*render->ctx_height/render->ctx_width; |
||
580 | |||
581 | |||
582 | |||
583 | |||
584 | sw = right * new_h; |
||
585 | sh = bottom * new_w; |
||
586 | |||
587 | |||
588 | new_h = bottom; |
||
589 | else |
||
590 | new_w = right; |
||
591 | |||
592 | |||
593 | { |
||
594 | new_w = 64; |
||
595 | new_h = 64*render->ctx_height/render->ctx_width; |
||
596 | }; |
||
597 | |||
2415 | Serge | 598 | |
599 | render->win_height = win->h-CAPTION_HEIGHT-55; |
||
2693 | Serge | 600 | render_set_size(render, new_w, new_h); |
2349 | Serge | 601 | }; |
602 | |||
603 | |||
604 | { |
||
605 | int dst_width, dst_height; |
||
606 | bitmap_t *bitmap; |
||
2415 | Serge | 607 | uint8_t *data[4]; |
608 | int linesize[4]; |
||
2349 | Serge | 609 | int ret; |
2415 | Serge | 610 | |
2349 | Serge | 611 | |
2427 | Serge | 612 | render->win_state == ROLLED) |
613 | return; |
||
2349 | Serge | 614 | |
615 | |||
616 | { |
||
617 | dst_width = render->ctx_width; |
||
618 | dst_height = render->ctx_height; |
||
619 | } |
||
620 | else |
||
621 | { |
||
622 | dst_width = render->win_width; |
||
623 | dst_height = render->win_height; |
||
624 | }; |
||
625 | |||
626 | |||
627 | render->ctx_width, render->ctx_height, render->ctx_format, |
||
628 | dst_width, dst_height, PIX_FMT_BGRA, |
||
629 | SWS_FAST_BILINEAR, NULL, NULL, NULL); |
||
630 | if(cvt_ctx == NULL) |
||
631 | { |
||
632 | printf("Cannot initialize the conversion context!\n"); |
||
633 | return ; |
||
634 | }; |
||
635 | |||
2415 | Serge | 636 | |
637 | |||
638 | |||
639 | if( ret != 0) |
||
640 | { |
||
641 | printf("Cannot lock the bitmap!\n"); |
||
642 | return ; |
||
643 | } |
||
644 | |||
645 | |||
2349 | Serge | 646 | data[0] = bitmap->data; |
2415 | Serge | 647 | data[1] = bitmap->data+1; |
648 | data[2] = bitmap->data+2; |
||
649 | data[3] = bitmap->data+3; |
||
650 | |||
2349 | Serge | 651 | |
2415 | Serge | 652 | linesize[1] = bitmap->pitch; |
653 | linesize[2] = bitmap->pitch; |
||
654 | linesize[3] = bitmap->pitch; |
||
655 | |||
2349 | Serge | 656 | |
657 | picture->linesize, 0, render->ctx_height, data, linesize); |
||
658 | // printf("sws_scale\n"); |
||
659 | |||
660 | |||
2415 | Serge | 661 | CAPTION_HEIGHT+render->rcvideo.t, |
2421 | Serge | 662 | render->rcvideo.r, render->rcvideo.b); |
2415 | Serge | 663 | render->last_bitmap = bitmap; |
2427 | Serge | 664 | // printf("blit_bitmap\n"); |
2349 | Serge | 665 | |
666 | |||
2415 | Serge | 667 | |
2349 | Serge | 668 | render->target&= 3; |
669 | } |
||
670 | |||
671 | |||
672 | { |
||
673 | uint8_t *data[4]; |
||
674 | int linesize[4]; |
||
675 | |||
676 | |||
2415 | Serge | 677 | render->win_state == ROLLED) |
678 | return; |
||
2349 | Serge | 679 | |
680 | |||
681 | render->ctx_width, render->ctx_height, |
||
682 | render->ctx_format, |
||
683 | render->rcvideo.r, render->rcvideo.b, |
||
2415 | Serge | 684 | PIX_FMT_BGRA, SWS_FAST_BILINEAR, NULL, NULL, NULL); |
2349 | Serge | 685 | if(cvt_ctx == NULL) |
686 | { |
||
687 | printf("Cannot initialize the conversion context!\n"); |
||
688 | return ; |
||
689 | } |
||
690 | |||
691 | |||
692 | data[1] = render->bitmap[0].data+1; |
||
693 | data[2] = render->bitmap[0].data+2; |
||
694 | data[3] = render->bitmap[0].data+3; |
||
695 | |||
696 | |||
697 | |||
698 | linesize[1] = render->bitmap[0].pitch; |
||
699 | linesize[2] = render->bitmap[0].pitch; |
||
700 | linesize[3] = render->bitmap[0].pitch; |
||
701 | |||
702 | |||
703 | picture->linesize, 0, render->ctx_height, data, linesize); |
||
704 | |||
705 | |||
2415 | Serge | 706 | render->rcvideo.t+CAPTION_HEIGHT, |
2421 | Serge | 707 | render->rcvideo.r, render->rcvideo.b); |
2415 | Serge | 708 | render->last_bitmap = &render->bitmap[0]; |
2427 | Serge | 709 | } |
2349 | Serge | 710 | |
711 | |||
2415 | Serge | 712 | { |
713 | if(render->win_state == MINIMIZED || |
||
714 | render->win_state == ROLLED) |
||
715 | return; |
||
716 | |||
2349 | Serge | 717 | |
2693 | Serge | 718 | (player_state == PLAY_INIT) ) |
719 | { |
||
2427 | Serge | 720 | if(frames[vfx].ready == 1 ) |
2693 | Serge | 721 | main_render->draw(main_render, &frames[vfx].picture); |
722 | else |
||
723 | draw_bar(0, CAPTION_HEIGHT, render->win_width, |
||
724 | render->rcvideo.b, 0); |
||
725 | }; |
||
2427 | Serge | 726 | |
727 | |||
2415 | Serge | 728 | draw_bar(0, CAPTION_HEIGHT, render->win_width, |
2421 | Serge | 729 | render->rctop.b, 0); |
2415 | Serge | 730 | if(render->layout & HAS_LEFT) |
731 | draw_bar(0, render->rcvideo.t+CAPTION_HEIGHT, render->rcleft.r, |
||
2421 | Serge | 732 | render->rcvideo.b, 0); |
2415 | Serge | 733 | if(render->layout & HAS_RIGHT) |
734 | draw_bar(render->rcright.l, render->rcvideo.t+CAPTION_HEIGHT, |
||
2421 | Serge | 735 | render->rcright.r, render->rcvideo.b, 0); |
2415 | Serge | 736 | if(render->layout & HAS_BOTTOM) |
737 | draw_bar(0, render->rcbottom.t+CAPTION_HEIGHT, |
||
2421 | Serge | 738 | render->win_width, render->rcbottom.b, 0); |
2415 | Serge | 739 | }>> |
740 | >=>>>=>>> |
||
2349 | Serge | 741 |