summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/base/media_plugin_base.cpp58
-rw-r--r--indra/media_plugins/base/media_plugin_base.h46
-rw-r--r--indra/media_plugins/example/media_plugin_example.cpp2
-rw-r--r--indra/media_plugins/gstreamer010/CMakeLists.txt4
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamer.h2
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp2
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h2
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h2
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp2
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h2
-rw-r--r--indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp2
-rw-r--r--indra/media_plugins/quicktime/media_plugin_quicktime.cpp2
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp13
13 files changed, 123 insertions, 16 deletions
diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp
index 6acac07423..658783e064 100644
--- a/indra/media_plugins/base/media_plugin_base.cpp
+++ b/indra/media_plugins/base/media_plugin_base.cpp
@@ -2,6 +2,9 @@
* @file media_plugin_base.cpp
* @brief Media plugin base class for LLMedia API plugin system
*
+ * All plugins should be a subclass of MediaPluginBase.
+ *
+ * @cond
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2008, Linden Research, Inc.
@@ -27,6 +30,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "linden_common.h"
@@ -35,7 +39,10 @@
// TODO: Make sure that the only symbol exported from this library is LLPluginInitEntryPoint
////////////////////////////////////////////////////////////////////////////////
-//
+/// Media plugin constructor.
+///
+/// @param[in] host_send_func Function for sending messages from plugin to plugin loader shell
+/// @param[in] host_user_data Message data for messages from plugin to plugin loader shell
MediaPluginBase::MediaPluginBase(
LLPluginInstance::sendMessageFunction host_send_func,
@@ -53,6 +60,12 @@ MediaPluginBase::MediaPluginBase(
mStatus = STATUS_NONE;
}
+/**
+ * Converts current media status enum value into string (STATUS_LOADING into "loading", etc.)
+ *
+ * @return Media status string ("loading", "playing", "paused", etc)
+ *
+ */
std::string MediaPluginBase::statusString()
{
std::string result;
@@ -73,6 +86,12 @@ std::string MediaPluginBase::statusString()
return result;
}
+/**
+ * Set media status.
+ *
+ * @param[in] status Media status (STATUS_LOADING, STATUS_PLAYING, STATUS_PAUSED, etc)
+ *
+ */
void MediaPluginBase::setStatus(EStatus status)
{
if(mStatus != status)
@@ -83,6 +102,13 @@ void MediaPluginBase::setStatus(EStatus status)
}
+/**
+ * Receive message from plugin loader shell.
+ *
+ * @param[in] message_string Message string
+ * @param[in] user_data Message data
+ *
+ */
void MediaPluginBase::staticReceiveMessage(const char *message_string, void **user_data)
{
MediaPluginBase *self = (MediaPluginBase*)*user_data;
@@ -100,12 +126,27 @@ void MediaPluginBase::staticReceiveMessage(const char *message_string, void **us
}
}
+/**
+ * Send message to plugin loader shell.
+ *
+ * @param[in] message Message data being sent to plugin loader shell
+ *
+ */
void MediaPluginBase::sendMessage(const LLPluginMessage &message)
{
std::string output = message.generate();
mHostSendFunction(output.c_str(), &mHostUserData);
}
+/**
+ * Notifies plugin loader shell that part of display area needs to be redrawn.
+ *
+ * @param[in] left Left X coordinate of area to redraw (0,0 is at top left corner)
+ * @param[in] top Top Y coordinate of area to redraw (0,0 is at top left corner)
+ * @param[in] right Right X-coordinate of area to redraw (0,0 is at top left corner)
+ * @param[in] bottom Bottom Y-coordinate of area to redraw (0,0 is at top left corner)
+ *
+ */
void MediaPluginBase::setDirty(int left, int top, int right, int bottom)
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "updated");
@@ -118,6 +159,10 @@ void MediaPluginBase::setDirty(int left, int top, int right, int bottom)
sendMessage(message);
}
+/**
+ * Sends "media_status" message to plugin loader shell ("loading", "playing", "paused", etc.)
+ *
+ */
void MediaPluginBase::sendStatus()
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "media_status");
@@ -141,6 +186,17 @@ extern "C"
LLSYMEXPORT int LLPluginInitEntryPoint(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data);
}
+/**
+ * Plugin initialization and entry point. Establishes communication channel for messages between plugin and plugin loader shell. TODO:DOC - Please check!
+ *
+ * @param[in] host_send_func Function for sending messages from plugin to plugin loader shell
+ * @param[in] host_user_data Message data for messages from plugin to plugin loader shell
+ * @param[out] plugin_send_func Function for plugin to receive messages from plugin loader shell
+ * @param[out] plugin_user_data Pointer to plugin instance
+ *
+ * @return int, where 0=success
+ *
+ */
LLSYMEXPORT int
LLPluginInitEntryPoint(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data)
{
diff --git a/indra/media_plugins/base/media_plugin_base.h b/indra/media_plugins/base/media_plugin_base.h
index f1e96335f9..ed4dc0cfa9 100644
--- a/indra/media_plugins/base/media_plugin_base.h
+++ b/indra/media_plugins/base/media_plugin_base.h
@@ -2,6 +2,7 @@
* @file media_plugin_base.h
* @brief Media plugin base class for LLMedia API plugin system
*
+ * @cond
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2008, Linden Research, Inc.
@@ -27,6 +28,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "linden_common.h"
@@ -40,14 +42,17 @@ class MediaPluginBase
{
public:
MediaPluginBase(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data);
+ /** Media plugin destructor. */
virtual ~MediaPluginBase() {}
+ /** Handle received message from plugin loader shell. */
virtual void receiveMessage(const char *message_string) = 0;
static void staticReceiveMessage(const char *message_string, void **user_data);
protected:
+ /** Plugin status. */
typedef enum
{
STATUS_NONE,
@@ -59,10 +64,13 @@ protected:
STATUS_DONE
} EStatus;
+ /** Plugin shared memory. */
class SharedSegmentInfo
{
public:
+ /** Shared memory address. */
void *mAddress;
+ /** Shared memory size. */
size_t mSize;
};
@@ -71,42 +79,56 @@ protected:
std::string statusString();
void setStatus(EStatus status);
- // The quicktime plugin overrides this to add current time and duration to the message...
+ /// Note: The quicktime plugin overrides this to add current time and duration to the message.
virtual void setDirty(int left, int top, int right, int bottom);
+ /** Map of shared memory names to shared memory. */
typedef std::map<std::string, SharedSegmentInfo> SharedSegmentMap;
+ /** Function to send message from plugin to plugin loader shell. */
LLPluginInstance::sendMessageFunction mHostSendFunction;
+ /** Message data being sent to plugin loader shell by mHostSendFunction. */
void *mHostUserData;
+ /** Flag to delete plugin instance (self). */
bool mDeleteMe;
+ /** Pixel array to display. TODO:DOC are pixels always 24-bit RGB format, aligned on 32-bit boundary? Also: calling this a pixel array may be misleading since 1 pixel > 1 char. */
unsigned char* mPixels;
+ /** TODO:DOC what's this for -- does a texture have its own piece of shared memory? updated on size_change_request, cleared on shm_remove */
std::string mTextureSegmentName;
+ /** Width of plugin display in pixels. */
int mWidth;
+ /** Height of plugin display in pixels. */
int mHeight;
+ /** Width of plugin texture. */
int mTextureWidth;
+ /** Height of plugin texture. */
int mTextureHeight;
+ /** Pixel depth (pixel size in bytes). */
int mDepth;
+ /** Current status of plugin. */
EStatus mStatus;
+ /** Map of shared memory segments. */
SharedSegmentMap mSharedSegments;
};
-// The plugin must define this function to create its instance.
+/** The plugin <b>must</b> define this function to create its instance.
+ * It should look something like this:
+ * @code
+ * {
+ * MediaPluginFoo *self = new MediaPluginFoo(host_send_func, host_user_data);
+ * *plugin_send_func = MediaPluginFoo::staticReceiveMessage;
+ * *plugin_user_data = (void*)self;
+ *
+ * return 0;
+ * }
+ * @endcode
+ */
int init_media_plugin(
LLPluginInstance::sendMessageFunction host_send_func,
void *host_user_data,
LLPluginInstance::sendMessageFunction *plugin_send_func,
void **plugin_user_data);
-// It should look something like this:
-/*
-{
- MediaPluginFoo *self = new MediaPluginFoo(host_send_func, host_user_data);
- *plugin_send_func = MediaPluginFoo::staticReceiveMessage;
- *plugin_user_data = (void*)self;
-
- return 0;
-}
-*/
diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp
index 99e0199a29..f5b077fea0 100644
--- a/indra/media_plugins/example/media_plugin_example.cpp
+++ b/indra/media_plugins/example/media_plugin_example.cpp
@@ -2,6 +2,7 @@
* @file media_plugin_example.cpp
* @brief Example plugin for LLMedia API plugin system
*
+ * @cond
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2009, Linden Research, Inc.
@@ -27,6 +28,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "linden_common.h"
diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt
index a9f7938b41..3b73e04786 100644
--- a/indra/media_plugins/gstreamer010/CMakeLists.txt
+++ b/indra/media_plugins/gstreamer010/CMakeLists.txt
@@ -42,12 +42,12 @@ set(media_plugin_gstreamer010_HEADER_FILES
llmediaimplgstreamertriviallogging.h
)
-if (${CXX_VERSION} MATCHES "4[23].")
+if (${CXX_VERSION_NUMBER} MATCHES "4[23].")
# Work around a bad interaction between broken gstreamer headers and
# g++ 4.3's increased strictness.
set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES
COMPILE_FLAGS -Wno-write-strings)
-endif (${CXX_VERSION} MATCHES "4[23].")
+endif (${CXX_VERSION_NUMBER} MATCHES "4[23].")
add_library(media_plugin_gstreamer010
SHARED
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h
index ef41736c18..48accd3e66 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h
@@ -3,6 +3,7 @@
* @author Tofu Linden
* @brief implementation that supports media playback via GStreamer.
*
+ * @cond
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
@@ -29,6 +30,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
// header guard
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp
index cc52232496..52cea46d46 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp
@@ -2,6 +2,7 @@
* @file llmediaimplgstreamer_syms.cpp
* @brief dynamic GStreamer symbol-grabbing code
*
+ * @cond
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
@@ -28,6 +29,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#if LL_GSTREAMER010_ENABLED
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h
index ee7473d6d1..88f100af6e 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h
@@ -2,6 +2,7 @@
* @file llmediaimplgstreamer_syms.h
* @brief dynamic GStreamer symbol-grabbing code
*
+ * @cond
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
@@ -28,6 +29,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "linden_common.h"
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h
index e31d4a3282..2244ccc146 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h
@@ -2,6 +2,7 @@
* @file llmediaimplgstreamertriviallogging.h
* @brief minimal logging utilities.
*
+ * @cond
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
* Copyright (c) 2009, Linden Research, Inc.
@@ -28,6 +29,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#ifndef __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp
index d8ccfaa702..5bb0ef5a99 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp
@@ -2,6 +2,7 @@
* @file llmediaimplgstreamervidplug.h
* @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl
*
+ * @cond
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
@@ -28,6 +29,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#if LL_GSTREAMER010_ENABLED
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h
index f6d55b8758..208523e8d0 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h
@@ -2,6 +2,7 @@
* @file llmediaimplgstreamervidplug.h
* @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl
*
+ * @cond
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
@@ -28,6 +29,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#ifndef __GST_SLVIDEO_H__
diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
index a4c43988ba..d21ff26f83 100644
--- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
+++ b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
@@ -2,6 +2,7 @@
* @file media_plugin_gstreamer010.cpp
* @brief GStreamer-0.10 plugin for LLMedia API plugin system
*
+ * @cond
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007, Linden Research, Inc.
@@ -27,6 +28,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "linden_common.h"
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index 236f79978d..dbc44c8334 100644
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -2,6 +2,7 @@
* @file media_plugin_quicktime.cpp
* @brief QuickTime plugin for LLMedia API plugin system
*
+ * @cond
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2008, Linden Research, Inc.
@@ -27,6 +28,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "linden_common.h"
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 09348782a4..25f4c8720a 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -2,6 +2,7 @@
* @file media_plugin_webkit.cpp
* @brief Webkit plugin for LLMedia API plugin system
*
+ * @cond
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2008, Linden Research, Inc.
@@ -27,6 +28,7 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
+ * @endcond
*/
#include "llqtwebkit.h"
@@ -495,7 +497,16 @@ private:
{
// std::cerr << "unicode input, code = 0x" << std::hex << (unsigned long)(wstr[i]) << std::dec << std::endl;
- LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i], modifiers);
+ if(wstr[i] == 32)
+ {
+ // For some reason, the webkit plugin really wants the space bar to come in through the key-event path, not the unicode path.
+ LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_DOWN, 32, modifiers);
+ LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_UP, 32, modifiers);
+ }
+ else
+ {
+ LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i], modifiers);
+ }
}
checkEditState();