MediaClient: Use higher level structs for the remaining methods

This commit is contained in:
Dario Casalinuovo
2016-11-24 21:37:14 +01:00
parent ace98a8db2
commit 902701e6bf
2 changed files with 35 additions and 5 deletions
+9 -3
View File
@@ -116,9 +116,9 @@ public:
BMediaConnection* OutputAt(int32 index) const; BMediaConnection* OutputAt(int32 index) const;
BMediaConnection* FindInput( BMediaConnection* FindInput(
const media_destination& dest) const; const media_connection& input) const;
BMediaConnection* FindOutput( BMediaConnection* FindOutput(
const media_source& source) const; const media_connection& output) const;
bool IsRunning() const; bool IsRunning() const;
@@ -135,7 +135,9 @@ public:
// It will be B_INCREASE_LATENCY by default // It will be B_INCREASE_LATENCY by default
BMediaNode::run_mode RunMode() const; BMediaNode::run_mode RunMode() const;
status_t SetRunMode(BMediaNode::run_mode mode); status_t SetRunMode(BMediaNode::run_mode mode);
status_t SetTimeSource(media_node timesource); // TODO: Really needed?
status_t SetTimeSource(
const media_client& timesource);
// Specify a latency range to allow the node behave correctly. // Specify a latency range to allow the node behave correctly.
// Ideally the minimum latency should be the algorithmic latency you expect // Ideally the minimum latency should be the algorithmic latency you expect
@@ -183,6 +185,10 @@ protected:
status_t ReleaseConnection(BMediaConnection* conn); status_t ReleaseConnection(BMediaConnection* conn);
private: private:
BMediaConnection* FindInput(
const media_destination& dest) const;
BMediaConnection* FindOutput(
const media_source& source) const;
void _Init(); void _Init();
void _Deinit(); void _Deinit();
+26 -2
View File
@@ -249,6 +249,30 @@ BMediaClient::OutputAt(int32 index) const
} }
BMediaConnection*
BMediaClient::FindInput(const media_connection& input) const
{
CALLED();
if (!input.IsInput())
return NULL;
return FindInput(input.Destination());
}
BMediaConnection*
BMediaClient::FindOutput(const media_connection& output) const
{
CALLED();
if (!output.IsOutput())
return NULL;
return FindOutput(output.Source());
}
BMediaConnection* BMediaConnection*
BMediaClient::FindInput(const media_destination& dest) const BMediaClient::FindInput(const media_destination& dest) const
{ {
@@ -388,12 +412,12 @@ BMediaClient::SetRunMode(BMediaNode::run_mode mode)
status_t status_t
BMediaClient::SetTimeSource(media_node timesource) BMediaClient::SetTimeSource(const media_client& timesource)
{ {
CALLED(); CALLED();
return BMediaRoster::CurrentRoster()->SetTimeSourceFor(fNode->Node().node, return BMediaRoster::CurrentRoster()->SetTimeSourceFor(fNode->Node().node,
timesource.node); timesource.node.node);
} }