diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 10 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 75 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_prim_media_controls.xml | 372 |
4 files changed, 268 insertions, 194 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8ad52784d3..52de17bff5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5369,7 +5369,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.0</real> + <real>1.0</real> </map> <key>PluginInstancesLow</key> <map> @@ -5385,24 +5385,24 @@ <key>PluginInstancesNormal</key> <map> <key>Comment</key> - <string>Limit on the number of inworld media plugins that will run at "normal" priority</string> + <string>Limit on the number of inworld media plugins that will run at "normal" or higher priority</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>U32</string> <key>Value</key> - <integer>4</integer> + <integer>2</integer> </map> <key>PluginInstancesTotal</key> <map> <key>Comment</key> - <string>Hard limit on the number of plugins that will be instantiated at once</string> + <string>Hard limit on the number of plugins that will be instantiated at once for inworld media</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>U32</string> <key>Value</key> - <integer>16</integer> + <integer>8</integer> </map> <key>PrecachingDelay</key> <map> diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 251d7d4a13..70490d3a6e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -541,6 +541,16 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView // The item with user focus always comes to the front of the list, period. return false; } + else if(i1->isParcelMedia()) + { + // The parcel media impl sorts above all other inworld media, unless one has focus. + return true; + } + else if(i2->isParcelMedia()) + { + // The parcel media impl sorts above all other inworld media, unless one has focus. + return false; + } else if(i1->getUsedInUI() && !i2->getUsedInUI()) { // i1 is a UI element, i2 is not. This makes i1 "less than" i2, so it sorts earlier in our list. @@ -551,14 +561,14 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView // i2 is a UI element, i1 is not. This makes i2 "less than" i1, so it sorts earlier in our list. return false; } - else if(i1->isParcelMedia()) + else if(i1->isPlayable() && !i2->isPlayable()) { - // The parcel media impl sorts above all other inworld media, unless one has focus. + // Playable items sort above ones that wouldn't play even if they got high enough priority return true; } - else if(i2->isParcelMedia()) + else if(!i1->isPlayable() && i2->isPlayable()) { - // The parcel media impl sorts above all other inworld media, unless one has focus. + // Playable items sort above ones that wouldn't play even if they got high enough priority return false; } else @@ -629,10 +639,12 @@ void LLViewerMedia::updateMedia() else if(pimpl->hasFocus()) { new_priority = LLPluginClassMedia::PRIORITY_HIGH; + impl_count_interest_normal++; // count this against the count of "normal" instances for priority purposes } else if(pimpl->getUsedInUI()) { new_priority = LLPluginClassMedia::PRIORITY_NORMAL; + impl_count_interest_normal++; } else { @@ -640,7 +652,17 @@ void LLViewerMedia::updateMedia() // Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture, // turn it down to low instead of normal. This may downsample for plugins that support it. - bool media_is_small = pimpl->getInterest() < (pimpl->getApproximateTextureInterest() / 4); + bool media_is_small = false; + F64 approximate_interest = pimpl->getApproximateTextureInterest(); + if(approximate_interest == 0.0f) + { + // this media has no current size, which probably means it's not loaded. + media_is_small = true; + } + else if(pimpl->getInterest() < (approximate_interest / 4)) + { + media_is_small = true; + } if(pimpl->getInterest() == 0.0f) { @@ -678,7 +700,7 @@ void LLViewerMedia::updateMedia() } } - if(new_priority != LLPluginClassMedia::PRIORITY_UNLOADED) + if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED)) { impl_count_total++; } @@ -1588,6 +1610,10 @@ void LLViewerMediaImpl::update() { // This media source should not be loaded. } + else if(mPriority <= LLPluginClassMedia::PRIORITY_SLIDESHOW) + { + // Don't load new instances that are at PRIORITY_SLIDESHOW or below. They're just kept around to preserve state. + } else if(mMimeTypeProbe != NULL) { // this media source is doing a MIME type probe -- don't try loading it again. @@ -1816,7 +1842,7 @@ bool LLViewerMediaImpl::isMediaPaused() ////////////////////////////////////////////////////////////////////////////////////////// // -bool LLViewerMediaImpl::hasMedia() +bool LLViewerMediaImpl::hasMedia() const { return mMediaSource != NULL; } @@ -1851,6 +1877,31 @@ bool LLViewerMediaImpl::isForcedUnloaded() const } ////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isPlayable() const +{ + if(isForcedUnloaded()) + { + // All of the forced-unloaded criteria also imply not playable. + return false; + } + + if(hasMedia()) + { + // Anything that's already playing is, by definition, playable. + return true; + } + + if(!mMediaURL.empty()) + { + // If something has navigated the instance, it's ready to be played. + return true; + } + + return false; +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event) { switch(event) @@ -2094,7 +2145,13 @@ F64 LLViewerMediaImpl::getApproximateTextureInterest() result = mMediaSource->getFullWidth(); result *= mMediaSource->getFullHeight(); } - + else + { + // No media source is loaded -- all we have to go on is the texture size that has been set on the impl, if any. + result = mMediaWidth; + result *= mMediaHeight; + } + return result; } @@ -2135,7 +2192,7 @@ void LLViewerMediaImpl::setPriority(LLPluginClassMedia::EPriority priority) { if(mPriority != priority) { - LL_INFOS("PluginPriority") + LL_DEBUGS("PluginPriority") << "changing priority of media id " << mTextureId << " from " << LLPluginClassMedia::priorityToString(mPriority) << " to " << LLPluginClassMedia::priorityToString(priority) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 639aed4b8a..a06079786e 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -194,7 +194,7 @@ public: bool isMediaPlaying(); bool isMediaPaused(); - bool hasMedia(); + bool hasMedia() const; bool isMediaFailed() const { return mMediaSourceFailed; }; void resetPreviousMediaState(); @@ -204,6 +204,9 @@ public: // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) bool isForcedUnloaded() const; + // returns true if this instance could be playable based on autoplay setting, current load state, etc. + bool isPlayable() const; + void setIsParcelMedia(bool is_parcel_media) { mIsParcelMedia = is_parcel_media; }; bool isParcelMedia() const { return mIsParcelMedia; }; diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index 70c5d7b823..98025e28db 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -77,10 +77,14 @@ width="22" top="4"> <button + image_overlay="Arrow_Left_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" auto_resize="false" height="22" - image_selected="media_btn_back.png" - image_unselected="media_btn_back.png" layout="topleft" tool_tip="Step back" width="22" @@ -96,37 +100,25 @@ user_resize="false" layout="topleft" top="10" - min_width="17" - width="17"> + min_width="22" + width="22"> <button + image_overlay="Arrow_Right_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" height="22" - image_selected="media_btn_forward.png" - image_unselected="media_btn_forward.png" layout="topleft" tool_tip="Step forward" top_delta="0" - min_width="17" - width="17"> + min_width="22" + width="22"> <button.commit_callback function="MediaCtrl.Forward" /> </button> </layout_panel> - <!-- - <panel - height="22" - layout="topleft" - auto_resize="false" - min_width="3" - width="3"> - <icon - height="22" - image_name="media_panel_divider.png" - layout="topleft" - top="0" - min_width="3" - width="3" /> - </panel> - --> <layout_panel name="home" auto_resize="false" @@ -136,11 +128,15 @@ min_width="22" width="22"> <button - height="22" - image_selected="media_btn_home.png" - image_unselected="media_btn_home.png" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_overlay="Home_Off" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" layout="topleft" tool_tip="Home page" + height="22" min_width="22" width="22"> <button.commit_callback @@ -155,10 +151,15 @@ top="2" min_width="22" width="22"> + <!-- The stop button here is temporary artwork --> <button + image_overlay="media_btn_stoploading.png" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" height="22" - image_selected="button_anim_stop.tga" - image_unselected="button_anim_stop.tga" layout="topleft" tool_tip="Stop media" min_width="22" @@ -167,22 +168,6 @@ function="MediaCtrl.Stop" /> </button> </layout_panel> - <!-- - <panel - height="22" - layout="topleft" - auto_resize="false" - min_width="3" - width="3"> - <icon - height="22" - image_name="media_panel_divider.png" - layout="topleft" - top="0" - min_width="3" - width="3" /> - </panel> - --> <layout_panel name="reload" auto_resize="false" @@ -193,8 +178,12 @@ width="22"> <button height="22" - image_selected="media_btn_reload.png" - image_unselected="media_btn_reload.png" + image_overlay="Refresh_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" layout="topleft" tool_tip="Reload" min_width="22" @@ -213,8 +202,12 @@ width="22"> <button height="22" - image_selected="media_btn_stoploading.png" - image_unselected="media_btn_stoploading.png" + image_overlay="StopReload_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" layout="topleft" tool_tip = "Stop loading" min_width="22" @@ -232,11 +225,15 @@ min_width="22" width="22"> <button - height="22" - image_selected="button_anim_play.tga" - image_unselected="button_anim_play.tga" + image_overlay="Play_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" layout="topleft" tool_tip = "Play media" + height="22" min_width="22" width="22"> <button.commit_callback @@ -252,10 +249,14 @@ min_width="22" width="22"> <button - height="22" - image_selected="button_anim_pause.tga" - image_unselected="button_anim_pause.tga" + image_overlay="Pause_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" layout="topleft" + height="22" tool_tip = "Pause media"> <button.commit_callback function="MediaCtrl.Pause" /> @@ -266,7 +267,7 @@ name="media_address" auto_resize="true" user_resize="false" - height="22" + height="24" follows="left|right|bottom" layout="topleft" width="190" @@ -313,7 +314,7 @@ function="MediaCtrl.CommitURL" /> name="media_whitelist_flag" follows="top|right" height="16" - image_name="smicon_warn.tga" + image_name="Flag" layout="topleft" tool_tip="White List enabled" min_width="16" @@ -327,7 +328,7 @@ function="MediaCtrl.CommitURL" /> <icon name="media_secure_lock_flag" height="16" - image_name="icon_lock.tga" + image_name="Lock2" layout="topleft" tool_tip="Secured Browsing" min_width="16" @@ -351,6 +352,7 @@ function="MediaCtrl.CommitURL" /> initial_value="0.5" layout="topleft" tool_tip="Movie play progress" + top="8" min_width="100" width="200"> <slider_bar.commit_callback @@ -362,43 +364,55 @@ function="MediaCtrl.CommitURL" /> auto_resize="false" user_resize="false" layout="topleft" - height="24" - min_width="24" - width="24"> + height="22" + min_width="22" + width="22"> + <!-- Note: this isn't quite right either...the mute button is not the --> + <!-- same as the others because it can't have the "image_overlay" be --> + <!-- two different images. --> <button + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="AudioMute_Off" + image_unselected="Audio_Off" + hover_glow_amount="0.15" name="media_volume_button" height="22" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" is_toggle="true" layout="topleft" scale_image="false" tool_tip="Mute This Media" - top_delta="22" - min_width="24" - width="24" > + top_delta="18" + min_width="22" + width="22" > <button.commit_callback function="MediaCtrl.ToggleMute" /> </button> </layout_panel> + <!-- We don't have a design yet for "volume", so this is a temporary --> + <!-- solution. See DEV-42827. --> <layout_panel name="volume_up" auto_resize="false" user_resize="false" layout="topleft" - min_width="20" + min_width="14" height="14" - width="20"> + width="14"> <button - top="-3" + image_overlay="media_btn_scrollup.png" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" + top="-5" height="14" - image_selected="media_btn_scrollup.png" - image_unselected="media_btn_scrollup.png" layout="topleft" tool_tip="Volume up" scale_image="true" - min_width="20" - width="20" > + min_width="14" + width="14" > <button.commit_callback function="MediaCtrl.CommitVolumeUp" /> </button> @@ -408,27 +422,33 @@ function="MediaCtrl.CommitURL" /> auto_resize="false" user_resize="false" layout="topleft" - min_width="20" + min_width="14" height="14" - width="20"> + width="14"> <button - top="-5" - height="14" - image_selected="media_btn_scrolldown.png" - image_unselected="media_btn_scrolldown.png" + image_overlay="media_btn_scrolldown.png" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" layout="topleft" tool_tip="Volume down" scale_image="true" - min_width="20" - width="20"> + top="-5" + height="14" + min_width="14" + width="14"> <button.commit_callback function="MediaCtrl.CommitVolumeDown" /> </button> </layout_panel> <!-- Scroll pad --> + <!-- This was removed from the design, but is still here because it is --> + <!-- complex, and recreating it would be hard. In case the design --> + <!-- changes, here it lies: --> <!-- - disabled - <layout_panel + <layout_panel name="media_panel_scroll" auto_resize="false" user_resize="false" @@ -437,64 +457,77 @@ function="MediaCtrl.CommitURL" /> layout="topleft" min_width="32" width="32"> - <icon - height="32" - image_name="media_panel_scrollbg.png" - layout="topleft" - top="0" - min_width="32" - width="32" /> - <button - name="scrollup" - height="8" - image_selected="media_btn_scrollup.png" - image_unselected="media_btn_scrollup.png" - layout="topleft" - tool_tip="Scroll up" - scale_image="false" - left="12" - top_delta="4" - min_width="8" - width="8" /> - <button - name="scrollleft" - height="8" - image_selected="media_btn_scrollleft.png" - image_unselected="media_btn_scrollleft.png" - layout="topleft" - left="3" - tool_tip="Scroll left" - scale_image="false" - top="12" - min_width="8" - width="8" /> - <button - name="scrollright" - height="8" - image_selected="media_btn_scrollright.png" - image_unselected="media_btn_scrollright.png" - layout="topleft" - left_pad="9" - tool_tip="Scroll right" - scale_image="false" - top_delta="0" - min_width="8" - width="8" /> - <button - name="scrolldown" - height="8" - image_selected="media_btn_scrolldown.png" - image_unselected="media_btn_scrolldown.png" - layout="topleft" - left="12" - tool_tip="Scroll down" - scale_image="false" - top="20" - min_width="8" - width="8" /> - </layout_panel> - disabled + <icon + height="32" + image_name="media_panel_scrollbg.png" + layout="topleft" + top="0" + min_width="32" + width="32" /> + <button + name="scrollup" + height="8" + image_selected="media_btn_scrollup.png" + image_unselected="media_btn_scrollup.png" + layout="topleft" + tool_tip="Scroll up" + scale_image="false" + left="12" + top_delta="4" + min_width="8" + width="8" /> + <button + name="scrollleft" + height="8" + image_selected="media_btn_scrollleft.png" + image_unselected="media_btn_scrollleft.png" + layout="topleft" + left="3" + tool_tip="Scroll left" + scale_image="false" + top="12" + min_width="8" + width="8" /> + <button + name="scrollright" + height="8" + image_selected="media_btn_scrollright.png" + image_unselected="media_btn_scrollright.png" + layout="topleft" + left_pad="9" + tool_tip="Scroll right" + scale_image="false" + top_delta="0" + min_width="8" + width="8" /> + <button + name="scrolldown" + height="8" + image_selected="media_btn_scrolldown.png" + image_unselected="media_btn_scrolldown.png" + layout="topleft" + left="12" + tool_tip="Scroll down" + scale_image="false" + top="20" + min_width="8" + width="8" /> + </layout_panel> --> + <panel + height="28" + layout="topleft" + auto_resize="false" + min_width="3" + width="3"> + <icon + height="26" + image_name="media_panel_divider.png" + layout="topleft" + top="0" + min_width="3" + width="3" /> + </panel> <layout_panel name="zoom_frame" auto_resize="false" @@ -504,9 +537,13 @@ function="MediaCtrl.CommitURL" /> min_width="22" width="22"> <button + image_overlay="Zoom_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" height="22" - image_selected="media_btn_optimalzoom.png" - image_unselected="media_btn_optimalzoom.png" layout="topleft" tool_tip="Zoom into media" min_width="22" @@ -522,10 +559,15 @@ function="MediaCtrl.CommitURL" /> layout="topleft" min_width="21" width="21" > + <!-- There is no "Zoom out" icon, so we use this temporarily --> <button + image_overlay="ForwardArrow_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" height="22" - image_selected="media_btn_done.png" - image_unselected="media_btn_done.png" layout="topleft" tool_tip ="Zoom Back" top_delta="-4" @@ -534,22 +576,6 @@ function="MediaCtrl.CommitURL" /> function="MediaCtrl.Close" /> </button> </layout_panel> - <!-- - <panel - height="22" - layout="topleft" - auto_resize="false" - min_width="3" - width="3"> - <icon - height="22" - image_name="media_panel_divider.png" - layout="topleft" - top="0" - min_width="3" - width="3" /> - </panel> - --> <layout_panel name="new_window" auto_resize="false" @@ -558,34 +584,22 @@ function="MediaCtrl.CommitURL" /> min_width="22" width="22"> <button + image_overlay="ExternalBrowser_Off" + image_disabled="PushButton_Disabled" + image_disabled_selected="PushButton_Disabled" + image_selected="PushButton_Selected" + image_unselected="PushButton_Off" + hover_glow_amount="0.15" height="22" - image_selected="media_btn_newwindow.png" - image_unselected="media_btn_newwindow.png" layout="topleft" tool_tip = "Open URL in browser" - top_delta="-3" + top_delta="-4" min_width="24" width="24" > <button.commit_callback function="MediaCtrl.Open" /> </button> </layout_panel> - <!-- - <panel - height="22" - layout="topleft" - auto_resize="false" - min_width="3" - width="3"> - <icon - height="22" - image_name="media_panel_divider.png" - layout="topleft" - top="0" - min_width="3" - width="3" /> - </panel> - --> <!-- bookend panel --> <layout_panel name="right_bookend" |