summaryrefslogtreecommitdiff
path: root/avmedia/source/opengl/oglframegrabber.cxx
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-03-26 18:46:52 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-03-27 11:22:32 +0100
commit4f48dc2f978d36ef9ba08bf828894fa578430fc7 (patch)
tree143ebad0b5b675fc96669510e4ced5965c6741e1 /avmedia/source/opengl/oglframegrabber.cxx
parentc4cf1a1891122eb1136484dd16145620b7678e96 (diff)
Skeleton of OpenGL avmedia service for playing 3D models
Change-Id: I3bf9e68e1a08ff3db065ec7f4e135119b7d1a4ef
Diffstat (limited to 'avmedia/source/opengl/oglframegrabber.cxx')
-rw-r--r--avmedia/source/opengl/oglframegrabber.cxx60
1 files changed, 60 insertions, 0 deletions
diff --git a/avmedia/source/opengl/oglframegrabber.cxx b/avmedia/source/opengl/oglframegrabber.cxx
new file mode 100644
index 000000000000..2aeda9720b8e
--- /dev/null
+++ b/avmedia/source/opengl/oglframegrabber.cxx
@@ -0,0 +1,60 @@
+/* -*- 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 "oglframegrabber.hxx"
+
+#include <cppuhelper/supportsservice.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/graph.hxx>
+
+using namespace com::sun::star;
+
+namespace avmedia { namespace ogl {
+
+OGLFrameGrabber::OGLFrameGrabber( const OUString& /*rUrl*/ )
+ : FrameGrabber_BASE()
+{
+}
+
+OGLFrameGrabber::~OGLFrameGrabber()
+{
+}
+
+uno::Reference< css::graphic::XGraphic > SAL_CALL OGLFrameGrabber::grabFrame( double /*fMediaTime*/ )
+ throw ( uno::RuntimeException, std::exception )
+{
+ // TODO: Here we need a bitmap of the model at the point specified by fMediaTime
+ // See com::sun::star::media::XFrameGrabber
+ BitmapEx aBitmap;
+ return Graphic( aBitmap ).GetXGraphic();
+}
+
+OUString SAL_CALL OGLFrameGrabber::getImplementationName() throw ( uno::RuntimeException, std::exception )
+{
+ return OUString("com.sun.star.comp.avmedia.FrameGrabber_OpenGL");
+}
+
+sal_Bool SAL_CALL OGLFrameGrabber::supportsService( const OUString& rServiceName )
+ throw ( uno::RuntimeException, std::exception )
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence< OUString > SAL_CALL OGLFrameGrabber::getSupportedServiceNames()
+ throw ( uno::RuntimeException, std::exception )
+{
+ uno::Sequence< OUString > aRet(1);
+ aRet[0] = OUString("com.sun.star.media.FrameGrabber_OpenGL");
+ return aRet;
+}
+
+} // namespace ogl
+} // namespace avmedia
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */