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-06-30 18:06:36 +02:00
|
|
|
#include "client/pinos.h"
|
2015-04-29 17:51:51 +02:00
|
|
|
|
2015-07-07 16:46:23 +02:00
|
|
|
#include "client/context.h"
|
|
|
|
|
#include "client/enumtypes.h"
|
|
|
|
|
#include "client/subscribe.h"
|
2015-04-29 17:51:51 +02:00
|
|
|
|
2015-07-07 16:46:23 +02:00
|
|
|
#include "client/private.h"
|
2015-04-29 17:51:51 +02:00
|
|
|
|
|
|
|
|
/**
|
2015-07-07 16:46:23 +02:00
|
|
|
* pinos_context_list_source_info:
|
|
|
|
|
* @context: a connected #PinosContext
|
|
|
|
|
* @flags: extra #PinosSourceInfoFlags
|
|
|
|
|
* @cb: a #PinosSourceInfoCallback
|
2015-04-29 17:51:51 +02:00
|
|
|
* @cancelable: a #GCancellable
|
|
|
|
|
* @user_data: user data passed to @cb
|
|
|
|
|
*
|
2015-07-08 17:40:37 +02:00
|
|
|
* Call @cb for each source. @cb will be called with NULL when there
|
|
|
|
|
* are no more sources to list.
|
2015-04-29 17:51:51 +02:00
|
|
|
*/
|
|
|
|
|
void
|
2015-07-07 16:46:23 +02:00
|
|
|
pinos_context_list_source_info (PinosContext *context,
|
|
|
|
|
PinosSourceInfoFlags flags,
|
|
|
|
|
PinosSourceInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data)
|
2015-04-29 17:51:51 +02:00
|
|
|
{
|
|
|
|
|
GList *walk;
|
2015-07-07 16:46:23 +02:00
|
|
|
PinosContextPrivate *priv = context->priv;
|
2015-04-29 17:51:51 +02:00
|
|
|
|
|
|
|
|
for (walk = priv->sources; walk; walk = g_list_next (walk)) {
|
|
|
|
|
GDBusProxy *proxy = walk->data;
|
2015-07-07 16:46:23 +02:00
|
|
|
PinosSourceInfo info;
|
2015-04-29 17:51:51 +02:00
|
|
|
|
2015-07-08 17:40:37 +02:00
|
|
|
info.id = proxy;
|
2015-05-21 16:49:26 +02:00
|
|
|
info.name = "gst";
|
2015-04-29 17:51:51 +02:00
|
|
|
|
|
|
|
|
cb (context, &info, user_data);
|
|
|
|
|
}
|
|
|
|
|
cb (context, NULL, user_data);
|
|
|
|
|
}
|
2015-07-08 17:40:37 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* pinos_context_get_source_info:
|
|
|
|
|
* @context: a connected #PinosContext
|
|
|
|
|
* @id: a source id
|
|
|
|
|
* @flags: extra #PinosSourceInfoFlags
|
|
|
|
|
* @cb: a #PinosSourceInfoCallback
|
|
|
|
|
* @cancelable: a #GCancellable
|
|
|
|
|
* @user_data: user data passed to @cb
|
|
|
|
|
*
|
|
|
|
|
* Call @cb for each source. @cb will be called with NULL when there
|
|
|
|
|
* are no more sources to list.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
pinos_context_get_source_info_by_id (PinosContext *context,
|
|
|
|
|
gpointer id,
|
|
|
|
|
PinosSourceInfoFlags flags,
|
|
|
|
|
PinosSourceInfoCallback cb,
|
|
|
|
|
GCancellable *cancellable,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
}
|