Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / ut_MafwGstRendererSeeker / ut_MafwGstRendererSeeker_stubs.c
diff --git a/qmafw-gst-subtitles-renderer/unittests/ut_MafwGstRendererSeeker/ut_MafwGstRendererSeeker_stubs.c b/qmafw-gst-subtitles-renderer/unittests/ut_MafwGstRendererSeeker/ut_MafwGstRendererSeeker_stubs.c
new file mode 100644 (file)
index 0000000..04d3cde
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * This file is part of QMAFW
+ *
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). All rights
+ * reserved.
+ *
+ * Contact: Visa Smolander <visa.smolander@nokia.com>
+ *
+ * This software, including documentation, is protected by copyright controlled
+ * by Nokia Corporation. All rights are reserved. Copying, including
+ * reproducing, storing, adapting or translating, any or all of this material
+ * requires the prior written consent of Nokia Corporation. This material also
+ * contains confidential information which may not be disclosed to others
+ * without the prior written consent of Nokia.
+ *
+ */
+
+#include <glib.h>
+
+#include <gst/gstelement.h>
+
+gint64 g_currentPosition;
+gint64 g_duration;
+gint64 g_seekRequested;
+gint g_seeksCalled;
+
+gboolean gst_element_query_position(GstElement *element,
+                                    GstFormat *format,
+                                    gint64 *value)
+{
+    *value = g_currentPosition * GST_SECOND;
+    return TRUE;
+}
+
+gboolean gst_element_query_duration(GstElement *element,
+                                    GstFormat *format,
+                                    gint64 *value)
+{
+    *value = g_duration * GST_SECOND;
+    return TRUE;
+}
+
+gboolean gst_element_seek(GstElement *element,
+                          gdouble rate,
+                          GstFormat format,
+                          GstSeekFlags flags,
+                          GstSeekType cur_type,
+                          gint64 cur,
+                          GstSeekType stop_type,
+                          gint64 stop)
+{
+    g_seekRequested = cur / GST_SECOND;
+    ++g_seeksCalled;
+    return TRUE;
+}