[GStreamer] Move toGstClockTime to utilities
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2014 15:20:19 +0000 (15:20 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2014 15:20:19 +0000 (15:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132702

Reviewed by Philippe Normand.

toGstClockTime should be in GStreamerUtilities and corrected typo
in getGstPlayFlag.

No new tests needed.

* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::getGstPlayFlag): Renamed from getGstPlaysFlag.
(WebCore::toGstClockTime): Moved from MediaPlayerPrivateGStreamer.
(WebCore::getGstPlaysFlag): Deleted.
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
Corrected getGstPlayFlag typo.
(WebCore::toGstClockTime): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168681 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp
Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index 08ce449..1b0dbd8 100644 (file)
@@ -1,3 +1,25 @@
+2014-05-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
+
+        [GStreamer] Move toGstClockTime to utilities
+        https://bugs.webkit.org/show_bug.cgi?id=132702
+
+        Reviewed by Philippe Normand.
+
+        toGstClockTime should be in GStreamerUtilities and corrected typo
+        in getGstPlayFlag.
+
+        No new tests needed.
+
+        * platform/graphics/gstreamer/GStreamerUtilities.cpp:
+        (WebCore::getGstPlayFlag): Renamed from getGstPlaysFlag.
+        (WebCore::toGstClockTime): Moved from MediaPlayerPrivateGStreamer.
+        (WebCore::getGstPlaysFlag): Deleted.
+        * platform/graphics/gstreamer/GStreamerUtilities.h:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
+        Corrected getGstPlayFlag typo.
+        (WebCore::toGstClockTime): Deleted.
+
 2014-05-12  Darin Adler  <darin@apple.com>
 
         Make a few icon database improvements
index 42a80d7..371b5ab 100644 (file)
@@ -134,7 +134,7 @@ bool initializeGStreamer()
     return gstInitialized;
 }
 
-unsigned getGstPlaysFlag(const char* nick)
+unsigned getGstPlayFlag(const char* nick)
 {
     static GFlagsClass* flagsClass = static_cast<GFlagsClass*>(g_type_class_ref(g_type_from_name("GstPlayFlags")));
     ASSERT(flagsClass);
@@ -146,6 +146,18 @@ unsigned getGstPlaysFlag(const char* nick)
     return flag->value;
 }
 
+GstClockTime toGstClockTime(float time)
+{
+    // Extract the integer part of the time (seconds) and the fractional part (microseconds). Attempt to
+    // round the microseconds so no floating point precision is lost and we can perform an accurate seek.
+    float seconds;
+    float microSeconds = modff(time, &seconds) * 1000000;
+    GTimeVal timeValue;
+    timeValue.tv_sec = static_cast<glong>(seconds);
+    timeValue.tv_usec = static_cast<glong>(roundf(microSeconds / 10000) * 10000);
+    return GST_TIMEVAL_TO_TIME(timeValue);
+}
+
 }
 
 #endif // USE(GSTREAMER)
index 4d10736..0ed3137 100644 (file)
@@ -72,6 +72,7 @@ char* getGstBufferDataPointer(GstBuffer*);
 void mapGstBuffer(GstBuffer*);
 void unmapGstBuffer(GstBuffer*);
 bool initializeGStreamer();
-unsigned getGstPlaysFlag(const char* nick);
+unsigned getGstPlayFlag(const char* nick);
+GstClockTime toGstClockTime(float time);
 
 }
index 0b4c0eb..b6911d2 100644 (file)
@@ -124,18 +124,6 @@ static void mediaPlayerPrivatePluginInstallerResultFunction(GstInstallPluginsRet
     player->handlePluginInstallerResult(result);
 }
 
-static GstClockTime toGstClockTime(float time)
-{
-    // Extract the integer part of the time (seconds) and the fractional part (microseconds). Attempt to
-    // round the microseconds so no floating point precision is lost and we can perform an accurate seek.
-    float seconds;
-    float microSeconds = modf(time, &seconds) * 1000000;
-    GTimeVal timeValue;
-    timeValue.tv_sec = static_cast<glong>(seconds);
-    timeValue.tv_usec = static_cast<glong>(roundf(microSeconds / 10000) * 10000);
-    return GST_TIMEVAL_TO_TIME(timeValue);
-}
-
 void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object)
 {
     if (g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstPulseSink"))
@@ -1769,7 +1757,7 @@ void MediaPlayerPrivateGStreamer::setDownloadBuffering()
     unsigned flags;
     g_object_get(m_playBin.get(), "flags", &flags, NULL);
 
-    unsigned flagDownload = getGstPlaysFlag("download");
+    unsigned flagDownload = getGstPlayFlag("download");
 
     // We don't want to stop downloading if we already started it.
     if (flags & flagDownload && m_readyState > MediaPlayer::HaveNothing && !m_resetPipeline)