diff options
author | Merov Linden <merov@lindenlab.com> | 2013-10-14 16:30:08 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-10-14 16:30:08 -0700 |
commit | c2f5365f986aab49d5c7cfa2834a68f5b35c09c2 (patch) | |
tree | 4cbbf7bd730ad0ad3aa00569c4364dad51de6082 /indra/media_plugins/webkit | |
parent | 0cf0efb6e31d505bc079f757fe7d832110797199 (diff) | |
parent | f7158bc5afcec1da8b9d2d5a4ed86921e62d4959 (diff) |
Pull merge from lindenlab/viewer-release
Diffstat (limited to 'indra/media_plugins/webkit')
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/CMakeLists.txt | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/dummy_volume_catcher.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/linux_volume_catcher.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/linux_volume_catcher_pa_syms.inc | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/linux_volume_catcher_paglib_syms.inc | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/mac_volume_catcher.cpp | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/media_plugin_webkit.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/volume_catcher.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/media_plugins/webkit/windows_volume_catcher.cpp | 52 |
9 files changed, 52 insertions, 13 deletions
diff --git a/indra/media_plugins/webkit/CMakeLists.txt b/indra/media_plugins/webkit/CMakeLists.txt index b36291f0e8..0c1c3d800e 100644..100755 --- a/indra/media_plugins/webkit/CMakeLists.txt +++ b/indra/media_plugins/webkit/CMakeLists.txt @@ -13,7 +13,7 @@ include(UI) include(Linking) include(PluginAPI) include(MediaPluginBase) -include(FindOpenGL) +include(OpenGL) include(PulseAudio) include(WebKitLibPlugin) @@ -29,6 +29,9 @@ include_directories( ${LLWINDOW_INCLUDE_DIRS} ${LLQTWEBKIT_INCLUDE_DIR} ) +include_directories(SYSTEM + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} + ) ### media_plugin_webkit diff --git a/indra/media_plugins/webkit/dummy_volume_catcher.cpp b/indra/media_plugins/webkit/dummy_volume_catcher.cpp index d54b31b2ae..d54b31b2ae 100644..100755 --- a/indra/media_plugins/webkit/dummy_volume_catcher.cpp +++ b/indra/media_plugins/webkit/dummy_volume_catcher.cpp diff --git a/indra/media_plugins/webkit/linux_volume_catcher.cpp b/indra/media_plugins/webkit/linux_volume_catcher.cpp index 91be3a89e9..91be3a89e9 100644..100755 --- a/indra/media_plugins/webkit/linux_volume_catcher.cpp +++ b/indra/media_plugins/webkit/linux_volume_catcher.cpp diff --git a/indra/media_plugins/webkit/linux_volume_catcher_pa_syms.inc b/indra/media_plugins/webkit/linux_volume_catcher_pa_syms.inc index d806b48428..d806b48428 100644..100755 --- a/indra/media_plugins/webkit/linux_volume_catcher_pa_syms.inc +++ b/indra/media_plugins/webkit/linux_volume_catcher_pa_syms.inc diff --git a/indra/media_plugins/webkit/linux_volume_catcher_paglib_syms.inc b/indra/media_plugins/webkit/linux_volume_catcher_paglib_syms.inc index abf628c96c..abf628c96c 100644..100755 --- a/indra/media_plugins/webkit/linux_volume_catcher_paglib_syms.inc +++ b/indra/media_plugins/webkit/linux_volume_catcher_paglib_syms.inc diff --git a/indra/media_plugins/webkit/mac_volume_catcher.cpp b/indra/media_plugins/webkit/mac_volume_catcher.cpp index 8a06bb8487..cc94556413 100644..100755 --- a/indra/media_plugins/webkit/mac_volume_catcher.cpp +++ b/indra/media_plugins/webkit/mac_volume_catcher.cpp @@ -35,10 +35,13 @@ #include "volume_catcher.h" -#include <Carbon/Carbon.h> #include <QuickTime/QuickTime.h> #include <AudioUnit/AudioUnit.h> +#if LL_DARWIN +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + struct VolumeCatcherStorage; class VolumeCatcherImpl @@ -266,3 +269,6 @@ void VolumeCatcher::pump() // No periodic tasks are necessary for this implementation. } +#if LL_DARWIN +#pragma GCC diagnostic warning "-Wdeprecated-declarations" +#endif diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 1812abd7d5..1812abd7d5 100644..100755 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp diff --git a/indra/media_plugins/webkit/volume_catcher.h b/indra/media_plugins/webkit/volume_catcher.h index 337f2913d3..337f2913d3 100644..100755 --- a/indra/media_plugins/webkit/volume_catcher.h +++ b/indra/media_plugins/webkit/volume_catcher.h diff --git a/indra/media_plugins/webkit/windows_volume_catcher.cpp b/indra/media_plugins/webkit/windows_volume_catcher.cpp index 5fb84756ee..0cfb810906 100644..100755 --- a/indra/media_plugins/webkit/windows_volume_catcher.cpp +++ b/indra/media_plugins/webkit/windows_volume_catcher.cpp @@ -48,18 +48,37 @@ private: set_volume_func_t mSetVolumeFunc; set_mute_func_t mSetMuteFunc; + // tests if running on Vista, 7, 8 + once in CTOR + bool isWindowsVistaOrHigher(); + F32 mVolume; F32 mPan; + bool mSystemIsVistaOrHigher; }; + +bool VolumeCatcherImpl::isWindowsVistaOrHigher() +{ + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + return osvi.dwMajorVersion >= 6; +} + VolumeCatcherImpl::VolumeCatcherImpl() -: mVolume(1.0f), // default volume is max - mPan(0.f) // default pan is centered +: mVolume(1.0f), // default volume is max + mPan(0.f) // default pan is centered { - HMODULE handle = ::LoadLibrary(L"winmm.dll"); - if(handle) + mSystemIsVistaOrHigher = isWindowsVistaOrHigher(); + + if ( ! mSystemIsVistaOrHigher ) { - mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume"); - mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute"); + HMODULE handle = ::LoadLibrary(L"winmm.dll"); + if(handle) + { + mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume"); + mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute"); + } } } @@ -67,18 +86,29 @@ VolumeCatcherImpl::~VolumeCatcherImpl() { } - void VolumeCatcherImpl::setVolume(F32 volume) { mVolume = volume; - if (mSetMuteFunc) + if ( mSystemIsVistaOrHigher ) { - mSetMuteFunc(volume == 0.f); + // set both left/right to same volume + // TODO: use pan value to set independently + DWORD left_channel = (DWORD)(mVolume * 65535.0f); + DWORD right_channel = (DWORD)(mVolume * 65535.0f); + DWORD hw_volume = left_channel << 16 | right_channel; + ::waveOutSetVolume(NULL, hw_volume); } - if (mSetVolumeFunc) + else { - mSetVolumeFunc(mVolume); + if (mSetMuteFunc) + { + mSetMuteFunc(volume == 0.f); + } + if (mSetVolumeFunc) + { + mSetVolumeFunc(mVolume); + } } } |