MediaConnection: Remove Reset()

This commit is contained in:
Dario Casalinuovo 2016-11-26 17:24:10 +01:00
parent 9ee6577e2d
commit 05e29ea1ad
5 changed files with 9 additions and 32 deletions

View File

@ -174,7 +174,6 @@ protected:
// Called from BMediaConnection
status_t DisconnectConnection(BMediaConnection* conn);
status_t ResetConnection(BMediaConnection* conn);
status_t ReleaseConnection(BMediaConnection* conn);
private:

View File

@ -91,18 +91,14 @@ public:
void SetCookie(void* cookie);
void* Cookie() const;
// Disconnect this connection.
// Disconnect this connection. When a connection is disconnected,
// it can be reused as brand new.
status_t Disconnect();
// TODO: We really need a Reset()?
// When you reset a connection it can be reused as it was brand new.
status_t Reset();
// Once you are done with this connection you release it, it automatically
// remove the object from the BMediaClient and free all used resources.
// This will make the connection to disappear completely, so if you
// want to preserve it for future connections just Disconnect() and
// Reset() it.
// want to preserve it for future connections just Disconnect() it.
status_t Release();
// Use this to set your callbacks.

View File

@ -195,15 +195,6 @@ BMediaClient::DisconnectConnection(BMediaConnection* conn)
}
status_t
BMediaClient::ResetConnection(BMediaConnection* conn)
{
CALLED();
return B_OK;
}
status_t
BMediaClient::ReleaseConnection(BMediaConnection* conn)
{

View File

@ -445,7 +445,7 @@ BMediaClientNode::Connect(status_t status, const media_source& source,
// Reset the connection to reuse it
if (status != B_OK) {
conn->Reset();
conn->Disconnect();
return;
}
@ -470,10 +470,10 @@ BMediaClientNode::Disconnect(const media_source& source,
if (conn == NULL)
return;
if (source == conn->Source() && dest == conn->Destination())
conn->Reset();
conn->Disconnected();
if (conn->Destination() == dest) {
conn->Disconnect();
conn->Disconnected();
}
}

View File

@ -129,19 +129,10 @@ BMediaConnection::Disconnect()
{
CALLED();
return fOwner->DisconnectConnection(this);
}
status_t
BMediaConnection::Reset()
{
CALLED();
delete fBufferGroup;
fBufferGroup = NULL;
return fOwner->ResetConnection(this);
return fOwner->DisconnectConnection(this);
}