Implemented GetStartLatency
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5626 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2422,8 +2422,25 @@ status_t
|
|||||||
BMediaRoster::GetStartLatencyFor(const media_node & time_source,
|
BMediaRoster::GetStartLatencyFor(const media_node & time_source,
|
||||||
bigtime_t * out_latency)
|
bigtime_t * out_latency)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED();
|
CALLED();
|
||||||
*out_latency = 5000;
|
if (out_latency == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
if (IS_INVALID_NODE(time_source))
|
||||||
|
return B_MEDIA_BAD_NODE;
|
||||||
|
if ((time_source.kind & B_TIME_SOURCE) == 0)
|
||||||
|
return B_MEDIA_BAD_NODE;
|
||||||
|
|
||||||
|
timesource_get_start_latency_request request;
|
||||||
|
timesource_get_start_latency_reply reply;
|
||||||
|
status_t rv;
|
||||||
|
|
||||||
|
rv = QueryPort(time_source.port, TIMESOURCE_GET_START_LATENCY, &request, sizeof(request), &reply, sizeof(reply));
|
||||||
|
if (rv != B_OK)
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
*out_latency = reply.start_latency;
|
||||||
|
|
||||||
|
printf("BMediaRoster::GetStartLatencyFor timesource %ld has maximum initial latency %Ld\n", time_source.node, *out_latency);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ BTimeSource::HandleMessage(int32 message,
|
|||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
PRINT(4, "BTimeSource::HandleMessage %#lx, node %ld\n", message, fNodeID);
|
PRINT(4, "BTimeSource::HandleMessage %#lx, node %ld\n", message, fNodeID);
|
||||||
|
status_t rv;
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case TIMESOURCE_OP:
|
case TIMESOURCE_OP:
|
||||||
{
|
{
|
||||||
@@ -275,6 +275,15 @@ BTimeSource::HandleMessage(int32 message,
|
|||||||
DirectRemoveMe(data->node);
|
DirectRemoveMe(data->node);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case TIMESOURCE_GET_START_LATENCY:
|
||||||
|
{
|
||||||
|
const timesource_get_start_latency_request *request = static_cast<const timesource_get_start_latency_request *>(rawdata);
|
||||||
|
timesource_get_start_latency_reply reply;
|
||||||
|
rv = GetStartLatency(&reply.start_latency);
|
||||||
|
request->SendReply(rv, &reply, sizeof(reply));
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user