⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181863 in webkit


Ignore:
Timestamp:
Mar 23, 2015, 1:31:56 PM (11 years ago)
Author:
achristensen@apple.com
Message:

[MediaFoundation] Implement seek.
https://bugs.webkit.org/show_bug.cgi?id=142594

Reviewed by Darin Adler.

  • platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:

(WebCore::MediaPlayerPrivateMediaFoundation::seeking):
(WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
(WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):

  • platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r181862 r181863  
     12015-03-23  Alex Christensen  <achristensen@webkit.org>
     2
     3        [MediaFoundation] Implement seek.
     4        https://bugs.webkit.org/show_bug.cgi?id=142594
     5
     6        Reviewed by Darin Adler.
     7
     8        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
     9        (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
     10        (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
     11        (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
     12        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
     13
    1142015-03-23  Dan Bernstein  <mitz@apple.com>
    215
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp

    r181805 r181863  
    167167bool MediaPlayerPrivateMediaFoundation::seeking() const
    168168{
    169     notImplemented();
     169    // We assume seeking is immediately complete.
    170170    return false;
     171}
     172
     173void MediaPlayerPrivateMediaFoundation::seekDouble(double time)
     174{
     175    const double tenMegahertz = 10000000;
     176    PROPVARIANT propVariant;
     177    PropVariantInit(&propVariant);
     178    propVariant.vt = VT_I8;
     179    propVariant.hVal.QuadPart = static_cast<__int64>(time * tenMegahertz);
     180   
     181    HRESULT hr = m_mediaSession->Start(&GUID_NULL, &propVariant);
     182    ASSERT(SUCCEEDED(hr));
     183    PropVariantClear(&propVariant);
     184}
     185
     186double MediaPlayerPrivateMediaFoundation::durationDouble() const
     187{
     188    const double tenMegahertz = 10000000;
     189    if (!m_mediaSource)
     190        return 0;
     191
     192    IMFPresentationDescriptor* descriptor;
     193    if (!SUCCEEDED(m_mediaSource->CreatePresentationDescriptor(&descriptor)))
     194        return 0;
     195   
     196    UINT64 duration;
     197    if (!SUCCEEDED(descriptor->GetUINT64(MF_PD_DURATION, &duration)))
     198        duration = 0;
     199    descriptor->Release();
     200   
     201    return static_cast<double>(duration) / tenMegahertz;
    171202}
    172203
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h

    r181805 r181863  
    6060
    6161    virtual bool seeking() const;
     62    virtual void seekDouble(double) override;
     63    virtual double durationDouble() const override;
    6264
    6365    virtual bool paused() const;
Note: See TracChangeset for help on using the changeset viewer.