llpluginclassmedia.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. /**
  2. * @file llpluginclassmedia.h
  3. * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class.
  4. *
  5. * $LicenseInfo:firstyear=2008&license=viewergpl$
  6. *
  7. * Copyright (c) 2008-2009, Linden Research, Inc.
  8. * Copyright (c) 2009-2024, Henri Beauchamp.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #ifndef LL_LLPLUGINCLASSMEDIA_H
  34. #define LL_LLPLUGINCLASSMEDIA_H
  35. #include <memory>
  36. #include <mutex>
  37. #include <queue>
  38. #include "llpluginclassmediaowner.h"
  39. #include "llpluginprocessparent.h"
  40. #include "llpreprocessor.h"
  41. #include "llrect.h"
  42. #include "llcolor4.h"
  43. class LLPluginClassMedia final : public LLPluginProcessParentOwner
  44. {
  45. protected:
  46. LOG_CLASS(LLPluginClassMedia);
  47. public:
  48. LLPluginClassMedia(LLPluginClassMediaOwner* owner);
  49. ~LLPluginClassMedia() override;
  50. // Local initialization, called by the media manager when creating a source
  51. bool init(const std::string& launcher_filename,
  52. const std::string& plugin_dir,
  53. const std::string& plugin_filename, bool debug);
  54. // Un-does everything init() did; called by the media manager when
  55. // destroying a source
  56. void reset();
  57. void idle();
  58. // All of these may return 0 or an actual valid value. Callers need to
  59. // check the return for 0, and not use the values in that case.
  60. LL_INLINE int getWidth() const { return mMediaWidth > 0 ? mMediaWidth : 0; }
  61. LL_INLINE int getHeight() const { return mMediaHeight > 0 ? mMediaHeight : 0; }
  62. LL_INLINE int getNaturalWidth() const { return mNaturalMediaWidth; }
  63. LL_INLINE int getNaturalHeight() const { return mNaturalMediaHeight; }
  64. LL_INLINE int getSetWidth() const { return mSetMediaWidth; }
  65. LL_INLINE int getSetHeight() const { return mSetMediaHeight; }
  66. LL_INLINE int getBitsWidth() const { return mTextureWidth > 0 ? mTextureWidth : 0; }
  67. LL_INLINE int getBitsHeight() const { return mTextureHeight > 0 ? mTextureHeight : 0; }
  68. LL_INLINE int getFullWidth() const { return mFullMediaWidth; }
  69. LL_INLINE int getFullHeight() const { return mFullMediaHeight; }
  70. LL_INLINE F64 getZoomFactor() const { return mZoomFactor; }
  71. int getTextureWidth() const;
  72. int getTextureHeight() const;
  73. // This may return NULL. Callers need to check for and handle this case.
  74. unsigned char* getBitsData();
  75. // Get the format details of the texture data. These may return 0 if they
  76. // have not been set up yet. The caller needs to detect this case.
  77. LL_INLINE int getTextureDepth() const { return mRequestedTextureDepth; }
  78. LL_INLINE int getTextureFormatInternal() const { return mRequestedTextureInternalFormat; }
  79. LL_INLINE int getTextureFormatPrimary() const { return mRequestedTextureFormat; }
  80. LL_INLINE int getTextureFormatType() const { return mRequestedTextureType; }
  81. LL_INLINE bool getTextureFormatSwapBytes() const { return mRequestedTextureSwapBytes; }
  82. LL_INLINE bool getTextureCoordsOpenGL() const { return mRequestedTextureCoordsOpenGL; }
  83. void setSize(int width, int height);
  84. void setAutoScale(bool auto_scale);
  85. LL_INLINE void setZoomFactor(F64 f) { mZoomFactor = f; }
  86. LL_INLINE void setBackgroundColor(const LLColor4& c)
  87. {
  88. mBackgroundColor = c;
  89. }
  90. LL_INLINE void setOwner(LLPluginClassMediaOwner* o) { mOwner = o; }
  91. // Returns true if all of the texture parameters (depth, format, size, and
  92. // texture size) are set up and consistent. This will initially be false,
  93. // and will also be false for some time after setSize while the resize is
  94. // processed. Note that if this returns true, it is safe to use all the
  95. // get() methods above without checking for invalid return values until
  96. // you call idle() again.
  97. bool textureValid();
  98. bool getDirty(LLRect* dirty_rect = NULL);
  99. void resetDirty();
  100. typedef enum
  101. {
  102. MOUSE_EVENT_DOWN,
  103. MOUSE_EVENT_UP,
  104. MOUSE_EVENT_MOVE,
  105. MOUSE_EVENT_DOUBLE_CLICK
  106. } EMouseEventType;
  107. void mouseEvent(EMouseEventType type, int button, int x, int y,
  108. MASK modifiers);
  109. typedef enum
  110. {
  111. KEY_EVENT_DOWN,
  112. KEY_EVENT_UP,
  113. KEY_EVENT_REPEAT
  114. } EKeyEventType;
  115. bool keyEvent(EKeyEventType type, int key_code, MASK modifiers,
  116. LLSD native_key_data);
  117. void scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers);
  118. // Enable/disable media plugin debugging messages and info spam
  119. void enableMediaPluginDebugging(bool enable);
  120. // Javascript <-> viewer events
  121. void jsEnableObject(bool enable);
  122. void jsAgentLocationEvent(double x, double y, double z);
  123. void jsAgentGlobalLocationEvent(double x, double y, double z);
  124. void jsAgentOrientationEvent(double angle);
  125. void jsAgentLanguageEvent(const std::string& language);
  126. void jsAgentRegionEvent(const std::string& region_name);
  127. void jsAgentMaturityEvent(const std::string& maturity);
  128. // Text may be unicode (utf8 encoded)
  129. bool textInput(const std::string& text, MASK modifiers,
  130. LLSD native_key_data);
  131. void setCookie(const std::string& uri, const std::string& name,
  132. const std::string& value, const std::string& domain,
  133. const std::string& path, bool httponly, bool secure);
  134. void loadURI(const std::string& uri);
  135. // "Loading" means uninitialized or any state prior to fully running
  136. // (processing commands)
  137. LL_INLINE bool isPluginLoading() { return mPlugin && mPlugin->isLoading(); }
  138. // "Running" means the steady state -- i.e. processing messages
  139. LL_INLINE bool isPluginRunning() { return mPlugin && mPlugin->isRunning(); }
  140. // "Exited" means any regular or error state after "Running" (plugin may
  141. // have crashed or exited normally)
  142. LL_INLINE bool isPluginExited() { return mPlugin && mPlugin->isDone(); }
  143. LL_INLINE std::string getPluginVersion() { return mPlugin ? mPlugin->getPluginVersion() : std::string(""); }
  144. LL_INLINE bool getDisableTimeout() { return mPlugin && mPlugin->getDisableTimeout(); }
  145. LL_INLINE void setDisableTimeout(bool disable)
  146. {
  147. if (mPlugin)
  148. {
  149. mPlugin->setDisableTimeout(disable);
  150. }
  151. }
  152. LL_INLINE void setLockupTimeout(F32 t)
  153. {
  154. if (mPlugin)
  155. {
  156. mPlugin->setLockupTimeout(t);
  157. }
  158. }
  159. // Inherited from LLPluginProcessParentOwner
  160. void receivePluginMessage(const LLPluginMessage& message) override;
  161. void pluginLaunchFailed() override;
  162. void pluginDied() override;
  163. typedef enum
  164. {
  165. PRIORITY_UNLOADED, // media plugin isn't even loaded.
  166. PRIORITY_STOPPED, // media is not playing, shouldn't need to update at all.
  167. PRIORITY_HIDDEN, // media is not being displayed or is out of view, don't need to do graphic updates, but may still update audio, playhead, etc.
  168. PRIORITY_SLIDESHOW, // media is in the far distance, updates very infrequently
  169. PRIORITY_LOW, // media is in the distance, may be rendered at reduced size
  170. PRIORITY_NORMAL, // normal (default) priority
  171. PRIORITY_HIGH // media has user focus and/or is taking up most of the screen
  172. } EPriority;
  173. static const char* priorityToString(EPriority priority);
  174. void setPriority(EPriority priority);
  175. void setLowPrioritySizeLimit(int size);
  176. F64 getCPUUsage();
  177. void sendPickFileResponse(const std::string& file);
  178. void sendPickFileResponse(const std::vector<std::string> files);
  179. // These are valid during MEDIA_EVENT_PICK_FILE_REQUEST
  180. LL_INLINE bool getIsMultipleFilePick() const { return mIsMultipleFilePick; }
  181. void sendAuthResponse(bool ok, const std::string& username,
  182. const std::string& password);
  183. // Valid after a MEDIA_EVENT_CURSOR_CHANGED event
  184. LL_INLINE std::string getCursorName() const { return mCursorName; }
  185. LL_INLINE LLPluginClassMediaOwner::EMediaStatus getStatus() const
  186. {
  187. return mStatus;
  188. }
  189. void cut();
  190. LL_INLINE bool canCut() const { return mCanCut; }
  191. void copy();
  192. LL_INLINE bool canCopy() const { return mCanCopy; }
  193. void paste();
  194. LL_INLINE bool canPaste() const { return mCanPaste; }
  195. // These can be called before init(), and they will be queued and sent
  196. // before the media init message.
  197. void setUserDataPath(const std::string& user_data_path);
  198. void setLanguageCode(const std::string& language_code);
  199. void setPreferredFont(const std::string& family);
  200. void setMinimumFontSize(U32 size);
  201. void setDefaultFontSize(U32 size);
  202. void setRemoteFontsEnabled(bool enabled);
  203. void setPluginsEnabled(bool enabled);
  204. void setJavascriptEnabled(bool enabled);
  205. LL_INLINE void setTarget(const std::string& tgt) { mTarget = tgt; }
  206. // mClickTarget is received from message and governs how link will be
  207. // opened; use this to enforce your own way of opening links inside
  208. // plugins.
  209. LL_INLINE void setOverrideClickTarget(const std::string& target)
  210. {
  211. mClickEnforceTarget = true;
  212. mOverrideClickTarget = target;
  213. }
  214. LL_INLINE std::string getOverrideClickTarget() const
  215. {
  216. return mOverrideClickTarget;
  217. }
  218. LL_INLINE void resetOverrideClickTarget() { mClickEnforceTarget = false; }
  219. LL_INLINE bool isOverrideClickTarget() const { return mClickEnforceTarget; }
  220. ///////////////////////////////////
  221. // Media browser class methods
  222. bool pluginSupportsMediaBrowser();
  223. void focus(bool focused);
  224. void set_page_zoom_factor(double factor);
  225. void clear_cache();
  226. void clear_cookies();
  227. void set_cookies(const std::string& cookies);
  228. void cookies_enabled(bool enable);
  229. void proxy_setup(bool enable, const std::string& host = LLStringUtil::null,
  230. int port = 0);
  231. void browse_stop();
  232. void browse_reload(bool ignore_cache = false);
  233. void browse_forward();
  234. void browse_back();
  235. void setBrowserUserAgent(const std::string& user_agent);
  236. void showWebInspector(bool show);
  237. void proxyWindowOpened(const std::string& target, const std::string& uuid);
  238. void proxyWindowClosed(const std::string& uuid);
  239. void ignore_ssl_cert_errors(bool ignore);
  240. void addCertificateFilePath(const std::string& path);
  241. // This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or
  242. // MEDIA_EVENT_NAVIGATE_COMPLETE
  243. LL_INLINE std::string getNavigateURI() const { return mNavigateURI; }
  244. // These are valid after MEDIA_EVENT_NAVIGATE_COMPLETE
  245. LL_INLINE S32 getNavigateResultCode() const { return mNavigateResultCode; }
  246. LL_INLINE std::string getNavigateResultString() const
  247. {
  248. return mNavigateResultString;
  249. }
  250. LL_INLINE bool getHistoryBackAvailable() const { return mHistoryBackAvailable; }
  251. LL_INLINE bool getHistoryForwardAvailable() const { return mHistoryForwardAvailable; }
  252. // This is valid after MEDIA_EVENT_PROGRESS_UPDATED
  253. LL_INLINE int getProgressPercent() const { return mProgressPercent; }
  254. // This is valid after MEDIA_EVENT_STATUS_TEXT_CHANGED
  255. LL_INLINE std::string getStatusText() const { return mStatusText; }
  256. // This is valid after MEDIA_EVENT_LOCATION_CHANGED
  257. LL_INLINE std::string getLocation() const { return mLocation; }
  258. // This is valid after MEDIA_EVENT_CLICK_LINK_HREF or
  259. // MEDIA_EVENT_CLICK_LINK_NOFOLLOW
  260. LL_INLINE std::string getClickURL() const { return mClickURL; }
  261. // This is valid after MEDIA_EVENT_CLICK_LINK_NOFOLLOW
  262. LL_INLINE std::string getClickNavType() const { return mClickNavType; }
  263. // This is valid after MEDIA_EVENT_CLICK_LINK_HREF
  264. LL_INLINE std::string getClickTarget() const { return mClickTarget; }
  265. // This is valid during MEDIA_EVENT_CLICK_LINK_HREF and
  266. // MEDIA_EVENT_GEOMETRY_CHANGE
  267. LL_INLINE std::string getClickUUID() const { return mClickUUID; }
  268. // These are valid during MEDIA_EVENT_DEBUG_MESSAGE
  269. LL_INLINE std::string getDebugMessageText() const { return mDebugMessageText; }
  270. LL_INLINE std::string getDebugMessageLevel() const { return mDebugMessageLevel; }
  271. // This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE
  272. LL_INLINE S32 getStatusCode() const { return mStatusCode; }
  273. // These are valid during MEDIA_EVENT_GEOMETRY_CHANGE
  274. LL_INLINE S32 getGeometryX() const { return mGeometryX; }
  275. LL_INLINE S32 getGeometryY() const { return mGeometryY; }
  276. LL_INLINE S32 getGeometryWidth() const { return mGeometryWidth; }
  277. LL_INLINE S32 getGeometryHeight() const { return mGeometryHeight; }
  278. // These are valid during MEDIA_EVENT_AUTH_REQUEST
  279. LL_INLINE std::string getAuthURL() const { return mAuthURL; }
  280. LL_INLINE std::string getAuthRealm() const { return mAuthRealm; }
  281. // These are valid during MEDIA_EVENT_LINK_HOVERED
  282. LL_INLINE std::string getHoverText() const { return mHoverText; }
  283. LL_INLINE std::string getHoverLink() const { return mHoverLink; }
  284. LL_INLINE const std::string& getPluginFileName() const
  285. {
  286. return mPluginFileName;
  287. }
  288. // These are valid during MEDIA_EVENT_FILE_DOWNLOAD
  289. LL_INLINE const std::string& getFileDownloadFilename() const
  290. {
  291. return mFileDownloadFilename;
  292. }
  293. // Media name (or title) and artist
  294. LL_INLINE const std::string& getMediaName() const { return mMediaName; }
  295. LL_INLINE const std::string& getArtist() const { return mArtist; }
  296. ///////////////////////////////////
  297. // Media time class methods
  298. bool pluginSupportsMediaTime();
  299. void stop();
  300. void start(float rate = 0.f);
  301. void pause();
  302. void seek(float time);
  303. void setLoop(bool loop);
  304. void setVolume(float volume);
  305. LL_INLINE float getVolume() { return mRequestedVolume; }
  306. LL_INLINE F64 getCurrentTime() const { return mCurrentTime; }
  307. LL_INLINE F64 getDuration() const { return mDuration; }
  308. LL_INLINE F64 getCurrentPlayRate() { return mCurrentRate; }
  309. LL_INLINE F64 getLoadedDuration() const { return mLoadedDuration; }
  310. // Initialize the URL history of the plugin by sending
  311. // "init_history" message
  312. void initializeUrlHistory(const LLSD& url_history);
  313. ///////////////////////////////////
  314. // Voice plugin related methods (non const LLSD&, so that the owner can
  315. // wipe them out once recovered). HB
  316. LL_INLINE LLSD& getCaptureDevices() { return mCaptureDevices; }
  317. LL_INLINE LLSD& getRenderDevices() { return mRenderDevices; }
  318. void refreshDevices();
  319. void setCaptureDevice(const std::string& device_id);
  320. void setRenderDevice(const std::string& device_id);
  321. void setMicGain(F32 gain);
  322. void setConfiguration(const LLSD& config);
  323. LL_INLINE F32 getAudioLevel() const { return mAudioLevel; }
  324. void setTuningMode(bool tuning_on);
  325. // Use these to lock the data before using or touching it. HB
  326. LL_INLINE void lockWebRTCData() { mWebRTCDataMutex.lock(); }
  327. LL_INLINE void unlockWebRTCData() { mWebRTCDataMutex.unlock(); }
  328. // To access all the data changes specific to a connection.
  329. LLSD& getVoiceData(const LLUUID& connection_id);
  330. // These methods send per-connection voice commands to the plugin. HB
  331. void sendVoiceCommand(const LLUUID& connection_id,
  332. const std::string& command);
  333. void sendVoiceCmdWithBool(const LLUUID& connection_id,
  334. const std::string& command,
  335. const std::string& param_name, bool param);
  336. void sendVoiceCmdWithReal(const LLUUID& connection_id,
  337. const std::string& command,
  338. const std::string& param_name, F64 param);
  339. void sendVoiceCmdWithString(const LLUUID& connection_id,
  340. const std::string& command,
  341. const std::string& param_name,
  342. const std::string& param);
  343. void sendVoiceCmdWithLLSD(const LLUUID& connection_id,
  344. const std::string& command,
  345. const std::string& param_name,
  346. const LLSD& param);
  347. LL_INLINE bool isVoiceDebugged() const { return mDebugVoice; }
  348. void setVoiceDebug(bool enable);
  349. // For debug use only
  350. LL_INLINE void setDeleteOK(bool flag) { mDeleteOK = flag; }
  351. // Crash the plugin. If you use this outside of a testbed, you will be
  352. // punished.
  353. void crashPlugin();
  354. // Hang the plugin. If you use this outside of a testbed, you will be
  355. // punished.
  356. void hangPlugin();
  357. LL_INLINE std::shared_ptr<LLPluginClassMedia> getSharedPtr()
  358. {
  359. return std::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this());
  360. }
  361. void injectOpenIdCookie();
  362. LL_INLINE static void setOpenIdCookie(const std::string& url,
  363. const std::string& host,
  364. const std::string& path,
  365. const std::string& name,
  366. const std::string& value)
  367. {
  368. sOpenIdCookieURL = url;
  369. sOpenIdCookieHost = host;
  370. sOpenIdCookiePath = path;
  371. sOpenIdCookieName = name;
  372. sOpenIdCookieValue = value;
  373. }
  374. protected:
  375. // Notify this object's owner that an event has occurred.
  376. void mediaEvent(LLPluginClassMediaOwner::EMediaEvent event);
  377. // Send message internally, either queueing or sending directly.
  378. void sendMessage(const LLPluginMessage& message);
  379. void setSizeInternal();
  380. std::string translateModifiers(MASK modifiers);
  381. protected:
  382. LLPluginClassMediaOwner* mOwner;
  383. LLPluginProcessParent::ptr_t mPlugin;
  384. LLPluginClassMediaOwner::EMediaStatus mStatus;
  385. int mProgressPercent;
  386. S32 mRequestedTextureDepth;
  387. U32 mRequestedTextureInternalFormat;
  388. U32 mRequestedTextureFormat;
  389. U32 mRequestedTextureType;
  390. std::string mTextureSharedMemoryName;
  391. size_t mTextureSharedMemorySize;
  392. // default media size for the plugin, from the texture_params message.
  393. int mDefaultMediaWidth;
  394. int mDefaultMediaHeight;
  395. // Size that has been requested by the plugin itself
  396. int mNaturalMediaWidth;
  397. int mNaturalMediaHeight;
  398. // Size that has been requested with setSize()
  399. int mSetMediaWidth;
  400. int mSetMediaHeight;
  401. // Full calculated media size (before auto-scale and downsample
  402. // calculations)
  403. int mFullMediaWidth;
  404. int mFullMediaHeight;
  405. // Actual media size being set (after auto-scale)
  406. int mRequestedMediaWidth;
  407. int mRequestedMediaHeight;
  408. // Texture size calculated from actual media size
  409. int mRequestedTextureWidth;
  410. int mRequestedTextureHeight;
  411. // Size that the plugin has acknowledged
  412. int mTextureWidth;
  413. int mTextureHeight;
  414. int mMediaWidth;
  415. int mMediaHeight;
  416. float mRequestedVolume;
  417. // Priority of this media stream
  418. EPriority mPriority;
  419. int mLowPrioritySizeLimit;
  420. int mPadding;
  421. LLRect mDirtyRect;
  422. int mLastMouseX;
  423. int mLastMouseY;
  424. F64 mZoomFactor;
  425. F64 mSleepTime;
  426. LLColor4 mBackgroundColor;
  427. std::string mCursorName;
  428. std::string mPluginFileName;
  429. std::string mMediaName;
  430. std::string mArtist;
  431. std::string mTarget;
  432. /////////////////////////////////////////
  433. // media_time class
  434. F64 mCurrentTime;
  435. F64 mDuration;
  436. F64 mCurrentRate;
  437. F64 mLoadedDuration;
  438. /////////////////////////////////////////
  439. // Used to queue messages while the plugin initializes.
  440. std::queue<LLPluginMessage> mSendQueue;
  441. /////////////////////////////////////////
  442. // media_browser class
  443. S32 mNavigateResultCode;
  444. S32 mGeometryX;
  445. S32 mGeometryY;
  446. S32 mGeometryWidth;
  447. S32 mGeometryHeight;
  448. S32 mStatusCode;
  449. std::string mNavigateURI;
  450. std::string mNavigateResultString;
  451. std::string mStatusText;
  452. std::string mLocation;
  453. std::string mClickURL;
  454. std::string mClickNavType;
  455. std::string mClickTarget;
  456. std::string mOverrideClickTarget;
  457. std::string mClickUUID;
  458. std::string mDebugMessageText;
  459. std::string mDebugMessageLevel;
  460. std::string mAuthURL;
  461. std::string mAuthRealm;
  462. std::string mHoverText;
  463. std::string mHoverLink;
  464. std::string mFileDownloadFilename;
  465. bool mIsMultipleFilePick;
  466. bool mClickEnforceTarget;
  467. /////////////////////////////////////////
  468. bool mCanCut;
  469. bool mCanCopy;
  470. bool mCanPaste;
  471. bool mAllowDownsample;
  472. // The mRequestedTexture* fields are only valid when this is true
  473. bool mTextureParamsReceived;
  474. // True to scale requested media up to the full size of the texture (i.e.
  475. // next power of two)
  476. bool mAutoScaleMedia;
  477. bool mRequestedTextureSwapBytes;
  478. bool mRequestedTextureCoordsOpenGL;
  479. bool mHistoryBackAvailable;
  480. bool mHistoryForwardAvailable;
  481. // Voice plugin related data. HB
  482. std::mutex mWebRTCDataMutex;
  483. LLSD mCaptureDevices;
  484. LLSD mRenderDevices;
  485. std::map<LLUUID, LLSD> mWebRTCDataMap;
  486. F32 mAudioLevel;
  487. bool mDebugVoice;
  488. private:
  489. // For debug use only
  490. bool mDeleteOK;
  491. static std::string sOpenIdCookieURL;
  492. static std::string sOpenIdCookieHost;
  493. static std::string sOpenIdCookiePath;
  494. static std::string sOpenIdCookieName;
  495. static std::string sOpenIdCookieValue;
  496. };
  497. #endif // LL_LLPLUGINCLASSMEDIA_H