MediaConnection: Remove Reset()
This commit is contained in:
@@ -174,7 +174,6 @@ protected:
|
|||||||
|
|
||||||
// Called from BMediaConnection
|
// Called from BMediaConnection
|
||||||
status_t DisconnectConnection(BMediaConnection* conn);
|
status_t DisconnectConnection(BMediaConnection* conn);
|
||||||
status_t ResetConnection(BMediaConnection* conn);
|
|
||||||
status_t ReleaseConnection(BMediaConnection* conn);
|
status_t ReleaseConnection(BMediaConnection* conn);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -91,18 +91,14 @@ public:
|
|||||||
void SetCookie(void* cookie);
|
void SetCookie(void* cookie);
|
||||||
void* Cookie() const;
|
void* Cookie() const;
|
||||||
|
|
||||||
// Disconnect this connection.
|
// Disconnect this connection. When a connection is disconnected,
|
||||||
|
// it can be reused as brand new.
|
||||||
status_t Disconnect();
|
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
|
// Once you are done with this connection you release it, it automatically
|
||||||
// remove the object from the BMediaClient and free all used resources.
|
// remove the object from the BMediaClient and free all used resources.
|
||||||
// This will make the connection to disappear completely, so if you
|
// This will make the connection to disappear completely, so if you
|
||||||
// want to preserve it for future connections just Disconnect() and
|
// want to preserve it for future connections just Disconnect() it.
|
||||||
// Reset() it.
|
|
||||||
status_t Release();
|
status_t Release();
|
||||||
|
|
||||||
// Use this to set your callbacks.
|
// Use this to set your callbacks.
|
||||||
|
|||||||
@@ -195,15 +195,6 @@ BMediaClient::DisconnectConnection(BMediaConnection* conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
BMediaClient::ResetConnection(BMediaConnection* conn)
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BMediaClient::ReleaseConnection(BMediaConnection* conn)
|
BMediaClient::ReleaseConnection(BMediaConnection* conn)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -445,7 +445,7 @@ BMediaClientNode::Connect(status_t status, const media_source& source,
|
|||||||
|
|
||||||
// Reset the connection to reuse it
|
// Reset the connection to reuse it
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
conn->Reset();
|
conn->Disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,10 +470,10 @@ BMediaClientNode::Disconnect(const media_source& source,
|
|||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (source == conn->Source() && dest == conn->Destination())
|
if (conn->Destination() == dest) {
|
||||||
conn->Reset();
|
conn->Disconnect();
|
||||||
|
conn->Disconnected();
|
||||||
conn->Disconnected();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -129,19 +129,10 @@ BMediaConnection::Disconnect()
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
return fOwner->DisconnectConnection(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
BMediaConnection::Reset()
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
delete fBufferGroup;
|
delete fBufferGroup;
|
||||||
fBufferGroup = NULL;
|
fBufferGroup = NULL;
|
||||||
|
|
||||||
return fOwner->ResetConnection(this);
|
return fOwner->DisconnectConnection(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user