2016-11-24 02:14:00 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2015, Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MEDIA_CLIENT_DEFS_H
|
|
|
|
#define _MEDIA_CLIENT_DEFS_H
|
|
|
|
|
|
|
|
#include <MediaDefs.h>
|
|
|
|
#include <MediaNode.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
|
|
|
|
|
2016-12-06 23:05:15 +03:00
|
|
|
typedef uint64 media_client_id;
|
|
|
|
typedef uint64 media_client_kinds;
|
|
|
|
typedef uint64 media_connection_kinds;
|
|
|
|
typedef uint64 media_connection_id;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
|
|
|
|
2016-12-06 23:05:15 +03:00
|
|
|
enum media_client_kind {
|
2016-11-24 02:14:00 +03:00
|
|
|
// The client can receive media data.
|
|
|
|
B_MEDIA_RECORDER = 0x000000001,
|
|
|
|
// The client can send media data to another client.
|
|
|
|
B_MEDIA_PLAYER = 0x000000002,
|
|
|
|
// The client specify a control GUI which can be used to configure it.
|
|
|
|
B_MEDIA_CONTROLLABLE = 0x000000004
|
|
|
|
};
|
|
|
|
|
2016-12-06 23:05:15 +03:00
|
|
|
enum media_connection_kind {
|
2016-11-24 02:14:00 +03:00
|
|
|
B_MEDIA_INPUT = 0,
|
|
|
|
B_MEDIA_OUTPUT = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct media_client {
|
|
|
|
media_client_id Id() const;
|
2016-12-06 23:05:15 +03:00
|
|
|
media_client_kinds Kinds() const;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
|
|
|
BMessage* ToMessage();
|
|
|
|
|
|
|
|
private:
|
2016-12-06 23:05:15 +03:00
|
|
|
media_client_kinds kinds;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
|
|
|
media_node node;
|
|
|
|
uint32 padding[16];
|
|
|
|
|
|
|
|
friend class BMediaClient;
|
|
|
|
friend class BMediaConnection;
|
|
|
|
friend class media_connection;
|
|
|
|
} media_client;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct media_connection {
|
|
|
|
media_connection_id Id() const;
|
2016-12-06 23:05:15 +03:00
|
|
|
media_connection_kinds Kinds() const;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
2016-11-25 02:05:06 +03:00
|
|
|
const media_client& Client() const;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
|
|
|
const char* Name() const;
|
|
|
|
|
|
|
|
bool IsInput() const;
|
|
|
|
bool IsOutput() const;
|
|
|
|
|
|
|
|
BMessage* ToMessage() const;
|
|
|
|
|
|
|
|
private:
|
2017-01-17 03:59:24 +03:00
|
|
|
media_input _MediaInput() const;
|
|
|
|
media_output _MediaOutput() const;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
2017-01-17 03:59:24 +03:00
|
|
|
const media_source& _Source() const;
|
|
|
|
const media_destination& _Destination() const;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
2017-01-17 03:59:24 +03:00
|
|
|
media_node _RemoteNode() const;
|
2016-11-24 02:14:00 +03:00
|
|
|
|
|
|
|
media_connection_id id;
|
|
|
|
|
|
|
|
media_client client;
|
|
|
|
// TODO really needed?
|
|
|
|
media_client remote_client;
|
|
|
|
|
|
|
|
media_source source;
|
|
|
|
media_destination destination;
|
|
|
|
media_format format;
|
|
|
|
char name[B_MEDIA_NAME_LENGTH];
|
|
|
|
|
2016-12-06 23:05:15 +03:00
|
|
|
media_connection_kinds kinds;
|
2016-11-24 02:14:00 +03:00
|
|
|
uint32 padding[16];
|
|
|
|
|
|
|
|
friend class BMediaClient;
|
|
|
|
friend class BMediaClientNode;
|
2016-11-25 19:29:17 +03:00
|
|
|
friend class BMediaConnection;
|
|
|
|
friend class BMediaInput;
|
|
|
|
friend class BMediaOutput;
|
2016-11-24 02:14:00 +03:00
|
|
|
} media_connection;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
using namespace BPrivate::media;
|
|
|
|
|
|
|
|
#endif
|