Merge Firestorm LGPL
commit
1dfdbe2d03
109
autobuild.xml
109
autobuild.xml
|
|
@ -3,39 +3,6 @@
|
|||
<map>
|
||||
<key>installables</key>
|
||||
<map>
|
||||
|
||||
<key>slplugin_x86</key>
|
||||
<map>
|
||||
<key>license</key>
|
||||
<string>LGPL</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/slplugin.txt</string>
|
||||
<key>name</key>
|
||||
<string>slplugin_x86</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>windows</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
<key>darwin</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>4c3728f376711663c22d32b6d71689df</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/slplugin_x86-4.7.10.51243-darwin-201610300350-r5.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
</map>
|
||||
</map>
|
||||
<key>ndPhysicsStub</key>
|
||||
<map>
|
||||
<key>license</key>
|
||||
|
|
@ -204,48 +171,6 @@
|
|||
<key>version</key>
|
||||
<string>2.1</string>
|
||||
</map>
|
||||
<key>gstreamer10</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
<string>Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/></string>
|
||||
<key>license</key>
|
||||
<string>LGPL</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/gstreamer.txt</string>
|
||||
<key>name</key>
|
||||
<string>gstreamer10</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>linux</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>01f39ecf80dae64e30402ac384035b3e</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/gstreamer10-1.6.3.201605191852-linux-201605191852.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
</map>
|
||||
<key>windows</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>437b1dfd7e20cd0b688e2c1393cdbfc3</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/gstreamer10-1.6.3.201605192127-r9-windows-201605192127-r9.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>0.10.6.294903</string>
|
||||
</map>
|
||||
|
||||
|
||||
<key>SDL</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
|
|
@ -1393,11 +1318,11 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>f62e7cff14feb646babaa19b7ea14ed3</string>
|
||||
<string>94fc457c46e1fb94b31251bd4747d10f</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/glod-1.0pre3.201704302344-linux-201704302344.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/glod-1.0pre3.171101143-darwin64-171101143.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -1407,11 +1332,11 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e3659aa7b670a8fbdfb1b820254abb44</string>
|
||||
<string>f62e7cff14feb646babaa19b7ea14ed3</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>http://downloads.phoenixviewer.com/glod-1.0pre3.201703081158-windows-201703081158.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/glod-1.0pre3.201704302344-linux-201704302344.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -3042,9 +2967,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>2adb5b8bd2493d576c5d02b992d8f819</string>
|
||||
<string>4e278d789c5d6e448d1e39211d19bf41</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openjpeg_3p-update-openjpeg/rev/297018/arch/Darwin/installer/openjpeg-1.4.297018-darwin-297018.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/openjpeg-1.4.201505181816-r27-darwin-201505181816-r27.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin</string>
|
||||
|
|
@ -3054,9 +2979,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>f7013e1f0b6a877090622fd73ec72cbc</string>
|
||||
<string>4e278d789c5d6e448d1e39211d19bf41</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1114/2576/openjpeg-1.5.1.501102-darwin64-501102.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/openjpeg-1.4.201505181816-r27-darwin-201505181816-r27.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>darwin64</string>
|
||||
|
|
@ -3066,9 +2991,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>e82317482647559d46a818ba48e9423a</string>
|
||||
<string>675c283030879d3d9c49082bfa2192eb</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-openjpeg/rev/314205/arch/Linux/installer/openjpeg-2.0.0.314205-linux-314205.tar.bz2</string>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openjpeg_3p-update-openjpeg/rev/297018/arch/Linux/installer/openjpeg-1.4.297018-linux-297018.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux</string>
|
||||
|
|
@ -3078,9 +3003,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>ac66f3197010b1549a5e4467aebbc27d</string>
|
||||
<string>8b36861396af4a31668f673aebd4b1d8</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1113/2571/openjpeg-1.5.1.501102-linux64-501102.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/jpeglib-8c.201505150200-r27-linux-x64-201505150200-r27.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
|
|
@ -3090,9 +3015,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>8a7f0be5647e07235d205ac00805fb78</string>
|
||||
<string>b35adcf74d22c128045aa87aade74736</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1116/2586/openjpeg-1.5.1.501102-windows-501102.tar.bz2</string>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openjpeg_3p-update-openjpeg/rev/297018/arch/CYGWIN/installer/openjpeg-1.4.297018-windows-297018.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
|
|
@ -3102,16 +3027,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>398544058036bc27097fcff208934d11</string>
|
||||
<string>47c09d96ae84fa4518b639cd93ba45b3</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1115/2581/openjpeg-1.5.1.501102-windows64-501102.tar.bz2</string>
|
||||
<string>http://downloads.phoenixviewer.com/openjpeg-1.4.201412051021-windows-x64-201412051021.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>1.5.1.501102</string>
|
||||
<string>1.4.0.297018</string>
|
||||
</map>
|
||||
<key>openssl</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -209,6 +209,8 @@ if (DARWIN)
|
|||
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
|
||||
set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations")
|
||||
#<FS:TS> Silence some more compiler warnings on Xcode 9
|
||||
set(DARWIN_extra_cstar_flags "${DARWIN_extra_cstar_flags} -Wno-unused-const-variable -Wno-unused-private-field -Wno-potentially-evaluated-expression")
|
||||
# Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format --
|
||||
# see Variables.cmake.
|
||||
string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}"
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (USESYSTEMLIBS)
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(GSTREAMER10 REQUIRED gstreamer-1.0)
|
||||
pkg_check_modules(GSTREAMER10_PLUGINS_BASE REQUIRED gstreamer-plugins-base-1.0)
|
||||
elseif (LINUX OR WINDOWS)
|
||||
use_prebuilt_binary(gstreamer10)
|
||||
use_prebuilt_binary(libxml2)
|
||||
set(GSTREAMER10_FOUND ON FORCE BOOL)
|
||||
set(GSTREAMER10_PLUGINS_BASE_FOUND ON FORCE BOOL)
|
||||
set(GSTREAMER10_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/gstreamer-1.0
|
||||
${LIBS_PREBUILT_DIR}/include/glib-2.0
|
||||
${LIBS_PREBUILT_DIR}/include/libxml2
|
||||
)
|
||||
# We don't need to explicitly link against gstreamer itself, because
|
||||
# LLMediaImplGStreamer probes for the system's copy at runtime.
|
||||
set(GSTREAMER10_LIBRARIES)
|
||||
endif (USESYSTEMLIBS)
|
||||
|
||||
if (GSTREAMER10_FOUND AND GSTREAMER10_PLUGINS_BASE_FOUND)
|
||||
set(GSTREAMER10 ON CACHE BOOL "Build with GStreamer-1.0 streaming media support.")
|
||||
endif (GSTREAMER10_FOUND AND GSTREAMER10_PLUGINS_BASE_FOUND)
|
||||
|
||||
if (GSTREAMER10)
|
||||
add_definitions(-DLL_GSTREAMER10_ENABLED=1)
|
||||
endif (GSTREAMER10)
|
||||
|
||||
|
|
@ -9,11 +9,5 @@ if (NOT USESYSTEMLIBS)
|
|||
use_prebuilt_binary(libhunspell)
|
||||
use_prebuilt_binary(slvoice)
|
||||
# use_prebuilt_binary(libidn)
|
||||
|
||||
if( ADDRESS_SIZE EQUAL 64 )
|
||||
if( DARWIN )
|
||||
use_prebuilt_binary( slplugin_x86 )
|
||||
endif( DARWIN )
|
||||
endif( )
|
||||
endif(NOT USESYSTEMLIBS)
|
||||
|
||||
|
|
|
|||
|
|
@ -145,10 +145,9 @@ ARGUMENTS=[
|
|||
default=None),
|
||||
dict(name='versionfile',
|
||||
description="""The name of a file containing the full version number."""),
|
||||
# <FS:Ansariel> Don't pass the bundle ID so we sign the Mac DMG file with the developer certificate
|
||||
#dict(name='bundleid',
|
||||
# description="""The Mac OS X Bundle identifier.""",
|
||||
# default="com.secondlife.indra.viewer"),
|
||||
dict(name='bundleid',
|
||||
description="""The Mac OS X Bundle identifier.""",
|
||||
default="com.secondlife.indra.viewer"),
|
||||
dict(name='signature',
|
||||
description="""This specifies an identity to sign the viewer with, if any.
|
||||
If no value is supplied, the default signature will be used, if any. Currently
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@
|
|||
#ifndef LL_LLKDUMEM_H
|
||||
#define LL_LLKDUMEM_H
|
||||
|
||||
//<FS:TS> Silence Clang warning the flag doesn't for some reason
|
||||
#if LL_DARWIN
|
||||
#pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
#endif
|
||||
//</FS:TS>
|
||||
|
||||
// Support classes for reading and writing from memory buffers in KDU
|
||||
#define KDU_NO_THREADS
|
||||
|
||||
|
|
|
|||
|
|
@ -611,63 +611,73 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
|
|||
//LLGLSLShader::startProfile();
|
||||
//glDrawArrays(sGLMode[mode], 0, count);
|
||||
//LLGLSLShader::stopProfile(count, mode);
|
||||
bool has_buffer = true;
|
||||
if (!sUtilityBuffer)
|
||||
{
|
||||
sUtilityBuffer = new LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD0, GL_STREAM_DRAW);
|
||||
has_buffer = sUtilityBuffer->allocateBuffer(count, count, true);
|
||||
}
|
||||
if (sUtilityBuffer->getNumVerts() < (S32) count)
|
||||
{
|
||||
has_buffer = sUtilityBuffer->resizeBuffer(count, count);
|
||||
}
|
||||
U32 start_pos = 0;
|
||||
U32 remaining = pos.size();
|
||||
|
||||
if (has_buffer)
|
||||
while (remaining > 0)
|
||||
{
|
||||
LLStrider<LLVector3> vertex_strider;
|
||||
LLStrider<LLVector3> normal_strider;
|
||||
sUtilityBuffer->getVertexStrider(vertex_strider);
|
||||
sUtilityBuffer->getNormalStrider(normal_strider);
|
||||
for (U32 i = 0; i < count; ++i)
|
||||
count = llmin(remaining, 65536u);
|
||||
start_pos = pos.size() - remaining;
|
||||
remaining -= count;
|
||||
|
||||
bool has_buffer = true;
|
||||
if (!sUtilityBuffer)
|
||||
{
|
||||
*(vertex_strider++) = pos[i];
|
||||
*(normal_strider++) = norm[i];
|
||||
sUtilityBuffer = new LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD0, GL_STREAM_DRAW);
|
||||
has_buffer = sUtilityBuffer->allocateBuffer(count, count, true);
|
||||
}
|
||||
if (sUtilityBuffer->getNumVerts() < (S32)count)
|
||||
{
|
||||
has_buffer = sUtilityBuffer->resizeBuffer(count, count);
|
||||
}
|
||||
|
||||
sUtilityBuffer->setBuffer(MAP_VERTEX | MAP_NORMAL);
|
||||
LLGLSLShader::startProfile();
|
||||
sUtilityBuffer->drawArrays(mode, 0, pos.size());
|
||||
LLGLSLShader::stopProfile(count, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
unbind();
|
||||
|
||||
setupClientArrays(MAP_VERTEX | MAP_NORMAL);
|
||||
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
|
||||
if (shader)
|
||||
if (has_buffer)
|
||||
{
|
||||
S32 loc = LLVertexBuffer::TYPE_VERTEX;
|
||||
if (loc > -1)
|
||||
LLStrider<LLVector3> vertex_strider;
|
||||
LLStrider<LLVector3> normal_strider;
|
||||
sUtilityBuffer->getVertexStrider(vertex_strider);
|
||||
sUtilityBuffer->getNormalStrider(normal_strider);
|
||||
for (U32 i = 0; i < count; ++i)
|
||||
{
|
||||
glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, pos[0].mV);
|
||||
}
|
||||
loc = LLVertexBuffer::TYPE_NORMAL;
|
||||
if (loc > -1)
|
||||
{
|
||||
glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, norm[0].mV);
|
||||
*(vertex_strider++) = pos[start_pos + i];
|
||||
*(normal_strider++) = norm[start_pos + i];
|
||||
}
|
||||
|
||||
sUtilityBuffer->setBuffer(MAP_VERTEX | MAP_NORMAL);
|
||||
LLGLSLShader::startProfile();
|
||||
sUtilityBuffer->drawArrays(mode, 0, count);
|
||||
LLGLSLShader::stopProfile(count, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, 0, pos[0].mV);
|
||||
glNormalPointer(GL_FLOAT, 0, norm[0].mV);
|
||||
unbind();
|
||||
|
||||
setupClientArrays(MAP_VERTEX | MAP_NORMAL);
|
||||
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
|
||||
if (shader)
|
||||
{
|
||||
S32 loc = LLVertexBuffer::TYPE_VERTEX;
|
||||
if (loc > -1)
|
||||
{
|
||||
glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, pos[start_pos].mV);
|
||||
}
|
||||
loc = LLVertexBuffer::TYPE_NORMAL;
|
||||
if (loc > -1)
|
||||
{
|
||||
glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, norm[start_pos].mV);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, 0, pos[start_pos].mV);
|
||||
glNormalPointer(GL_FLOAT, 0, norm[start_pos].mV);
|
||||
}
|
||||
LLGLSLShader::startProfile();
|
||||
glDrawArrays(sGLMode[mode], 0, count);
|
||||
LLGLSLShader::stopProfile(count, mode);
|
||||
}
|
||||
LLGLSLShader::startProfile();
|
||||
glDrawArrays(sGLMode[mode], 0, count);
|
||||
LLGLSLShader::stopProfile(count, mode);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -624,7 +624,9 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
|
|||
bool can_drag = true;
|
||||
if ( (root->isOverDragThreshold(screen_x, screen_y)) && (root->getCurSelectedItem()) )
|
||||
{
|
||||
if (can_drag = root->startDrag())
|
||||
//<FS:TS> Silence compiler warning
|
||||
//if (can_drag = root->startDrag())
|
||||
if ((can_drag = root->startDrag()))
|
||||
{
|
||||
// RN: when starting drag and drop, clear out last auto-open
|
||||
root->autoOpenTest(NULL);
|
||||
|
|
|
|||
|
|
@ -967,7 +967,7 @@ void LLLineEditor::removeWord(bool prev)
|
|||
if (new_pos == pos) // Other character we don't jump over
|
||||
new_pos = prev ? prevWordPos(new_pos-1) : nextWordPos(new_pos+1);
|
||||
|
||||
const U32 diff(labs(pos - new_pos));
|
||||
const U32 diff(labs(static_cast<S32>(pos) - static_cast<S32>(new_pos)));
|
||||
if (prev)
|
||||
{
|
||||
mText.erase(new_pos, diff);
|
||||
|
|
|
|||
|
|
@ -1128,7 +1128,7 @@ void LLTextEditor::removeWord(bool prev)
|
|||
if (new_pos == pos) // Other character we don't jump over
|
||||
new_pos = prev ? prevWordPos(new_pos-1) : nextWordPos(new_pos+1);
|
||||
|
||||
const U32 diff(labs(pos - new_pos));
|
||||
const U32 diff(labs(static_cast<S32>(pos) - static_cast<S32>(new_pos)));
|
||||
if (prev)
|
||||
{
|
||||
remove(new_pos, diff, false);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,3 @@ if (WINDOWS)
|
|||
add_subdirectory(libvlc)
|
||||
add_subdirectory(example)
|
||||
endif (WINDOWS)
|
||||
|
||||
if (WINDOWS OR LINUX)
|
||||
add_subdirectory(gstreamer10)
|
||||
endif (WINDOWS OR LINUX)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ if (WINDOWS)
|
|||
set_target_properties(
|
||||
media_plugin_example
|
||||
PROPERTIES
|
||||
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT"
|
||||
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
project(media_plugin_gstreamer10)
|
||||
|
||||
include(00-Common)
|
||||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLPlugin)
|
||||
include(LLMath)
|
||||
include(LLRender)
|
||||
include(LLWindow)
|
||||
include(Linking)
|
||||
include(PluginAPI)
|
||||
include(MediaPluginBase)
|
||||
include(OpenGL)
|
||||
|
||||
include(GStreamer10Plugin)
|
||||
|
||||
include_directories(
|
||||
${LLPLUGIN_INCLUDE_DIRS}
|
||||
${MEDIA_PLUGIN_BASE_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLIMAGE_INCLUDE_DIRS}
|
||||
${LLRENDER_INCLUDE_DIRS}
|
||||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${GSTREAMER10_INCLUDE_DIRS}
|
||||
${GSTREAMER10_PLUGINS_BASE_INCLUDE_DIRS}
|
||||
)
|
||||
include_directories(SYSTEM
|
||||
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
### media_plugin_gstreamer10
|
||||
|
||||
if(NOT WORD_SIZE EQUAL 32)
|
||||
if(NOT WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif()
|
||||
endif(NOT WORD_SIZE EQUAL 32)
|
||||
|
||||
set(media_plugin_gstreamer10_SOURCE_FILES
|
||||
media_plugin_gstreamer10.cpp
|
||||
llmediaimplgstreamer_syms.cpp
|
||||
)
|
||||
|
||||
set(media_plugin_gstreamer10_HEADER_FILES
|
||||
llmediaimplgstreamer_syms.h
|
||||
llmediaimplgstreamertriviallogging.h
|
||||
)
|
||||
|
||||
add_library(media_plugin_gstreamer10
|
||||
SHARED
|
||||
${media_plugin_gstreamer10_SOURCE_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(media_plugin_gstreamer10
|
||||
${LLPLUGIN_LIBRARIES}
|
||||
${MEDIA_PLUGIN_BASE_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${PLUGIN_API_WINDOWS_LIBRARIES}
|
||||
${GSTREAMER10_LIBRARIES}
|
||||
)
|
||||
|
||||
#add_dependencies(media_plugin_gstreamer10
|
||||
# ${LLPLUGIN_LIBRARIES}
|
||||
# ${MEDIA_PLUGIN_BASE_LIBRARIES}
|
||||
# ${LLCOMMON_LIBRARIES}
|
||||
#)
|
||||
|
||||
if (WINDOWS)
|
||||
set_target_properties(
|
||||
media_plugin_gstreamer10
|
||||
PROPERTIES
|
||||
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
|
||||
)
|
||||
endif (WINDOWS)
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/**
|
||||
* @file llmediaimplgstreamer.h
|
||||
* @author Tofu Linden
|
||||
* @brief implementation that supports media playback via GStreamer.
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
// header guard
|
||||
#ifndef llmediaimplgstreamer_h
|
||||
#define llmediaimplgstreamer_h
|
||||
|
||||
#if LL_GSTREAMER010_ENABLED
|
||||
|
||||
extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "apr_pools.h"
|
||||
#include "apr_dso.h"
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
gboolean llmediaimplgstreamer_bus_callback (GstBus *bus,
|
||||
GstMessage *message,
|
||||
gpointer data);
|
||||
}
|
||||
|
||||
#endif // LL_GSTREAMER010_ENABLED
|
||||
|
||||
#endif // llmediaimplgstreamer_h
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
/**
|
||||
* @file llmediaimplgstreamer_syms.cpp
|
||||
* @brief dynamic GStreamer symbol-grabbing code
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0502
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
extern "C" {
|
||||
#include <gst/gst.h>
|
||||
#include <gst/app/gstappsink.h>
|
||||
}
|
||||
|
||||
#include "apr_pools.h"
|
||||
#include "apr_dso.h"
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
|
||||
#ifndef _M_AMD64
|
||||
#define GSTREAMER_REG_KEY "Software\\GStreamer1.0\\x86"
|
||||
#define GSTREAMER_DIR_SUFFIX "1.0\\x86\\bin\\"
|
||||
#else
|
||||
#define GSTREAMER_REG_KEY "Software\\GStreamer1.0\\x86_64"
|
||||
#define GSTREAMER_DIR_SUFFIX "1.0\\x86_64\\bin\\"
|
||||
#endif
|
||||
|
||||
bool openRegKey( HKEY &aKey )
|
||||
{
|
||||
// Try native (32 bit view/64 bit view) of registry first.
|
||||
if( ERROR_SUCCESS == ::RegOpenKeyExA( HKEY_LOCAL_MACHINE, GSTREAMER_REG_KEY, 0, KEY_QUERY_VALUE, &aKey ) )
|
||||
return true;
|
||||
|
||||
// If native view fails, use 32 bit view or registry.
|
||||
if( ERROR_SUCCESS == ::RegOpenKeyExA( HKEY_LOCAL_MACHINE, GSTREAMER_REG_KEY, 0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &aKey ) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string getGStreamerDir()
|
||||
{
|
||||
std::string ret;
|
||||
HKEY hKey;
|
||||
|
||||
if( openRegKey( hKey ) )
|
||||
{
|
||||
DWORD dwLen(0);
|
||||
::RegQueryValueExA( hKey, "InstallDir", nullptr, nullptr, nullptr, &dwLen );
|
||||
|
||||
if( dwLen > 0 )
|
||||
{
|
||||
std::vector< char > vctBuffer;
|
||||
vctBuffer.resize( dwLen );
|
||||
::RegQueryValueExA( hKey, "InstallDir", nullptr, nullptr, reinterpret_cast< LPBYTE>(&vctBuffer[ 0 ]), &dwLen );
|
||||
ret = &vctBuffer[0];
|
||||
|
||||
if( ret[ dwLen-1 ] != '\\' )
|
||||
ret += "\\";
|
||||
ret += GSTREAMER_DIR_SUFFIX;
|
||||
|
||||
SetDllDirectoryA( ret.c_str() );
|
||||
}
|
||||
::RegCloseKey( hKey );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
std::string getGStreamerDir() { return ""; }
|
||||
#endif
|
||||
|
||||
#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL;
|
||||
#include "llmediaimplgstreamer_syms_raw.inc"
|
||||
#undef LL_GST_SYM
|
||||
|
||||
struct Symloader
|
||||
{
|
||||
bool mRequired;
|
||||
char const *mName;
|
||||
apr_dso_handle_sym_t *mPPFunc;
|
||||
};
|
||||
|
||||
#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) { REQ, #GSTSYM , (apr_dso_handle_sym_t*)&ll##GSTSYM},
|
||||
Symloader sSyms[] = {
|
||||
#include "llmediaimplgstreamer_syms_raw.inc"
|
||||
{ false, 0, 0 } };
|
||||
#undef LL_GST_SYM
|
||||
|
||||
// a couple of stubs for disgusting reasons
|
||||
GstDebugCategory*
|
||||
ll_gst_debug_category_new(gchar *name, guint color, gchar *description)
|
||||
{
|
||||
static GstDebugCategory dummy;
|
||||
return &dummy;
|
||||
}
|
||||
void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname)
|
||||
{
|
||||
}
|
||||
|
||||
static bool sSymsGrabbed = false;
|
||||
static apr_pool_t *sSymGSTDSOMemoryPool = NULL;
|
||||
|
||||
std::vector< apr_dso_handle_t* > sLoadedLibraries;
|
||||
|
||||
bool grab_gst_syms( std::vector< std::string > const &aDSONames )
|
||||
{
|
||||
if (sSymsGrabbed)
|
||||
return true;
|
||||
|
||||
//attempt to load the shared libraries
|
||||
apr_pool_create(&sSymGSTDSOMemoryPool, NULL);
|
||||
|
||||
for( std::vector< std::string >::const_iterator itr = aDSONames.begin(); itr != aDSONames.end(); ++itr )
|
||||
{
|
||||
apr_dso_handle_t *pDSO(NULL);
|
||||
std::string strDSO = getGStreamerDir() + *itr;
|
||||
if( APR_SUCCESS == apr_dso_load( &pDSO, strDSO.c_str(), sSymGSTDSOMemoryPool ))
|
||||
sLoadedLibraries.push_back( pDSO );
|
||||
|
||||
for( int i = 0; sSyms[ i ].mName; ++i )
|
||||
{
|
||||
if( !*sSyms[ i ].mPPFunc )
|
||||
{
|
||||
apr_dso_sym( sSyms[ i ].mPPFunc, pDSO, sSyms[ i ].mName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream strm;
|
||||
bool sym_error = false;
|
||||
for( int i = 0; sSyms[ i ].mName; ++i )
|
||||
{
|
||||
if( sSyms[ i ].mRequired && ! *sSyms[ i ].mPPFunc )
|
||||
{
|
||||
sym_error = true;
|
||||
strm << sSyms[ i ].mName << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
sSymsGrabbed = !sym_error;
|
||||
return sSymsGrabbed;
|
||||
}
|
||||
|
||||
|
||||
void ungrab_gst_syms()
|
||||
{
|
||||
// should be safe to call regardless of whether we've
|
||||
// actually grabbed syms.
|
||||
|
||||
for( std::vector< apr_dso_handle_t* >::iterator itr = sLoadedLibraries.begin(); itr != sLoadedLibraries.end(); ++itr )
|
||||
apr_dso_unload( *itr );
|
||||
|
||||
sLoadedLibraries.clear();
|
||||
|
||||
if ( sSymGSTDSOMemoryPool )
|
||||
{
|
||||
apr_pool_destroy(sSymGSTDSOMemoryPool);
|
||||
sSymGSTDSOMemoryPool = NULL;
|
||||
}
|
||||
|
||||
for( int i = 0; sSyms[ i ].mName; ++i )
|
||||
*sSyms[ i ].mPPFunc = NULL;
|
||||
|
||||
sSymsGrabbed = false;
|
||||
}
|
||||
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/**
|
||||
* @file llmediaimplgstreamer_syms.h
|
||||
* @brief dynamic GStreamer symbol-grabbing code
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include <vector>
|
||||
extern "C" {
|
||||
#include <gst/gst.h>
|
||||
}
|
||||
|
||||
bool grab_gst_syms( std::vector< std::string > const&);
|
||||
void ungrab_gst_syms();
|
||||
|
||||
#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) extern RTN (*ll##GSTSYM)(__VA_ARGS__);
|
||||
#include "llmediaimplgstreamer_syms_raw.inc"
|
||||
#undef LL_GST_SYM
|
||||
|
||||
// regrettable hacks to give us better runtime compatibility with older systems
|
||||
#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0)
|
||||
#define llg_return_val_if_fail(COND,V) do{if (!(COND)) return V;}while(0)
|
||||
|
||||
// regrettable hacks because GStreamer was not designed for runtime loading
|
||||
#undef GST_TYPE_MESSAGE
|
||||
#define GST_TYPE_MESSAGE (llgst_message_get_type())
|
||||
#undef GST_TYPE_OBJECT
|
||||
#define GST_TYPE_OBJECT (llgst_object_get_type())
|
||||
#undef GST_TYPE_PIPELINE
|
||||
#define GST_TYPE_PIPELINE (llgst_pipeline_get_type())
|
||||
#undef GST_TYPE_ELEMENT
|
||||
#define GST_TYPE_ELEMENT (llgst_element_get_type())
|
||||
#undef GST_TYPE_VIDEO_SINK
|
||||
#define GST_TYPE_VIDEO_SINK (llgst_video_sink_get_type())
|
||||
// more regrettable hacks to stub-out these .h-exposed GStreamer internals
|
||||
void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname);
|
||||
#undef _gst_debug_register_funcptr
|
||||
#define _gst_debug_register_funcptr ll_gst_debug_register_funcptr
|
||||
GstDebugCategory* ll_gst_debug_category_new(gchar *name, guint color, gchar *description);
|
||||
#undef _gst_debug_category_new
|
||||
#define _gst_debug_category_new ll_gst_debug_category_new
|
||||
#undef __gst_debug_enabled
|
||||
#define __gst_debug_enabled (0)
|
||||
|
||||
// more hacks
|
||||
#define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M)))
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
LL_GST_SYM(true, gst_buffer_new, GstBuffer*, void)
|
||||
LL_GST_SYM(true, gst_structure_set_value, void, GstStructure *, const gchar *, const GValue*)
|
||||
LL_GST_SYM(true, gst_init_check, gboolean, int *argc, char **argv[], GError ** err)
|
||||
LL_GST_SYM(true, gst_message_get_type, GType, void)
|
||||
LL_GST_SYM(true, gst_message_type_get_name, const gchar*, GstMessageType type)
|
||||
LL_GST_SYM(true, gst_message_parse_error, void, GstMessage *message, GError **gerror, gchar **debug)
|
||||
LL_GST_SYM(true, gst_message_parse_warning, void, GstMessage *message, GError **gerror, gchar **debug)
|
||||
LL_GST_SYM(true, gst_message_parse_state_changed, void, GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending)
|
||||
LL_GST_SYM(true, gst_element_set_state, GstStateChangeReturn, GstElement *element, GstState state)
|
||||
LL_GST_SYM(true, gst_object_unref, void, gpointer object)
|
||||
LL_GST_SYM(true, gst_object_get_type, GType, void)
|
||||
LL_GST_SYM(true, gst_pipeline_get_type, GType, void)
|
||||
LL_GST_SYM(true, gst_pipeline_get_bus, GstBus*, GstPipeline *pipeline)
|
||||
LL_GST_SYM(true, gst_bus_add_watch, guint, GstBus * bus, GstBusFunc func, gpointer user_data)
|
||||
LL_GST_SYM(true, gst_element_factory_make, GstElement*, const gchar *factoryname, const gchar *name)
|
||||
LL_GST_SYM(true, gst_element_get_type, GType, void)
|
||||
LL_GST_SYM(true, gst_static_pad_template_get, GstPadTemplate*, GstStaticPadTemplate *pad_template)
|
||||
LL_GST_SYM(true, gst_element_class_add_pad_template, void, GstElementClass *klass, GstPadTemplate *temp)
|
||||
LL_GST_SYM(true, gst_caps_from_string, GstCaps *, const gchar *string)
|
||||
LL_GST_SYM(true, gst_caps_get_structure, GstStructure *, const GstCaps *caps, guint index)
|
||||
LL_GST_SYM(true, gst_element_register, gboolean, GstPlugin *plugin, const gchar *name, guint rank, GType type)
|
||||
LL_GST_SYM(true, gst_structure_get_int, gboolean, const GstStructure *structure, const gchar *fieldname, gint *value)
|
||||
LL_GST_SYM(true, gst_structure_get_value, G_CONST_RETURN GValue *, const GstStructure *structure, const gchar *fieldname)
|
||||
LL_GST_SYM(true, gst_value_get_fraction_numerator, gint, const GValue *value)
|
||||
LL_GST_SYM(true, gst_value_get_fraction_denominator, gint, const GValue *value)
|
||||
LL_GST_SYM(true, gst_structure_get_name, G_CONST_RETURN gchar *, const GstStructure *structure)
|
||||
LL_GST_SYM(true, gst_element_seek, bool, GstElement *, gdouble, GstFormat, GstSeekFlags, GstSeekType, gint64, GstSeekType, gint64)
|
||||
|
||||
LL_GST_SYM(false, gst_registry_fork_set_enabled, void, gboolean enabled)
|
||||
LL_GST_SYM(false, gst_segtrap_set_enabled, void, gboolean enabled)
|
||||
LL_GST_SYM(false, gst_message_parse_buffering, void, GstMessage *message, gint *percent)
|
||||
LL_GST_SYM(false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug)
|
||||
LL_GST_SYM(false, gst_element_query_position, gboolean, GstElement *element, GstFormat *format, gint64 *cur)
|
||||
LL_GST_SYM(false, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano)
|
||||
|
||||
LL_GST_SYM( true, gst_message_parse_tag, void, GstMessage *, GstTagList **)
|
||||
LL_GST_SYM( true, gst_tag_list_foreach, void, const GstTagList *, GstTagForeachFunc, gpointer)
|
||||
LL_GST_SYM( true, gst_tag_list_get_tag_size, guint, const GstTagList *, const gchar *)
|
||||
LL_GST_SYM( true, gst_tag_list_get_value_index, const GValue *, const GstTagList *, const gchar *, guint)
|
||||
|
||||
LL_GST_SYM( true, gst_caps_new_simple, GstCaps*, const char *, const char*, ... )
|
||||
|
||||
LL_GST_SYM( true, gst_sample_get_caps, GstCaps*, GstSample* )
|
||||
LL_GST_SYM( true, gst_sample_get_buffer, GstBuffer*, GstSample* )
|
||||
LL_GST_SYM( true, gst_buffer_map, gboolean, GstBuffer*, GstMapInfo*, GstMapFlags )
|
||||
LL_GST_SYM( true, gst_buffer_unmap, void, GstBuffer*, GstMapInfo* )
|
||||
|
||||
LL_GST_SYM( true, gst_app_sink_set_caps, void, GstAppSink*, GstCaps const* )
|
||||
LL_GST_SYM( true, gst_app_sink_pull_sample, GstSample*, GstAppSink* )
|
||||
|
||||
LL_GST_SYM( true, g_free, void, gpointer )
|
||||
LL_GST_SYM( true, g_error_free, void, GError* )
|
||||
|
||||
LL_GST_SYM( true, g_main_context_pending, gboolean, GMainContext* )
|
||||
LL_GST_SYM( true, g_main_loop_get_context, GMainContext*, GMainLoop* )
|
||||
LL_GST_SYM( true, g_main_context_iteration, gboolean, GMainContext*, gboolean )
|
||||
LL_GST_SYM( true, g_main_loop_new, GMainLoop*, GMainContext*, gboolean )
|
||||
LL_GST_SYM( true, g_main_loop_quit, void, GMainLoop* )
|
||||
LL_GST_SYM( true, gst_mini_object_unref, void, GstMiniObject* )
|
||||
LL_GST_SYM( true, g_object_set, void, gpointer, gchar const*, ... )
|
||||
LL_GST_SYM( true, g_source_remove, gboolean, guint )
|
||||
LL_GST_SYM( true, g_value_get_string, gchar const*, GValue const* )
|
||||
|
||||
|
||||
LL_GST_SYM( true, gst_debug_set_active, void, gboolean )
|
||||
LL_GST_SYM( true, gst_debug_add_log_function, void, GstLogFunction, gpointer, GDestroyNotify )
|
||||
LL_GST_SYM( true, gst_debug_set_default_threshold, void, GstDebugLevel )
|
||||
LL_GST_SYM( true, gst_debug_message_get , gchar const*, GstDebugMessage * )
|
||||
|
|
@ -1,980 +0,0 @@
|
|||
/**
|
||||
* @file media_plugin_gstreamer10.cpp
|
||||
* @brief GStreamer-1.0 plugin for LLMedia API plugin system
|
||||
*
|
||||
* @cond
|
||||
* $LicenseInfo:firstyear=2016&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2016, Linden Research, Inc. / Nicky Dasmijn
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
#define FLIP_Y
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llgl.h"
|
||||
|
||||
#include "llplugininstance.h"
|
||||
#include "llpluginmessage.h"
|
||||
#include "llpluginmessageclasses.h"
|
||||
#include "media_plugin_base.h"
|
||||
|
||||
#define G_DISABLE_CAST_CHECKS
|
||||
extern "C" {
|
||||
#include <gst/gst.h>
|
||||
#include <gst/app/gstappsink.h>
|
||||
|
||||
}
|
||||
|
||||
#include "llmediaimplgstreamer.h"
|
||||
#include "llmediaimplgstreamer_syms.h"
|
||||
|
||||
static inline void llgst_caps_unref( GstCaps * caps )
|
||||
{
|
||||
llgst_mini_object_unref( GST_MINI_OBJECT_CAST( caps ) );
|
||||
}
|
||||
|
||||
static inline void llgst_sample_unref( GstSample *aSample )
|
||||
{
|
||||
llgst_mini_object_unref( GST_MINI_OBJECT_CAST( aSample ) );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class MediaPluginGStreamer10 : public MediaPluginBase
|
||||
{
|
||||
public:
|
||||
MediaPluginGStreamer10(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data);
|
||||
~MediaPluginGStreamer10();
|
||||
|
||||
/* virtual */ void receiveMessage(const char *message_string);
|
||||
|
||||
static bool startup();
|
||||
static bool closedown();
|
||||
|
||||
gboolean processGSTEvents(GstBus *bus, GstMessage *message);
|
||||
|
||||
private:
|
||||
std::string getVersion();
|
||||
bool navigateTo( const std::string urlIn );
|
||||
bool seek( double time_sec );
|
||||
bool setVolume( float volume );
|
||||
|
||||
// misc
|
||||
bool pause();
|
||||
bool stop();
|
||||
bool play(double rate);
|
||||
bool getTimePos(double &sec_out);
|
||||
|
||||
double MIN_LOOP_SEC = 1.0F;
|
||||
U32 INTERNAL_TEXTURE_SIZE = 1024;
|
||||
|
||||
bool mIsLooping;
|
||||
|
||||
enum ECommand {
|
||||
COMMAND_NONE,
|
||||
COMMAND_STOP,
|
||||
COMMAND_PLAY,
|
||||
COMMAND_FAST_FORWARD,
|
||||
COMMAND_FAST_REWIND,
|
||||
COMMAND_PAUSE,
|
||||
COMMAND_SEEK,
|
||||
};
|
||||
ECommand mCommand;
|
||||
|
||||
private:
|
||||
bool unload();
|
||||
bool load();
|
||||
|
||||
bool update(int milliseconds);
|
||||
void mouseDown( int x, int y );
|
||||
void mouseUp( int x, int y );
|
||||
void mouseMove( int x, int y );
|
||||
|
||||
static bool mDoneInit;
|
||||
|
||||
guint mBusWatchID;
|
||||
|
||||
float mVolume;
|
||||
|
||||
int mDepth;
|
||||
|
||||
// padded texture size we need to write into
|
||||
int mTextureWidth;
|
||||
int mTextureHeight;
|
||||
|
||||
bool mSeekWanted;
|
||||
double mSeekDestination;
|
||||
|
||||
// Very GStreamer-specific
|
||||
GMainLoop *mPump; // event pump for this media
|
||||
GstElement *mPlaybin;
|
||||
GstAppSink *mAppSink;
|
||||
};
|
||||
|
||||
//static
|
||||
bool MediaPluginGStreamer10::mDoneInit = false;
|
||||
|
||||
MediaPluginGStreamer10::MediaPluginGStreamer10( LLPluginInstance::sendMessageFunction host_send_func,
|
||||
void *host_user_data )
|
||||
: MediaPluginBase(host_send_func, host_user_data)
|
||||
, mBusWatchID ( 0 )
|
||||
, mSeekWanted(false)
|
||||
, mSeekDestination(0.0)
|
||||
, mPump ( NULL )
|
||||
, mPlaybin ( NULL )
|
||||
, mAppSink ( NULL )
|
||||
, mCommand ( COMMAND_NONE )
|
||||
{
|
||||
}
|
||||
|
||||
gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *message)
|
||||
{
|
||||
if (!message)
|
||||
return TRUE; // shield against GStreamer bug
|
||||
|
||||
switch (GST_MESSAGE_TYPE (message))
|
||||
{
|
||||
case GST_MESSAGE_BUFFERING:
|
||||
{
|
||||
// NEEDS GST 0.10.11+
|
||||
if (llgst_message_parse_buffering)
|
||||
{
|
||||
gint percent = 0;
|
||||
llgst_message_parse_buffering(message, &percent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_MESSAGE_STATE_CHANGED:
|
||||
{
|
||||
GstState old_state;
|
||||
GstState new_state;
|
||||
GstState pending_state;
|
||||
llgst_message_parse_state_changed(message,
|
||||
&old_state,
|
||||
&new_state,
|
||||
&pending_state);
|
||||
|
||||
switch (new_state)
|
||||
{
|
||||
case GST_STATE_VOID_PENDING:
|
||||
break;
|
||||
case GST_STATE_NULL:
|
||||
break;
|
||||
case GST_STATE_READY:
|
||||
setStatus(STATUS_LOADED);
|
||||
break;
|
||||
case GST_STATE_PAUSED:
|
||||
setStatus(STATUS_PAUSED);
|
||||
break;
|
||||
case GST_STATE_PLAYING:
|
||||
setStatus(STATUS_PLAYING);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_MESSAGE_ERROR:
|
||||
{
|
||||
GError *err = NULL;
|
||||
gchar *debug = NULL;
|
||||
|
||||
llgst_message_parse_error (message, &err, &debug);
|
||||
if (err)
|
||||
llg_error_free (err);
|
||||
llg_free (debug);
|
||||
|
||||
mCommand = COMMAND_STOP;
|
||||
|
||||
setStatus(STATUS_ERROR);
|
||||
|
||||
break;
|
||||
}
|
||||
case GST_MESSAGE_INFO:
|
||||
{
|
||||
if (llgst_message_parse_info)
|
||||
{
|
||||
GError *err = NULL;
|
||||
gchar *debug = NULL;
|
||||
|
||||
llgst_message_parse_info (message, &err, &debug);
|
||||
if (err)
|
||||
llg_error_free (err);
|
||||
llg_free (debug);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_MESSAGE_WARNING:
|
||||
{
|
||||
GError *err = NULL;
|
||||
gchar *debug = NULL;
|
||||
|
||||
llgst_message_parse_warning (message, &err, &debug);
|
||||
if (err)
|
||||
llg_error_free (err);
|
||||
llg_free (debug);
|
||||
|
||||
break;
|
||||
}
|
||||
case GST_MESSAGE_EOS:
|
||||
/* end-of-stream */
|
||||
if (mIsLooping)
|
||||
{
|
||||
double eos_pos_sec = 0.0F;
|
||||
bool got_eos_position = getTimePos(eos_pos_sec);
|
||||
|
||||
if (got_eos_position && eos_pos_sec < MIN_LOOP_SEC)
|
||||
{
|
||||
// if we know that the movie is really short, don't
|
||||
// loop it else it can easily become a time-hog
|
||||
// because of GStreamer spin-up overhead
|
||||
// inject a COMMAND_PAUSE
|
||||
mCommand = COMMAND_PAUSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
stop();
|
||||
play(1.0);
|
||||
}
|
||||
}
|
||||
else // not a looping media
|
||||
{
|
||||
// inject a COMMAND_STOP
|
||||
mCommand = COMMAND_STOP;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* unhandled message */
|
||||
break;
|
||||
}
|
||||
|
||||
/* we want to be notified again the next time there is a message
|
||||
* on the bus, so return true (false means we want to stop watching
|
||||
* for messages on the bus and our callback should not be called again)
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
gboolean llmediaimplgstreamer_bus_callback (GstBus *bus,
|
||||
GstMessage *message,
|
||||
gpointer data)
|
||||
{
|
||||
MediaPluginGStreamer10 *impl = (MediaPluginGStreamer10*)data;
|
||||
return impl->processGSTEvents(bus, message);
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
|
||||
|
||||
bool MediaPluginGStreamer10::navigateTo ( const std::string urlIn )
|
||||
{
|
||||
if (!mDoneInit)
|
||||
return false; // error
|
||||
|
||||
setStatus(STATUS_LOADING);
|
||||
|
||||
mSeekWanted = false;
|
||||
|
||||
if (NULL == mPump || NULL == mPlaybin)
|
||||
{
|
||||
setStatus(STATUS_ERROR);
|
||||
return false; // error
|
||||
}
|
||||
|
||||
llg_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL);
|
||||
|
||||
// navigateTo implicitly plays, too.
|
||||
play(1.0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
class GstSampleUnref
|
||||
{
|
||||
GstSample *mT;
|
||||
public:
|
||||
GstSampleUnref( GstSample *aT )
|
||||
: mT( aT )
|
||||
{ llassert_always( mT ); }
|
||||
|
||||
~GstSampleUnref( )
|
||||
{ llgst_sample_unref( mT ); }
|
||||
};
|
||||
|
||||
bool MediaPluginGStreamer10::update(int milliseconds)
|
||||
{
|
||||
if (!mDoneInit)
|
||||
return false; // error
|
||||
|
||||
// DEBUGMSG("updating media...");
|
||||
|
||||
// sanity check
|
||||
if (NULL == mPump || NULL == mPlaybin)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// see if there's an outstanding seek wanted
|
||||
if (mSeekWanted &&
|
||||
// bleh, GST has to be happy that the movie is really truly playing
|
||||
// or it may quietly ignore the seek (with rtsp:// at least).
|
||||
(GST_STATE(mPlaybin) == GST_STATE_PLAYING))
|
||||
{
|
||||
seek(mSeekDestination);
|
||||
mSeekWanted = false;
|
||||
}
|
||||
|
||||
// *TODO: time-limit - but there isn't a lot we can do here, most
|
||||
// time is spent in gstreamer's own opaque worker-threads. maybe
|
||||
// we can do something sneaky like only unlock the video object
|
||||
// for 'milliseconds' and otherwise hold the lock.
|
||||
while (llg_main_context_pending(llg_main_loop_get_context(mPump)))
|
||||
{
|
||||
llg_main_context_iteration(llg_main_loop_get_context(mPump), FALSE);
|
||||
}
|
||||
|
||||
// check for availability of a new frame
|
||||
|
||||
if( !mAppSink )
|
||||
return true;
|
||||
|
||||
if( GST_STATE(mPlaybin) != GST_STATE_PLAYING) // Do not try to pull a sample if not in playing state
|
||||
return true;
|
||||
|
||||
GstSample *pSample = llgst_app_sink_pull_sample( mAppSink );
|
||||
if(!pSample)
|
||||
return false; // Done playing
|
||||
|
||||
GstSampleUnref oSampleUnref( pSample );
|
||||
GstCaps *pCaps = llgst_sample_get_caps ( pSample );
|
||||
if (!pCaps)
|
||||
return false;
|
||||
|
||||
gint width, height;
|
||||
GstStructure *pStruct = llgst_caps_get_structure ( pCaps, 0);
|
||||
|
||||
int res = llgst_structure_get_int ( pStruct, "width", &width);
|
||||
res |= llgst_structure_get_int ( pStruct, "height", &height);
|
||||
|
||||
if( !mPixels )
|
||||
return true;
|
||||
|
||||
GstBuffer *pBuffer = llgst_sample_get_buffer ( pSample );
|
||||
GstMapInfo map;
|
||||
llgst_buffer_map ( pBuffer, &map, GST_MAP_READ);
|
||||
|
||||
// Our render buffer is always 1kx1k
|
||||
|
||||
U32 rowSkip = INTERNAL_TEXTURE_SIZE / mTextureHeight;
|
||||
U32 colSkip = INTERNAL_TEXTURE_SIZE / mTextureWidth;
|
||||
|
||||
for (int row = 0; row < mTextureHeight; ++row)
|
||||
{
|
||||
U8 const *pTexelIn = map.data + (row*rowSkip * width *3);
|
||||
#ifndef FLIP_Y
|
||||
U8 *pTexelOut = mPixels + (row * mTextureWidth * mDepth );
|
||||
#else
|
||||
U8 *pTexelOut = mPixels + ((mTextureHeight-row-1) * mTextureWidth * mDepth );
|
||||
#endif
|
||||
for( int col = 0; col < mTextureWidth; ++col )
|
||||
{
|
||||
pTexelOut[ 0 ] = pTexelIn[0];
|
||||
pTexelOut[ 1 ] = pTexelIn[1];
|
||||
pTexelOut[ 2 ] = pTexelIn[2];
|
||||
pTexelOut += mDepth;
|
||||
pTexelIn += colSkip*3;
|
||||
}
|
||||
}
|
||||
|
||||
llgst_buffer_unmap( pBuffer, &map );
|
||||
setDirty(0,0,mTextureWidth,mTextureHeight);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MediaPluginGStreamer10::mouseDown( int x, int y )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void MediaPluginGStreamer10::mouseUp( int x, int y )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void MediaPluginGStreamer10::mouseMove( int x, int y )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
bool MediaPluginGStreamer10::pause()
|
||||
{
|
||||
// todo: error-check this?
|
||||
if (mDoneInit && mPlaybin)
|
||||
{
|
||||
llgst_element_set_state(mPlaybin, GST_STATE_PAUSED);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::stop()
|
||||
{
|
||||
// todo: error-check this?
|
||||
if (mDoneInit && mPlaybin)
|
||||
{
|
||||
llgst_element_set_state(mPlaybin, GST_STATE_READY);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::play(double rate)
|
||||
{
|
||||
// NOTE: we don't actually support non-natural rate.
|
||||
|
||||
// todo: error-check this?
|
||||
if (mDoneInit && mPlaybin)
|
||||
{
|
||||
llgst_element_set_state(mPlaybin, GST_STATE_PLAYING);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::setVolume( float volume )
|
||||
{
|
||||
// we try to only update volume as conservatively as
|
||||
// possible, as many gst-plugins-base versions up to at least
|
||||
// November 2008 have critical race-conditions in setting volume - sigh
|
||||
if (mVolume == volume)
|
||||
return true; // nothing to do, everything's fine
|
||||
|
||||
mVolume = volume;
|
||||
if (mDoneInit && mPlaybin)
|
||||
{
|
||||
llg_object_set(mPlaybin, "volume", mVolume, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::seek(double time_sec)
|
||||
{
|
||||
bool success = false;
|
||||
if (mDoneInit && mPlaybin)
|
||||
{
|
||||
success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
|
||||
GstSeekFlags(GST_SEEK_FLAG_FLUSH |
|
||||
GST_SEEK_FLAG_KEY_UNIT),
|
||||
GST_SEEK_TYPE_SET, gint64(time_sec*GST_SECOND),
|
||||
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::getTimePos(double &sec_out)
|
||||
{
|
||||
bool got_position = false;
|
||||
if (mDoneInit && mPlaybin)
|
||||
{
|
||||
gint64 pos(0);
|
||||
GstFormat timefmt = GST_FORMAT_TIME;
|
||||
got_position =
|
||||
llgst_element_query_position &&
|
||||
llgst_element_query_position(mPlaybin,
|
||||
&timefmt,
|
||||
&pos);
|
||||
got_position = got_position
|
||||
&& (timefmt == GST_FORMAT_TIME);
|
||||
// GStreamer may have other ideas, but we consider the current position
|
||||
// undefined if not PLAYING or PAUSED
|
||||
got_position = got_position &&
|
||||
(GST_STATE(mPlaybin) == GST_STATE_PLAYING ||
|
||||
GST_STATE(mPlaybin) == GST_STATE_PAUSED);
|
||||
if (got_position && !GST_CLOCK_TIME_IS_VALID(pos))
|
||||
{
|
||||
if (GST_STATE(mPlaybin) == GST_STATE_PLAYING)
|
||||
{
|
||||
// if we're playing then we treat an invalid clock time
|
||||
// as 0, for complicated reasons (insert reason here)
|
||||
pos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
got_position = false;
|
||||
}
|
||||
|
||||
}
|
||||
// If all the preconditions succeeded... we can trust the result.
|
||||
if (got_position)
|
||||
{
|
||||
sec_out = double(pos) / double(GST_SECOND); // gst to sec
|
||||
}
|
||||
}
|
||||
return got_position;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::load()
|
||||
{
|
||||
if (!mDoneInit)
|
||||
return false; // error
|
||||
|
||||
setStatus(STATUS_LOADING);
|
||||
|
||||
mIsLooping = false;
|
||||
mVolume = 0.1234567f; // minor hack to force an initial volume update
|
||||
|
||||
// Create a pumpable main-loop for this media
|
||||
mPump = llg_main_loop_new (NULL, FALSE);
|
||||
if (!mPump)
|
||||
{
|
||||
setStatus(STATUS_ERROR);
|
||||
return false; // error
|
||||
}
|
||||
|
||||
// instantiate a playbin element to do the hard work
|
||||
mPlaybin = llgst_element_factory_make ("playbin", "");
|
||||
if (!mPlaybin)
|
||||
{
|
||||
setStatus(STATUS_ERROR);
|
||||
return false; // error
|
||||
}
|
||||
|
||||
// get playbin's bus
|
||||
GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin));
|
||||
if (!bus)
|
||||
{
|
||||
setStatus(STATUS_ERROR);
|
||||
return false; // error
|
||||
}
|
||||
mBusWatchID = llgst_bus_add_watch (bus,
|
||||
llmediaimplgstreamer_bus_callback,
|
||||
this);
|
||||
llgst_object_unref (bus);
|
||||
|
||||
mAppSink = (GstAppSink*)(llgst_element_factory_make ("appsink", ""));
|
||||
|
||||
GstCaps* pCaps = llgst_caps_new_simple( "video/x-raw",
|
||||
"format", G_TYPE_STRING, "RGB",
|
||||
"width", G_TYPE_INT, INTERNAL_TEXTURE_SIZE,
|
||||
"height", G_TYPE_INT, INTERNAL_TEXTURE_SIZE,
|
||||
NULL );
|
||||
|
||||
llgst_app_sink_set_caps( mAppSink, pCaps );
|
||||
llgst_caps_unref( pCaps );
|
||||
|
||||
if (!mAppSink)
|
||||
{
|
||||
setStatus(STATUS_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
llg_object_set(mPlaybin, "video-sink", mAppSink, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MediaPluginGStreamer10::unload ()
|
||||
{
|
||||
if (!mDoneInit)
|
||||
return false; // error
|
||||
|
||||
// stop getting callbacks for this bus
|
||||
llg_source_remove(mBusWatchID);
|
||||
mBusWatchID = 0;
|
||||
|
||||
if (mPlaybin)
|
||||
{
|
||||
llgst_element_set_state (mPlaybin, GST_STATE_NULL);
|
||||
llgst_object_unref (GST_OBJECT (mPlaybin));
|
||||
mPlaybin = NULL;
|
||||
}
|
||||
|
||||
if (mPump)
|
||||
{
|
||||
llg_main_loop_quit(mPump);
|
||||
mPump = NULL;
|
||||
}
|
||||
|
||||
mAppSink = NULL;
|
||||
|
||||
setStatus(STATUS_NONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LogFunction(GstDebugCategory *category, GstDebugLevel level, const gchar *file, const gchar *function, gint line, GObject *object, GstDebugMessage *message, gpointer user_data )
|
||||
#ifndef LL_LINUX // Docu says we need G_GNUC_NO_INSTRUMENT, but GCC says 'error'
|
||||
G_GNUC_NO_INSTRUMENT
|
||||
#endif
|
||||
{
|
||||
#ifdef LL_LINUX
|
||||
std::cerr << file << ":" << line << "(" << function << "): " << llgst_debug_message_get( message ) << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
//static
|
||||
bool MediaPluginGStreamer10::startup()
|
||||
{
|
||||
// first - check if GStreamer is explicitly disabled
|
||||
if (NULL != getenv("LL_DISABLE_GSTREAMER"))
|
||||
return false;
|
||||
|
||||
// only do global GStreamer initialization once.
|
||||
if (!mDoneInit)
|
||||
{
|
||||
ll_init_apr();
|
||||
|
||||
// Get symbols!
|
||||
std::vector< std::string > vctDSONames;
|
||||
#if LL_DARWIN
|
||||
#elif LL_WINDOWS
|
||||
vctDSONames.push_back( "libgstreamer-1.0-0.dll" );
|
||||
vctDSONames.push_back( "libgstapp-1.0-0.dll" );
|
||||
vctDSONames.push_back( "libglib-2.0-0.dll" );
|
||||
vctDSONames.push_back( "libgobject-2.0-0.dll" );
|
||||
#else // linux or other ELFy unixoid
|
||||
vctDSONames.push_back( "libgstreamer-1.0.so.0" );
|
||||
vctDSONames.push_back( "libgstapp-1.0.so.0" );
|
||||
vctDSONames.push_back( "libglib-2.0.so.0" );
|
||||
vctDSONames.push_back( "libgobject-2.0.so" );
|
||||
#endif
|
||||
if( !grab_gst_syms( vctDSONames ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (llgst_segtrap_set_enabled)
|
||||
{
|
||||
llgst_segtrap_set_enabled(FALSE);
|
||||
}
|
||||
#if LL_LINUX
|
||||
// Gstreamer tries a fork during init, waitpid-ing on it,
|
||||
// which conflicts with any installed SIGCHLD handler...
|
||||
struct sigaction tmpact, oldact;
|
||||
if (llgst_registry_fork_set_enabled ) {
|
||||
// if we can disable SIGCHLD-using forking behaviour,
|
||||
// do it.
|
||||
llgst_registry_fork_set_enabled(false);
|
||||
}
|
||||
else {
|
||||
// else temporarily install default SIGCHLD handler
|
||||
// while GStreamer initialises
|
||||
tmpact.sa_handler = SIG_DFL;
|
||||
sigemptyset( &tmpact.sa_mask );
|
||||
tmpact.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGCHLD, &tmpact, &oldact);
|
||||
}
|
||||
#endif // LL_LINUX
|
||||
// Protect against GStreamer resetting the locale, yuck.
|
||||
static std::string saved_locale;
|
||||
saved_locale = setlocale(LC_ALL, NULL);
|
||||
|
||||
// _putenv_s( "GST_PLUGIN_PATH", "E:\\gstreamer\\1.0\\x86\\lib\\gstreamer-1.0" );
|
||||
|
||||
llgst_debug_set_default_threshold( GST_LEVEL_WARNING );
|
||||
llgst_debug_add_log_function( LogFunction, NULL, NULL );
|
||||
llgst_debug_set_active( false );
|
||||
|
||||
// finally, try to initialize GStreamer!
|
||||
GError *err = NULL;
|
||||
gboolean init_gst_success = llgst_init_check(NULL, NULL, &err);
|
||||
|
||||
// restore old locale
|
||||
setlocale(LC_ALL, saved_locale.c_str() );
|
||||
|
||||
#if LL_LINUX
|
||||
// restore old SIGCHLD handler
|
||||
if (!llgst_registry_fork_set_enabled)
|
||||
sigaction(SIGCHLD, &oldact, NULL);
|
||||
#endif // LL_LINUX
|
||||
|
||||
if (!init_gst_success) // fail
|
||||
{
|
||||
if (err)
|
||||
{
|
||||
llg_error_free(err);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
mDoneInit = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//static
|
||||
bool MediaPluginGStreamer10::closedown()
|
||||
{
|
||||
if (!mDoneInit)
|
||||
return false; // error
|
||||
|
||||
ungrab_gst_syms();
|
||||
|
||||
mDoneInit = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
MediaPluginGStreamer10::~MediaPluginGStreamer10()
|
||||
{
|
||||
closedown();
|
||||
}
|
||||
|
||||
|
||||
std::string MediaPluginGStreamer10::getVersion()
|
||||
{
|
||||
std::string plugin_version = "GStreamer10 media plugin, GStreamer version ";
|
||||
if (mDoneInit &&
|
||||
llgst_version)
|
||||
{
|
||||
guint major, minor, micro, nano;
|
||||
llgst_version(&major, &minor, µ, &nano);
|
||||
plugin_version += llformat("%u.%u.%u.%u (runtime), %u.%u.%u.%u (headers)", (unsigned int)major, (unsigned int)minor,
|
||||
(unsigned int)micro, (unsigned int)nano, (unsigned int)GST_VERSION_MAJOR, (unsigned int)GST_VERSION_MINOR,
|
||||
(unsigned int)GST_VERSION_MICRO, (unsigned int)GST_VERSION_NANO);
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin_version += "(unknown)";
|
||||
}
|
||||
return plugin_version;
|
||||
}
|
||||
|
||||
void MediaPluginGStreamer10::receiveMessage(const char *message_string)
|
||||
{
|
||||
LLPluginMessage message_in;
|
||||
|
||||
if(message_in.parse(message_string) >= 0)
|
||||
{
|
||||
std::string message_class = message_in.getClass();
|
||||
std::string message_name = message_in.getName();
|
||||
|
||||
if(message_class == LLPLUGIN_MESSAGE_CLASS_BASE)
|
||||
{
|
||||
if(message_name == "init")
|
||||
{
|
||||
LLPluginMessage message("base", "init_response");
|
||||
LLSD versions = LLSD::emptyMap();
|
||||
versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;
|
||||
versions[LLPLUGIN_MESSAGE_CLASS_MEDIA] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;
|
||||
versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME] = LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME_VERSION;
|
||||
message.setValueLLSD("versions", versions);
|
||||
|
||||
load();
|
||||
|
||||
message.setValue("plugin_version", getVersion());
|
||||
sendMessage(message);
|
||||
}
|
||||
else if(message_name == "idle")
|
||||
{
|
||||
// no response is necessary here.
|
||||
double time = message_in.getValueReal("time");
|
||||
|
||||
// Convert time to milliseconds for update()
|
||||
update((int)(time * 1000.0f));
|
||||
}
|
||||
else if(message_name == "cleanup")
|
||||
{
|
||||
unload();
|
||||
closedown();
|
||||
}
|
||||
else if(message_name == "shm_added")
|
||||
{
|
||||
SharedSegmentInfo info;
|
||||
info.mAddress = message_in.getValuePointer("address");
|
||||
info.mSize = (size_t)message_in.getValueS32("size");
|
||||
std::string name = message_in.getValue("name");
|
||||
|
||||
mSharedSegments.insert(SharedSegmentMap::value_type(name, info));
|
||||
}
|
||||
else if(message_name == "shm_remove")
|
||||
{
|
||||
std::string name = message_in.getValue("name");
|
||||
|
||||
SharedSegmentMap::iterator iter = mSharedSegments.find(name);
|
||||
if(iter != mSharedSegments.end())
|
||||
{
|
||||
if(mPixels == iter->second.mAddress)
|
||||
{
|
||||
// This is the currently active pixel buffer. Make sure we stop drawing to it.
|
||||
mPixels = NULL;
|
||||
mTextureSegmentName.clear();
|
||||
}
|
||||
mSharedSegments.erase(iter);
|
||||
}
|
||||
|
||||
// Send the response so it can be cleaned up.
|
||||
LLPluginMessage message("base", "shm_remove_response");
|
||||
message.setValue("name", name);
|
||||
sendMessage(message);
|
||||
}
|
||||
}
|
||||
else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA)
|
||||
{
|
||||
if(message_name == "init")
|
||||
{
|
||||
// Plugin gets to decide the texture parameters to use.
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params");
|
||||
// lame to have to decide this now, it depends on the movie. Oh well.
|
||||
mDepth = 4;
|
||||
|
||||
mTextureWidth = 1;
|
||||
mTextureHeight = 1;
|
||||
|
||||
message.setValueU32("format", GL_RGBA);
|
||||
message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV);
|
||||
|
||||
message.setValueS32("depth", mDepth);
|
||||
message.setValueS32("default_width", INTERNAL_TEXTURE_SIZE );
|
||||
message.setValueS32("default_height", INTERNAL_TEXTURE_SIZE );
|
||||
message.setValueU32("internalformat", GL_RGBA8);
|
||||
message.setValueBoolean("coords_opengl", true); // true == use OpenGL-style coordinates, false == (0,0) is upper left.
|
||||
message.setValueBoolean("allow_downsample", true); // we respond with grace and performance if asked to downscale
|
||||
sendMessage(message);
|
||||
}
|
||||
else if(message_name == "size_change")
|
||||
{
|
||||
std::string name = message_in.getValue("name");
|
||||
S32 width = message_in.getValueS32("width");
|
||||
S32 height = message_in.getValueS32("height");
|
||||
S32 texture_width = message_in.getValueS32("texture_width");
|
||||
S32 texture_height = message_in.getValueS32("texture_height");
|
||||
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response");
|
||||
message.setValue("name", name);
|
||||
message.setValueS32("width", width);
|
||||
message.setValueS32("height", height);
|
||||
message.setValueS32("texture_width", texture_width);
|
||||
message.setValueS32("texture_height", texture_height);
|
||||
sendMessage(message);
|
||||
|
||||
if(!name.empty())
|
||||
{
|
||||
// Find the shared memory region with this name
|
||||
SharedSegmentMap::iterator iter = mSharedSegments.find(name);
|
||||
if(iter != mSharedSegments.end())
|
||||
{
|
||||
mPixels = (unsigned char*)iter->second.mAddress;
|
||||
mTextureSegmentName = name;
|
||||
|
||||
mTextureWidth = texture_width;
|
||||
mTextureHeight = texture_height;
|
||||
memset( mPixels, 0, mTextureWidth*mTextureHeight*mDepth );
|
||||
}
|
||||
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request");
|
||||
message.setValue("name", mTextureSegmentName);
|
||||
message.setValueS32("width", INTERNAL_TEXTURE_SIZE );
|
||||
message.setValueS32("height", INTERNAL_TEXTURE_SIZE );
|
||||
sendMessage(message);
|
||||
|
||||
}
|
||||
}
|
||||
else if(message_name == "load_uri")
|
||||
{
|
||||
std::string uri = message_in.getValue("uri");
|
||||
navigateTo( uri );
|
||||
sendStatus();
|
||||
}
|
||||
else if(message_name == "mouse_event")
|
||||
{
|
||||
std::string event = message_in.getValue("event");
|
||||
S32 x = message_in.getValueS32("x");
|
||||
S32 y = message_in.getValueS32("y");
|
||||
|
||||
if(event == "down")
|
||||
{
|
||||
mouseDown(x, y);
|
||||
}
|
||||
else if(event == "up")
|
||||
{
|
||||
mouseUp(x, y);
|
||||
}
|
||||
else if(event == "move")
|
||||
{
|
||||
mouseMove(x, y);
|
||||
};
|
||||
};
|
||||
}
|
||||
else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME)
|
||||
{
|
||||
if(message_name == "stop")
|
||||
{
|
||||
stop();
|
||||
}
|
||||
else if(message_name == "start")
|
||||
{
|
||||
double rate = 0.0;
|
||||
if(message_in.hasValue("rate"))
|
||||
{
|
||||
rate = message_in.getValueReal("rate");
|
||||
}
|
||||
// NOTE: we don't actually support rate.
|
||||
play(rate);
|
||||
}
|
||||
else if(message_name == "pause")
|
||||
{
|
||||
pause();
|
||||
}
|
||||
else if(message_name == "seek")
|
||||
{
|
||||
double time = message_in.getValueReal("time");
|
||||
// defer the actual seek in case we haven't
|
||||
// really truly started yet in which case there
|
||||
// is nothing to seek upon
|
||||
mSeekWanted = true;
|
||||
mSeekDestination = time;
|
||||
}
|
||||
else if(message_name == "set_loop")
|
||||
{
|
||||
bool loop = message_in.getValueBoolean("loop");
|
||||
mIsLooping = loop;
|
||||
}
|
||||
else if(message_name == "set_volume")
|
||||
{
|
||||
double volume = message_in.getValueReal("volume");
|
||||
setVolume(volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data)
|
||||
{
|
||||
if( MediaPluginGStreamer10::startup() )
|
||||
{
|
||||
MediaPluginGStreamer10 *self = new MediaPluginGStreamer10(host_send_func, host_user_data);
|
||||
*plugin_send_func = MediaPluginGStreamer10::staticReceiveMessage;
|
||||
*plugin_user_data = (void*)self;
|
||||
|
||||
return 0; // okay
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1; // failed to init
|
||||
}
|
||||
}
|
||||
|
|
@ -2147,8 +2147,6 @@ if (WINDOWS)
|
|||
media_plugin_cef
|
||||
media_plugin_libvlc
|
||||
media_plugin_example
|
||||
media_plugin_gstreamer10
|
||||
winmm_shim
|
||||
windows-crash-logger
|
||||
)
|
||||
|
||||
|
|
@ -2400,7 +2398,6 @@ else (NOT ENABLE_MEDIA_PLUGINS)
|
|||
SLPlugin
|
||||
media_plugin_cef
|
||||
media_plugin_gstreamer010
|
||||
media_plugin_gstreamer10
|
||||
llcommon
|
||||
)
|
||||
endif (NOT ENABLE_MEDIA_PLUGINS)
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ void FSFloaterIMContainer::addFloater(LLFloater* floaterp,
|
|||
// Look for the first IM session to the left of this one
|
||||
while (--idxChiclet >= 0)
|
||||
{
|
||||
if (pChiclet = dynamic_cast<LLIMChiclet*>(pChicletPanel->getChiclet(idxChiclet)))
|
||||
if ((pChiclet = dynamic_cast<LLIMChiclet*>(pChicletPanel->getChiclet(idxChiclet))))
|
||||
{
|
||||
FSFloaterIM* pFloater = FSFloaterIM::findInstance(pChiclet->getSessionId());
|
||||
if (pFloater)
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ void FSFloaterWearableFavorites::onDoubleClick()
|
|||
if (get_is_item_worn(selected_item_id))
|
||||
{
|
||||
if ((item->getType() == LLAssetType::AT_CLOTHING && (!RlvActions::isRlvEnabled() || gRlvWearableLocks.canRemove(item))) ||
|
||||
(item->getType() == LLAssetType::AT_OBJECT) && (!RlvActions::isRlvEnabled() || gRlvAttachmentLocks.canDetach(item)))
|
||||
((item->getType() == LLAssetType::AT_OBJECT) && (!RlvActions::isRlvEnabled() || gRlvAttachmentLocks.canDetach(item))))
|
||||
{
|
||||
LLAppearanceMgr::instance().removeItemsFromAvatar(ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@
|
|||
#include "llviewercontrol.h"
|
||||
|
||||
#ifdef GROWL_HAS_LOG
|
||||
#if LL_WINDOWS
|
||||
#pragma comment(lib,"growl.lib")
|
||||
#endif
|
||||
void __cdecl GrowlLogSink( char const *aMessage, int aLevel )
|
||||
{
|
||||
LL_INFOS( "Growl" ) << aMessage << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@ on run (volumeName)
|
|||
set file_list to every file
|
||||
repeat with i in file_list
|
||||
if the name of i is "Applications" then
|
||||
set the position of i to {345, 125}
|
||||
set the position of i to {345, 200}
|
||||
else if the name of i ends with ".app" then
|
||||
set the position of i to {145, 125}
|
||||
set the position of i to {145, 200}
|
||||
else if the name of i is "LGPL License.txt" then
|
||||
set the position of i to {145, 225}
|
||||
set the position of i to {145, 400}
|
||||
set the extension hidden of i to true
|
||||
else if the name of i is "Vivox Acceptable Use Policy.txt" then
|
||||
set the position of i to {345, 225}
|
||||
set the position of i to {345, 400}
|
||||
set the extension hidden of i to true
|
||||
end if
|
||||
end repeat
|
||||
|
|
|
|||
|
|
@ -2012,10 +2012,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
|
|||
// F | T | skip av => slam focus
|
||||
// F | F | clamp focus then av
|
||||
bool fCamAvDistClamped, fCamAvDistLocked = false; float nCamAvDistLimitMin, nCamAvDistLimitMax;
|
||||
if (fCamAvDistClamped = RlvActions::getCameraAvatarDistanceLimits(nCamAvDistLimitMin, nCamAvDistLimitMax))
|
||||
if ((fCamAvDistClamped = RlvActions::getCameraAvatarDistanceLimits(nCamAvDistLimitMin, nCamAvDistLimitMax)))
|
||||
fCamAvDistLocked = nCamAvDistLimitMin == nCamAvDistLimitMax;
|
||||
bool fCamOriginDistClamped, fCamOriginDistLocked = false; float nCamOriginDistLimitMin, nCamOriginDistLimitMax;
|
||||
if (fCamOriginDistClamped = RlvActions::getCameraOriginDistanceLimits(nCamOriginDistLimitMin, nCamOriginDistLimitMax))
|
||||
if ((fCamOriginDistClamped = RlvActions::getCameraOriginDistanceLimits(nCamOriginDistLimitMin, nCamOriginDistLimitMax)))
|
||||
fCamOriginDistLocked = nCamOriginDistLimitMin == nCamOriginDistLimitMax;
|
||||
|
||||
// Check focus distance limits
|
||||
|
|
|
|||
|
|
@ -1596,13 +1596,13 @@ U32 LLInventoryFilter::getFilterSubStringCount() const
|
|||
|
||||
std::string::size_type LLInventoryFilter::getFilterSubStringPos(U32 index) const
|
||||
{
|
||||
if (index < 0 || index >= mSubStringMatchOffsets.size()) return std::string::npos;
|
||||
if (index >= mSubStringMatchOffsets.size()) return std::string::npos;
|
||||
return mSubStringMatchOffsets[index];
|
||||
}
|
||||
|
||||
std::string::size_type LLInventoryFilter::getFilterSubStringLen(U32 index) const
|
||||
{
|
||||
if (index < 0 || index >= mFilterSubStrings.size()) return 0;
|
||||
if (index >= mFilterSubStrings.size()) return 0;
|
||||
return mFilterSubStrings[index].size();
|
||||
}
|
||||
// </FS:Zi> Multi-substring inventory search
|
||||
|
|
|
|||
|
|
@ -178,33 +178,13 @@ std::string LLMIMETypes::widgetType(const std::string& mime_type)
|
|||
}
|
||||
}
|
||||
|
||||
// <FS:ND> Get the selected media impl, hardcoded for now. Can be quicktime/gstreamer/(vlc in the future) depending on OS and bitness
|
||||
std::string getStreamingPlugin()
|
||||
{
|
||||
#if defined( LL_LINUX ) || defined( LL_WINDOWS )
|
||||
return "media_plugin_libvlc";
|
||||
#else
|
||||
llassert_always( false );
|
||||
#endif
|
||||
}
|
||||
// </FS:ND>
|
||||
|
||||
// static
|
||||
std::string LLMIMETypes::implType(const std::string& mime_type)
|
||||
{
|
||||
mime_info_map_t::const_iterator it = sMap.find(mime_type);
|
||||
if (it != sMap.end())
|
||||
{
|
||||
// <FS:ND> Get the selected media impl, hardcoded for now. Can be quicktime/gstreamer/(vlc in the future) depending on OS and bitness
|
||||
|
||||
// return it->second.mImpl;
|
||||
std::string impl = it->second.mImpl;
|
||||
|
||||
if( impl == "media_plugin_streaming" )
|
||||
return getStreamingPlugin();
|
||||
|
||||
return impl;
|
||||
// </FS:ND>
|
||||
return it->second.mImpl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -519,7 +519,6 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4
|
|||
const U32 BEACON_VERTS = 256;
|
||||
F32 step;
|
||||
|
||||
LLVector3d pos_agent_3d = gAgent.getPositionGlobal(); // <FS:CR> FIRE-8234
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
|
||||
|
|
|
|||
|
|
@ -10512,7 +10512,9 @@ class LLEditTakeOff : public view_listener_t
|
|||
&& (gAgentWearables.getWearableCount(type) > 0))
|
||||
{
|
||||
// MULTI-WEARABLES: assuming user wanted to remove top shirt.
|
||||
U32 wearable_index = gAgentWearables.getWearableCount(type) - 1;
|
||||
//<FS:TS> Shut the compiler up about unsigned comparisons <0 or >0
|
||||
//U32 wearable_index = gAgentWearables.getWearableCount(type) - 1;
|
||||
S32 wearable_index = gAgentWearables.getWearableCount(type) - 1;
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-06-09 (RLVa-1.2.0g) | Added: RLVa-1.2.0g
|
||||
if ( (rlv_handler_t::isEnabled()) && (gRlvWearableLocks.hasLockedWearable(type)) )
|
||||
|
|
|
|||
|
|
@ -4542,7 +4542,7 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
|
|||
|
||||
LLCDMeshData res;
|
||||
LLCDResult retval;
|
||||
if (retval = LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh(&mesh, &res))
|
||||
if ((retval = LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh(&mesh, &res)))
|
||||
{
|
||||
LL_WARNS() << "ConvexDecomp Failed (generateSingleHullMeshFromMesh): " << retval << LL_ENDL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1769,7 +1769,7 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string:
|
|||
*pidxStart = std::string::npos; // Assume we won't find anything
|
||||
|
||||
// Extracts the last - matched - parenthesised text from the input string
|
||||
std::string::size_type idxIt, idxEnd; int cntLevel = 1;
|
||||
int idxIt; std::string::size_type idxEnd; int cntLevel = 1;
|
||||
if ((idxEnd = strText.find_last_of(')')) == std::string::npos)
|
||||
return std::string();
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</scheme>
|
||||
<scheme name="example">
|
||||
|
|
@ -144,6 +144,17 @@
|
|||
media_plugin_example
|
||||
</impl>
|
||||
</scheme>
|
||||
<scheme name="libvlc">
|
||||
<label name="libvlc_label">
|
||||
LibVLC supported media
|
||||
</label>
|
||||
<widgettype>
|
||||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</scheme>
|
||||
<mimetype name="blank">
|
||||
<label name="blank_label">
|
||||
- None -
|
||||
|
|
@ -174,7 +185,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/*">
|
||||
|
|
@ -185,7 +196,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="image/*">
|
||||
|
|
@ -207,7 +218,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/javascript">
|
||||
|
|
@ -229,7 +240,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/pdf">
|
||||
|
|
@ -306,7 +317,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/mpeg">
|
||||
|
|
@ -317,7 +328,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/x-aiff">
|
||||
|
|
@ -328,7 +339,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/x-wav">
|
||||
|
|
@ -339,7 +350,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="image/bmp">
|
||||
|
|
@ -449,7 +460,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/mp4">
|
||||
|
|
@ -460,7 +471,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/octet-stream">
|
||||
|
|
@ -471,7 +482,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/quicktime">
|
||||
|
|
@ -482,7 +493,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/x-ms-asf">
|
||||
|
|
@ -493,7 +504,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/x-ms-wmv">
|
||||
|
|
@ -504,7 +515,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_cef
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/x-msvideo">
|
||||
|
|
@ -515,7 +526,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
</mimetypes>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</scheme>
|
||||
<mimetype name="blank">
|
||||
|
|
@ -163,7 +163,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/*">
|
||||
|
|
@ -174,7 +174,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="image/*">
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/javascript">
|
||||
|
|
@ -218,7 +218,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="application/pdf">
|
||||
|
|
@ -295,7 +295,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/mpeg">
|
||||
|
|
@ -306,7 +306,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/x-aiff">
|
||||
|
|
@ -317,7 +317,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="audio/x-wav">
|
||||
|
|
@ -328,7 +328,7 @@
|
|||
audio
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="image/bmp">
|
||||
|
|
@ -438,7 +438,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/mp4">
|
||||
|
|
@ -449,7 +449,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/quicktime">
|
||||
|
|
@ -460,7 +460,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/x-ms-asf">
|
||||
|
|
@ -471,7 +471,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype name="video/x-ms-wmv">
|
||||
|
|
@ -482,7 +482,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/x-msvideo">
|
||||
|
|
@ -493,7 +493,7 @@
|
|||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_streaming
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
</mimetypes>
|
||||
|
|
|
|||
|
|
@ -261,10 +261,15 @@ class ViewerManifest(LLManifest,FSViewerManifest):
|
|||
channel_type='release'
|
||||
elif channel_qualifier.startswith('beta'):
|
||||
channel_type='beta'
|
||||
elif channel_qualifier.startswith('project'):
|
||||
channel_type='project'
|
||||
#<FS:TS> Use our more-or-less-standard channel types instead of LL's
|
||||
#elif channel_qualifier.startswith('project'):
|
||||
# channel_type='project'
|
||||
#else:
|
||||
# channel_type='test'
|
||||
elif channel_qualifier.startswith('nightly'):
|
||||
channel_type='nightly'
|
||||
else:
|
||||
channel_type='test'
|
||||
channel_type='private'
|
||||
return channel_type
|
||||
|
||||
def channel_variant_app_suffix(self):
|
||||
|
|
@ -275,7 +280,8 @@ class ViewerManifest(LLManifest,FSViewerManifest):
|
|||
suffix=suffix.replace('Release', '').strip()
|
||||
# for the base release viewer, suffix will now be null - for any other, append what remains
|
||||
if len(suffix) > 0:
|
||||
suffix = "_"+ ("_".join(suffix.split()))
|
||||
#suffix = "_"+ ("_".join(suffix.split()))
|
||||
suffix = "_".join(suffix.split())
|
||||
# the additional_packages mechanism adds more to the installer name (but not to the app name itself)
|
||||
if 'channel_suffix' in self.args and self.args['channel_suffix']:
|
||||
suffix+='_'+("_".join(self.args['channel_suffix'].split()))
|
||||
|
|
@ -284,8 +290,13 @@ class ViewerManifest(LLManifest,FSViewerManifest):
|
|||
def installer_base_name(self):
|
||||
global CHANNEL_VENDOR_BASE
|
||||
# a standard map of strings for replacing in the templates
|
||||
#<FS:TS> tag "OS" after CHANNEL_VENDOR_BASE and before any suffix
|
||||
channel_base = "Phoenix-" + CHANNEL_VENDOR_BASE
|
||||
if self.fs_flavor() == 'oss':
|
||||
channel_base = channel_base + "OS"
|
||||
#</FS:TS>
|
||||
substitution_strings = {
|
||||
'channel_vendor_base' : '_'.join(CHANNEL_VENDOR_BASE.split()),
|
||||
'channel_vendor_base' : '_'.join(channel_base.split()),
|
||||
'channel_variant_underscores':self.channel_variant_app_suffix(),
|
||||
'version_underscores' : '_'.join(self.args['version']),
|
||||
'arch':self.args['arch']
|
||||
|
|
@ -683,10 +694,6 @@ class WindowsManifest(ViewerManifest):
|
|||
if self.channel_type() != 'release':
|
||||
with self.prefix(src='../media_plugins/example/%s' % self.args['configuration'], dst="llplugin"):
|
||||
self.path("media_plugin_example.dll")
|
||||
|
||||
# Media plugins - GStreamer
|
||||
with self.prefix(src='../media_plugins/gstreamer10/%s' % self.args['configuration'], dst="llplugin"):
|
||||
self.path("media_plugin_gstreamer10.dll")
|
||||
|
||||
# CEF runtime files - debug
|
||||
# CEF runtime files - not debug (release, relwithdebinfo etc.)
|
||||
|
|
@ -1708,21 +1715,52 @@ class DarwinManifest(ViewerManifest):
|
|||
# one for release candidate and one for first look. Any other channels
|
||||
# will use the release .DS_Store, and will look broken.
|
||||
# - Ambroff 2008-08-20
|
||||
#<FS:TS> Select proper directory based on flavor and build type
|
||||
dmg_template_prefix = 'firestorm'
|
||||
if self.fs_flavor() == 'oss':
|
||||
dmg_template_prefix = 'firestormos'
|
||||
dmg_template = os.path.join(
|
||||
'installers', 'darwin', '%s-dmg' % self.channel_type())
|
||||
'installers', 'darwin', '%s-%s-dmg' % (dmg_template_prefix, self.channel_type()))
|
||||
print "Trying template directory", dmg_template
|
||||
|
||||
if not os.path.exists (self.src_path_of(dmg_template)):
|
||||
dmg_template = os.path.join ('installers', 'darwin', 'release-dmg')
|
||||
print "Not found, trying template directory", dmg_template
|
||||
|
||||
for s,d in {self.get_dst_prefix():app_name + ".app",
|
||||
os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns",
|
||||
os.path.join(dmg_template, "background.jpg"): "background.jpg",
|
||||
#os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns",
|
||||
os.path.join(dmg_template, "background.png"): "background.png",
|
||||
os.path.join(dmg_template, "LGPL-license.txt"): "LGPL License.txt",
|
||||
os.path.join(dmg_template, "VivoxAUP.txt"): "Vivox Acceptable Use Policy.txt",
|
||||
os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items():
|
||||
print "Copying to dmg", s, d
|
||||
self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
|
||||
|
||||
# <FS:TS> The next two commands *MUST* execute before the loop
|
||||
# that hides the files. If not, packaging will fail.
|
||||
# YOU HAVE BEEN WARNED.
|
||||
# Create the alias file (which is a resource file) from the .r
|
||||
self.run_command(
|
||||
['Rez', self.src_path_of("%s/Applications-alias.r" % dmg_template),
|
||||
'-o', os.path.join(volpath, "Applications")])
|
||||
|
||||
# Set up the installer disk image: set icon positions, folder view
|
||||
# options, and icon label colors. This must be done before the
|
||||
# files are hidden.
|
||||
self.run_command(
|
||||
['osascript',
|
||||
self.src_path_of("installers/darwin/installer-dmg.applescript"),
|
||||
volname])
|
||||
|
||||
# <FS:TS> ARGH! osascript clobbers the volume icon file, for no
|
||||
# reason I can find anywhere. So we need to copy it after
|
||||
# running the script to set everything else up.
|
||||
print "Copying volume icon to dmg"
|
||||
self.copy_action(self.src_path_of(os.path.join(dmg_template, "_VolumeIcon.icns")),
|
||||
os.path.join(volpath, ".VolumeIcon.icns"))
|
||||
|
||||
# Hide the background image, DS_Store file, and volume icon file (set their "visible" bit)
|
||||
for f in ".VolumeIcon.icns", "background.jpg", ".DS_Store":
|
||||
for f in ".VolumeIcon.icns", "background.png", ".DS_Store":
|
||||
pathname = os.path.join(volpath, f)
|
||||
# We've observed mysterious "no such file" failures of the SetFile
|
||||
# command, especially on the first file listed above -- yet
|
||||
|
|
@ -1741,11 +1779,6 @@ class DarwinManifest(ViewerManifest):
|
|||
# the original problem manifest by executing the desired command.
|
||||
self.run_command(['SetFile', '-a', 'V', pathname])
|
||||
|
||||
# Create the alias file (which is a resource file) from the .r
|
||||
self.run_command(
|
||||
['Rez', self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"),
|
||||
'-o', os.path.join(volpath, "Applications")])
|
||||
|
||||
# Set the alias file's alias and custom icon bits
|
||||
self.run_command(['SetFile', '-a', 'AC', os.path.join(volpath, "Applications")])
|
||||
|
||||
|
|
|
|||
|
|
@ -344,8 +344,14 @@ if [ \( $WANTS_CLEAN -eq $TRUE \) -a \( $WANTS_BUILD -eq $FALSE \) ] ; then
|
|||
pushd ..
|
||||
|
||||
if [ $PLATFORM == "darwin" ] ; then
|
||||
rm -rf build-darwin-i386/*
|
||||
mkdir -p build-darwin-i386/logs
|
||||
if [ "${AUTOBUILD_ADDRSIZE}" == "64" ]
|
||||
then
|
||||
rm -rf build-darwin-x86_64/*
|
||||
mkdir -p build-darwin-x86_64/logs
|
||||
else
|
||||
rm -rf build-darwin-i386/*
|
||||
mkdir -p build-darwin-i386/logs
|
||||
fi
|
||||
|
||||
elif [ $PLATFORM == "win32" ] ; then
|
||||
rm -rf build-vc120-${AUTOBUILD_ADDRSIZE}
|
||||
|
|
|
|||
Loading…
Reference in New Issue