MediaConnection: Move buffer management on producer side
This commit is contained in:
@@ -89,8 +89,6 @@ private:
|
|||||||
// see BMediaClient::Bind.
|
// see BMediaClient::Bind.
|
||||||
BMediaConnection* fBind;
|
BMediaConnection* fBind;
|
||||||
|
|
||||||
BBufferGroup* fBufferGroup;
|
|
||||||
|
|
||||||
bool fConnected;
|
bool fConnected;
|
||||||
|
|
||||||
virtual void _ReservedMediaConnection0();
|
virtual void _ReservedMediaConnection0();
|
||||||
@@ -164,6 +162,8 @@ protected:
|
|||||||
// you are doing.
|
// you are doing.
|
||||||
virtual status_t SendBuffer(BBuffer* buffer);
|
virtual status_t SendBuffer(BBuffer* buffer);
|
||||||
|
|
||||||
|
virtual void Disconnected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
media_output _MediaOutput() const;
|
media_output _MediaOutput() const;
|
||||||
|
|
||||||
@@ -174,6 +174,8 @@ private:
|
|||||||
bool fEnabled;
|
bool fEnabled;
|
||||||
size_t fFramesSent;
|
size_t fFramesSent;
|
||||||
|
|
||||||
|
BBufferGroup* fBufferGroup;
|
||||||
|
|
||||||
virtual void _ReservedMediaOutput0();
|
virtual void _ReservedMediaOutput0();
|
||||||
virtual void _ReservedMediaOutput1();
|
virtual void _ReservedMediaOutput1();
|
||||||
virtual void _ReservedMediaOutput2();
|
virtual void _ReservedMediaOutput2();
|
||||||
|
|||||||
@@ -13,8 +13,7 @@
|
|||||||
BMediaConnection::BMediaConnection(media_connection_kinds kinds)
|
BMediaConnection::BMediaConnection(media_connection_kinds kinds)
|
||||||
:
|
:
|
||||||
fOwner(NULL),
|
fOwner(NULL),
|
||||||
fBind(NULL),
|
fBind(NULL)
|
||||||
fBufferGroup(NULL)
|
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
@@ -95,14 +94,7 @@ BMediaConnection::Disconnect()
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
status_t ret = fOwner->_DisconnectConnection(this);
|
return fOwner->_DisconnectConnection(this);
|
||||||
if (ret != B_OK)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
delete fBufferGroup;
|
|
||||||
fBufferGroup = NULL;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -238,7 +230,8 @@ void BMediaInput::_ReservedMediaInput10() {}
|
|||||||
|
|
||||||
BMediaOutput::BMediaOutput()
|
BMediaOutput::BMediaOutput()
|
||||||
:
|
:
|
||||||
BMediaConnection(B_MEDIA_OUTPUT)
|
BMediaConnection(B_MEDIA_OUTPUT),
|
||||||
|
fBufferGroup(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,6 +297,16 @@ BMediaOutput::SendBuffer(BBuffer* buffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BMediaOutput::Disconnected()
|
||||||
|
{
|
||||||
|
delete fBufferGroup;
|
||||||
|
fBufferGroup = NULL;
|
||||||
|
|
||||||
|
BMediaConnection::Disconnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
media_output
|
media_output
|
||||||
BMediaOutput::_MediaOutput() const
|
BMediaOutput::_MediaOutput() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user