MediaConnection: Remove redundant IsInput/IsOutput
This commit is contained in:
@@ -35,9 +35,6 @@ public:
|
|||||||
media_connection_id Id() const;
|
media_connection_id Id() const;
|
||||||
const char* Name() const;
|
const char* Name() const;
|
||||||
|
|
||||||
bool IsInput() const;
|
|
||||||
bool IsOutput() const;
|
|
||||||
|
|
||||||
bool HasBinding() const;
|
bool HasBinding() const;
|
||||||
BMediaConnection* Binding() const;
|
BMediaConnection* Binding() const;
|
||||||
|
|
||||||
|
|||||||
@@ -146,10 +146,13 @@ BMediaClient::Connect(BMediaConnection* ourConnection,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (ourConnection->IsOutput() && theirConnection.IsInput())
|
BMediaOutput* output = dynamic_cast<BMediaOutput*>(ourConnection);
|
||||||
return _ConnectInput(dynamic_cast<BMediaOutput*>(ourConnection), theirConnection);
|
if (output != NULL && theirConnection.IsInput())
|
||||||
else if (ourConnection->IsInput() && theirConnection.IsOutput())
|
return _ConnectInput(output, theirConnection);
|
||||||
return _ConnectOutput(dynamic_cast<BMediaInput*>(ourConnection), theirConnection);
|
|
||||||
|
BMediaInput* input = dynamic_cast<BMediaInput*>(ourConnection);
|
||||||
|
if (input != NULL && theirConnection.IsOutput())
|
||||||
|
return _ConnectOutput(input, theirConnection);
|
||||||
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,24 +36,6 @@ BMediaConnection::Connection() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BMediaConnection::IsOutput() const
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
return fConnection.IsOutput();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BMediaConnection::IsInput() const
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
return fConnection.IsInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BMediaConnection::HasBinding() const
|
BMediaConnection::HasBinding() const
|
||||||
{
|
{
|
||||||
@@ -162,7 +144,7 @@ BMediaConnection::ConnectionRegistered(BMediaClient* owner,
|
|||||||
fConnection.id = id;
|
fConnection.id = id;
|
||||||
fConnection.client = fOwner->Client();
|
fConnection.client = fOwner->Client();
|
||||||
|
|
||||||
if (IsOutput()) {
|
if (fConnection.IsOutput()) {
|
||||||
fConnection.source.port = fOwner->fNode->ControlPort();
|
fConnection.source.port = fOwner->fNode->ControlPort();
|
||||||
fConnection.source.id = fConnection.id;
|
fConnection.source.id = fConnection.id;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user