Global nodes can mow be released by the teams which created them.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2923 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2003-03-16 03:52:52 +00:00
parent 2937222250
commit 54187cc6e8
13 changed files with 303 additions and 70 deletions
+24 -1
View File
@@ -97,6 +97,8 @@ enum {
SERVER_REGISTER_BUFFER,
SERVER_UNREGISTER_BUFFER,
SERVER_RESCAN_DEFAULTS,
SERVER_SET_NODE_CREATOR,
SERVER_CHANGE_DORMANT_NODE_USECOUNT,
SERVER_MESSAGE_END,
NODE_MESSAGE_START = 0x200,
@@ -228,6 +230,7 @@ struct addonserver_instantiate_dormant_node_request : public request_data
{
media_addon_id addonid;
int32 flavorid;
team_id creator_team;
};
struct addonserver_instantiate_dormant_node_reply : public reply_data
@@ -665,7 +668,26 @@ struct server_unregister_app_reply : public reply_data
{
};
struct server_set_node_creator_request : public request_data
{
media_node_id node;
team_id creator;
};
struct server_set_node_creator_reply : public reply_data
{
};
struct server_change_dormant_node_usecount_request : public request_data
{
media_addon_id addon_id;
int32 addon_flavor_id;
int32 delta;
};
struct server_change_dormant_node_usecount_reply : public reply_data
{
};
struct server_register_node_request : public request_data
{
@@ -690,7 +712,8 @@ struct server_unregister_node_request : public request_data
struct server_unregister_node_reply : public reply_data
{
media_addon_id addon_id;
media_addon_id addonid;
int32 flavorid;
};
struct server_get_live_node_info_request : public request_data
+13 -3
View File
@@ -11,17 +11,27 @@
namespace BPrivate {
namespace media {
// To instantiate a dormant node in the current address space, we need to
// either load the add-on from file and create a new BMediaAddOn class and
// cache the BMediaAddOn after that for later reuse, or reuse the cached
// BMediaAddOn if we already have one.
// This is handled by the DormantNodeManager.
//
// GetAddon() will provide a ready to use BMediaAddOn, while
// PutAddonDelayed() will unload it when it's no longer needed,
// but will delay the unloading slightly, because it is called
// from a node destructor of the loaded add-on.
class DormantNodeManager
{
public:
DormantNodeManager();
~DormantNodeManager();
// InstantiateDormantNode(const dormant_node_info & in_info, bool global, media_node * out_node);
// Be careful, GetAddon and PutAddon must be balanced.
// Be careful, GetAddon and PutAddon[Delayed] must be balanced.
BMediaAddOn *GetAddon(media_addon_id id);
void PutAddon(media_addon_id id);
void PutAddonDelayed(media_addon_id id);
// For use by media_addon_server only
media_addon_id RegisterAddon(const char *path);
+10 -1
View File
@@ -32,7 +32,16 @@ namespace BPrivate { namespace media {
class BMediaRosterEx : public BMediaRoster
{
public:
status_t InstantiateDormantNode(media_addon_id addonid, int32 flavorid, media_node *out_node);
status_t SaveNodeConfiguration(BMediaNode *node);
status_t LoadNodeConfiguration(media_addon_id addonid, int32 flavorid, BMessage *out_msg);
status_t IncrementDormantNodeUseCount(media_addon_id addonid, int32 flavorid);
status_t DecrementDormantNodeUseCount(media_addon_id addonid, int32 flavorid);
status_t SetNodeCreator(media_node_id node, team_id creator);
status_t RegisterNode(BMediaNode * node, media_addon_id addonid, int32 flavorid);
status_t InstantiateDormantNode(media_addon_id addonid, int32 flavorid, team_id creator, media_node *out_node);
status_t GetDormantFlavorInfo(media_addon_id addonid, int32 flavorid, dormant_flavor_info *out_flavor);
status_t GetNode(node_type type, media_node * out_node, int32 * out_input_id = NULL, BString * out_input_name = NULL);
status_t SetNode(node_type type, const media_node *node, const dormant_node_info *info = NULL, const media_input *input = NULL);