Opened 5 years ago

Closed 4 years ago

#11856 closed enhancement (fixed)

Implement BMediaRoster::SyncToNode

Reported by: Barrett Owned by: Barrett
Priority: normal Milestone: R1
Component: Kits/Media Kit Version: R1/Development
Keywords: SyncToNode Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

SyncToNode allow to set a performance time and get the function returns when the specified node reach this time. While i don't know one app that use this part of the BeOS API it should be implemented as it's a useful functionality and may become handy in future. It's anyway a missing part of BeOS API.

Attachments (3)

0002-Implement-BMediaRoster-SyncToNode.2.patch (5.5 KB ) - added by Barrett 5 years ago.
0001-Add-SyncToNode-test-to-NodeTest-and-update-it-to-act.patch (2.8 KB ) - added by Barrett 4 years ago.
Fix NodeTest and add SyncToNode test.
0002-Implement-BMediaRoster-SyncToNode.patch (5.7 KB ) - added by Barrett 4 years ago.
An attempt to be more consistent.

Download all attachments as: .zip

Change History (13)

comment:1 by Barrett, 5 years ago

Has a Patch: set

comment:2 by jackburton, 5 years ago

Some comments on the patch:

port_id wait_port = create_port(1, "SyncToNode wait port");

if (wait_port == B_BAD_VALUE
wait_port == B_NO_MORE_PORTS)

return wait_port;

Is it correct to only check wait_port against these error codes ? Shouldn't this line read

if (wait_port < 0)

Same thing later, in

read_port_etc(wait_port, &code, &reply, sizeof(reply),

You only check for B_TIMEOUT, although you check the "code" varibale later, but maybe you should also check if read_port succeeded ?

comment:3 by Barrett, 5 years ago

I was a bit uncertain on how to handle those situations, i've fixed it in the new patch.

comment:4 by Barrett, 5 years ago

Could someone look at this one?

by Barrett, 4 years ago

Fix NodeTest and add SyncToNode test.

comment:5 by Barrett, 4 years ago

I'm trying to make my branch more slim so that i don't have too many beef on the roaster. I don't know what to do with the notifyPoint argument except use it for some logging.

comment:6 by korli, 4 years ago

The if statement in TimerExpired() is multilines, thus requires braces. The call to read_port_etc() has 0 as second argument, it should be NULL.

by Barrett, 4 years ago

An attempt to be more consistent.

comment:7 by Barrett, 4 years ago

Is there something missing to get the code applied?

On a side note the MixALot sample code from Be is using this function.

comment:8 by Barrett, 4 years ago

Updated patches of SyncToNode have been published into this branch:

https://github.com/Barrett17/haiku/commits/mediaroster

Last edited 4 years ago by Barrett (previous) (diff)

comment:9 by Barrett, 4 years ago

Owner: changed from axeld to Barrett
Status: newassigned

comment:10 by Barrett, 4 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev49387.

Note: See TracTickets for help on using tickets.