예제 #1
0
qlonglong QStorageInfo_CustomPrivate::totalDiskSpace(const QString &drive)
{
    qlonglong totalBytes(-1);
    if (!GetDiskFreeSpaceEx((WCHAR *)drive.utf16(), 0, (PULARGE_INTEGER)&totalBytes, 0))
        totalBytes = -1;
    return totalBytes;
}
size_t MediaPlayerPrivateAVFoundation::extraMemoryCost() const
{
    double duration = this->duration();
    if (!duration)
        return 0;

    unsigned long long extra = totalBytes() * buffered()->totalDuration() / duration;
    return static_cast<unsigned>(extra);
}
unsigned MediaPlayerPrivateAVFoundation::bytesLoaded() const
{
    float dur = duration();
    if (!dur)
        return 0;
    unsigned loaded = totalBytes() * maxTimeLoaded() / dur;
    LOG(Media, "MediaPlayerPrivateAVFoundation::bytesLoaded(%p) - returning %i", this, loaded);
    return loaded;
}
bool MediaPlayerPrivateAVFoundation::didLoadingProgress() const
{
    if (!duration() || !totalBytes())
        return false;
    float currentMaxTimeLoaded = maxTimeLoaded();
    bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
    m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;

    return didLoadingProgress;
}
bool MediaPlayerPrivate::totalBytesKnown()
{
    printf("MediaPlayerPrivate::totalBytesKnown\n");
    notImplemented();
    return totalBytes() > 0;
}
bool MediaPlayerPrivate::totalBytesKnown() const
{
    notImplemented();
    LOG_VERBOSE(Media, "totalBytesKnown");
    return totalBytes() > 0;
}
bool MediaPlayerPrivate::totalBytesKnown() const
{
    LOG_VERBOSE(Media, "totalBytesKnown");
    return totalBytes() > 0;
}