aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llviewermedia.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llviewermedia.cpp')
-rw-r--r--linden/indra/newview/llviewermedia.cpp46
1 files changed, 33 insertions, 13 deletions
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp
index e11d1a2..76c11f1 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -460,13 +460,45 @@ bool LLViewerMediaImpl::handleSkinCurrentChanged(const LLSD& /*newvalue*/)
460// Wrapper class 460// Wrapper class
461////////////////////////////////////////////////////////////////////////////////////////// 461//////////////////////////////////////////////////////////////////////////////////////////
462 462
463
464//////////////////////////////////////////////////////////////////////////////////////////
465// The viewer takes a long time to load the start screen. Part of the problem
466// is media initialization -- in particular, QuickTime loads many DLLs and
467// hits the disk heavily. So we initialize only the browser component before
468// the login screen, then do the rest later when we have a progress bar. JC
469// static
470void LLViewerMedia::initBrowser()
471{
472 LLMediaManagerData* init_data = new LLMediaManagerData;
473 buildMediaManagerData( init_data );
474 LLMediaManager::initBrowser( init_data );
475 delete init_data;
476}
477
463////////////////////////////////////////////////////////////////////////////////////////// 478//////////////////////////////////////////////////////////////////////////////////////////
464// static 479// static
465void LLViewerMedia::initClass() 480void LLViewerMedia::initClass()
466{ 481{
467 // *TODO: This looks like a memory leak to me. JC 482 // *TODO: This looks like a memory leak to me. JC
468 LLMediaManagerData* init_data = new LLMediaManagerData; 483 LLMediaManagerData* init_data = new LLMediaManagerData;
484 buildMediaManagerData( init_data );
485 LLMediaManager::initClass( init_data );
486 delete init_data;
469 487
488 LLMediaManager* mm = LLMediaManager::getInstance();
489 LLMIMETypes::mime_info_map_t::const_iterator it;
490 for (it = LLMIMETypes::sMap.begin(); it != LLMIMETypes::sMap.end(); ++it)
491 {
492 const std::string& mime_type = it->first;
493 const LLMIMETypes::LLMIMEInfo& info = it->second;
494 mm->addMimeTypeImplNameMap( mime_type, info.mImpl );
495 }
496}
497
498//////////////////////////////////////////////////////////////////////////////////////////
499// static
500void LLViewerMedia::buildMediaManagerData( LLMediaManagerData* init_data )
501{
470// std::string executable_dir = std::string( arg0 ).substr( 0, std::string( arg0 ).find_last_of("\\/") ); 502// std::string executable_dir = std::string( arg0 ).substr( 0, std::string( arg0 ).find_last_of("\\/") );
471// std::string component_dir = std::string( executable_dir ).substr( 0, std::string( executable_dir ).find_last_of("\\/") ); 503// std::string component_dir = std::string( executable_dir ).substr( 0, std::string( executable_dir ).find_last_of("\\/") );
472// component_dir = std::string( component_dir ).substr( 0, std::string( component_dir ).find_last_of("\\/") ); 504// component_dir = std::string( component_dir ).substr( 0, std::string( component_dir ).find_last_of("\\/") );
@@ -504,9 +536,7 @@ void LLViewerMedia::initClass()
504 init_data->setBrowserComponentDir( component_dir ); 536 init_data->setBrowserComponentDir( component_dir );
505 std::string profile_name("Second Life"); 537 std::string profile_name("Second Life");
506 init_data->setBrowserProfileName( profile_name ); 538 init_data->setBrowserProfileName( profile_name );
507 init_data->setBrowserParentWindow( gViewerWindow->getPlatformWindow() ); 539 init_data->setBrowserParentWindow( gViewerWindow->getMediaWindow() );
508
509 LLMediaManager::initClass( init_data );
510 540
511 // We use a custom user agent with viewer version and skin name. 541 // We use a custom user agent with viewer version and skin name.
512 LLViewerMediaImpl::updateBrowserUserAgent(); 542 LLViewerMediaImpl::updateBrowserUserAgent();
@@ -516,14 +546,6 @@ void LLViewerMedia::initClass()
516 gSavedSettings.getControl("SkinCurrent")->getSignal()->connect( 546 gSavedSettings.getControl("SkinCurrent")->getSignal()->connect(
517 boost::bind( LLViewerMediaImpl::handleSkinCurrentChanged, _1 ) ); 547 boost::bind( LLViewerMediaImpl::handleSkinCurrentChanged, _1 ) );
518 548
519 LLMediaManager* mm = LLMediaManager::getInstance();
520 LLMIMETypes::mime_info_map_t::const_iterator it;
521 for (it = LLMIMETypes::sMap.begin(); it != LLMIMETypes::sMap.end(); ++it)
522 {
523 const LLString& mime_type = it->first;
524 const LLMIMETypes::LLMIMEInfo& info = it->second;
525 mm->addMimeTypeImplNameMap( mime_type, info.mImpl );
526 }
527} 549}
528 550
529////////////////////////////////////////////////////////////////////////////////////////// 551//////////////////////////////////////////////////////////////////////////////////////////
@@ -672,5 +694,3 @@ void LLViewerMedia::setMimeType(std::string mime_type)
672{ 694{
673 sViewerMediaImpl.mMimeType = mime_type; 695 sViewerMediaImpl.mMimeType = mime_type;
674} 696}
675
676