MediaClient: Fix style for private methods and other cleanup
* Cleaned up some unneeded callbacks.
This commit is contained in:
@@ -142,33 +142,21 @@ protected:
|
|||||||
virtual void HandleSeek(bigtime_t mediaTime,
|
virtual void HandleSeek(bigtime_t mediaTime,
|
||||||
bigtime_t performanceTime);
|
bigtime_t performanceTime);
|
||||||
|
|
||||||
virtual status_t HandleFormatSuggestion(media_type type,
|
virtual status_t FormatSuggestion(media_type type,
|
||||||
int32 quality, media_format* format);
|
int32 quality, media_format* format);
|
||||||
|
|
||||||
// Called from BMediaConnection
|
|
||||||
status_t ConnectionDisconnected(BMediaConnection* conn);
|
|
||||||
status_t ConnectionReleased(BMediaConnection* conn);
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void AddInput(BMediaInput* input);
|
|
||||||
virtual void AddOutput(BMediaOutput* output);
|
|
||||||
|
|
||||||
BMediaInput* FindInput(
|
|
||||||
const media_destination& dest) const;
|
|
||||||
BMediaOutput* FindOutput(
|
|
||||||
const media_source& source) const;
|
|
||||||
|
|
||||||
// Possible canditates for removal
|
|
||||||
void HandleTimeWarp(bigtime_t realTime,
|
|
||||||
bigtime_t performanceTime);
|
|
||||||
|
|
||||||
status_t SetTimeSource(
|
|
||||||
const media_client& timesource);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _Init();
|
void _Init();
|
||||||
void _Deinit();
|
void _Deinit();
|
||||||
|
|
||||||
|
void _AddInput(BMediaInput* input);
|
||||||
|
void _AddOutput(BMediaOutput* output);
|
||||||
|
|
||||||
|
BMediaInput* _FindInput(
|
||||||
|
const media_destination& dest) const;
|
||||||
|
BMediaOutput* _FindOutput(
|
||||||
|
const media_source& source) const;
|
||||||
|
|
||||||
status_t _ConnectInput(BMediaOutput* output,
|
status_t _ConnectInput(BMediaOutput* output,
|
||||||
const media_connection& input);
|
const media_connection& input);
|
||||||
status_t _ConnectOutput(BMediaInput* input,
|
status_t _ConnectOutput(BMediaInput* input,
|
||||||
|
|||||||
@@ -66,15 +66,14 @@ typedef struct media_connection {
|
|||||||
BMessage* ToMessage() const;
|
BMessage* ToMessage() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
media_input MediaInput() const;
|
media_input _MediaInput() const;
|
||||||
media_output MediaOutput() const;
|
media_output _MediaOutput() const;
|
||||||
|
|
||||||
const media_source& Source() const;
|
const media_source& _Source() const;
|
||||||
const media_destination& Destination() const;
|
const media_destination& _Destination() const;
|
||||||
|
|
||||||
media_node RemoteNode() const;
|
media_node _RemoteNode() const;
|
||||||
|
|
||||||
private:
|
|
||||||
media_connection_id id;
|
media_connection_id id;
|
||||||
|
|
||||||
media_client client;
|
media_client client;
|
||||||
|
|||||||
@@ -84,11 +84,11 @@ protected:
|
|||||||
bigtime_t* max) const;
|
bigtime_t* max) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ConnectionRegistered(BMediaClient* owner,
|
void _ConnectionRegistered(BMediaClient* owner,
|
||||||
media_connection_id id);
|
media_connection_id id);
|
||||||
|
|
||||||
const media_source& Source() const;
|
const media_source& _Source() const;
|
||||||
const media_destination& Destination() const;
|
const media_destination& _Destination() const;
|
||||||
|
|
||||||
media_connection fConnection;
|
media_connection fConnection;
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ protected:
|
|||||||
virtual void BufferReceived(BBuffer* buffer);
|
virtual void BufferReceived(BBuffer* buffer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
media_input MediaInput() const;
|
media_input _MediaInput() const;
|
||||||
|
|
||||||
virtual void _ReservedMediaInput0();
|
virtual void _ReservedMediaInput0();
|
||||||
virtual void _ReservedMediaInput1();
|
virtual void _ReservedMediaInput1();
|
||||||
@@ -182,7 +182,7 @@ protected:
|
|||||||
virtual status_t SendBuffer(BBuffer* buffer);
|
virtual status_t SendBuffer(BBuffer* buffer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
media_output MediaOutput() const;
|
media_output _MediaOutput() const;
|
||||||
|
|
||||||
bool fEnabled;
|
bool fEnabled;
|
||||||
size_t fFramesSent;
|
size_t fFramesSent;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ public:
|
|||||||
B_WILL_START = 1, // performance_time
|
B_WILL_START = 1, // performance_time
|
||||||
B_WILL_STOP, // performance_time immediate
|
B_WILL_STOP, // performance_time immediate
|
||||||
B_WILL_SEEK, // performance_time media_time
|
B_WILL_SEEK, // performance_time media_time
|
||||||
B_WILL_TIMEWARP, // real_time performance_time
|
|
||||||
|
|
||||||
B_FORMAT_SUGGESTION, // media_type type, int32 quality,
|
B_FORMAT_SUGGESTION, // media_type type, int32 quality,
|
||||||
// media_format* format
|
// media_format* format
|
||||||
@@ -59,9 +58,6 @@ protected:
|
|||||||
virtual void HandleSeek(bigtime_t mediaTime,
|
virtual void HandleSeek(bigtime_t mediaTime,
|
||||||
bigtime_t performanceTime);
|
bigtime_t performanceTime);
|
||||||
|
|
||||||
virtual void HandleTimeWarp(bigtime_t realTime,
|
|
||||||
bigtime_t performanceTime);
|
|
||||||
|
|
||||||
virtual status_t HandleFormatSuggestion(media_type type,
|
virtual status_t HandleFormatSuggestion(media_type type,
|
||||||
int32 quality, media_format* format);
|
int32 quality, media_format* format);
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ BMediaClient::MediaType() const
|
|||||||
status_t
|
status_t
|
||||||
BMediaClient::RegisterInput(BMediaInput* input)
|
BMediaClient::RegisterInput(BMediaInput* input)
|
||||||
{
|
{
|
||||||
input->ConnectionRegistered(this, ++fLastID);
|
input->_ConnectionRegistered(this, ++fLastID);
|
||||||
AddInput(input);
|
_AddInput(input);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,8 +85,8 @@ BMediaClient::RegisterInput(BMediaInput* input)
|
|||||||
status_t
|
status_t
|
||||||
BMediaClient::RegisterOutput(BMediaOutput* output)
|
BMediaClient::RegisterOutput(BMediaOutput* output)
|
||||||
{
|
{
|
||||||
output->ConnectionRegistered(this, ++fLastID);
|
output->_ConnectionRegistered(this, ++fLastID);
|
||||||
AddOutput(output);
|
_AddOutput(output);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ BMediaClient::FindInput(const media_connection& input) const
|
|||||||
if (!input.IsInput())
|
if (!input.IsInput())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return FindInput(input.Destination());
|
return _FindInput(input._Destination());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -243,33 +243,7 @@ BMediaClient::FindOutput(const media_connection& output) const
|
|||||||
if (!output.IsOutput())
|
if (!output.IsOutput())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return FindOutput(output.Source());
|
return _FindOutput(output._Source());
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BMediaInput*
|
|
||||||
BMediaClient::FindInput(const media_destination& dest) const
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
for (int32 i = 0; i < CountInputs(); i++) {
|
|
||||||
if (dest.id == InputAt(i)->Destination().id)
|
|
||||||
return InputAt(i);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BMediaOutput*
|
|
||||||
BMediaClient::FindOutput(const media_source& source) const
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
for (int32 i = 0; i < CountOutputs(); i++) {
|
|
||||||
if (source.id == OutputAt(i)->Source().id)
|
|
||||||
return OutputAt(i);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -289,7 +263,7 @@ BMediaClient::Start()
|
|||||||
|
|
||||||
status_t err = B_OK;
|
status_t err = B_OK;
|
||||||
for (int32 i = 0; i < CountOutputs(); i++) {
|
for (int32 i = 0; i < CountOutputs(); i++) {
|
||||||
media_node remoteNode = OutputAt(i)->Connection().RemoteNode();
|
media_node remoteNode = OutputAt(i)->Connection()._RemoteNode();
|
||||||
if (remoteNode.kind & B_TIME_SOURCE)
|
if (remoteNode.kind & B_TIME_SOURCE)
|
||||||
err = BMediaRoster::CurrentRoster()->StartTimeSource(
|
err = BMediaRoster::CurrentRoster()->StartTimeSource(
|
||||||
remoteNode, BTimeSource::RealTime());
|
remoteNode, BTimeSource::RealTime());
|
||||||
@@ -371,16 +345,6 @@ BMediaClient::SetRunMode(BMediaNode::run_mode mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
BMediaClient::SetTimeSource(const media_client& timesource)
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
return BMediaRoster::CurrentRoster()->SetTimeSourceFor(fNode->Node().node,
|
|
||||||
timesource.node.node);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bigtime_t
|
bigtime_t
|
||||||
BMediaClient::CurrentTime() const
|
BMediaClient::CurrentTime() const
|
||||||
{
|
{
|
||||||
@@ -390,24 +354,6 @@ BMediaClient::CurrentTime() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BMediaClient::AddInput(BMediaInput* input)
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
fInputs.AddItem(input);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BMediaClient::AddOutput(BMediaOutput* output)
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
fOutputs.AddItem(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BMediaAddOn*
|
BMediaAddOn*
|
||||||
BMediaClient::AddOn(int32* id) const
|
BMediaClient::AddOn(int32* id) const
|
||||||
{
|
{
|
||||||
@@ -437,34 +383,14 @@ BMediaClient::HandleSeek(bigtime_t mediaTime, bigtime_t performanceTime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BMediaClient::HandleTimeWarp(bigtime_t realTime, bigtime_t performanceTime)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BMediaClient::HandleFormatSuggestion(media_type type, int32 quality,
|
BMediaClient::FormatSuggestion(media_type type, int32 quality,
|
||||||
media_format* format)
|
media_format* format)
|
||||||
{
|
{
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
BMediaClient::ConnectionReleased(BMediaConnection* connection)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
BMediaClient::ConnectionDisconnected(BMediaConnection* connection)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMediaClient::_Init()
|
BMediaClient::_Init()
|
||||||
{
|
{
|
||||||
@@ -490,17 +416,61 @@ BMediaClient::_Deinit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BMediaClient::_AddInput(BMediaInput* input)
|
||||||
|
{
|
||||||
|
CALLED();
|
||||||
|
|
||||||
|
fInputs.AddItem(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BMediaClient::_AddOutput(BMediaOutput* output)
|
||||||
|
{
|
||||||
|
CALLED();
|
||||||
|
|
||||||
|
fOutputs.AddItem(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BMediaInput*
|
||||||
|
BMediaClient::_FindInput(const media_destination& dest) const
|
||||||
|
{
|
||||||
|
CALLED();
|
||||||
|
|
||||||
|
for (int32 i = 0; i < CountInputs(); i++) {
|
||||||
|
if (dest.id == InputAt(i)->_Destination().id)
|
||||||
|
return InputAt(i);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BMediaOutput*
|
||||||
|
BMediaClient::_FindOutput(const media_source& source) const
|
||||||
|
{
|
||||||
|
CALLED();
|
||||||
|
|
||||||
|
for (int32 i = 0; i < CountOutputs(); i++) {
|
||||||
|
if (source.id == OutputAt(i)->_Source().id)
|
||||||
|
return OutputAt(i);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BMediaClient::_ConnectInput(BMediaOutput* output,
|
BMediaClient::_ConnectInput(BMediaOutput* output,
|
||||||
const media_connection& input)
|
const media_connection& input)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (input.Destination() == media_destination::null)
|
if (input._Destination() == media_destination::null)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
media_output ourOutput = output->Connection().MediaOutput();
|
media_output ourOutput = output->Connection()._MediaOutput();
|
||||||
media_input theirInput = input.MediaInput();
|
media_input theirInput = input._MediaInput();
|
||||||
media_format format = output->AcceptedFormat();
|
media_format format = output->AcceptedFormat();
|
||||||
|
|
||||||
return BMediaRoster::CurrentRoster()->Connect(ourOutput.source,
|
return BMediaRoster::CurrentRoster()->Connect(ourOutput.source,
|
||||||
@@ -515,11 +485,11 @@ BMediaClient::_ConnectOutput(BMediaInput* input,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (output.Source() == media_source::null)
|
if (output._Source() == media_source::null)
|
||||||
return B_MEDIA_BAD_SOURCE;
|
return B_MEDIA_BAD_SOURCE;
|
||||||
|
|
||||||
media_input ourInput = input->Connection().MediaInput();
|
media_input ourInput = input->Connection()._MediaInput();
|
||||||
media_output theirOutput = output.MediaOutput();
|
media_output theirOutput = output._MediaOutput();
|
||||||
media_format format = input->AcceptedFormat();
|
media_format format = input->AcceptedFormat();
|
||||||
|
|
||||||
// TODO manage the node problems
|
// TODO manage the node problems
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ media_connection::IsOutput() const
|
|||||||
|
|
||||||
|
|
||||||
media_input
|
media_input
|
||||||
media_connection::MediaInput() const
|
media_connection::_MediaInput() const
|
||||||
{
|
{
|
||||||
media_input input;
|
media_input input;
|
||||||
input.node = client.node;
|
input.node = client.node;
|
||||||
@@ -64,7 +64,7 @@ media_connection::MediaInput() const
|
|||||||
|
|
||||||
|
|
||||||
media_output
|
media_output
|
||||||
media_connection::MediaOutput() const
|
media_connection::_MediaOutput() const
|
||||||
{
|
{
|
||||||
media_output output;
|
media_output output;
|
||||||
output.node = client.node;
|
output.node = client.node;
|
||||||
@@ -76,21 +76,21 @@ media_connection::MediaOutput() const
|
|||||||
|
|
||||||
|
|
||||||
const media_source&
|
const media_source&
|
||||||
media_connection::Source() const
|
media_connection::_Source() const
|
||||||
{
|
{
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const media_destination&
|
const media_destination&
|
||||||
media_connection::Destination() const
|
media_connection::_Destination() const
|
||||||
{
|
{
|
||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
media_node
|
media_node
|
||||||
media_connection::RemoteNode() const
|
media_connection::_RemoteNode() const
|
||||||
{
|
{
|
||||||
return remote_client.node;
|
return remote_client.node;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ BMediaClientNode::BMediaClientNode(const char* name,
|
|||||||
status_t
|
status_t
|
||||||
BMediaClientNode::SendBuffer(BBuffer* buffer, BMediaConnection* conn)
|
BMediaClientNode::SendBuffer(BBuffer* buffer, BMediaConnection* conn)
|
||||||
{
|
{
|
||||||
return BBufferProducer::SendBuffer(buffer, conn->Source(), conn->Destination());
|
return BBufferProducer::SendBuffer(buffer, conn->_Source(), conn->_Destination());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ BMediaClientNode::AcceptFormat(const media_destination& dest,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaInput* conn = fOwner->FindInput(dest);
|
BMediaInput* conn = fOwner->_FindInput(dest);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ BMediaClientNode::GetNextInput(int32* cookie,
|
|||||||
} else {
|
} else {
|
||||||
BMediaInput* conn = fOwner->InputAt(*cookie);
|
BMediaInput* conn = fOwner->InputAt(*cookie);
|
||||||
if (conn != NULL) {
|
if (conn != NULL) {
|
||||||
*input = conn->MediaInput();
|
*input = conn->_MediaInput();
|
||||||
*cookie += 1;
|
*cookie += 1;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ BMediaClientNode::GetLatencyFor(const media_destination& dest,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaInput* conn = fOwner->FindInput(dest);
|
BMediaInput* conn = fOwner->_FindInput(dest);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ BMediaClientNode::Connected(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaInput* conn = fOwner->FindInput(dest);
|
BMediaInput* conn = fOwner->_FindInput(dest);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ BMediaClientNode::Connected(const media_source& source,
|
|||||||
|
|
||||||
conn->Connected(format);
|
conn->Connected(format);
|
||||||
|
|
||||||
*outInput = conn->MediaInput();
|
*outInput = conn->_MediaInput();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,11 +243,11 @@ BMediaClientNode::Disconnected(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaInput* conn = fOwner->FindInput(dest);
|
BMediaInput* conn = fOwner->_FindInput(dest);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn->Source() == source) {
|
if (conn->_Source() == source) {
|
||||||
conn->Disconnect();
|
conn->Disconnect();
|
||||||
conn->Disconnected();
|
conn->Disconnected();
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ BMediaClientNode::FormatChanged(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaInput* conn = fOwner->FindInput(dest);
|
BMediaInput* conn = fOwner->_FindInput(dest);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ BMediaClientNode::FormatSuggestionRequested(media_type type,
|
|||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t ret = fOwner->HandleFormatSuggestion(type, quality, format);
|
status_t ret = fOwner->FormatSuggestion(type, quality, format);
|
||||||
if (ret != B_OK) {
|
if (ret != B_OK) {
|
||||||
// In that case we return just a very generic format.
|
// In that case we return just a very generic format.
|
||||||
media_format outFormat;
|
media_format outFormat;
|
||||||
@@ -299,7 +299,7 @@ BMediaClientNode::FormatProposal(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
@@ -314,7 +314,7 @@ BMediaClientNode::FormatChangeRequested(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ BMediaClientNode::GetNextOutput(int32* cookie, media_output* output)
|
|||||||
} else {
|
} else {
|
||||||
BMediaOutput* conn = fOwner->OutputAt(*cookie);
|
BMediaOutput* conn = fOwner->OutputAt(*cookie);
|
||||||
if (conn != NULL) {
|
if (conn != NULL) {
|
||||||
*output = conn->MediaOutput();
|
*output = conn->_MediaOutput();
|
||||||
*cookie += 1;
|
*cookie += 1;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ BMediaClientNode::SetBufferGroup(const media_source& source, BBufferGroup* group
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_SOURCE;
|
return B_MEDIA_BAD_SOURCE;
|
||||||
|
|
||||||
@@ -404,11 +404,11 @@ BMediaClientNode::PrepareToConnect(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return B_MEDIA_BAD_SOURCE;
|
return B_MEDIA_BAD_SOURCE;
|
||||||
|
|
||||||
if (conn->Destination() != media_destination::null)
|
if (conn->_Destination() != media_destination::null)
|
||||||
return B_MEDIA_ALREADY_CONNECTED;
|
return B_MEDIA_ALREADY_CONNECTED;
|
||||||
|
|
||||||
if (fOwner->MediaType() != B_MEDIA_UNKNOWN_TYPE
|
if (fOwner->MediaType() != B_MEDIA_UNKNOWN_TYPE
|
||||||
@@ -422,7 +422,7 @@ BMediaClientNode::PrepareToConnect(const media_source& source,
|
|||||||
if (err != B_OK)
|
if (err != B_OK)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
*out_source = conn->Source();
|
*out_source = conn->_Source();
|
||||||
strcpy(name, Name());
|
strcpy(name, Name());
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -436,7 +436,7 @@ BMediaClientNode::Connect(status_t status, const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -463,11 +463,11 @@ BMediaClientNode::Disconnect(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn->Destination() == dest) {
|
if (conn->_Destination() == dest) {
|
||||||
conn->Disconnect();
|
conn->Disconnect();
|
||||||
conn->Disconnected();
|
conn->Disconnected();
|
||||||
}
|
}
|
||||||
@@ -480,7 +480,7 @@ BMediaClientNode::EnableOutput(const media_source& source,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
BMediaOutput* conn = fOwner->FindOutput(source);
|
BMediaOutput* conn = fOwner->_FindOutput(source);
|
||||||
if (conn != NULL)
|
if (conn != NULL)
|
||||||
conn->SetEnabled(enabled);
|
conn->SetEnabled(enabled);
|
||||||
}
|
}
|
||||||
@@ -556,7 +556,7 @@ BMediaClientNode::HandleEvent(const media_timed_event* event,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case BTimedEventQueue::B_WARP:
|
case BTimedEventQueue::B_WARP:
|
||||||
fOwner->HandleTimeWarp(event->event_time, event->bigdata);
|
// NOTE: We have no need to handle it
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ BMediaClientNode::_HandleBuffer(BBuffer* buffer)
|
|||||||
|
|
||||||
media_destination dest;
|
media_destination dest;
|
||||||
dest.id = buffer->Header()->destination;
|
dest.id = buffer->Header()->destination;
|
||||||
BMediaInput* conn = fOwner->FindInput(dest);
|
BMediaInput* conn = fOwner->_FindInput(dest);
|
||||||
|
|
||||||
if (conn != NULL)
|
if (conn != NULL)
|
||||||
conn->BufferReceived(buffer);
|
conn->BufferReceived(buffer);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ BMediaConnection::Disconnect()
|
|||||||
delete fBufferGroup;
|
delete fBufferGroup;
|
||||||
fBufferGroup = NULL;
|
fBufferGroup = NULL;
|
||||||
|
|
||||||
return fOwner->ConnectionDisconnected(this);
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ BMediaConnection::Release()
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
return fOwner->ConnectionReleased(this);
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ BMediaConnection::SetLatencyRange(bigtime_t min, bigtime_t max)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMediaConnection::ConnectionRegistered(BMediaClient* owner,
|
BMediaConnection::_ConnectionRegistered(BMediaClient* owner,
|
||||||
media_connection_id id)
|
media_connection_id id)
|
||||||
{
|
{
|
||||||
fOwner = owner;
|
fOwner = owner;
|
||||||
@@ -183,16 +183,16 @@ BMediaConnection::ConnectionRegistered(BMediaClient* owner,
|
|||||||
|
|
||||||
|
|
||||||
const media_source&
|
const media_source&
|
||||||
BMediaConnection::Source() const
|
BMediaConnection::_Source() const
|
||||||
{
|
{
|
||||||
return fConnection.Source();
|
return fConnection._Source();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const media_destination&
|
const media_destination&
|
||||||
BMediaConnection::Destination() const
|
BMediaConnection::_Destination() const
|
||||||
{
|
{
|
||||||
return fConnection.Destination();
|
return fConnection._Destination();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -216,13 +216,6 @@ BMediaInput::BMediaInput()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
media_input
|
|
||||||
BMediaInput::MediaInput() const
|
|
||||||
{
|
|
||||||
return Connection().MediaInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BMediaInput::FormatChanged(const media_format& format)
|
BMediaInput::FormatChanged(const media_format& format)
|
||||||
{
|
{
|
||||||
@@ -243,6 +236,13 @@ BMediaInput::BufferReceived(BBuffer* buffer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
media_input
|
||||||
|
BMediaInput::_MediaInput() const
|
||||||
|
{
|
||||||
|
return Connection()._MediaInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void BMediaInput::_ReservedMediaInput0() {}
|
void BMediaInput::_ReservedMediaInput0() {}
|
||||||
void BMediaInput::_ReservedMediaInput1() {}
|
void BMediaInput::_ReservedMediaInput1() {}
|
||||||
void BMediaInput::_ReservedMediaInput2() {}
|
void BMediaInput::_ReservedMediaInput2() {}
|
||||||
@@ -313,9 +313,9 @@ BMediaOutput::SendBuffer(BBuffer* buffer)
|
|||||||
|
|
||||||
|
|
||||||
media_output
|
media_output
|
||||||
BMediaOutput::MediaOutput() const
|
BMediaOutput::_MediaOutput() const
|
||||||
{
|
{
|
||||||
return Connection().MediaOutput();
|
return Connection()._MediaOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -90,17 +90,6 @@ BSimpleMediaClient::HandleSeek(bigtime_t mediaTime, bigtime_t performanceTime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BSimpleMediaClient::HandleTimeWarp(bigtime_t realTime, bigtime_t performanceTime)
|
|
||||||
{
|
|
||||||
if (fNotifyHook != NULL) {
|
|
||||||
(*fNotifyHook)(BSimpleMediaClient::fNotifyCookie,
|
|
||||||
BSimpleMediaClient::B_WILL_TIMEWARP,
|
|
||||||
realTime, performanceTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BSimpleMediaClient::HandleFormatSuggestion(media_type type, int32 quality,
|
BSimpleMediaClient::HandleFormatSuggestion(media_type type, int32 quality,
|
||||||
media_format* format)
|
media_format* format)
|
||||||
|
|||||||
Reference in New Issue
Block a user