From 50351b0c8d0a5d4e0995ddfcc0c7f777f8e1fc42 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Tue, 27 Jan 2015 17:48:43 -0800 Subject: [PATCH] Backed out changeset 774ff21aecb3 (bug 1120128) for build bustage --- dom/media/fmp4/wmf/WMFVideoMFTManager.cpp | 3 +- dom/media/mediasource/moz.build | 1 - dom/media/wmf/WMFReader.cpp | 3 +- gfx/thebes/gfxPlatform.cpp | 15 ------- gfx/thebes/gfxPlatform.h | 1 - media/libstagefright/binding/BufferStream.cpp | 45 +++---------------- .../include/mp4_demuxer/BufferStream.h | 19 ++++---- widget/GfxDriverInfo.cpp | 3 -- widget/GfxDriverInfo.h | 1 - widget/GfxInfoBase.cpp | 6 --- widget/nsIGfxInfo.idl | 2 - widget/windows/GfxInfo.cpp | 5 --- 12 files changed, 17 insertions(+), 87 deletions(-) diff --git a/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp b/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp index dbd07f2bbe3..b547f8f6568 100644 --- a/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp +++ b/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp @@ -154,8 +154,7 @@ WMFVideoMFTManager::InitializeDXVA() return false; } - if (gfxWindowsPlatform::GetPlatform()->IsWARP() || - !gfxPlatform::CanUseDXVA()) { + if (gfxWindowsPlatform::GetPlatform()->IsWARP()) { return false; } diff --git a/dom/media/mediasource/moz.build b/dom/media/mediasource/moz.build index 41115805c01..4365bc99190 100644 --- a/dom/media/mediasource/moz.build +++ b/dom/media/mediasource/moz.build @@ -9,7 +9,6 @@ EXPORTS += [ 'AsyncEventRunner.h', 'MediaSourceDecoder.h', 'MediaSourceReader.h', - 'ResourceQueue.h', ] EXPORTS.mozilla.dom += [ diff --git a/dom/media/wmf/WMFReader.cpp b/dom/media/wmf/WMFReader.cpp index 326014cc1d3..f6a73ec5e9c 100644 --- a/dom/media/wmf/WMFReader.cpp +++ b/dom/media/wmf/WMFReader.cpp @@ -111,8 +111,7 @@ WMFReader::InitializeDXVA() return false; } - if (gfxWindowsPlatform::GetPlatform()->IsWARP() || - !gfxPlatform::CanUseDXVA()) { + if (gfxWindowsPlatform::GetPlatform()->IsWARP()) { return false; } diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 2e271cf3f52..671eb52c855 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2164,7 +2164,6 @@ gfxPlatform::OptimalFormatForContent(gfxContentType aContent) */ static bool sLayersSupportsD3D9 = false; static bool sLayersSupportsD3D11 = false; -static bool sLayersSupportsDXVA = false; static bool sBufferRotationCheckPref = true; static bool sPrefBrowserTabsRemoteAutostart = false; @@ -2206,11 +2205,6 @@ InitLayersAccelerationPrefs() // Always support D3D11 when WARP is allowed. sLayersSupportsD3D11 = true; } - if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DXVA, &status))) { - if (status == nsIGfxInfo::FEATURE_STATUS_OK) { - sLayersSupportsDXVA = true; - } - } } } #endif @@ -2237,15 +2231,6 @@ gfxPlatform::CanUseDirect3D11() return sLayersSupportsD3D11; } -bool -gfxPlatform::CanUseDXVA() -{ - // this function is called from the compositor thread, so it is not - // safe to init the prefs etc. from here. - MOZ_ASSERT(sLayersAccelerationPrefsInitialized); - return sLayersSupportsDXVA; -} - bool gfxPlatform::BufferRotationEnabled() { diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 45b8bf45729..495e6f797ae 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -481,7 +481,6 @@ public: static bool CanUseDirect3D9(); static bool CanUseDirect3D11(); - static bool CanUseDXVA(); /** * Is it possible to use buffer rotation. Note that these diff --git a/media/libstagefright/binding/BufferStream.cpp b/media/libstagefright/binding/BufferStream.cpp index aba9201eeac..8e75cc91425 100644 --- a/media/libstagefright/binding/BufferStream.cpp +++ b/media/libstagefright/binding/BufferStream.cpp @@ -12,8 +12,6 @@ namespace mp4_demuxer { BufferStream::BufferStream() : mStartOffset(0) - , mLogicalLength(0) - , mStartIndex(0) { } @@ -21,33 +19,12 @@ BufferStream::BufferStream() BufferStream::ReadAt(int64_t aOffset, void* aData, size_t aLength, size_t* aBytesRead) { - if (aOffset < (mStartOffset + mStartIndex) || - mData.IsEmpty() || - aOffset > mStartOffset + mData.LastElement()->Length()) { + if (aOffset < mStartOffset || aOffset > mStartOffset + mData.Length()) { return false; } *aBytesRead = std::min(aLength, size_t(mStartOffset + mData.Length() - aOffset)); memcpy(aData, &mData[aOffset - mStartOffset], *aBytesRead); - - aOffset -= mStartOffset; - size_t index = mStartIndex; - *aBytesRead = 0; - - uint8_t* dest = (uint8_t*)aData; - - for (uint32_t i = 0; i < mData.Length() && aLength; i++) { - ResourceItem* item = mData[i]; - if (aOffset >= index && aOffset < item->Length()) { - size_t count = std::min(item->Length() - aOffset, (uint64_t)aLength); - *aBytesRead += count; - memcpy(dest, &item->mData[aOffset], count); - dest += count; - aLength -= count; - } - aOffset -= item->Length(); - index = 0; - } return true; } @@ -61,36 +38,28 @@ BufferStream::CachedReadAt(int64_t aOffset, void* aData, size_t aLength, /*virtual*/ bool BufferStream::Length(int64_t* aLength) { - *aLength = mLogicalLength; + *aLength = mStartOffset + mData.Length(); return true; } /* virtual */ void BufferStream::DiscardBefore(int64_t aOffset) { - while (!mData.IsEmpty() && - mStartOffset + mData[0]->mData.Length() <= aOffset) { - mStartOffset += mData[0]->mData.Length(); - mData.RemoveElementAt(0); + if (aOffset > mStartOffset) { + mData.RemoveElementsAt(0, aOffset - mStartOffset); + mStartOffset = aOffset; } - mStartIndex = aOffset - mStartOffset; } void BufferStream::AppendBytes(const uint8_t* aData, size_t aLength) { - mData.AppendElement(new ResourceItem(aData, aLength)); -} - -void -BufferStream::AppendData(ResourceItem* aItem) -{ - mData.AppendElement(aItem); + mData.AppendElements(aData, aLength); } MediaByteRange BufferStream::GetByteRange() { - return MediaByteRange(mStartOffset + mStartIndex, mLogicalLength); + return MediaByteRange(mStartOffset, mStartOffset + mData.Length()); } } diff --git a/media/libstagefright/binding/include/mp4_demuxer/BufferStream.h b/media/libstagefright/binding/include/mp4_demuxer/BufferStream.h index 3c4fe028ce0..b74151d23fa 100644 --- a/media/libstagefright/binding/include/mp4_demuxer/BufferStream.h +++ b/media/libstagefright/binding/include/mp4_demuxer/BufferStream.h @@ -7,7 +7,6 @@ #include "mp4_demuxer/mp4_demuxer.h" #include "nsTArray.h" -#include "ResourceQueue.h" namespace mp4_demuxer { @@ -19,23 +18,21 @@ public: */ BufferStream(); - bool ReadAt(int64_t aOffset, void* aData, size_t aLength, - size_t* aBytesRead); - bool CachedReadAt(int64_t aOffset, void* aData, size_t aLength, - size_t* aBytesRead); - bool Length(int64_t* aLength); + virtual bool ReadAt(int64_t aOffset, void* aData, size_t aLength, + size_t* aBytesRead) MOZ_OVERRIDE; + virtual bool CachedReadAt(int64_t aOffset, void* aData, size_t aLength, + size_t* aBytesRead) MOZ_OVERRIDE; + virtual bool Length(int64_t* aLength) MOZ_OVERRIDE; - void DiscardBefore(int64_t aOffset); + virtual void DiscardBefore(int64_t aOffset) MOZ_OVERRIDE; void AppendBytes(const uint8_t* aData, size_t aLength); - void AppendData(mozilla::ResourceItem* aItem); mozilla::MediaByteRange GetByteRange(); +private: int64_t mStartOffset; - int64_t mLogicalLength; - int64_t mStartIndex; - nsTArray> mData; + nsTArray mData; }; } diff --git a/widget/GfxDriverInfo.cpp b/widget/GfxDriverInfo.cpp index ee7cef2594f..be41415d6fa 100644 --- a/widget/GfxDriverInfo.cpp +++ b/widget/GfxDriverInfo.cpp @@ -214,9 +214,6 @@ const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id) case Nvidia310M: APPEND_DEVICE(0x0A70); break; - case AMDRadeonHD5800: - APPEND_DEVICE(0x6899); - break; // This should never happen, but we get a warning if we don't handle this. case DeviceFamilyMax: NS_WARNING("Invalid DeviceFamily id"); diff --git a/widget/GfxDriverInfo.h b/widget/GfxDriverInfo.h index 1cdcb689d25..834c90abf9f 100644 --- a/widget/GfxDriverInfo.h +++ b/widget/GfxDriverInfo.h @@ -73,7 +73,6 @@ enum DeviceFamily { RadeonX1000, Geforce7300GT, Nvidia310M, - AMDRadeonHD5800, DeviceFamilyMax }; diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index 2d25f75eb86..c04894ab9a3 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -123,9 +123,6 @@ GetPrefNameForFeature(int32_t aFeature) case nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS: name = BLACKLIST_PREF_BRANCH "layers.direct3d11"; break; - case nsIGfxInfo::FEATURE_DXVA: - name = BLACKLIST_PREF_BRANCH "dxva"; - break; case nsIGfxInfo::FEATURE_OPENGL_LAYERS: name = BLACKLIST_PREF_BRANCH "layers.opengl"; break; @@ -290,8 +287,6 @@ BlacklistFeatureToGfxFeature(const nsAString& aFeature) return nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS; else if (aFeature.EqualsLiteral("DIRECT3D_11_LAYERS")) return nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS; - else if (aFeature.EqualsLiteral("DXVA")) - return nsIGfxInfo::FEATURE_DXVA; else if (aFeature.EqualsLiteral("OPENGL_LAYERS")) return nsIGfxInfo::FEATURE_OPENGL_LAYERS; else if (aFeature.EqualsLiteral("WEBGL_OPENGL")) @@ -847,7 +842,6 @@ GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray& aDriverInfo) nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS, nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS, nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, - nsIGfxInfo::FEATURE_DXVA, nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_WEBGL_ANGLE, diff --git a/widget/nsIGfxInfo.idl b/widget/nsIGfxInfo.idl index b51d82bb44c..8b248d80ab7 100644 --- a/widget/nsIGfxInfo.idl +++ b/widget/nsIGfxInfo.idl @@ -87,8 +87,6 @@ interface nsIGfxInfo : nsISupports const long FEATURE_WEBRTC_HW_ACCELERATION = 10; /* Whether Direct3D 11 is supported for layers. */ const long FEATURE_DIRECT3D_11_LAYERS = 11; - /* Whether DXVA is supported for video decoding. */ - const long FEATURE_DXVA = 12; /* * A set of return values from GetFeatureStatus diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index cde3d9a6921..fb122e27a25 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -1034,11 +1034,6 @@ GfxInfo::GetGfxDriverInfo() (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(Nvidia310M), nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions); - - APPEND_TO_DRIVER_BLOCKLIST2(DRIVER_OS_ALL, - (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorATI), (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(AMDRadeonHD5800), - nsIGfxInfo::FEATURE_DXVA, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, - DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions); } return *mDriverInfo; }