diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-07-14 00:21:55 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-07-14 10:40:57 +0200 |
commit | 58fd5a6dd6d5d599df88c9fd4ed5257577562bd9 (patch) | |
tree | c4d4a0395f67cf214fcdb2df5e0dbf9271736a98 /avmedia | |
parent | f4a8d7cd10cda57143b22519e16cdf8d5f19e759 (diff) |
glTF: More rendering related error handling
If any error occurs related to glTF rendering, a question
mark is displayed at the place of the OpenGL window
(Question mark is a general concept of media objects).
Change-Id: Id7df5a47a4dd6832e640b3a7cb3c7712ebfb4408
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/opengl/oglframegrabber.cxx | 7 | ||||
-rw-r--r-- | avmedia/source/opengl/oglwindow.cxx | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/avmedia/source/opengl/oglframegrabber.cxx b/avmedia/source/opengl/oglframegrabber.cxx index cca8cc0f889d..2f76436bed23 100644 --- a/avmedia/source/opengl/oglframegrabber.cxx +++ b/avmedia/source/opengl/oglframegrabber.cxx @@ -38,7 +38,12 @@ uno::Reference< css::graphic::XGraphic > SAL_CALL OGLFrameGrabber::grabFrame( do { boost::scoped_array<sal_uInt8> pBuffer(new sal_uInt8[m_rHandle.viewport.width * m_rHandle.viewport.height * 4]); glTFHandle* pHandle = &m_rHandle; - gltf_renderer_get_bitmap(&pHandle, 1, (char*)pBuffer.get(), GL_BGRA); + int nRet = gltf_renderer_get_bitmap(&pHandle, 1, (char*)pBuffer.get(), GL_BGRA); + if( nRet != 0 ) + { + SAL_WARN("avmedia.opengl", "Error occured while rendering to bitmap! Error code: " << nRet); + return uno::Reference< css::graphic::XGraphic >(); + } BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(pBuffer.get(), m_rHandle.viewport.width, m_rHandle.viewport.height); return Graphic( aBitmap ).GetXGraphic(); } diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx index 9f09533d2ce9..dbb366215a53 100644 --- a/avmedia/source/opengl/oglwindow.cxx +++ b/avmedia/source/opengl/oglwindow.cxx @@ -33,7 +33,12 @@ OGLWindow::~OGLWindow() void SAL_CALL OGLWindow::update() throw (css::uno::RuntimeException, std::exception) { m_rContext.makeCurrent(); - gltf_prepare_renderer(&m_rHandle); + int nRet = gltf_prepare_renderer(&m_rHandle); + if( nRet != 0 ) + { + SAL_WARN("avmedia.opengl", "Error occured while preparing for rendering! Error code: " << nRet); + return; + } gltf_renderer(&m_rHandle); gltf_complete_renderer(&m_rHandle); m_rContext.swapBuffers(); |