MediaConnection: Fix buffer size and duration redudancy

* There's no need to supply ways to mismatch the buffer duration
and size. Anything should reflect the media_format, this is at least
fixed on API level.
This commit is contained in:
Dario Casalinuovo 2016-12-17 19:07:23 +01:00
parent 2fdc256d60
commit 75b90c42e5
2 changed files with 8 additions and 24 deletions

View File

@ -41,22 +41,22 @@ public:
bool HasBinding() const; bool HasBinding() const;
BMediaConnection* Binding() const; BMediaConnection* Binding() const;
bool IsConnected() const;
// This allow to specify a format that will be used while // This allow to specify a format that will be used while
// connecting to another node. See BMediaClient::SetFormat. // connecting to another node. See BMediaClient::SetFormat.
void SetAcceptedFormat( void SetAcceptedFormat(
const media_format& format); const media_format& format);
const media_format& AcceptedFormat() const; const media_format& AcceptedFormat() const;
// Represents the buffer size used by the media_node // Represents the buffer size, depends on the format set or negotiated
void SetBufferSize(size_t size); // for this connection.
size_t BufferSize() const; size_t BufferSize() const;
// Represents the duration of one buffer // Represents the duration of one buffer depends on the format set or
void SetBufferDuration(bigtime_t duration); // negotiated for this connection.
bigtime_t BufferDuration() const; bigtime_t BufferDuration() const;
bool IsConnected() const;
// Disconnect this connection. When a connection is disconnected, // Disconnect this connection. When a connection is disconnected,
// it can be reused as brand new. // it can be reused as brand new.
status_t Disconnect(); status_t Disconnect();

View File

@ -120,15 +120,8 @@ BMediaConnection::Release()
} }
void // TODO: The data represented by the following two functions should be
BMediaConnection::SetBufferSize(size_t size) // automatically calculated depending on the media_format.
{
CALLED();
fBufferSize = size;
}
size_t size_t
BMediaConnection::BufferSize() const BMediaConnection::BufferSize() const
{ {
@ -138,15 +131,6 @@ BMediaConnection::BufferSize() const
} }
void
BMediaConnection::SetBufferDuration(bigtime_t duration)
{
CALLED();
fBufferDuration = duration;
}
bigtime_t bigtime_t
BMediaConnection::BufferDuration() const BMediaConnection::BufferDuration() const
{ {