Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c1baaddd
Kaydet (Commit)
c1baaddd
authored
Nis 20, 2014
tarafından
Zolnai Tamás
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
avmediaogl: load all needed files into buffers for gltf rendering
Change-Id: I00fe209f3b0061dd67240eb1a490fb62530ffb55
üst
0db1e713
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
1 deletion
+101
-1
RepositoryExternal.mk
RepositoryExternal.mk
+2
-0
Library_avmediaogl.mk
avmedia/Library_avmediaogl.mk
+35
-1
oglplayer.cxx
avmedia/source/opengl/oglplayer.cxx
+62
-0
oglplayer.hxx
avmedia/source/opengl/oglplayer.hxx
+2
-0
No files found.
RepositoryExternal.mk
Dosyayı görüntüle @
c1baaddd
...
@@ -3090,9 +3090,11 @@ endif # DESKTOP
...
@@ -3090,9 +3090,11 @@ endif # DESKTOP
ifeq ($(ENABLE_GLTF),TRUE)
ifeq ($(ENABLE_GLTF),TRUE)
# !! We need to avoid setting src as include (changes needed in libgltf)
define gb_LinkTarget__use_libgltf
define gb_LinkTarget__use_libgltf
$(call gb_LinkTarget_set_include,$(1),\
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,libgltf)/inc \
-I$(call gb_UnpackedTarball_get_dir,libgltf)/inc \
-I$(call gb_UnpackedTarball_get_dir,libgltf)/src \
$$(INCLUDE) \
$$(INCLUDE) \
)
)
...
...
avmedia/Library_avmediaogl.mk
Dosyayı görüntüle @
c1baaddd
...
@@ -13,7 +13,17 @@ $(eval $(call gb_Library_set_componentfile,avmediaogl,avmedia/source/opengl/avme
...
@@ -13,7 +13,17 @@ $(eval $(call gb_Library_set_componentfile,avmediaogl,avmedia/source/opengl/avme
$(eval $(call gb_Library_use_sdk_api,avmediaogl))
$(eval $(call gb_Library_use_sdk_api,avmediaogl))
$(eval $(call gb_Library_use_external,avmediaogl,boost_headers))
# Avoid warnings until libgltf's interface is minimized
$(eval $(call gb_Library_add_cxxflags,avmediaogl,-w))
$(eval $(call gb_Library_use_externals,avmediaogl, \
boost_headers \
libgltf \
mesa_headers \
glew \
zlib \
freetype \
))
$(eval $(call gb_Library_use_libraries,avmediaogl,\
$(eval $(call gb_Library_use_libraries,avmediaogl,\
comphelper \
comphelper \
...
@@ -23,9 +33,14 @@ $(eval $(call gb_Library_use_libraries,avmediaogl,\
...
@@ -23,9 +33,14 @@ $(eval $(call gb_Library_use_libraries,avmediaogl,\
salhelper \
salhelper \
tl \
tl \
vcl \
vcl \
vclopengl \
$(gb_UWINAPI) \
$(gb_UWINAPI) \
))
))
$(eval $(call gb_Library_set_include,avmediaogl,\
$$(INCLUDE) \
))
$(eval $(call gb_Library_add_exception_objects,avmediaogl,\
$(eval $(call gb_Library_add_exception_objects,avmediaogl,\
avmedia/source/opengl/oglframegrabber \
avmedia/source/opengl/oglframegrabber \
avmedia/source/opengl/oglmanager \
avmedia/source/opengl/oglmanager \
...
@@ -34,4 +49,23 @@ $(eval $(call gb_Library_add_exception_objects,avmediaogl,\
...
@@ -34,4 +49,23 @@ $(eval $(call gb_Library_add_exception_objects,avmediaogl,\
avmedia/source/opengl/oglwindow \
avmedia/source/opengl/oglwindow \
))
))
ifeq ($(strip $(OS)),WNT)
$(eval $(call gb_Library_use_system_win32_libs,avmediaogl,\
opengl32 \
gdi32 \
glu32 \
))
else ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_use_system_darwin_frameworks,avmediaogl,\
OpenGL \
))
else ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,avmediaogl,\
-ldl \
-lGL \
-lGLU \
-lX11 \
))
endif
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
avmedia/source/opengl/oglplayer.cxx
Dosyayı görüntüle @
c1baaddd
...
@@ -12,6 +12,11 @@
...
@@ -12,6 +12,11 @@
#include "oglwindow.hxx"
#include "oglwindow.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <tools/stream.hxx>
#include <vcl/graph.hxx>
#include <vcl/graphicfilter.hxx>
#include <tools/urlobj.hxx>
#include <vcl/opengl/OpenGLHelper.hxx>
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
;
...
@@ -26,9 +31,66 @@ OGLPlayer::~OGLPlayer()
...
@@ -26,9 +31,66 @@ OGLPlayer::~OGLPlayer()
{
{
}
}
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
;
}
bool
OGLPlayer
::
create
(
const
OUString
&
rURL
)
bool
OGLPlayer
::
create
(
const
OUString
&
rURL
)
{
{
m_sURL
=
rURL
;
m_sURL
=
rURL
;
// Load *.json file and init renderer
glTFFile
aJsonFile
;
aJsonFile
.
type
=
GLTF_JSON
;
OString
sFileName
=
OUStringToOString
(
m_sURL
.
copy
(
m_sURL
.
lastIndexOf
(
"/"
)
+
1
),
RTL_TEXTENCODING_UTF8
);
aJsonFile
.
filename
=
(
char
*
)
sFileName
.
getStr
();
if
(
!
lcl_LoadFile
(
&
aJsonFile
,
m_sURL
)
)
return
false
;
m_pHandle
=
gltf_renderer_init
(
&
aJsonFile
);
if
(
!
m_pHandle
||
!
m_pHandle
->
files
)
return
false
;
// Load external resources
for
(
size_t
i
=
0
;
i
<
m_pHandle
->
size
;
++
i
)
{
glTFFile
*
pFile
=
m_pHandle
->
files
[
i
];
if
(
pFile
&&
pFile
->
filename
)
{
const
OUString
sFilesURL
=
m_sURL
.
copy
(
0
,
m_sURL
.
lastIndexOf
(
"/"
)
+
1
)
+
OStringToOUString
(
OString
(
pFile
->
filename
),
RTL_TEXTENCODING_UTF8
);
if
(
pFile
->
type
==
GLTF_IMAGE
)
{
// Load images as bitmaps
GraphicFilter
aFilter
;
Graphic
aGraphic
;
aFilter
.
ImportGraphic
(
aGraphic
,
INetURLObject
(
sFilesURL
));
const
BitmapEx
aBitmapEx
=
aGraphic
.
GetBitmapEx
();
pFile
->
buffer
=
(
char
*
)
OpenGLHelper
::
ConvertBitmapExToRGBABuffer
(
aBitmapEx
);
pFile
->
imagewidth
=
aBitmapEx
.
GetSizePixel
().
Width
();
pFile
->
imageheight
=
aBitmapEx
.
GetSizePixel
().
Height
();
}
else
if
(
pFile
->
type
==
GLTF_BINARY
||
pFile
->
type
==
GLTF_GLSL
)
{
if
(
!
lcl_LoadFile
(
pFile
,
sFilesURL
)
)
return
false
;
}
}
}
return
true
;
return
true
;
}
}
...
...
avmedia/source/opengl/oglplayer.hxx
Dosyayı görüntüle @
c1baaddd
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/media/XPlayer.hpp>
#include <com/sun/star/media/XPlayer.hpp>
#include <libgltf.h>
namespace
avmedia
{
namespace
ogl
{
namespace
avmedia
{
namespace
ogl
{
...
@@ -54,6 +55,7 @@ public:
...
@@ -54,6 +55,7 @@ public:
private
:
private
:
OUString
m_sURL
;
OUString
m_sURL
;
glTFHandle
*
m_pHandle
;
};
};
}
// namespace ogl
}
// namespace ogl
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment