aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediamanager.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llmedia/llmediamanager.h
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llmedia/llmediamanager.h')
-rw-r--r--linden/indra/llmedia/llmediamanager.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediamanager.h b/linden/indra/llmedia/llmediamanager.h
new file mode 100644
index 0000000..7a2c868
--- /dev/null
+++ b/linden/indra/llmedia/llmediamanager.h
@@ -0,0 +1,120 @@
1/**
2 * @file llmediamanager.h
3 * @brief Manages instances of media impls
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#ifndef LLMEDIAMANAGER_H
33#define LLMEDIAMANAGER_H
34
35#include <map>
36#include <set>
37
38#include "llmediaimplcommon.h"
39
40////////////////////////////////////////////////////////////////////////////////
41//
42class LLMediaManagerData
43{
44 public:
45 LLMediaManagerData() :
46 mBrowserParentWindow( 0 ),
47 mBrowserProfileDir( "" ),
48 mBrowserProfileName ( "" ),
49 mBrowserUserAgentId( "" )
50 { };
51
52 void setBrowserApplicationDir( const std::string& browser_application_dir ) { mBrowserApplicationDir = browser_application_dir; };
53 std::string& getBrowserApplicationDir() { return mBrowserApplicationDir; };
54
55 void setBrowserComponentDir( const std::string& browser_component_dir ) { mBrowserComponentDir = browser_component_dir; };
56 std::string& getBrowserComponentDir() { return mBrowserComponentDir; };
57
58 void setBrowserParentWindow( void* browser_parent_window ) { mBrowserParentWindow = browser_parent_window; };
59 void* getBrowserParentWindow() { return mBrowserParentWindow; };
60
61 void setBrowserProfileDir( const std::string& browser_profile_dir ) { mBrowserProfileDir = browser_profile_dir; };
62 std::string& getBrowserProfileDir() { return mBrowserProfileDir; };
63
64 void setBrowserProfileName( const std::string& browser_profile_name ) { mBrowserProfileName = browser_profile_name; };
65 std::string& getBrowserProfileName() { return mBrowserProfileName; };
66
67 void setBrowserUserAgentId( const std::string& browser_user_agent_id ) { mBrowserUserAgentId = browser_user_agent_id; };
68 std::string& getBrowserUserAgentId() { return mBrowserUserAgentId; };
69
70 private:
71 void* mBrowserParentWindow;
72 std::string mBrowserProfileDir;
73 std::string mBrowserProfileName;
74 std::string mBrowserApplicationDir;
75 std::string mBrowserComponentDir;
76 std::string mBrowserUserAgentId;
77};
78
79////////////////////////////////////////////////////////////////////////////////
80//
81class LLMediaManager
82{
83 public:
84 virtual ~LLMediaManager();
85
86 static void initClass( LLMediaManagerData* init_data );
87 static void cleanupClass();
88 static LLMediaManager* getInstance();
89
90 // Calls update on all media sources
91 static void updateClass();
92
93 // Given an URL and mime_type, construct/destroy a playback engine for
94 // it (a "media impl").
95 LLMediaBase* createSourceFromMimeType( std::string scheme, std::string mime_type );
96 bool destroySource( LLMediaBase* media_impl );
97
98 // mime type to impl mapping functions
99 bool addMimeTypeImplNameMap( std::string mime_type, std::string impl_name );
100 std::string getImplNameFromMimeType( std::string mime_type );
101
102 // Name accessor for querying type support
103 bool supportsMediaType( const std::string& impl_name, const std::string& scheme, const std::string& mime_type );
104
105 // convenience functions for getting suggested texture sizes to hold various size media
106 static int textureWidthFromMediaWidth( int media_width );
107 static int textureHeightFromMediaHeight( int media_height );
108
109 private:
110 LLMediaManager();
111 static LLMediaManager* sInstance;
112
113 typedef std::set< LLMediaBase* > media_impl_container_t;
114 media_impl_container_t mMediaImplContainer;
115
116 typedef std::map< std::string, std::string > mime_type_impl_name_container_t;
117 mime_type_impl_name_container_t mMimeTypeImplNameContainer;
118};
119
120#endif // LLMEDIAMANAGER_H