screen-cast-session: Add API to get stream from object path

Will be needed by the remote desktop session to translate stream local
input coordinates.
This commit is contained in:
Jonas Ådahl 2018-01-29 14:46:42 +08:00
parent d27e6921d6
commit f3203f0330
2 changed files with 23 additions and 0 deletions

View File

@ -97,6 +97,24 @@ meta_screen_cast_session_close (MetaScreenCastSession *session)
g_object_unref (session); g_object_unref (session);
} }
MetaScreenCastStream *
meta_screen_cast_session_get_stream (MetaScreenCastSession *session,
const char *path)
{
GList *l;
for (l = session->streams; l; l = l->next)
{
MetaScreenCastStream *stream = l->data;
if (g_strcmp0 (meta_screen_cast_stream_get_object_path (stream),
path) == 0)
return stream;
}
return NULL;
}
char * char *
meta_screen_cast_session_get_object_path (MetaScreenCastSession *session) meta_screen_cast_session_get_object_path (MetaScreenCastSession *session)
{ {

View File

@ -25,6 +25,8 @@
#include "backends/meta-screen-cast.h" #include "backends/meta-screen-cast.h"
#include "backends/meta-screen-cast-stream.h"
typedef enum _MetaScreenCastSessionType typedef enum _MetaScreenCastSessionType
{ {
META_SCREEN_CAST_SESSION_TYPE_NORMAL, META_SCREEN_CAST_SESSION_TYPE_NORMAL,
@ -48,4 +50,7 @@ gboolean meta_screen_cast_session_start (MetaScreenCastSession *session,
void meta_screen_cast_session_close (MetaScreenCastSession *session); void meta_screen_cast_session_close (MetaScreenCastSession *session);
MetaScreenCastStream * meta_screen_cast_session_get_stream (MetaScreenCastSession *session,
const char *path);
#endif /* META_SCREEN_CAST_SESSION_H */ #endif /* META_SCREEN_CAST_SESSION_H */