diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-05-29 15:00:20 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-05-29 15:05:28 +0200 |
commit | 1f1c3b2966c36149ca8b8a2e411d562c154f6c6b (patch) | |
tree | 59a556c5bf1737a07712b2e008bd97c4d2db7149 /avmedia | |
parent | c90a742ed507b493fc20a5dbe68f8601217f7e4c (diff) |
OGLFrameGrabber: use reference instead of pointer
Change-Id: Id21138ce2a5d8e764407f42afa2b21464da70e45
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/opengl/oglframegrabber.cxx | 11 | ||||
-rw-r--r-- | avmedia/source/opengl/oglframegrabber.hxx | 4 | ||||
-rw-r--r-- | avmedia/source/opengl/oglplayer.cxx | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/avmedia/source/opengl/oglframegrabber.cxx b/avmedia/source/opengl/oglframegrabber.cxx index e92cd862aec8..cca8cc0f889d 100644 --- a/avmedia/source/opengl/oglframegrabber.cxx +++ b/avmedia/source/opengl/oglframegrabber.cxx @@ -23,9 +23,9 @@ using namespace com::sun::star; namespace avmedia { namespace ogl { -OGLFrameGrabber::OGLFrameGrabber( glTFHandle* pHandle ) +OGLFrameGrabber::OGLFrameGrabber( glTFHandle& rHandle ) : FrameGrabber_BASE() - , m_pHandle( pHandle ) + , m_rHandle( rHandle ) { } @@ -36,9 +36,10 @@ OGLFrameGrabber::~OGLFrameGrabber() uno::Reference< css::graphic::XGraphic > SAL_CALL OGLFrameGrabber::grabFrame( double /*fMediaTime*/ ) throw ( uno::RuntimeException, std::exception ) { - boost::scoped_array<sal_uInt8> pBuffer(new sal_uInt8[m_pHandle->viewport.width * m_pHandle->viewport.height * 4]); - gltf_renderer_get_bitmap(&m_pHandle, 1, (char*)pBuffer.get(), GL_BGRA); - BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(pBuffer.get(), m_pHandle->viewport.width, m_pHandle->viewport.height); + 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); + BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(pBuffer.get(), m_rHandle.viewport.width, m_rHandle.viewport.height); return Graphic( aBitmap ).GetXGraphic(); } diff --git a/avmedia/source/opengl/oglframegrabber.hxx b/avmedia/source/opengl/oglframegrabber.hxx index 5be63714cbbe..b6cc0e8dd346 100644 --- a/avmedia/source/opengl/oglframegrabber.hxx +++ b/avmedia/source/opengl/oglframegrabber.hxx @@ -25,7 +25,7 @@ class OGLFrameGrabber : public FrameGrabber_BASE { public: - OGLFrameGrabber( glTFHandle* pHandle ); + OGLFrameGrabber( glTFHandle& rHandle ); virtual ~OGLFrameGrabber(); // XFrameGrabber @@ -37,7 +37,7 @@ public: virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; private: - glTFHandle* m_pHandle; + glTFHandle& m_rHandle; }; } // namespace ogl diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx index 7a111f9b8531..35d99a408476 100644 --- a/avmedia/source/opengl/oglplayer.cxx +++ b/avmedia/source/opengl/oglplayer.cxx @@ -291,7 +291,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL OGLPlayer::createFrameGrabber() SAL_WARN("avmedia.opengl", "Error occured while parsing *.json file! Error code: " << nRet); return uno::Reference< media::XFrameGrabber >(); } - OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( m_pHandle ); + OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( *m_pHandle ); return uno::Reference< media::XFrameGrabber >( pFrameGrabber ); } |