added real media_server node management, removed bugs, added debug output

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1467 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-10-08 23:59:43 +00:00
parent defec30317
commit 1299bfb29f
16 changed files with 399 additions and 46 deletions
+6 -4
View File
@@ -39,7 +39,7 @@ struct request_data
{
port_id reply_port;
void SendReply(status_t result, reply_data *reply, int replysize) const;
status_t SendReply(status_t result, reply_data *reply, int replysize) const;
};
// The base struct used for all raw replys
@@ -233,8 +233,8 @@ struct server_publish_inputs_request : public request_data
media_node node;
int32 count;
area_id area; // if count > MAX_INPUTS, inputs are in the area
// area is created in the server, and also deleted
// in the server after the reply has been received
// area is created in the library, and also deleted
// in the library after the reply has been received
media_input inputs[MAX_INPUTS];
};
@@ -247,6 +247,8 @@ struct server_publish_outputs_request : public request_data
media_node node;
int32 count;
area_id area; // if count > MAX_OUTPUTS, outputs are in the area
// area is created in the library, and also deleted
// in the library after the reply has been received
media_output outputs[MAX_OUTPUTS];
};
@@ -366,7 +368,7 @@ struct server_get_live_nodes_reply : public reply_data
{
int32 count;
area_id area; // if count > MAX_LIVE_INFO, live_node_infos are in the area
// area is created in the server, but deleted in the application
// area is created in the server, but deleted in the library
live_node_info live_info[MAX_LIVE_INFO];
};
+13
View File
@@ -22,6 +22,14 @@ public:
*v = list[index];
return true;
}
bool GetPointerAt(int32 index, value **v)
{
if (index < 0 || index >= count)
return false;
*v = &list[index];
return true;
}
// you can't Remove() while iterating through the map using GetAt()
bool Remove(int32 index)
@@ -33,6 +41,11 @@ public:
list[index] = list[count];
return true;
}
void MakeEmpty()
{
count = 0;
}
private:
enum { MAXENT = 64 };
+2 -1
View File
@@ -6,7 +6,7 @@ template<class key, class value> class Map
public:
Map() : count(0) {}
void Insert(const key &k, const value &v)
bool Insert(const key &k, const value &v)
{
value temp;
if (count == MAXENT) debugger("template Map out of memory");
@@ -14,6 +14,7 @@ public:
list[count].k = k;
list[count].v = v;
count++;
return true;
}
bool Get(const key &k, value *v)