Changeset 15732 in vbox for trunk/src/VBox/Main
- Timestamp:
- Dec 23, 2008 3:12:45 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DisplayImpl.cpp
r15256 r15732 1250 1250 STDMETHODIMP Display::COMGETTER(Width) (ULONG *width) 1251 1251 { 1252 if (!width) 1253 return E_POINTER; 1252 CheckComArgSafeArrayNotNull(width); 1254 1253 1255 1254 AutoCaller autoCaller (this); … … 1273 1272 STDMETHODIMP Display::COMGETTER(Height) (ULONG *height) 1274 1273 { 1275 if (!height) 1276 return E_POINTER; 1274 CheckComArgNotNull(height); 1277 1275 1278 1276 AutoCaller autoCaller (this); … … 1372 1370 STDMETHODIMP Display::LockFramebuffer (BYTE **address) 1373 1371 { 1374 if (!address) 1375 return E_POINTER; 1372 CheckComArgOutPointerValid(address); 1376 1373 1377 1374 AutoCaller autoCaller (this); … … 1381 1378 1382 1379 /* only allowed for internal framebuffers */ 1383 if (mInternalFramebuffer && !mFramebufferOpened && !maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer.isNull()) 1380 if (mInternalFramebuffer && !mFramebufferOpened 1381 && !maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer.isNull()) 1384 1382 { 1385 1383 CHECK_CONSOLE_DRV (mpDrv); … … 1391 1389 } 1392 1390 1393 return setError ( E_FAIL,1394 1391 return setError (VBOX_E_NOT_SUPPORTED, 1392 tr ("Framebuffer locking is allowed only for the internal framebuffer")); 1395 1393 } 1396 1394 … … 1411 1409 } 1412 1410 1413 return setError ( E_FAIL,1414 1411 return setError (VBOX_E_NOT_SUPPORTED, 1412 tr ("Framebuffer locking is allowed only for the internal framebuffer")); 1415 1413 } 1416 1414 … … 1419 1417 LogFlowFunc (("\n")); 1420 1418 1421 if (!frameBuf) 1422 return E_POINTER; 1419 CheckComArgNotNull(frameBuf); 1423 1420 1424 1421 AutoCaller autoCaller (this); … … 1430 1427 if (pVM.isOk()) 1431 1428 { 1432 /* Must leave the lock here because the changeFramebuffer will also obtain it. */ 1429 /* Must leave the lock here because the changeFramebuffer will 1430 * also obtain it. */ 1433 1431 alock.leave (); 1434 1432 … … 1436 1434 PVMREQ pReq = NULL; 1437 1435 int vrc = VMR3ReqCall (pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, 1438 (PFNRT) changeFramebuffer, 4,1439 this, frameBuf, false /* aInternal */,VBOX_VIDEO_PRIMARY_SCREEN);1436 (PFNRT) changeFramebuffer, 4, this, frameBuf, false /* aInternal */, 1437 VBOX_VIDEO_PRIMARY_SCREEN); 1440 1438 if (RT_SUCCESS (vrc)) 1441 1439 vrc = pReq->iStatus; … … 1449 1447 { 1450 1448 /* No VM is created (VM is powered off), do a direct call */ 1451 int vrc = changeFramebuffer (this, frameBuf, false /* aInternal */, VBOX_VIDEO_PRIMARY_SCREEN); 1449 int vrc = changeFramebuffer (this, frameBuf, false /* aInternal */, 1450 VBOX_VIDEO_PRIMARY_SCREEN); 1452 1451 ComAssertRCRet (vrc, E_FAIL); 1453 1452 } … … 1456 1455 } 1457 1456 1458 STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId, IFramebuffer *aFramebuffer) 1457 STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId, 1458 IFramebuffer *aFramebuffer) 1459 1459 { 1460 1460 LogFlowFunc (("\n")); … … 1470 1470 if (pVM.isOk()) 1471 1471 { 1472 /* Must leave the lock here because the changeFramebuffer will also obtain it. */ 1472 /* Must leave the lock here because the changeFramebuffer will 1473 * also obtain it. */ 1473 1474 alock.leave (); 1474 1475 … … 1476 1477 PVMREQ pReq = NULL; 1477 1478 int vrc = VMR3ReqCall (pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, 1478 (PFNRT) changeFramebuffer, 4,1479 this, aFramebuffer, false /* aInternal */,aScreenId);1479 (PFNRT) changeFramebuffer, 4, this, aFramebuffer, false /* aInternal */, 1480 aScreenId); 1480 1481 if (RT_SUCCESS (vrc)) 1481 1482 vrc = pReq->iStatus; … … 1489 1490 { 1490 1491 /* No VM is created (VM is powered off), do a direct call */ 1491 int vrc = changeFramebuffer (this, aFramebuffer, false /* aInternal */, aScreenId); 1492 int vrc = changeFramebuffer (this, aFramebuffer, false /* aInternal */, 1493 aScreenId); 1492 1494 ComAssertRCRet (vrc, E_FAIL); 1493 1495 } … … 1496 1498 } 1497 1499 1498 STDMETHODIMP Display::GetFramebuffer (ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin) 1500 STDMETHODIMP Display::GetFramebuffer (ULONG aScreenId, 1501 IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin) 1499 1502 { 1500 1503 LogFlowFunc (("aScreenId = %d\n", aScreenId)); … … 1521 1524 } 1522 1525 1523 STDMETHODIMP Display::SetVideoModeHint(ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel, ULONG aDisplay) 1526 STDMETHODIMP Display::SetVideoModeHint(ULONG aWidth, ULONG aHeight, 1527 ULONG aBitsPerPixel, ULONG aDisplay) 1524 1528 { 1525 1529 AutoCaller autoCaller (this); … … 1561 1565 // return setError(E_FAIL, tr("Not enough VRAM for the selected video mode")); 1562 1566 1563 /* Have to leave the lock because the pfnRequestDisplayChange will call EMT. */ 1567 /* Have to leave the lock because the pfnRequestDisplayChange 1568 * will call EMT. */ 1564 1569 alock.leave (); 1565 1570 if (mParent->getVMMDev()) … … 1598 1603 address, width, height)); 1599 1604 1600 if (!address) 1601 return E_POINTER; 1602 if (!width || !height) 1603 return E_INVALIDARG; 1605 CheckComArgNotNull(address); 1606 CheckComArgExpr(width, width != 0); 1607 CheckComArgExpr(height, height != 0); 1604 1608 1605 1609 AutoCaller autoCaller (this); … … 1619 1623 /* 1620 1624 * First try use the graphics device features for making a snapshot. 1621 * This does not support stretching, is an optional feature (returns not supported). 1625 * This does not support stretching, is an optional feature (returns 1626 * not supported). 1622 1627 * 1623 1628 * Note: It may cause a display resize. Watch out for deadlocks. … … 1630 1635 size_t cbData = RT_ALIGN_Z(width, 4) * 4 * height; 1631 1636 rcVBox = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, 1632 1633 1637 (PFNRT)mpDrv->pUpPort->pfnSnapshot, 6, mpDrv->pUpPort, 1638 address, cbData, (uintptr_t)NULL, (uintptr_t)NULL, (uintptr_t)NULL); 1634 1639 if (RT_SUCCESS(rcVBox)) 1635 1640 { … … 1645 1650 if (rcVBox == VERR_NOT_SUPPORTED || rcVBox == VERR_NOT_IMPLEMENTED) 1646 1651 { 1647 /** @todo implement snapshot stretching andgeneric snapshot fallback. */1652 /** @todo implement snapshot stretching & generic snapshot fallback. */ 1648 1653 rc = setError (E_NOTIMPL, tr ("This feature is not implemented")); 1649 1654 } 1650 1655 else if (RT_FAILURE(rcVBox)) 1651 rc = setError ( E_FAIL,1656 rc = setError (VBOX_E_IPRT_ERROR, 1652 1657 tr ("Could not take a screenshot (%Rrc)"), rcVBox); 1653 1658 … … 1668 1673 LogFlowFuncEnter(); 1669 1674 LogFlowFunc (("address=%p, x=%d, y=%d, width=%d, height=%d\n", 1670 address, x, y, width, height)); 1671 1672 if (!address) 1673 return E_POINTER; 1674 if (!width || !height) 1675 return E_INVALIDARG; 1675 (void *)address, x, y, width, height)); 1676 1677 CheckComArgNotNull(address); 1678 CheckComArgExpr(width, width != 0); 1679 CheckComArgExpr(height, height != 0); 1676 1680 1677 1681 AutoCaller autoCaller (this); … … 1691 1695 PVMREQ pReq; 1692 1696 int rcVBox = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, 1693 1694 1697 (PFNRT)mpDrv->pUpPort->pfnDisplayBlt, 6, mpDrv->pUpPort, 1698 address, x, y, width, height); 1695 1699 if (RT_SUCCESS(rcVBox)) 1696 1700 { … … 1710 1714 } 1711 1715 else if (RT_FAILURE(rcVBox)) 1712 rc = setError ( E_FAIL,1716 rc = setError (VBOX_E_IPRT_ERROR, 1713 1717 tr ("Could not draw to the screen (%Rrc)"), rcVBox); 1714 1718 //@todo … … 1751 1755 PVMREQ pReq; 1752 1756 int rcVBox = VMR3ReqCallVoid(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, 1753 1757 (PFNRT)mpDrv->pUpPort->pfnUpdateDisplayAll, 1, mpDrv->pUpPort); 1754 1758 if (RT_SUCCESS(rcVBox)) 1755 1759 VMR3ReqFree(pReq); 1756 1760 1757 1761 if (RT_FAILURE(rcVBox)) 1758 rc = setError ( E_FAIL,1762 rc = setError (VBOX_E_IPRT_ERROR, 1759 1763 tr ("Could not invalidate and update the screen (%Rrc)"), rcVBox); 1760 1764 … … 1787 1791 /* this is only valid for external framebuffers */ 1788 1792 if (mInternalFramebuffer) 1789 return setError ( E_FAIL,1793 return setError (VBOX_E_NOT_SUPPORTED, 1790 1794 tr ("Resize completed notification is valid only " 1791 1795 "for external framebuffers")); 1792 1796 1793 /* Set the flag indicating that the resize has completed and display data need to be updated. */ 1794 bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[aScreenId].u32ResizeStatus, ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress); 1797 /* Set the flag indicating that the resize has completed and display 1798 * data need to be updated. */ 1799 bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[aScreenId].u32ResizeStatus, 1800 ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress); 1795 1801 AssertRelease(f);NOREF(f); 1796 1802 … … 1821 1827 /* this is only valid for external framebuffers */ 1822 1828 if (mInternalFramebuffer) 1823 return setError ( E_FAIL,1829 return setError (VBOX_E_NOT_SUPPORTED, 1824 1830 tr ("Resize completed notification is valid only " 1825 1831 "for external framebuffers")); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r15727 r15732 9564 9564 <desc> 9565 9565 Requests access to the internal frame buffer. 9566 9567 <result name="VBOX_E_NOT_SUPPORTED"> 9568 Attempt to lock a non-internal frame buffer. 9569 </result> 9570 9566 9571 </desc> 9567 9572 <param name="address" type="octet" mod="ptr" dir="return"/> … … 9571 9576 <desc> 9572 9577 Releases access to the internal frame buffer. 9578 9579 <result name="VBOX_E_NOT_SUPPORTED"> 9580 Attempt to unlock a non-internal frame buffer. 9581 </result> 9582 9573 9583 </desc> 9574 9584 </method> … … 9618 9628 must be <tt>0</tt>. 9619 9629 9630 <result name="E_INVALIDARG"> 9631 The @a display is not associated with any monitor. 9632 </result> 9633 9620 9634 </desc> 9621 9635 <param name="width" type="unsigned long" dir="in"/> … … 9641 9655 Takes a screen shot of the requested size and copies it to the 9642 9656 32-bpp buffer allocated by the caller. 9657 9658 <result name="E_NOTIMPL"> 9659 Feature not implemented. 9660 </result> 9661 <result name="VBOX_E_IPRT_ERROR"> 9662 Could not take a screenshot. 9663 </result> 9664 9643 9665 </desc> 9644 9666 <param name="address" type="octet" mod="ptr" dir="in"/> … … 9651 9673 Draws a 32-bpp image of the specified size from the given buffer 9652 9674 to the given point on the VM display. 9675 9676 <result name="E_NOTIMPL"> 9677 Feature not implemented. 9678 </result> 9679 <result name="VBOX_E_IPRT_ERROR"> 9680 Could not draw to screen. 9681 </result> 9682 9653 9683 </desc> 9654 9684 <param name="address" type="octet" mod="ptr" dir="in"/> … … 9663 9693 Does a full invalidation of the VM display and instructs the VM 9664 9694 to update it. 9695 9696 <result name="VBOX_E_IPRT_ERROR"> 9697 Could not invalidate and update screen. 9698 </result> 9699 9665 9700 </desc> 9666 9701 </method> … … 9669 9704 <desc> 9670 9705 Signals that a framebuffer has completed the resize operation. 9706 9707 <result name="VBOX_E_NOT_SUPPORTED"> 9708 Operation only valid for external frame buffers. 9709 </result> 9710 9671 9711 </desc> 9672 9712 <param name="screenId" type="unsigned long" dir="in"/> … … 9676 9716 <desc> 9677 9717 Signals that a framebuffer has completed the update operation. 9718 9719 <result name="VBOX_E_NOT_SUPPORTED"> 9720 Operation only valid for external frame buffers. 9721 </result> 9722 9678 9723 </desc> 9679 9724 </method>
Note:
See TracChangeset
for help on using the changeset viewer.