even more BMediaRoster functions
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1396 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
94fc97f703
commit
85dfab2ba8
@ -78,6 +78,8 @@ enum {
|
||||
SERVER_RELEASE_NODE,
|
||||
SERVER_REGISTER_NODE,
|
||||
SERVER_UNREGISTER_NODE,
|
||||
SERVER_GET_DORMANT_NODE_FOR,
|
||||
SERVER_GET_INSTANCES_FOR,
|
||||
CONSUMER_GET_NEXT_INPUT = 0x2000,
|
||||
CONSUMER_DISPOSE_INPUT_COOKIE,
|
||||
CONSUMER_ACCEPT_FORMAT,
|
||||
@ -117,6 +119,12 @@ enum
|
||||
MAX_LIVE_INFO = 62,
|
||||
};
|
||||
|
||||
// used by SERVER_GET_INSTANCES_FOR
|
||||
enum
|
||||
{
|
||||
MAX_NODE_ID = 4000,
|
||||
};
|
||||
|
||||
struct addonserver_instantiate_dormant_node_request : public request_data
|
||||
{
|
||||
dormant_node_info info;
|
||||
@ -393,5 +401,28 @@ struct server_release_node_reply : public reply_data
|
||||
{
|
||||
};
|
||||
|
||||
struct server_get_dormant_node_for_request : public request_data
|
||||
{
|
||||
media_node node;
|
||||
};
|
||||
|
||||
struct server_get_dormant_node_for_reply : public reply_data
|
||||
{
|
||||
dormant_node_info node_info;
|
||||
};
|
||||
|
||||
struct server_get_instances_for_request : public request_data
|
||||
{
|
||||
int32 maxcount;
|
||||
media_addon_id addon_id;
|
||||
int32 addon_flavor_id;
|
||||
};
|
||||
|
||||
struct server_get_instances_for_reply : public reply_data
|
||||
{
|
||||
int32 count;
|
||||
media_node_id node_id[MAX_NODE_ID]; // no area here, MAX_NODE_ID is really large
|
||||
};
|
||||
|
||||
|
||||
#endif // _DATA_EXCHANGE_H
|
||||
|
@ -1589,9 +1589,24 @@ status_t
|
||||
BMediaRoster::GetDormantNodeFor(const media_node & node,
|
||||
dormant_node_info * out_info)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
CALLED();
|
||||
if (out_info == NULL)
|
||||
return B_BAD_VALUE;
|
||||
if (node.node <= 0)
|
||||
return B_MEDIA_BAD_NODE;
|
||||
|
||||
server_get_dormant_node_for_request request;
|
||||
server_get_dormant_node_for_reply reply;
|
||||
status_t rv;
|
||||
|
||||
return B_ERROR;
|
||||
request.node = node;
|
||||
|
||||
rv = QueryAddonServer(SERVER_GET_DORMANT_NODE_FOR, &request, sizeof(request), &reply, sizeof(reply));
|
||||
if (rv != B_OK)
|
||||
return rv;
|
||||
|
||||
*out_info = reply.node_info;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -1827,11 +1842,32 @@ BMediaRoster::GetInstancesFor(media_addon_id addon,
|
||||
media_node_id * out_id,
|
||||
int32 * io_count)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
// flavor
|
||||
return B_ERROR;
|
||||
}
|
||||
CALLED();
|
||||
if (out_id == NULL || io_count == NULL)
|
||||
return B_BAD_VALUE;
|
||||
if (*io_count <= 0)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
server_get_instances_for_request request;
|
||||
server_get_instances_for_reply reply;
|
||||
status_t rv;
|
||||
|
||||
request.maxcount = *io_count;
|
||||
request.addon_id = addon;
|
||||
request.addon_flavor_id = flavor;
|
||||
|
||||
rv = QueryServer(SERVER_GET_INSTANCES_FOR, &request, sizeof(request), &reply, sizeof(reply));
|
||||
if (rv != B_OK) {
|
||||
TRACE("BMediaRoster::GetLiveNodes failed\n");
|
||||
return rv;
|
||||
}
|
||||
|
||||
*io_count = reply.count;
|
||||
if (reply.count > 0)
|
||||
memcpy(out_id, reply.node_id, sizeof(media_node_id) * reply.count);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
|
@ -269,6 +269,24 @@ ServerApp::HandleMessage(int32 code, void *data, size_t size)
|
||||
request->SendReply(B_OK, &reply, sizeof(reply));
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVER_GET_DORMANT_NODE_FOR:
|
||||
{
|
||||
const server_get_dormant_node_for_request *request = reinterpret_cast<const server_get_dormant_node_for_request *>(data);
|
||||
server_get_dormant_node_for_reply reply;
|
||||
// XXX do something here
|
||||
request->SendReply(B_OK, &reply, sizeof(reply));
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVER_GET_INSTANCES_FOR:
|
||||
{
|
||||
const server_get_instances_for_request *request = reinterpret_cast<const server_get_instances_for_request *>(data);
|
||||
server_get_instances_for_reply reply;
|
||||
// XXX do something here
|
||||
request->SendReply(B_OK, &reply, sizeof(reply));
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVER_REGISTER_MEDIAADDON:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user