2014-03-26 18:46:52 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "oglplayer.hxx"
|
|
|
|
#include "oglframegrabber.hxx"
|
|
|
|
#include "oglwindow.hxx"
|
|
|
|
|
|
|
|
#include <cppuhelper/supportsservice.hxx>
|
2014-04-20 10:27:13 +02:00
|
|
|
#include <tools/stream.hxx>
|
|
|
|
#include <vcl/graph.hxx>
|
|
|
|
#include <vcl/graphicfilter.hxx>
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
#include <vcl/opengl/OpenGLHelper.hxx>
|
2014-03-26 18:46:52 +01:00
|
|
|
|
2014-05-29 13:24:34 +02:00
|
|
|
#include <cassert>
|
|
|
|
|
2014-03-26 18:46:52 +01:00
|
|
|
using namespace com::sun::star;
|
2014-08-05 09:54:05 +02:00
|
|
|
using namespace libgltf;
|
2014-03-26 18:46:52 +01:00
|
|
|
|
|
|
|
namespace avmedia { namespace ogl {
|
|
|
|
|
2014-04-18 14:06:22 +02:00
|
|
|
OGLPlayer::OGLPlayer()
|
2014-03-26 18:46:52 +01:00
|
|
|
: Player_BASE(m_aMutex)
|
2014-04-29 11:17:46 +01:00
|
|
|
, m_pHandle(NULL)
|
2014-05-23 10:27:01 +01:00
|
|
|
, m_pOGLWindow(NULL)
|
2014-06-25 15:19:41 +02:00
|
|
|
, m_bIsRendering(false)
|
2014-03-26 18:46:52 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
OGLPlayer::~OGLPlayer()
|
|
|
|
{
|
2014-05-28 15:38:22 +02:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 05:27:46 +02:00
|
|
|
if( m_pHandle )
|
2014-05-28 13:07:38 +02:00
|
|
|
{
|
2014-07-11 11:23:29 +02:00
|
|
|
m_aContext.makeCurrent();
|
2014-05-29 05:27:46 +02:00
|
|
|
gltf_renderer_release(m_pHandle);
|
2014-05-28 13:07:38 +02:00
|
|
|
}
|
2014-08-05 09:54:05 +02:00
|
|
|
releaseInputFiles();
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
2014-04-20 10:27:13 +02:00
|
|
|
static bool lcl_LoadFile( glTFFile* io_pFile, const OUString& rURL)
|
|
|
|
{
|
|
|
|
SvFileStream aStream( rURL, STREAM_READ );
|
|
|
|
if( !aStream.IsOpen() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
const sal_Int64 nBytes = aStream.remainingSize();
|
|
|
|
char* pBuffer = new char[nBytes];
|
|
|
|
aStream.Read( pBuffer, nBytes );
|
|
|
|
aStream.Close();
|
|
|
|
|
|
|
|
io_pFile->buffer = pBuffer;
|
|
|
|
io_pFile->size = nBytes;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-04-18 14:06:22 +02:00
|
|
|
bool OGLPlayer::create( const OUString& rURL )
|
|
|
|
{
|
2014-05-28 15:38:22 +02:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
|
|
|
|
2014-04-18 14:06:22 +02:00
|
|
|
m_sURL = rURL;
|
2014-04-20 10:27:13 +02:00
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
// Convert URL to a system path
|
|
|
|
const INetURLObject aURLObj(m_sURL);
|
|
|
|
const std::string sFilePath = OUStringToOString( aURLObj.getFSysPath(INetURLObject::FSYS_DETECT), RTL_TEXTENCODING_UTF8 ).getStr();
|
2014-04-20 10:27:13 +02:00
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
// Load *.json file and init renderer
|
|
|
|
m_pHandle = gltf_renderer_init(sFilePath, m_vInputFiles);
|
2014-05-28 13:07:38 +02:00
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
if( !m_pHandle )
|
2014-05-09 18:03:03 +02:00
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "gltf_renderer_init returned an invalid glTFHandle");
|
2014-04-20 10:27:13 +02:00
|
|
|
return false;
|
2014-05-09 18:03:03 +02:00
|
|
|
}
|
2014-04-20 10:27:13 +02:00
|
|
|
|
|
|
|
// Load external resources
|
2014-08-05 09:54:05 +02:00
|
|
|
for( size_t i = 0; i < m_vInputFiles.size(); ++i )
|
2014-04-20 10:27:13 +02:00
|
|
|
{
|
2014-08-05 09:54:05 +02:00
|
|
|
glTFFile& rFile = m_vInputFiles[i];
|
|
|
|
if( !rFile.filename.empty() )
|
2014-04-20 10:27:13 +02:00
|
|
|
{
|
2014-04-22 13:05:23 +02:00
|
|
|
const OUString sFilesURL =
|
2014-08-05 09:54:05 +02:00
|
|
|
INetURLObject::GetAbsURL(m_sURL,OStringToOUString(OString(rFile.filename.c_str()),RTL_TEXTENCODING_UTF8));
|
2014-05-24 17:49:38 +02:00
|
|
|
if( rFile.type == GLTF_IMAGE )
|
2014-04-20 10:27:13 +02:00
|
|
|
{
|
|
|
|
// Load images as bitmaps
|
|
|
|
GraphicFilter aFilter;
|
|
|
|
Graphic aGraphic;
|
2014-05-28 13:07:38 +02:00
|
|
|
if( aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL)) != GRFILTER_OK )
|
|
|
|
{
|
|
|
|
rFile.buffer = 0;
|
|
|
|
rFile.imagewidth = 0;
|
|
|
|
rFile.imageheight = 0;
|
|
|
|
SAL_WARN("avmedia.opengl", "Can't load texture file: " + sFilesURL);
|
|
|
|
return false;
|
|
|
|
}
|
2014-05-27 20:12:59 +02:00
|
|
|
BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
|
|
|
|
aBitmapEx.Mirror(BMP_MIRROR_VERT);
|
2014-05-24 17:49:38 +02:00
|
|
|
rFile.buffer = (char*)OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx);
|
|
|
|
rFile.imagewidth = aBitmapEx.GetSizePixel().Width();
|
|
|
|
rFile.imageheight = aBitmapEx.GetSizePixel().Height();
|
2014-04-20 10:27:13 +02:00
|
|
|
}
|
2014-05-24 17:49:38 +02:00
|
|
|
else if( rFile.type == GLTF_BINARY || rFile.type == GLTF_GLSL )
|
2014-04-20 10:27:13 +02:00
|
|
|
{
|
2014-05-24 17:49:38 +02:00
|
|
|
if( !lcl_LoadFile(&rFile, sFilesURL) )
|
2014-05-09 18:03:03 +02:00
|
|
|
{
|
2014-05-28 13:07:38 +02:00
|
|
|
rFile.buffer = 0;
|
|
|
|
rFile.size = 0;
|
2014-05-09 18:03:03 +02:00
|
|
|
SAL_WARN("avmedia.opengl", "Can't load glTF file: " + sFilesURL);
|
2014-04-20 10:27:13 +02:00
|
|
|
return false;
|
2014-05-09 18:03:03 +02:00
|
|
|
}
|
2014-04-20 10:27:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-16 22:07:16 +02:00
|
|
|
|
|
|
|
// Set timer
|
|
|
|
m_aTimer.SetTimeout(10);
|
|
|
|
m_aTimer.SetTimeoutHdl(LINK(this,OGLPlayer,TimerHandler));
|
2014-04-18 14:06:22 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
void OGLPlayer::releaseInputFiles()
|
|
|
|
{
|
|
|
|
for (size_t i = 0; i < m_vInputFiles.size() && m_vInputFiles[i].buffer; ++i)
|
|
|
|
{
|
|
|
|
delete [] m_vInputFiles[i].buffer;
|
|
|
|
m_vInputFiles[i].buffer = 0;
|
|
|
|
}
|
|
|
|
m_vInputFiles.clear();
|
|
|
|
}
|
|
|
|
|
2014-03-26 18:46:52 +01:00
|
|
|
void SAL_CALL OGLPlayer::start() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-06-25 15:19:41 +02:00
|
|
|
|
2014-07-11 07:53:19 +02:00
|
|
|
if(!m_pOGLWindow)
|
|
|
|
return;
|
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
gltf_animation_resume(m_pHandle);
|
2014-05-16 22:07:16 +02:00
|
|
|
m_aTimer.Start();
|
2014-06-25 15:19:41 +02:00
|
|
|
m_bIsRendering = true;
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL OGLPlayer::stop() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-05-16 22:07:16 +02:00
|
|
|
m_aTimer.Stop();
|
2014-05-28 16:43:08 +02:00
|
|
|
gltf_animation_stop(m_pHandle);
|
2014-06-25 15:19:41 +02:00
|
|
|
m_bIsRendering = false;
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OGLPlayer::isPlaying() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-06-25 15:19:41 +02:00
|
|
|
// Here isPlaying means model is rendered in the window and
|
|
|
|
// able to interact with the user (e.g. moving camera)
|
|
|
|
if( getDuration() > 0.0 )
|
|
|
|
return gltf_animation_is_playing(m_pHandle);
|
|
|
|
else
|
|
|
|
return m_bIsRendering;
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
double SAL_CALL OGLPlayer::getDuration() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-04-27 16:30:46 +02:00
|
|
|
return gltf_animation_get_duration(m_pHandle);
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
2014-04-27 16:30:46 +02:00
|
|
|
void SAL_CALL OGLPlayer::setMediaTime( double fTime ) throw ( uno::RuntimeException, std::exception )
|
2014-03-26 18:46:52 +01:00
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-06-25 15:19:41 +02:00
|
|
|
gltf_animation_set_time(m_pHandle, fTime);
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
double SAL_CALL OGLPlayer::getMediaTime() throw ( ::com::sun::star::uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-06-25 15:19:41 +02:00
|
|
|
return gltf_animation_get_time(m_pHandle);
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
2014-04-27 16:30:46 +02:00
|
|
|
void SAL_CALL OGLPlayer::setPlaybackLoop( sal_Bool bSet ) throw ( uno::RuntimeException, std::exception )
|
2014-03-26 18:46:52 +01:00
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-08-05 09:54:05 +02:00
|
|
|
gltf_animation_set_looping(m_pHandle, bSet);
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OGLPlayer::isPlaybackLoop() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-08-05 09:54:05 +02:00
|
|
|
return gltf_animation_get_looping(m_pHandle);
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL OGLPlayer::setVolumeDB( sal_Int16 /*nVolumDB*/ ) throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
2014-04-27 14:41:12 +02:00
|
|
|
// OpenGL models have no sound.
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int16 SAL_CALL OGLPlayer::getVolumeDB() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
2014-04-27 14:41:12 +02:00
|
|
|
// OpenGL models have no sound.
|
2014-03-26 18:46:52 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL OGLPlayer::setMute( sal_Bool /*bSet*/ ) throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
2014-04-27 14:41:12 +02:00
|
|
|
// OpenGL models have no sound.
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OGLPlayer::isMute() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
2014-04-27 14:41:12 +02:00
|
|
|
// OpenGL models have no sound.
|
2014-03-26 18:46:52 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
awt::Size SAL_CALL OGLPlayer::getPreferredPlayerWindowSize() throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
2014-05-06 17:10:59 +02:00
|
|
|
return awt::Size( 480, 360 );
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
2014-07-20 17:20:01 +02:00
|
|
|
static bool lcl_CheckOpenGLRequirements()
|
|
|
|
{
|
2014-08-17 09:26:33 +02:00
|
|
|
return OpenGLHelper::getGLVersion() >= 3.0;
|
2014-07-20 17:20:01 +02:00
|
|
|
}
|
|
|
|
|
2014-04-27 12:20:13 +02:00
|
|
|
uno::Reference< media::XPlayerWindow > SAL_CALL OGLPlayer::createPlayerWindow( const uno::Sequence< uno::Any >& rArguments )
|
2014-03-26 18:46:52 +01:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard( m_aMutex );
|
2014-04-27 12:20:13 +02:00
|
|
|
|
2014-05-09 18:03:03 +02:00
|
|
|
assert( rArguments.getLength() >= 3 );
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-05-09 18:03:03 +02:00
|
|
|
|
|
|
|
sal_IntPtr pIntPtr = 0;
|
|
|
|
rArguments[ 2 ] >>= pIntPtr;
|
|
|
|
SystemChildWindow *pChildWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr );
|
|
|
|
|
2014-05-29 13:24:34 +02:00
|
|
|
if( !pChildWindow )
|
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "Failed to get the SystemChildWindow for rendering!");
|
|
|
|
return uno::Reference< media::XPlayerWindow >();
|
|
|
|
}
|
2014-05-29 13:21:08 +02:00
|
|
|
assert(pChildWindow->GetParent());
|
2014-05-29 13:24:34 +02:00
|
|
|
|
2014-05-09 18:03:03 +02:00
|
|
|
if( !m_aContext.init(pChildWindow) )
|
2014-04-27 12:20:13 +02:00
|
|
|
{
|
2014-05-09 18:03:03 +02:00
|
|
|
SAL_WARN("avmedia.opengl", "Context initialization failed");
|
|
|
|
return uno::Reference< media::XPlayerWindow >();
|
2014-04-27 12:20:13 +02:00
|
|
|
}
|
2014-05-09 18:03:03 +02:00
|
|
|
|
2014-08-29 11:55:23 +02:00
|
|
|
if( !m_aContext.supportMultiSampling() )
|
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "Context does not support multisampling!");
|
|
|
|
return uno::Reference< media::XPlayerWindow >();
|
|
|
|
}
|
|
|
|
|
2014-07-20 17:20:01 +02:00
|
|
|
if( !lcl_CheckOpenGLRequirements() )
|
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "Your platform does not have the minimal OpenGL requiremenets!");
|
|
|
|
return uno::Reference< media::XPlayerWindow >();
|
|
|
|
}
|
|
|
|
|
2014-05-09 18:03:03 +02:00
|
|
|
Size aSize = pChildWindow->GetSizePixel();
|
|
|
|
m_aContext.setWinSize(aSize);
|
|
|
|
m_pHandle->viewport.x = 0;
|
|
|
|
m_pHandle->viewport.y = 0;
|
|
|
|
m_pHandle->viewport.width = aSize.Width();
|
|
|
|
m_pHandle->viewport.height = aSize.Height();
|
2014-05-29 05:48:54 +02:00
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
// TODO: Use the error codes to print a readable error message
|
|
|
|
int nRet = gltf_renderer_set_content(m_pHandle, m_vInputFiles);
|
|
|
|
releaseInputFiles();
|
2014-05-29 05:48:54 +02:00
|
|
|
if( nRet != 0 )
|
|
|
|
{
|
2014-08-29 11:55:23 +02:00
|
|
|
SAL_WARN("avmedia.opengl", "Error occured while setting up the scene! Error code: " << nRet);
|
2014-05-29 05:48:54 +02:00
|
|
|
return uno::Reference< media::XPlayerWindow >();
|
|
|
|
}
|
2014-06-25 15:19:41 +02:00
|
|
|
// The background color is white by default, but we need to separate the
|
|
|
|
// OpenGL window from the main window so set background color to grey
|
|
|
|
glClearColor(0.5f, 0.5f, 0.5f, 0.5f);
|
2014-05-29 13:21:08 +02:00
|
|
|
m_pOGLWindow = new OGLWindow(*m_pHandle, m_aContext, *pChildWindow->GetParent());
|
2014-05-16 22:07:16 +02:00
|
|
|
return uno::Reference< media::XPlayerWindow >( m_pOGLWindow );
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< media::XFrameGrabber > SAL_CALL OGLPlayer::createFrameGrabber()
|
|
|
|
throw ( uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pHandle);
|
2014-05-09 18:03:03 +02:00
|
|
|
|
|
|
|
if( !m_aContext.init() )
|
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "Offscreen context initialization failed");
|
|
|
|
return uno::Reference< media::XFrameGrabber >();
|
|
|
|
}
|
|
|
|
|
2014-08-29 11:55:23 +02:00
|
|
|
if( !m_aContext.supportMultiSampling() )
|
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "Context does not support multisampling!");
|
|
|
|
return uno::Reference< media::XFrameGrabber >();
|
|
|
|
}
|
|
|
|
|
2014-07-20 17:20:01 +02:00
|
|
|
if( !lcl_CheckOpenGLRequirements() )
|
|
|
|
{
|
|
|
|
SAL_WARN("avmedia.opengl", "Your platform does not have the minimal OpenGL requiremenets!");
|
|
|
|
return uno::Reference< media::XFrameGrabber >();
|
|
|
|
}
|
|
|
|
|
2014-04-20 22:57:08 +02:00
|
|
|
m_pHandle->viewport.x = 0;
|
|
|
|
m_pHandle->viewport.y = 0;
|
2014-04-27 12:20:13 +02:00
|
|
|
m_pHandle->viewport.width = getPreferredPlayerWindowSize().Width;
|
|
|
|
m_pHandle->viewport.height = getPreferredPlayerWindowSize().Height;
|
2014-05-29 05:48:54 +02:00
|
|
|
|
2014-08-05 09:54:05 +02:00
|
|
|
int nRet = gltf_renderer_set_content(m_pHandle, m_vInputFiles);
|
|
|
|
releaseInputFiles();
|
2014-05-29 05:48:54 +02:00
|
|
|
if( nRet != 0 )
|
|
|
|
{
|
2014-08-29 11:55:23 +02:00
|
|
|
SAL_WARN("avmedia.opengl", "Error occured while setting up the scene! Error code: " << nRet);
|
2014-05-29 05:48:54 +02:00
|
|
|
return uno::Reference< media::XFrameGrabber >();
|
|
|
|
}
|
2014-06-25 15:19:41 +02:00
|
|
|
glClearColor(0.5f, 0.5f, 0.5f, 0.5f);
|
2014-05-29 15:00:20 +02:00
|
|
|
OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( *m_pHandle );
|
2014-05-06 17:10:59 +02:00
|
|
|
return uno::Reference< media::XFrameGrabber >( pFrameGrabber );
|
2014-03-26 18:46:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL OGLPlayer::getImplementationName()
|
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception )
|
|
|
|
{
|
|
|
|
return OUString("com.sun.star.comp.avmedia.Player_OpenGL");
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OGLPlayer::supportsService( const OUString& rServiceName )
|
2014-04-03 11:28:53 +02:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2014-03-26 18:46:52 +01:00
|
|
|
{
|
|
|
|
return cppu::supportsService(this, rServiceName);
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL OGLPlayer::getSupportedServiceNames()
|
2014-04-03 11:28:53 +02:00
|
|
|
throw ( uno::RuntimeException, std::exception )
|
2014-03-26 18:46:52 +01:00
|
|
|
{
|
|
|
|
uno::Sequence< OUString > aRet(1);
|
|
|
|
aRet[0] = OUString("com.sun.star.media.Player_OpenGL");
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
2014-05-16 22:07:16 +02:00
|
|
|
IMPL_LINK(OGLPlayer,TimerHandler,Timer*,pTimer)
|
|
|
|
{
|
|
|
|
if (pTimer == &m_aTimer)
|
|
|
|
{
|
2014-05-28 15:38:22 +02:00
|
|
|
osl::MutexGuard aGuard(m_aMutex);
|
2014-05-29 13:24:34 +02:00
|
|
|
assert(m_pOGLWindow);
|
2014-05-16 22:07:16 +02:00
|
|
|
m_pOGLWindow->update();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-26 18:46:52 +01:00
|
|
|
} // namespace ogl
|
|
|
|
} // namespace avmedia
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|