2015-06-30 18:06:36 +02:00
|
|
|
/* Pinos
|
2015-04-29 17:51:51 +02:00
|
|
|
* Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Library General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2015-07-07 16:46:23 +02:00
|
|
|
#ifndef __PINOS_INTROSPECT_H__
|
|
|
|
|
#define __PINOS_INTROSPECT_H__
|
2015-04-29 17:51:51 +02:00
|
|
|
|
|
|
|
|
#include <gio/gio.h>
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
2015-07-07 16:46:23 +02:00
|
|
|
#include <client/context.h>
|
2015-07-17 16:57:01 +02:00
|
|
|
#include <client/properties.h>
|
2015-04-29 17:51:51 +02:00
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2015-07-17 16:58:42 +02:00
|
|
|
/**
|
2015-07-28 17:05:03 +02:00
|
|
|
* PinosDaemonInfo:
|
2015-07-17 16:58:42 +02:00
|
|
|
* @id: generic id of the daemon
|
2015-08-12 11:34:29 +02:00
|
|
|
* @daemon-path: unique path of the daemon
|
2015-08-05 11:57:02 +02:00
|
|
|
* @change_mask: bitfield of changed fields since last call
|
2015-07-17 16:58:42 +02:00
|
|
|
* @user_name: name of the user that started the daemon
|
|
|
|
|
* @host_name: name of the machine the daemon is running on
|
|
|
|
|
* @version: version of the daemon
|
|
|
|
|
* @name: name of the daemon
|
|
|
|
|
* @cookie: a random cookie for identifying this instance of Pinos
|
|
|
|
|
* @properties: extra properties
|
|
|
|
|
*
|
|
|
|
|
* The daemon information. Extra information can be added in later
|
|
|
|
|
* versions.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
|
|
|
|
gpointer id;
|
2015-08-12 11:34:29 +02:00
|
|
|
const char *daemon_path;
|
2015-08-05 11:57:02 +02:00
|
|
|
guint64 change_mask;
|
2015-07-17 16:58:42 +02:00
|
|
|
const char *user_name;
|
|
|
|
|
const char *host_name;
|
|
|
|
|
const char *version;
|
|
|
|
|
const char *name;
|
|
|
|
|
guint32 cookie;
|
|
|
|
|
PinosProperties *properties;
|
|
|
|
|
} PinosDaemonInfo;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
PINOS_DAEMON_INFO_FLAGS_NONE = 0,
|
|
|
|
|
} PinosDaemonInfoFlags;
|
|
|
|
|
|
|
|
|
|
typedef gboolean (*PinosDaemonInfoCallback) (PinosContext *c, const PinosDaemonInfo *info, gpointer userdata);
|
|
|
|
|
|
|
|
|
|
void pinos_context_get_daemon_info (PinosContext *context,
|
|
|
|
|
PinosDaemonInfoFlags flags,
|
|
|
|
|
PinosDaemonInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
2015-07-28 17:05:03 +02:00
|
|
|
/**
|
|
|
|
|
* PinosClientInfo:
|
|
|
|
|
* @id: generic id of the client
|
2015-08-12 11:34:29 +02:00
|
|
|
* @client_path: unique path of the client
|
2015-08-05 11:57:02 +02:00
|
|
|
* @change_mask: bitfield of changed fields since last call
|
2015-07-28 17:05:03 +02:00
|
|
|
* @name: name of client
|
|
|
|
|
* @properties: extra properties
|
|
|
|
|
*
|
|
|
|
|
* The client information. Extra information can be added in later
|
|
|
|
|
* versions.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
|
|
|
|
gpointer id;
|
2015-08-12 11:34:29 +02:00
|
|
|
const char *client_path;
|
2015-08-05 11:57:02 +02:00
|
|
|
guint64 change_mask;
|
2015-07-28 17:05:03 +02:00
|
|
|
const char *name;
|
|
|
|
|
PinosProperties *properties;
|
|
|
|
|
} PinosClientInfo;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
PINOS_CLIENT_INFO_FLAGS_NONE = 0,
|
|
|
|
|
} PinosClientInfoFlags;
|
|
|
|
|
|
|
|
|
|
typedef gboolean (*PinosClientInfoCallback) (PinosContext *c, const PinosClientInfo *info, gpointer userdata);
|
|
|
|
|
|
|
|
|
|
void pinos_context_list_client_info (PinosContext *context,
|
|
|
|
|
PinosClientInfoFlags flags,
|
|
|
|
|
PinosClientInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
void pinos_context_get_client_info_by_id (PinosContext *context,
|
|
|
|
|
gpointer id,
|
|
|
|
|
PinosClientInfoFlags flags,
|
|
|
|
|
PinosClientInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
2015-05-05 18:20:32 +02:00
|
|
|
/**
|
2015-07-07 16:46:23 +02:00
|
|
|
* PinosSourceState:
|
|
|
|
|
* @PINOS_SOURCE_STATE_ERROR: the source is in error
|
|
|
|
|
* @PINOS_SOURCE_STATE_SUSPENDED: the source is suspended, the device might
|
2015-05-05 18:20:32 +02:00
|
|
|
* be closed
|
2015-07-09 11:34:34 +02:00
|
|
|
* @PINOS_SOURCE_STATE_INITIALIZING: the source is initializing, the device is
|
|
|
|
|
* being opened and the capabilities are queried
|
2015-07-07 16:46:23 +02:00
|
|
|
* @PINOS_SOURCE_STATE_IDLE: the source is running but there is no active
|
2015-05-05 18:20:32 +02:00
|
|
|
* source-output
|
2015-07-09 11:34:34 +02:00
|
|
|
* @PINOS_SOURCE_STATE_RUNNING: the source is running
|
2015-05-05 18:20:32 +02:00
|
|
|
*
|
|
|
|
|
* The different source states
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
2015-07-09 11:34:34 +02:00
|
|
|
PINOS_SOURCE_STATE_ERROR = -1,
|
|
|
|
|
PINOS_SOURCE_STATE_SUSPENDED = 0,
|
|
|
|
|
PINOS_SOURCE_STATE_INITIALIZING = 1,
|
|
|
|
|
PINOS_SOURCE_STATE_IDLE = 2,
|
|
|
|
|
PINOS_SOURCE_STATE_RUNNING = 3,
|
2015-07-07 16:46:23 +02:00
|
|
|
} PinosSourceState;
|
2015-05-05 18:20:32 +02:00
|
|
|
|
2015-04-29 17:51:51 +02:00
|
|
|
/**
|
2015-07-07 16:46:23 +02:00
|
|
|
* PinosSourceInfo:
|
2015-07-08 17:40:37 +02:00
|
|
|
* @id: generic id of the source
|
2015-07-09 17:58:54 +02:00
|
|
|
* @source_path: the unique path of the source, suitable for connecting
|
2015-08-05 11:57:02 +02:00
|
|
|
* @change_mask: bitfield of changed fields since last call
|
2015-07-09 17:30:37 +02:00
|
|
|
* @name: name the source, suitable for display
|
2015-04-29 17:51:51 +02:00
|
|
|
* @properties: the properties of the source
|
|
|
|
|
* @state: the current state of the source
|
2015-08-04 17:34:11 +02:00
|
|
|
* @possible formats: the possible formats this source can produce
|
2015-04-29 17:51:51 +02:00
|
|
|
*
|
2015-07-17 16:57:01 +02:00
|
|
|
* The source information. Extra information can be added in later
|
|
|
|
|
* versions.
|
2015-04-29 17:51:51 +02:00
|
|
|
*/
|
|
|
|
|
typedef struct {
|
2015-07-08 17:40:37 +02:00
|
|
|
gpointer id;
|
2015-07-09 17:58:54 +02:00
|
|
|
const char *source_path;
|
2015-08-05 11:57:02 +02:00
|
|
|
guint64 change_mask;
|
2015-04-29 17:51:51 +02:00
|
|
|
const char *name;
|
2015-07-17 16:57:01 +02:00
|
|
|
PinosProperties *properties;
|
2015-07-07 16:46:23 +02:00
|
|
|
PinosSourceState state;
|
2015-08-04 17:34:11 +02:00
|
|
|
GBytes *possible_formats;
|
2015-07-07 16:46:23 +02:00
|
|
|
} PinosSourceInfo;
|
2015-04-29 17:51:51 +02:00
|
|
|
|
|
|
|
|
/**
|
2015-07-07 16:46:23 +02:00
|
|
|
* PinosSourceInfoFlags:
|
|
|
|
|
* @PINOS_SOURCE_INFO_FLAGS_NONE: no flags
|
|
|
|
|
* @PINOS_SOURCE_INFO_FLAGS_FORMATS: include formats
|
2015-04-29 17:51:51 +02:00
|
|
|
*
|
2015-07-07 16:46:23 +02:00
|
|
|
* Extra flags to pass to pinos_context_get_source_info_list.
|
2015-04-29 17:51:51 +02:00
|
|
|
*/
|
|
|
|
|
typedef enum {
|
2015-07-07 16:46:23 +02:00
|
|
|
PINOS_SOURCE_INFO_FLAGS_NONE = 0,
|
|
|
|
|
PINOS_SOURCE_INFO_FLAGS_FORMATS = (1 << 0)
|
|
|
|
|
} PinosSourceInfoFlags;
|
2015-04-29 17:51:51 +02:00
|
|
|
|
2015-07-07 16:46:23 +02:00
|
|
|
typedef gboolean (*PinosSourceInfoCallback) (PinosContext *c, const PinosSourceInfo *info, gpointer userdata);
|
2015-04-29 17:51:51 +02:00
|
|
|
|
2015-07-08 17:40:37 +02:00
|
|
|
void pinos_context_list_source_info (PinosContext *context,
|
|
|
|
|
PinosSourceInfoFlags flags,
|
|
|
|
|
PinosSourceInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
void pinos_context_get_source_info_by_id (PinosContext *context,
|
|
|
|
|
gpointer id,
|
|
|
|
|
PinosSourceInfoFlags flags,
|
|
|
|
|
PinosSourceInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
2015-04-29 17:51:51 +02:00
|
|
|
|
2015-08-04 15:59:36 +02:00
|
|
|
/**
|
|
|
|
|
* PinosSourceState:
|
|
|
|
|
* @PINOS_SOURCE_OUTPUT_STATE_ERROR: the source output is in error
|
|
|
|
|
* @PINOS_SOURCE_OUTPUT_STATE_IDLE: the source output is idle
|
|
|
|
|
* @PINOS_SOURCE_OUTPUT_STATE_STARTING: the source output is starting
|
|
|
|
|
* @PINOS_SOURCE_OUTPUT_STATE_STREAMING: the source output is streaming
|
|
|
|
|
*
|
|
|
|
|
* The different source output states
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
PINOS_SOURCE_OUTPUT_STATE_ERROR = -1,
|
|
|
|
|
PINOS_SOURCE_OUTPUT_STATE_IDLE = 0,
|
|
|
|
|
PINOS_SOURCE_OUTPUT_STATE_STARTING = 1,
|
|
|
|
|
PINOS_SOURCE_OUTPUT_STATE_STREAMING = 2,
|
|
|
|
|
} PinosSourceOutputState;
|
|
|
|
|
|
2015-07-28 17:05:03 +02:00
|
|
|
/**
|
|
|
|
|
* PinosSourceOutputInfo:
|
|
|
|
|
* @id: generic id of the output
|
2015-08-12 11:34:29 +02:00
|
|
|
* @path: the unique path of the output
|
2015-08-05 11:57:02 +02:00
|
|
|
* @change_mask: bitfield of changed fields since last call
|
2015-07-28 17:05:03 +02:00
|
|
|
* @client_path: the owner client
|
|
|
|
|
* @source_path: the source path
|
|
|
|
|
* @possible_formats: the possible formats
|
2015-08-04 15:59:36 +02:00
|
|
|
* @state: the state
|
|
|
|
|
* @format: when streaming, the current format
|
2015-07-28 17:05:03 +02:00
|
|
|
* @properties: the properties of the source
|
|
|
|
|
*
|
|
|
|
|
* The source information. Extra information can be added in later
|
|
|
|
|
* versions.
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
|
|
|
|
gpointer id;
|
2015-08-12 11:34:29 +02:00
|
|
|
const char *output_path;
|
2015-08-05 11:57:02 +02:00
|
|
|
guint64 change_mask;
|
2015-07-28 17:05:03 +02:00
|
|
|
const char *client_path;
|
|
|
|
|
const char *source_path;
|
|
|
|
|
GBytes *possible_formats;
|
2015-08-04 15:59:36 +02:00
|
|
|
PinosSourceOutputState state;
|
|
|
|
|
GBytes *format;
|
2015-07-28 17:05:03 +02:00
|
|
|
PinosProperties *properties;
|
|
|
|
|
} PinosSourceOutputInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* PinosSourceOutputInfoFlags:
|
|
|
|
|
* @PINOS_SOURCE_OUTPUT_INFO_FLAGS_NONE: no flags
|
|
|
|
|
*
|
|
|
|
|
* Extra flags to pass to pinos_context_get_source_output_info_list.
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
PINOS_SOURCE_OUTPUT_INFO_FLAGS_NONE = 0,
|
|
|
|
|
} PinosSourceOutputInfoFlags;
|
|
|
|
|
|
|
|
|
|
typedef gboolean (*PinosSourceOutputInfoCallback) (PinosContext *c, const PinosSourceOutputInfo *info, gpointer userdata);
|
|
|
|
|
|
|
|
|
|
void pinos_context_list_source_output_info (PinosContext *context,
|
|
|
|
|
PinosSourceOutputInfoFlags flags,
|
|
|
|
|
PinosSourceOutputInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
void pinos_context_get_source_output_info_by_id (PinosContext *context,
|
|
|
|
|
gpointer id,
|
|
|
|
|
PinosSourceOutputInfoFlags flags,
|
|
|
|
|
PinosSourceOutputInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data);
|
2015-04-29 17:51:51 +02:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
2015-07-07 16:46:23 +02:00
|
|
|
#endif /* __PINOS_INTROSPECT_H__ */
|
2015-04-29 17:51:51 +02:00
|
|
|
|