various bugfixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3339 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -111,7 +111,6 @@ enum {
|
|||||||
NODE_SET_TIMESOURCE,
|
NODE_SET_TIMESOURCE,
|
||||||
NODE_REQUEST_COMPLETED,
|
NODE_REQUEST_COMPLETED,
|
||||||
NODE_FINAL_RELEASE,
|
NODE_FINAL_RELEASE,
|
||||||
NODE_PUBLISH_CONNECTIONS,
|
|
||||||
|
|
||||||
NODE_MESSAGE_END,
|
NODE_MESSAGE_END,
|
||||||
CONSUMER_MESSAGE_START = 0x300,
|
CONSUMER_MESSAGE_START = 0x300,
|
||||||
|
|||||||
@@ -1554,25 +1554,6 @@ BMediaRosterEx::RegisterNode(BMediaNode * node, media_addon_id addonid, int32 fl
|
|||||||
ts->FinishCreate();
|
ts->FinishCreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX XXX XXX
|
|
||||||
// Calling GetAllOutputs and GetAllInputs here,
|
|
||||||
// followed by PublishOutputs and PublishInputs,
|
|
||||||
// does not work, it is too early, and in some
|
|
||||||
// cases it will deadlock the node control thread.
|
|
||||||
|
|
||||||
// Posting a message to the roster thread here
|
|
||||||
// is also to early, the multi_audio add-on will
|
|
||||||
// no list any inputs
|
|
||||||
// XXX XXX XXX
|
|
||||||
|
|
||||||
|
|
||||||
BMessage msg(NODE_PUBLISH_CONNECTIONS);
|
|
||||||
media_node tempnode;
|
|
||||||
tempnode = node->Node();
|
|
||||||
msg.AddData("node", B_RAW_TYPE, &tempnode, sizeof(tempnode));
|
|
||||||
PostMessage(&msg);
|
|
||||||
|
|
||||||
/*
|
|
||||||
// register existing inputs and outputs with the
|
// register existing inputs and outputs with the
|
||||||
// media_server, this allows GetLiveNodes() to work
|
// media_server, this allows GetLiveNodes() to work
|
||||||
// with created, but unconnected nodes.
|
// with created, but unconnected nodes.
|
||||||
@@ -1580,12 +1561,13 @@ BMediaRosterEx::RegisterNode(BMediaNode * node, media_addon_id addonid, int32 fl
|
|||||||
List<media_output> list;
|
List<media_output> list;
|
||||||
if (B_OK == GetAllOutputs(node->Node(), &list))
|
if (B_OK == GetAllOutputs(node->Node(), &list))
|
||||||
PublishOutputs(node->Node(), &list);
|
PublishOutputs(node->Node(), &list);
|
||||||
} else if (node->Kinds() & B_BUFFER_CONSUMER) {
|
}
|
||||||
|
if (node->Kinds() & B_BUFFER_CONSUMER) {
|
||||||
List<media_input> list;
|
List<media_input> list;
|
||||||
if (B_OK == GetAllInputs(node->Node(), &list))
|
if (B_OK == GetAllInputs(node->Node(), &list))
|
||||||
PublishInputs(node->Node(), &list);
|
PublishInputs(node->Node(), &list);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
BPrivate::media::notifications::NodesCreated(&reply.nodeid, 1);
|
BPrivate::media::notifications::NodesCreated(&reply.nodeid, 1);
|
||||||
/*
|
/*
|
||||||
TRACE("BMediaRoster::RegisterNode: registered node name '%s', id %ld, addon %ld, flavor %ld\n", node->Name(), node->ID(), addon_id, addon_flavor_id);
|
TRACE("BMediaRoster::RegisterNode: registered node name '%s', id %ld, addon %ld, flavor %ld\n", node->Name(), node->ID(), addon_id, addon_flavor_id);
|
||||||
@@ -1596,7 +1578,6 @@ BMediaRosterEx::RegisterNode(BMediaNode * node, media_addon_id addonid, int32 fl
|
|||||||
TRACE("BMediaRoster::RegisterNode: node fControllableThis %p\n", node->fControllableThis);
|
TRACE("BMediaRoster::RegisterNode: node fControllableThis %p\n", node->fControllableThis);
|
||||||
TRACE("BMediaRoster::RegisterNode: node fTimeSourceThis %p\n", node->fTimeSourceThis);
|
TRACE("BMediaRoster::RegisterNode: node fTimeSourceThis %p\n", node->fTimeSourceThis);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2463,34 +2444,6 @@ BMediaRoster::MessageReceived(BMessage * message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NODE_PUBLISH_CONNECTIONS:
|
|
||||||
{
|
|
||||||
const void *data;
|
|
||||||
ssize_t numBytes;
|
|
||||||
media_node node;
|
|
||||||
|
|
||||||
printf("NODE_PUBLISH_CONNECTIONS enter\n");
|
|
||||||
|
|
||||||
message->FindData("node", B_RAW_TYPE, &data, &numBytes);
|
|
||||||
node = *(const media_node *)data;
|
|
||||||
|
|
||||||
// register existing inputs and outputs with the
|
|
||||||
// media_server, this allows GetLiveNodes() to work
|
|
||||||
// with created, but unconnected nodes.
|
|
||||||
if (node.kind & B_BUFFER_PRODUCER) {
|
|
||||||
List<media_output> outputlist;
|
|
||||||
if (B_OK == MediaRosterEx(this)->GetAllOutputs(node, &outputlist))
|
|
||||||
MediaRosterEx(this)->PublishOutputs(node, &outputlist);
|
|
||||||
}
|
|
||||||
if (node.kind & B_BUFFER_CONSUMER) {
|
|
||||||
List<media_input> inputlist;
|
|
||||||
if (B_OK == MediaRosterEx(this)->GetAllInputs(node, &inputlist))
|
|
||||||
MediaRosterEx(this)->PublishInputs(node, &inputlist);
|
|
||||||
}
|
|
||||||
printf("NODE_PUBLISH_CONNECTIONS leave\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case NODE_FINAL_RELEASE:
|
case NODE_FINAL_RELEASE:
|
||||||
{
|
{
|
||||||
// this function is called by a BMediaNode to delete
|
// this function is called by a BMediaNode to delete
|
||||||
|
|||||||
@@ -8,11 +8,8 @@
|
|||||||
#include <TimeSource.h>
|
#include <TimeSource.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "DefaultManager.h"
|
#include "DefaultManager.h"
|
||||||
#include "NodeManager.h"
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
extern NodeManager *gNodeManager;
|
|
||||||
|
|
||||||
/* no locking used in this file, we assume that the caller (NodeManager) does it.
|
/* no locking used in this file, we assume that the caller (NodeManager) does it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -161,11 +158,7 @@ DefaultManager::RescanThread()
|
|||||||
// We do not search for the system time source,
|
// We do not search for the system time source,
|
||||||
// it should already exist
|
// it should already exist
|
||||||
ASSERT(fSystemTimeSource != -1);
|
ASSERT(fSystemTimeSource != -1);
|
||||||
/*
|
|
||||||
//for (int i = 0; i < 10; i++) { // XXX ugly workaround
|
|
||||||
gNodeManager->UpdateNodeConnections(); // XXX ugly workaround
|
|
||||||
snooze(1000000); // XXX ugly workaround
|
|
||||||
*/
|
|
||||||
if (fPhysicalVideoOut == -1)
|
if (fPhysicalVideoOut == -1)
|
||||||
FindPhysicalVideoOut();
|
FindPhysicalVideoOut();
|
||||||
if (fPhysicalVideoIn == -1)
|
if (fPhysicalVideoIn == -1)
|
||||||
@@ -176,7 +169,6 @@ DefaultManager::RescanThread()
|
|||||||
FindPhysicalAudioIn();
|
FindPhysicalAudioIn();
|
||||||
if (fAudioMixer == -1)
|
if (fAudioMixer == -1)
|
||||||
FindAudioMixer();
|
FindAudioMixer();
|
||||||
//}
|
|
||||||
|
|
||||||
// The normal time source is searched for after the
|
// The normal time source is searched for after the
|
||||||
// Physical Audio Out has been created.
|
// Physical Audio Out has been created.
|
||||||
@@ -383,6 +375,11 @@ DefaultManager::ConnectMixerToOutput()
|
|||||||
|
|
||||||
memset(&format, 0, sizeof(format));
|
memset(&format, 0, sizeof(format));
|
||||||
format.type = B_MEDIA_RAW_AUDIO;
|
format.type = B_MEDIA_RAW_AUDIO;
|
||||||
|
format.u.raw_audio.frame_rate = 44100;
|
||||||
|
format.u.raw_audio.channel_count = 2;
|
||||||
|
format.u.raw_audio.format = 0x2;
|
||||||
|
|
||||||
|
//roster->GetFormatFor(input, &format);
|
||||||
|
|
||||||
rv = roster->Connect(output.source, input.destination, &format, &output, &input);
|
rv = roster->Connect(output.source, input.destination, &format, &output, &input);
|
||||||
if (rv != B_OK) {
|
if (rv != B_OK) {
|
||||||
@@ -404,6 +401,7 @@ DefaultManager::ConnectMixerToOutput()
|
|||||||
finish:
|
finish:
|
||||||
roster->ReleaseNode(mixer);
|
roster->ReleaseNode(mixer);
|
||||||
roster->ReleaseNode(soundcard);
|
roster->ReleaseNode(soundcard);
|
||||||
|
roster->ReleaseNode(timesource);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -543,28 +543,6 @@ NodeManager::GetLiveNodes(BMessage *msg)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
NodeManager::UpdateNodeConnections()
|
|
||||||
{
|
|
||||||
// XXX this is only a workaround because the multi_audio
|
|
||||||
// XXX addon does not publish inputs right after creation :(
|
|
||||||
BAutolock lock(fLocker);
|
|
||||||
|
|
||||||
registered_node *rn;
|
|
||||||
for (fRegisteredNodeMap->Rewind(); fRegisteredNodeMap->GetNext(&rn); ) {
|
|
||||||
|
|
||||||
BMessage msg(NODE_PUBLISH_CONNECTIONS);
|
|
||||||
media_node tempnode;
|
|
||||||
tempnode.node = rn->nodeid;
|
|
||||||
tempnode.port = rn->port;
|
|
||||||
tempnode.kind = rn->kinds;
|
|
||||||
msg.AddData("node", B_RAW_TYPE, &tempnode, sizeof(tempnode));
|
|
||||||
|
|
||||||
gAppManager->SendMessage(rn->team, &msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Registration of BMediaAddOns
|
* Registration of BMediaAddOns
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|||||||
@@ -105,8 +105,6 @@ public:
|
|||||||
|
|
||||||
void CleanupTeam(team_id team);
|
void CleanupTeam(team_id team);
|
||||||
|
|
||||||
void UpdateNodeConnections();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
media_addon_id fNextAddOnID;
|
media_addon_id fNextAddOnID;
|
||||||
media_node_id fNextNodeID;
|
media_node_id fNextNodeID;
|
||||||
|
|||||||
Reference in New Issue
Block a user