summaryrefslogtreecommitdiff
path: root/indra/newview/llmediactrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r--indra/newview/llmediactrl.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 679157dc1e..26422d7d47 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -1370,6 +1370,7 @@ public:
private:
void getMediaInfo(const LLSD& request);
void getMediaText(const LLSD& request);
+ void getPluginsList(const LLSD& request);
void replyError(const LLSD& request, const std::string& error);
LLMediaCtrl* findMediaCtrl(const std::string& path);
};
@@ -1388,6 +1389,12 @@ LLMediaCtrlListener::LLMediaCtrlListener():
"Returns the text content of the page or a portion of it.",
&LLMediaCtrlListener::getMediaText,
llsd::map("path", LLSD(), "reply", LLSD()));
+
+ add("getPluginsList",
+ "Enumerate the active media plugin (SLPlugin) instances.\n"
+ "Reply contains [\"plugins\"] an array of { pid, url, mime_type, remote_debugging_port } entries.",
+ &LLMediaCtrlListener::getPluginsList,
+ llsd::map("reply", LLSD()));
}
LLMediaCtrl* LLMediaCtrlListener::findMediaCtrl(const std::string& path)
@@ -1457,4 +1464,31 @@ void LLMediaCtrlListener::getMediaText(const LLSD& request)
}
}
+void LLMediaCtrlListener::getPluginsList(const LLSD& request)
+{
+ Response reply(LLSD(), request);
+
+ LLSD plugins;
+
+ LLViewerMedia::impl_list& impls = LLViewerMedia::getInstance()->getPriorityList();
+ for (LLViewerMedia::impl_list::iterator it = impls.begin(); it != impls.end(); ++it)
+ {
+ LLViewerMediaImpl* impl = *it;
+ if (!impl)
+ {
+ continue;
+ }
+ LLPluginClassMedia* plugin = impl->getMediaPlugin();
+
+ LLSD entry;
+ entry["url"] = impl->getCurrentMediaURL();
+ entry["mime_type"] = impl->getMimeType();
+ entry["pid"] = plugin ? plugin->getProcessID() : 0;
+ entry["remote_debugging_port"] = plugin ? (S32)plugin->getCefRemoteDebuggingPort() : 0;
+
+ plugins.append(entry);
+ }
+ reply["plugins"] = plugins;
+}
+
static LLMediaCtrlListener sMediaCtrlListener;