Changeset a53dd0f3eb2d0174ead98ca0e3191daf6ee2a775
- Timestamp:
- 04/03/01 00:40:07
(7 years ago)
- Author:
- Richard Shepherd <richards@videolan.org>
- git-committer:
- Richard Shepherd <richards@videolan.org> 986251207 +0000
- git-parent:
[f6c80a75e25d27a95a9e56e48a7af90a5a70afec]
- git-author:
- Richard Shepherd <richards@videolan.org> 986251207 +0000
- Message:
vout_beos now uses double buffering for YCbCr overlay.
This (for some reason) improves audio/video sync
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra32ef53 |
ra53dd0f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2000, 2001 VideoLAN |
|---|
| 5 | | * $Id: vout_beos.cpp,v 1.23 2001/03/25 17:09:14 richards Exp $ |
|---|
| | 5 | * $Id: vout_beos.cpp,v 1.24 2001/04/02 22:40:07 richards Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jean-Marc Dressler <polux@via.ecp.fr> |
|---|
| … | … | |
| 130 | 130 | if( w->fDirty ) |
|---|
| 131 | 131 | { |
|---|
| 132 | | w->view->DrawBitmap(w->bitmap[w->i_buffer_index], w->bitmap[w->i_buffer_index]->Bounds(), w->Bounds()); |
|---|
| | 132 | if(w->fUsingOverlay) |
|---|
| | 133 | { |
|---|
| | 134 | rgb_color key; |
|---|
| | 135 | w->view->SetViewOverlay(w->bitmap[w->i_buffer_index], w->bitmap[w->i_buffer_index]->Bounds(), w->Bounds(), &key, B_FOLLOW_ALL, |
|---|
| | 136 | B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL|B_OVERLAY_TRANSFER_CHANNEL); |
|---|
| | 137 | w->view->SetViewColor(key); |
|---|
| | 138 | } |
|---|
| | 139 | else |
|---|
| | 140 | w->view->DrawBitmap(w->bitmap[w->i_buffer_index], w->bitmap[w->i_buffer_index]->Bounds(), w->Bounds()); |
|---|
| 133 | 141 | w->fDirty = false; |
|---|
| 134 | 142 | } |
|---|
| … | … | |
| 159 | 167 | AddChild(view); |
|---|
| 160 | 168 | bitmap[0] = new BBitmap(Bounds(), B_BITMAP_WILL_OVERLAY|B_BITMAP_RESERVE_OVERLAY_CHANNEL, B_YCbCr422); |
|---|
| | 169 | bitmap[1] = new BBitmap(Bounds(), B_BITMAP_WILL_OVERLAY, B_YCbCr422); |
|---|
| 161 | 170 | fUsingOverlay = true; |
|---|
| 162 | 171 | i_screen_depth = 16; |
|---|
| 163 | 172 | p_vout->b_YCbr = true; |
|---|
| 164 | 173 | |
|---|
| 165 | | if (bitmap[0]->InitCheck() != B_OK) |
|---|
| | 174 | if ((bitmap[0]->InitCheck() != B_OK) || (bitmap[1]->InitCheck() != B_OK)) |
|---|
| 166 | 175 | { |
|---|
| 167 | 176 | delete bitmap[0]; |
|---|
| | 177 | delete bitmap[1]; |
|---|
| 168 | 178 | p_vout->b_YCbr = false; |
|---|
| 169 | 179 | fUsingOverlay = false; |
|---|
| … | … | |
| 191 | 201 | i_screen_depth = 32; |
|---|
| 192 | 202 | } |
|---|
| 193 | | memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength()); |
|---|
| 194 | | memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength()); |
|---|
| 195 | 203 | SetTitle(VOUT_TITLE " (BBitmap output)"); |
|---|
| 196 | 204 | } |
|---|
| … | … | |
| 205 | 213 | GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); |
|---|
| 206 | 214 | SetSizeLimits((float) Bounds().IntegerWidth(), maxWidth, (float) Bounds().IntegerHeight(), maxHeight); |
|---|
| 207 | | memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength()); |
|---|
| 208 | 215 | } |
|---|
| 209 | | else |
|---|
| | 216 | // else |
|---|
| 210 | 217 | { |
|---|
| 211 | 218 | fDrawThreadID = spawn_thread(DrawingThread, "drawing_thread", |
|---|
| … | … | |
| 214 | 221 | } |
|---|
| 215 | 222 | |
|---|
| | 223 | memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength()); |
|---|
| | 224 | memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength()); |
|---|
| 216 | 225 | i_bytes_per_pixel = bitmap[0]->BytesPerRow()/bitmap[0]->Bounds().IntegerWidth(); |
|---|
| 217 | 226 | fRowBytes = bitmap[0]->BytesPerRow(); |
|---|
| … | … | |
| 226 | 235 | Hide(); |
|---|
| 227 | 236 | Sync(); |
|---|
| 228 | | if(!fUsingOverlay) |
|---|
| 229 | | { |
|---|
| | 237 | // if(!fUsingOverlay) |
|---|
| | 238 | // { |
|---|
| 230 | 239 | teardownwindow = true; |
|---|
| 231 | 240 | wait_for_thread(fDrawThreadID, &result); |
|---|
| 232 | 241 | delete bitmap[0]; |
|---|
| 233 | 242 | delete bitmap[1]; |
|---|
| 234 | | } |
|---|
| | 243 | // } |
|---|
| 235 | 244 | } |
|---|
| 236 | 245 | |
|---|
| … | … | |
| 431 | 440 | p_vout->p_sys->i_height = p_vout->i_height; |
|---|
| 432 | 441 | |
|---|
| 433 | | if(p_win->fUsingOverlay) |
|---|
| | 442 | /* if(p_win->fUsingOverlay) |
|---|
| 434 | 443 | { |
|---|
| 435 | 444 | if(p_win->bitmap[0] != NULL) |
|---|
| … | … | |
| 448 | 457 | (byte_t *)p_win->bitmap[1]->Bits()); |
|---|
| 449 | 458 | } |
|---|
| 450 | | } |
|---|
| | 459 | }*/ |
|---|
| | 460 | if((p_win->bitmap[0] != NULL) && (p_win->bitmap[1] != NULL)) |
|---|
| | 461 | { |
|---|
| | 462 | vout_SetBuffers( p_vout, (byte_t *)p_win->bitmap[0]->Bits(), |
|---|
| | 463 | (byte_t *)p_win->bitmap[1]->Bits()); |
|---|
| | 464 | } |
|---|
| | 465 | |
|---|
| 451 | 466 | return( 0 ); |
|---|
| 452 | 467 | } |
|---|
| … | … | |
| 492 | 507 | p_win->Lock(); |
|---|
| 493 | 508 | p_win->view->ClearViewOverlay(); |
|---|
| | 509 | delete p_win->bitmap[0]; |
|---|
| | 510 | delete p_win->bitmap[1]; |
|---|
| 494 | 511 | p_vout->p_sys->i_width = p_vout->i_width; |
|---|
| 495 | 512 | p_vout->p_sys->i_height = p_vout->i_height;; |
|---|
| … | … | |
| 500 | 517 | B_BITMAP_WILL_OVERLAY|B_BITMAP_RESERVE_OVERLAY_CHANNEL, |
|---|
| 501 | 518 | B_YCbCr422); |
|---|
| | 519 | p_win->bitmap[0] = new BBitmap(p_win->Bounds(), |
|---|
| | 520 | B_BITMAP_WILL_OVERLAY, B_YCbCr422); |
|---|
| 502 | 521 | memset(p_win->bitmap[0]->Bits(), 0, p_win->bitmap[0]->BitsLength()); |
|---|
| | 522 | memset(p_win->bitmap[1]->Bits(), 0, p_win->bitmap[1]->BitsLength()); |
|---|
| 503 | 523 | p_win->view->SetViewOverlay(p_win->bitmap[0], p_win->bitmap[0]->Bounds(), p_win->Bounds(), &key, B_FOLLOW_ALL, |
|---|
| 504 | | B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL); |
|---|
| | 524 | B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL|B_OVERLAY_TRANSFER_CHANNEL); |
|---|
| 505 | 525 | p_win->view->SetViewColor(key); |
|---|
| 506 | 526 | p_win->Unlock(); |
|---|
| … | … | |
| 524 | 544 | |
|---|
| 525 | 545 | p_win->i_buffer_index = p_vout->i_buffer_index; |
|---|
| 526 | | p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1; |
|---|
| | 546 | if(p_win->fUsingOverlay) |
|---|
| | 547 | p_vout->i_buffer_index = p_vout->i_buffer_index & 1; |
|---|
| | 548 | else |
|---|
| | 549 | p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1; |
|---|
| 527 | 550 | p_win->fDirty = true; |
|---|
| 528 | 551 | } |
|---|