2003-03-14 17:09:27 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2003 Marcus Overhagen.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This file may be used under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _MEDIA_ROSTER_EX_H_
|
|
|
|
#define _MEDIA_ROSTER_EX_H_
|
|
|
|
|
2015-03-23 13:46:08 +03:00
|
|
|
|
2003-03-14 17:09:27 +03:00
|
|
|
#ifndef _MEDIA_T_LIST_H
|
|
|
|
#include "TList.h"
|
|
|
|
#endif
|
|
|
|
#ifndef _DATA_EXCHANGE_H
|
|
|
|
#include "DataExchange.h"
|
|
|
|
#endif
|
|
|
|
#ifndef _MEDIA_NODE_H
|
|
|
|
#include <MediaNode.h>
|
|
|
|
#endif
|
|
|
|
#ifndef _MEDIA_ADD_ON_H
|
|
|
|
#include <MediaAddOn.h>
|
|
|
|
#endif
|
|
|
|
|
2015-03-23 13:46:08 +03:00
|
|
|
|
2003-03-14 17:09:27 +03:00
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
|
2015-03-23 13:46:08 +03:00
|
|
|
|
2003-03-14 17:09:27 +03:00
|
|
|
/* The BMediaRosterEx class is an extension to the BMediaRoster.
|
|
|
|
* It provides functionality that can be used by the implementation
|
|
|
|
* of media_server, media_addon_server and libmedia.so.
|
|
|
|
* To access it, convert any BMediaRoster pointer in a BMediaRosterEx
|
|
|
|
* pointer using the inline function provided below.
|
|
|
|
*/
|
|
|
|
class BMediaRosterEx : public BMediaRoster
|
|
|
|
{
|
|
|
|
public:
|
2015-03-23 13:46:08 +03:00
|
|
|
BMediaRosterEx(status_t* out_error);
|
2015-07-23 16:03:56 +03:00
|
|
|
virtual ~BMediaRosterEx();
|
2015-03-23 13:46:08 +03:00
|
|
|
|
2015-09-01 14:02:07 +03:00
|
|
|
virtual void Quit();
|
|
|
|
|
2015-03-23 13:46:08 +03:00
|
|
|
status_t SaveNodeConfiguration(BMediaNode* node);
|
|
|
|
status_t LoadNodeConfiguration(media_addon_id addonid,
|
|
|
|
int32 flavorid, BMessage* out_msg);
|
|
|
|
|
|
|
|
status_t IncrementAddonFlavorInstancesCount(
|
|
|
|
media_addon_id addonid, int32 flavorid);
|
|
|
|
|
|
|
|
status_t DecrementAddonFlavorInstancesCount(
|
|
|
|
media_addon_id addonid, int32 flavorid);
|
|
|
|
|
|
|
|
status_t ReleaseNodeAll(const media_node& node);
|
|
|
|
|
|
|
|
status_t SetNodeCreator(media_node_id node, team_id creator);
|
|
|
|
|
|
|
|
status_t RegisterNode(BMediaNode* node, media_addon_id addonid,
|
|
|
|
int32 flavorid);
|
|
|
|
|
|
|
|
status_t InstantiateDormantNode(media_addon_id addonid,
|
|
|
|
int32 flavorid, team_id creator, media_node* out_node);
|
|
|
|
|
|
|
|
status_t GetDormantFlavorInfo(media_addon_id addonid,
|
|
|
|
int32 flavorid, dormant_flavor_info* out_flavor);
|
|
|
|
|
|
|
|
status_t GetNode(node_type type, media_node* out_node,
|
|
|
|
int32* out_input_id = NULL,
|
|
|
|
BString* out_input_name = NULL);
|
|
|
|
|
|
|
|
status_t SetNode(node_type type, const media_node* node,
|
|
|
|
const dormant_node_info* info = NULL,
|
|
|
|
const media_input *input = NULL);
|
|
|
|
|
|
|
|
status_t GetAllOutputs(const media_node& node,
|
|
|
|
List<media_output>* list);
|
|
|
|
|
|
|
|
status_t GetAllOutputs(BBufferProducer* node,
|
|
|
|
List<media_output>* list);
|
|
|
|
|
|
|
|
status_t GetAllInputs(const media_node& node,
|
|
|
|
List<media_input>* list);
|
|
|
|
|
|
|
|
status_t GetAllInputs(BBufferConsumer* node,
|
|
|
|
List<media_input>* list);
|
|
|
|
|
|
|
|
status_t PublishOutputs(const media_node& node,
|
|
|
|
List<media_output>* list);
|
|
|
|
|
|
|
|
status_t PublishInputs(const media_node& node,
|
|
|
|
List<media_input>* list);
|
|
|
|
|
|
|
|
BTimeSource* MakeTimeSourceObject(media_node_id timesource_id);
|
2003-03-14 17:09:27 +03:00
|
|
|
|
2015-07-23 18:58:45 +03:00
|
|
|
status_t BuildConnections();
|
|
|
|
|
2015-11-28 18:28:10 +03:00
|
|
|
void RegisterLocalNode(BMediaNode* node);
|
|
|
|
void UnregisterLocalNode(BMediaNode* node);
|
|
|
|
|
2016-04-21 19:07:58 +03:00
|
|
|
void EnableLaunchNotification(bool enable,
|
|
|
|
bool autoExit);
|
|
|
|
|
2003-03-14 17:09:27 +03:00
|
|
|
private:
|
2016-04-21 19:07:58 +03:00
|
|
|
bool fLaunchNotification;
|
|
|
|
bool fAutoExit;
|
|
|
|
|
2003-03-14 17:09:27 +03:00
|
|
|
friend class BMediaRoster;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* The pointer returned by BMediaRoster::Roster() is always a
|
|
|
|
* BMediaRosterEx object pointer. Use this to convert it.
|
|
|
|
*/
|
2015-03-23 13:46:08 +03:00
|
|
|
inline BMediaRosterEx* MediaRosterEx(BMediaRoster* mediaroster)
|
2003-03-14 17:09:27 +03:00
|
|
|
{
|
2015-03-23 13:46:08 +03:00
|
|
|
return static_cast<BMediaRosterEx*>(mediaroster);
|
2003-03-14 17:09:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} } // BPrivate::media
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
|
|
|
|
#endif
|