From 590d317a94fadcb72660d4c56d92c0436fb82f40 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 16 May 2018 12:42:44 +0100 Subject: [PATCH] cursor: add helper to get reader We might need this so that we can access to the updated end time that was determined by iterating frames. --- lib/capture/sp-capture-cursor.c | 15 +++++++++++++++ lib/capture/sp-capture-cursor.h | 1 + 2 files changed, 16 insertions(+) diff --git a/lib/capture/sp-capture-cursor.c b/lib/capture/sp-capture-cursor.c index eb675243..6877bec6 100644 --- a/lib/capture/sp-capture-cursor.c +++ b/lib/capture/sp-capture-cursor.c @@ -210,3 +210,18 @@ sp_capture_cursor_new (SpCaptureReader *reader) return self; } + +/** + * sp_capture_cursor_get_reader: + * + * Gets the underlying reader that is used by the cursor. + * + * Returns: (transfer none): An #SpCaptureReader + */ +SpCaptureReader * +sp_capture_cursor_get_reader (SpCaptureCursor *self) +{ + g_return_val_if_fail (SP_IS_CAPTURE_CURSOR (self), NULL); + + return self->reader; +} diff --git a/lib/capture/sp-capture-cursor.h b/lib/capture/sp-capture-cursor.h index fb09656d..d4ea9006 100644 --- a/lib/capture/sp-capture-cursor.h +++ b/lib/capture/sp-capture-cursor.h @@ -42,6 +42,7 @@ typedef gboolean (*SpCaptureCursorCallback) (const SpCaptureFrame *frame, gpointer user_data); SpCaptureCursor *sp_capture_cursor_new (SpCaptureReader *reader); +SpCaptureReader *sp_capture_cursor_get_reader (SpCaptureCursor *self); void sp_capture_cursor_foreach (SpCaptureCursor *self, SpCaptureCursorCallback callback, gpointer user_data);