Implement BMediaRoster::RollNode().
Fixes #9083. Signed-off-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
67d5656fab
commit
14896b937a
@@ -88,6 +88,7 @@ enum {
|
|||||||
NODE_SET_RUN_MODE,
|
NODE_SET_RUN_MODE,
|
||||||
NODE_TIME_WARP,
|
NODE_TIME_WARP,
|
||||||
NODE_PREROLL,
|
NODE_PREROLL,
|
||||||
|
NODE_ROLL,
|
||||||
NODE_SET_TIMESOURCE,
|
NODE_SET_TIMESOURCE,
|
||||||
NODE_GET_TIMESOURCE,
|
NODE_GET_TIMESOURCE,
|
||||||
NODE_REQUEST_COMPLETED,
|
NODE_REQUEST_COMPLETED,
|
||||||
@@ -899,6 +900,12 @@ struct node_seek_command : command_data {
|
|||||||
bigtime_t performance_time;
|
bigtime_t performance_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct node_roll_command : command_data {
|
||||||
|
bigtime_t start_performance_time;
|
||||||
|
bigtime_t stop_performance_time;
|
||||||
|
bigtime_t seek_media_time;
|
||||||
|
};
|
||||||
|
|
||||||
struct node_set_run_mode_command : command_data {
|
struct node_set_run_mode_command : command_data {
|
||||||
BMediaNode::run_mode mode;
|
BMediaNode::run_mode mode;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -632,6 +632,23 @@ BMediaNode::HandleMessage(int32 message,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NODE_ROLL:
|
||||||
|
{
|
||||||
|
const node_roll_command *command
|
||||||
|
= static_cast<const node_roll_command *>(data);
|
||||||
|
|
||||||
|
TRACE("BMediaNode::HandleMessage NODE_ROLL, node %ld\n",
|
||||||
|
fNodeID);
|
||||||
|
|
||||||
|
if (command->seek_media_time != B_INFINITE_TIMEOUT)
|
||||||
|
Seek(command->seek_media_time,
|
||||||
|
command->start_performance_time);
|
||||||
|
|
||||||
|
Start(command->start_performance_time);
|
||||||
|
Stop(command->stop_performance_time, false);
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
case NODE_SET_TIMESOURCE:
|
case NODE_SET_TIMESOURCE:
|
||||||
{
|
{
|
||||||
const node_set_timesource_command *command = static_cast<const node_set_timesource_command *>(data);
|
const node_set_timesource_command *command = static_cast<const node_set_timesource_command *>(data);
|
||||||
|
|||||||
@@ -1400,8 +1400,21 @@ status_t
|
|||||||
BMediaRoster::RollNode(const media_node& node, bigtime_t startPerformance,
|
BMediaRoster::RollNode(const media_node& node, bigtime_t startPerformance,
|
||||||
bigtime_t stopPerformance, bigtime_t atMediaTime)
|
bigtime_t stopPerformance, bigtime_t atMediaTime)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED();
|
CALLED();
|
||||||
return B_ERROR;
|
if (IS_INVALID_NODE(node))
|
||||||
|
return B_MEDIA_BAD_NODE;
|
||||||
|
|
||||||
|
TRACE("BMediaRoster::RollNode, node %" B_PRId32 ", at start perf %"
|
||||||
|
B_PRId64 ", at stop perf %" B_PRId64 ", at media time %"
|
||||||
|
B_PRId64 "\n", node.node, startPerformance,
|
||||||
|
stopPerformance, atMediaTime);
|
||||||
|
|
||||||
|
node_roll_command command;
|
||||||
|
command.start_performance_time = startPerformance;
|
||||||
|
command.stop_performance_time = stopPerformance;
|
||||||
|
command.seek_media_time = atMediaTime;
|
||||||
|
|
||||||
|
return write_port(node.port, NODE_ROLL, &command, sizeof(command));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user