diff options
-rw-r--r-- | Kodi.xcodeproj/project.pbxproj | 30 | ||||
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 6 | ||||
-rw-r--r-- | system/settings/settings.xml | 6 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 8 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.cpp | 269 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp | 123 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h (renamed from xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.h) | 14 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp | 131 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.h | 6 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShader.cpp | 6 | ||||
-rw-r--r-- | xbmc/settings/SettingConditions.cpp | 2 | ||||
-rw-r--r-- | xbmc/settings/Settings.cpp | 2 | ||||
-rw-r--r-- | xbmc/settings/Settings.h | 2 |
14 files changed, 245 insertions, 364 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj index f88402a0b5..1d43355aeb 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -245,7 +245,6 @@ 43348AA4107747CD00F859CF /* Edl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43348AA1107747CD00F859CF /* Edl.cpp */; }; 43348AAE1077486D00F859CF /* PlayerCoreFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43348AA81077486D00F859CF /* PlayerCoreFactory.cpp */; }; 43348AAF1077486D00F859CF /* PlayerSelectionRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43348AAA1077486D00F859CF /* PlayerSelectionRule.cpp */; }; - 551C3A45175A12010051AAAD /* VDA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 551C3A43175A12010051AAAD /* VDA.cpp */; }; 552840CC1626163B00ED1333 /* UPnPPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 552840CA1626163B00ED1333 /* UPnPPlayer.cpp */; settings = {COMPILER_FLAGS = "-I$SRCROOT/lib/libUPnP -I$SRCROOT/lib/libUPnP/Neptune/Source/Core -I$SRCROOT/lib/libUPnP/Platinum/Source/Core -I$SRCROOT/lib/libUPnP/Platinum/Source/Platinum -I$SRCROOT/lib/libUPnP/Platinum/Source/Extras -I$SRCROOT/lib/libUPnP/Platinum/Source/Devices/MediaServer -I$SRCROOT/lib/libUPnP/Platinum/Source/Devices/MediaConnect -I$SRCROOT/lib/libUPnP/Platinum/Source/Devices/MediaRenderer"; }; }; 5558ED10176396CD00118C35 /* StereoscopicsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5558ED0E176396CD00118C35 /* StereoscopicsManager.cpp */; }; 55611BA31766672F00754072 /* RenderFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55611BA21766672F00754072 /* RenderFlags.cpp */; }; @@ -398,6 +397,7 @@ 7C7CEAF1165629530059C9EB /* AELimiter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C7CEAEF165629530059C9EB /* AELimiter.cpp */; }; 7C84A59E12FA3C1600CD1714 /* SourcesDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C84A59C12FA3C1600CD1714 /* SourcesDirectory.cpp */; }; 7C87B2CE162CE39600EF897D /* PlayerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C87B2CC162CE39600EF897D /* PlayerController.cpp */; }; + 7C87F5C81CD1E9D4009AC381 /* RendererVTBGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C87F5C61CD1E9D4009AC381 /* RendererVTBGL.cpp */; }; 7C89619213B6A16F003631FE /* GUIWindowScreensaverDim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89619013B6A16F003631FE /* GUIWindowScreensaverDim.cpp */; }; 7C8A14571154CB2600E5FCFA /* TextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C8A14541154CB2600E5FCFA /* TextureCache.cpp */; }; 7C8A187D115B2A8200E5FCFA /* TextureDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C8A187A115B2A8200E5FCFA /* TextureDatabase.cpp */; }; @@ -480,8 +480,6 @@ 7CC7B6C919186A8800DDB120 /* SettingConditions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC7B6C619186A8800DDB120 /* SettingConditions.cpp */; }; 7CC82C9318284F9F0010DF30 /* CharsetDetection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC82C9118284F9F0010DF30 /* CharsetDetection.cpp */; }; 7CC82C9418284F9F0010DF30 /* CharsetDetection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC82C9118284F9F0010DF30 /* CharsetDetection.cpp */; }; - 7CCA95BF1BC6E6670091D308 /* RendererVDA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCA95BB1BC6E6670091D308 /* RendererVDA.cpp */; }; - 7CCA95C01BC6E6670091D308 /* RendererVDA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCA95BB1BC6E6670091D308 /* RendererVDA.cpp */; }; 7CCA95C11BC6E6670091D308 /* RendererVTB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCA95BD1BC6E6670091D308 /* RendererVTB.cpp */; }; 7CCA95C21BC6E6670091D308 /* RendererVTB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCA95BD1BC6E6670091D308 /* RendererVTB.cpp */; }; 7CCA95C81BC6E6F90091D308 /* Resolution.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCA95C71BC6E6F90091D308 /* Resolution.cpp */; }; @@ -680,6 +678,7 @@ 7CCF7FC9106A0DF500992676 /* TimeUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCF7FC7106A0DF500992676 /* TimeUtils.cpp */; }; 7CD46A141CCDEA7500BF4AD4 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CD46A131CCDEA7500BF4AD4 /* VideoToolbox.framework */; }; 7CD46A161CCDF09500BF4AD4 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CD46A151CCDF09500BF4AD4 /* CoreMedia.framework */; }; + 7CD46A191CCDF21300BF4AD4 /* VTB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD46A181CCDF21300BF4AD4 /* VTB.cpp */; }; 7CD4F7EC1C60DBC10015214B /* VideoFileItemListModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD4F7EA1C60DBC10015214B /* VideoFileItemListModifier.cpp */; }; 7CD4F7ED1C60DBC10015214B /* VideoFileItemListModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD4F7EA1C60DBC10015214B /* VideoFileItemListModifier.cpp */; }; 7CDAE9050FFCA3520040B25F /* DVDTSCorrection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */; }; @@ -2171,7 +2170,6 @@ F500E35617F3412C004FC217 /* WinEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F500E35517F3412C004FC217 /* WinEvents.cpp */; }; F500E35717F3412C004FC217 /* WinEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F500E35517F3412C004FC217 /* WinEvents.cpp */; }; F506297A0E57B9680066625A /* MultiPathFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F50629780E57B9680066625A /* MultiPathFile.cpp */; }; - F5071906175A26AD004C87D1 /* VideoDecodeAcceleration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5071905175A26AD004C87D1 /* VideoDecodeAcceleration.framework */; }; F50FDC5A119B4B2C00C8B8CD /* GUIDialogTextViewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F50FDC59119B4B2C00C8B8CD /* GUIDialogTextViewer.cpp */; }; F50FE04E11A3411A00C8B8CD /* EncoderFFmpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F50FE04D11A3411A00C8B8CD /* EncoderFFmpeg.cpp */; }; F52A733D1560BC34005B1A0B /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F52A733C1560BC34005B1A0B /* CoreFoundation.framework */; }; @@ -2723,8 +2721,6 @@ 436721A612D66A09002508E6 /* IAnnouncer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IAnnouncer.h; sourceTree = "<group>"; }; 436B38F3106628850049AB3B /* EndianSwap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EndianSwap.h; sourceTree = "<group>"; }; 43FAC87112D6349400F67914 /* IStorageProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IStorageProvider.h; sourceTree = "<group>"; }; - 551C3A43175A12010051AAAD /* VDA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VDA.cpp; sourceTree = "<group>"; }; - 551C3A44175A12010051AAAD /* VDA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VDA.h; sourceTree = "<group>"; }; 552840CA1626163B00ED1333 /* UPnPPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UPnPPlayer.cpp; sourceTree = "<group>"; }; 552840CB1626163B00ED1333 /* UPnPPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UPnPPlayer.h; sourceTree = "<group>"; }; 5558ED0E176396CD00118C35 /* StereoscopicsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StereoscopicsManager.cpp; sourceTree = "<group>"; }; @@ -2933,6 +2929,8 @@ 7C84A59D12FA3C1600CD1714 /* SourcesDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourcesDirectory.h; path = xbmc/filesystem/SourcesDirectory.h; sourceTree = SOURCE_ROOT; }; 7C87B2CC162CE39600EF897D /* PlayerController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayerController.cpp; sourceTree = "<group>"; }; 7C87B2CD162CE39600EF897D /* PlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerController.h; sourceTree = "<group>"; }; + 7C87F5C61CD1E9D4009AC381 /* RendererVTBGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RendererVTBGL.cpp; path = HwDecRender/RendererVTBGL.cpp; sourceTree = "<group>"; }; + 7C87F5C71CD1E9D4009AC381 /* RendererVTBGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RendererVTBGL.h; path = HwDecRender/RendererVTBGL.h; sourceTree = "<group>"; }; 7C89619013B6A16F003631FE /* GUIWindowScreensaverDim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowScreensaverDim.cpp; sourceTree = "<group>"; }; 7C89619113B6A16F003631FE /* GUIWindowScreensaverDim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowScreensaverDim.h; sourceTree = "<group>"; }; 7C89674413C03B22003631FE /* InfoBool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoBool.h; sourceTree = "<group>"; }; @@ -3041,8 +3039,6 @@ 7CC7B6C719186A8800DDB120 /* SettingConditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingConditions.h; sourceTree = "<group>"; }; 7CC82C9118284F9F0010DF30 /* CharsetDetection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharsetDetection.cpp; sourceTree = "<group>"; }; 7CC82C9218284F9F0010DF30 /* CharsetDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharsetDetection.h; sourceTree = "<group>"; }; - 7CCA95BB1BC6E6670091D308 /* RendererVDA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RendererVDA.cpp; path = HwDecRender/RendererVDA.cpp; sourceTree = "<group>"; }; - 7CCA95BC1BC6E6670091D308 /* RendererVDA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RendererVDA.h; path = HwDecRender/RendererVDA.h; sourceTree = "<group>"; }; 7CCA95BD1BC6E6670091D308 /* RendererVTB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RendererVTB.cpp; path = HwDecRender/RendererVTB.cpp; sourceTree = "<group>"; }; 7CCA95BE1BC6E6670091D308 /* RendererVTB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RendererVTB.h; path = HwDecRender/RendererVTB.h; sourceTree = "<group>"; }; 7CCA95C71BC6E6F90091D308 /* Resolution.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Resolution.cpp; sourceTree = "<group>"; }; @@ -3391,6 +3387,8 @@ 7CCF7FC8106A0DF500992676 /* TimeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeUtils.h; sourceTree = "<group>"; }; 7CD46A131CCDEA7500BF4AD4 /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; }; 7CD46A151CCDF09500BF4AD4 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; + 7CD46A171CCDF1FD00BF4AD4 /* VTB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTB.h; sourceTree = "<group>"; }; + 7CD46A181CCDF21300BF4AD4 /* VTB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTB.cpp; sourceTree = "<group>"; }; 7CD4F7EA1C60DBC10015214B /* VideoFileItemListModifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoFileItemListModifier.cpp; sourceTree = "<group>"; }; 7CD4F7EB1C60DBC10015214B /* VideoFileItemListModifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFileItemListModifier.h; sourceTree = "<group>"; }; 7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDTSCorrection.cpp; sourceTree = "<group>"; }; @@ -4816,7 +4814,6 @@ F502BFF1160F36AD00C96C76 /* swig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = swig.h; path = python/swig.h; sourceTree = "<group>"; }; F50629780E57B9680066625A /* MultiPathFile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MultiPathFile.cpp; sourceTree = "<group>"; }; F50629790E57B9680066625A /* MultiPathFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultiPathFile.h; sourceTree = "<group>"; }; - F5071905175A26AD004C87D1 /* VideoDecodeAcceleration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoDecodeAcceleration.framework; path = System/Library/Frameworks/VideoDecodeAcceleration.framework; sourceTree = SDKROOT; }; F50FDC58119B4B2C00C8B8CD /* GUIDialogTextViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogTextViewer.h; sourceTree = "<group>"; }; F50FDC59119B4B2C00C8B8CD /* GUIDialogTextViewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogTextViewer.cpp; sourceTree = "<group>"; }; F50FE04C11A3411A00C8B8CD /* EncoderFFmpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncoderFFmpeg.h; sourceTree = "<group>"; }; @@ -5040,7 +5037,6 @@ F59879080FBAA0C3008EF4FB /* QuartzCore.framework in Frameworks */, F52A733D1560BC34005B1A0B /* CoreFoundation.framework in Frameworks */, DFBE805115F7D75700D7D102 /* SystemConfiguration.framework in Frameworks */, - F5071906175A26AD004C87D1 /* VideoDecodeAcceleration.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -6397,8 +6393,8 @@ 7CCA95BA1BC6E6450091D308 /* HwDecRender */ = { isa = PBXGroup; children = ( - 7CCA95BB1BC6E6670091D308 /* RendererVDA.cpp */, - 7CCA95BC1BC6E6670091D308 /* RendererVDA.h */, + 7C87F5C61CD1E9D4009AC381 /* RendererVTBGL.cpp */, + 7C87F5C71CD1E9D4009AC381 /* RendererVTBGL.h */, 7CCA95BD1BC6E6670091D308 /* RendererVTB.cpp */, 7CCA95BE1BC6E6670091D308 /* RendererVTB.h */, ); @@ -7982,8 +7978,8 @@ E4991590174E6ABE00741B6D /* DVDVideoCodecVideoToolBox.h */, E38E15410D25F9F900618676 /* DVDVideoPPFFmpeg.cpp */, E38E15420D25F9F900618676 /* DVDVideoPPFFmpeg.h */, - 551C3A43175A12010051AAAD /* VDA.cpp */, - 551C3A44175A12010051AAAD /* VDA.h */, + 7CD46A171CCDF1FD00BF4AD4 /* VTB.h */, + 7CD46A181CCDF21300BF4AD4 /* VTB.cpp */, ); path = Video; sourceTree = "<group>"; @@ -8906,7 +8902,6 @@ E38E23910D2626E600618676 /* OpenGL.framework */, F59879070FBAA0C3008EF4FB /* QuartzCore.framework */, DFBE803D15F7D72100D7D102 /* SystemConfiguration.framework */, - F5071905175A26AD004C87D1 /* VideoDecodeAcceleration.framework */, ); name = OSX; sourceTree = "<group>"; @@ -10070,7 +10065,6 @@ E4A249F71095C880003D74C6 /* AutorunMediaJob.cpp in Sources */, F5A9D3091097C9370050490F /* AliasShortcutUtils.cpp in Sources */, DF396ED11C42A25F00214C1A /* DarwinNSUserDefaults.mm in Sources */, - 7CCA95BF1BC6E6670091D308 /* RendererVDA.cpp in Sources */, 431AE5DA109C1A63007428C3 /* OverlayRendererUtil.cpp in Sources */, 7C45DBE910F325C400D4BBF3 /* DAVDirectory.cpp in Sources */, 7CAA57471C8AF6C20032A326 /* DebugRenderer.cpp in Sources */, @@ -10231,6 +10225,7 @@ 433219D812E4C6A500CD7486 /* udf25.cpp in Sources */, 433219D912E4C6A500CD7486 /* UDFDirectory.cpp in Sources */, 7C4705AE12EF584C00369E51 /* AddonInstaller.cpp in Sources */, + 7CD46A191CCDF21300BF4AD4 /* VTB.cpp in Sources */, 18C1D22D13033F6A00CFFE59 /* GLUtils.cpp in Sources */, F56579AF13060D1E0085ED7F /* RenderCapture.cpp in Sources */, 7C84A59E12FA3C1600CD1714 /* SourcesDirectory.cpp in Sources */, @@ -10315,6 +10310,7 @@ DF93D69D1444A8B1007C6459 /* CurlFile.cpp in Sources */, DF93D69F1444A8B1007C6459 /* DirectoryFactory.cpp in Sources */, DF93D6A01444A8B1007C6459 /* FileDirectoryFactory.cpp in Sources */, + 7C87F5C81CD1E9D4009AC381 /* RendererVTBGL.cpp in Sources */, 68AE5C2D1C9243A000C4D527 /* Controller.cpp in Sources */, DF2401261B41A26F001E02DA /* ImageResource.cpp in Sources */, DF93D6A11444A8B1007C6459 /* FileReaderFile.cpp in Sources */, @@ -10535,7 +10531,6 @@ 68AE5BE11C92421800C4D527 /* AddonButtonMapping.cpp in Sources */, 68AE5C091C92437900C4D527 /* GUIControllerList.cpp in Sources */, 7C8E02461BA35D0B0072E8B2 /* SystemBuiltins.cpp in Sources */, - 551C3A45175A12010051AAAD /* VDA.cpp in Sources */, DFBB431B178B5E6F006CC20A /* CompileInfo.cpp in Sources */, DF40BC20178B4BEC009DB567 /* PythonInvoker.cpp in Sources */, DF40BC2F178B4C07009DB567 /* LanguageInvokerThread.cpp in Sources */, @@ -11471,7 +11466,6 @@ E4991453174E605900741B6D /* FileUtils.cpp in Sources */, E4991454174E605900741B6D /* GLUtils.cpp in Sources */, 7CAA57481C8AF6C20032A326 /* DebugRenderer.cpp in Sources */, - 7CCA95C01BC6E6670091D308 /* RendererVDA.cpp in Sources */, E4991455174E605900741B6D /* GroupUtils.cpp in Sources */, E4991457174E605900741B6D /* HTMLUtil.cpp in Sources */, E4991458174E605900741B6D /* HttpHeader.cpp in Sources */, diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index aa865f6de5..1425fc2f3e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -6608,7 +6608,7 @@ msgstr "" #: system/settings/settings.xml msgctxt "#13429" -msgid "Allow hardware acceleration - VDADecoder" +msgid "Allow hardware acceleration - VTBDecoder" msgstr "" #: system/settings/settings.xml @@ -16340,10 +16340,10 @@ msgctxt "#36159" msgid "Enable CrystalHD decoding of video files." msgstr "" -#. Description of setting "Videos -> Playback -> Allow hardware acceleration (VDADecoder)" with label #13429 +#. Description of setting "Videos -> Playback -> Allow hardware acceleration (VideoToolbox)" with label #13429 #: system/settings/settings.xml msgctxt "#36160" -msgid "Enable VDA hardware decoding of video files." +msgid "Enable VTB hardware decoding of video files." msgstr "" #. Description of setting "Videos -> Playback -> Allow hardware acceleration (OpenMax)" with label #13430 diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 3070cc4f4b..d1cb80dcb1 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -817,8 +817,8 @@ <default>true</default> <control type="toggle" /> </setting> - <setting id="videoplayer.usevda" type="boolean" label="13429" help="36160"> - <requirement>HasVDA</requirement> + <setting id="videoplayer.usevtb" type="boolean" label="13429" help="36160"> + <requirement>HasVTB</requirement> <level>2</level> <default>true</default> <control type="toggle" /> @@ -1049,7 +1049,7 @@ <level>1</level> <default></default> <constraints> - <allowempty>true</allowempty> + <allowempty>true</allowempty> <addontype>xbmc.subtitle.module</addontype> </constraints> <control type="button" format="addon"> diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index f4ba986c96..f83616c319 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -58,7 +58,7 @@ #include "VAAPI.h" #endif #ifdef TARGET_DARWIN_OSX -#include "VDA.h" +#include "VTB.h" #endif #ifdef HAS_MMAL #include "MMALFFmpeg.h" @@ -165,9 +165,9 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avct #endif #ifdef TARGET_DARWIN_OSX - if (*cur == AV_PIX_FMT_VDA && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDA) && g_advancedSettings.m_useFfmpegVda) + if (*cur == AV_PIX_FMT_VIDEOTOOLBOX && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB)) { - VDA::CDecoder* dec = new VDA::CDecoder(); + VTB::CDecoder* dec = new VTB::CDecoder(); if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount)) { ctx->SetHardware(dec); @@ -290,7 +290,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options tryhw = true; #endif #ifdef TARGET_DARWIN_OSX - if(CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVDA)) + if(CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVTB)) tryhw = true; #endif #ifdef HAS_MMAL diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.cpp deleted file mode 100644 index d5af5957f6..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ -#include "system.h" -#ifdef TARGET_DARWIN_OSX -#include "platform/darwin/osx/CocoaInterface.h" -#include "platform/darwin/DarwinUtils.h" -#include "DVDVideoCodec.h" -#include "DVDCodecs/DVDCodecUtils.h" -#include "utils/log.h" -#include "VDA.h" -#include "utils/BitstreamConverter.h" - -extern "C" { - #include "libavcodec/vda.h" -} - -using namespace VDA; - - -CDecoder::CDecoder() -: m_renderbuffers_count(3) -{ - //m_ctx = av_vda_alloc_context(); - m_bitstream = NULL; -} - -CDecoder::~CDecoder() -{ - Close(); - av_free(m_ctx); -} - -bool CDecoder::Create(AVCodecContext *avctx) -{ - OSStatus status; - CFNumberRef height; - CFNumberRef width; - CFNumberRef format; - CFMutableDictionaryRef config_info; - CFMutableDictionaryRef buffer_attributes; - CFDictionaryRef io_surface_properties; - CFNumberRef cv_pix_fmt; - CFDataRef avcCData; - int32_t fmt = 'avc1'; - int32_t pix_fmt = kCVPixelFormatType_422YpCbCr8; - - switch (avctx->codec_id) - { - case AV_CODEC_ID_H264: - m_bitstream = new CBitstreamConverter; - if (!m_bitstream->Open(avctx->codec_id, (uint8_t*)avctx->extradata, avctx->extradata_size, false)) - { - return false; - } - break; - - default: - return false; - break; - } - - avcCData = CFDataCreate(kCFAllocatorDefault, - (const uint8_t*)m_bitstream->GetExtraData(), m_bitstream->GetExtraSize()); - - // check the avcC atom's sps for number of reference frames and - // bail if interlaced, VDA does not handle interlaced h264. - uint32_t avcc_len = CFDataGetLength(avcCData); - if (avcc_len < 8) - { - // avcc atoms with length less than 8 are borked. - CFRelease(avcCData); - return false; - } - else - { - bool interlaced = true; - int max_ref_frames; - uint8_t *spc = (uint8_t*)CFDataGetBytePtr(avcCData) + 6; - uint32_t sps_size = BS_RB16(spc); - if (sps_size) - m_bitstream->parseh264_sps(spc+3, sps_size-1, &interlaced, &max_ref_frames); - if (interlaced) - { - CLog::Log(LOGNOTICE, "%s - possible interlaced content.", __FUNCTION__); - CFRelease(avcCData); - return false; - } - - if (((uint8_t*)avctx->extradata)[4] == 0xFE) - { - // video content is from so silly encoder that think 3 byte NAL sizes are valid - CLog::Log(LOGNOTICE, "%s - 3 byte nal length not supported", __FUNCTION__); - CFRelease(avcCData); - return false; - } - } - - - config_info = CFDictionaryCreateMutable(kCFAllocatorDefault, - 4, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &avctx->height); - width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &avctx->width); - format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &fmt); - - CFDictionarySetValue(config_info, kVDADecoderConfiguration_Height, height); - CFDictionarySetValue(config_info, kVDADecoderConfiguration_Width, width); - CFDictionarySetValue(config_info, kVDADecoderConfiguration_SourceFormat, format); - CFDictionarySetValue(config_info, kVDADecoderConfiguration_avcCData, avcCData); - - buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, - 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - io_surface_properties = CFDictionaryCreate(kCFAllocatorDefault, - NULL, NULL, 0, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - - cv_pix_fmt = CFNumberCreate(kCFAllocatorDefault, - kCFNumberSInt32Type, - &pix_fmt); - - CFDictionarySetValue(buffer_attributes, - kCVPixelBufferPixelFormatTypeKey, - cv_pix_fmt); - - CFDictionarySetValue(buffer_attributes, - kCVPixelBufferIOSurfacePropertiesKey, - io_surface_properties); - - status = VDADecoderCreate(config_info, - buffer_attributes, - (VDADecoderOutputCallback*)m_ctx->output_callback, - avctx, - &m_ctx->decoder); - - CFRelease(height); - CFRelease(width); - CFRelease(format); - CFRelease(avcCData); - CFRelease(config_info); - CFRelease(io_surface_properties); - CFRelease(cv_pix_fmt); - if (CDarwinUtils::DeviceHasLeakyVDA()) - CFRelease(cv_pix_fmt); - CFRelease(buffer_attributes); - - if(status != kVDADecoderNoErr) - { - CLog::Log(LOGERROR, "VDA::CDecoder - Failed to init VDA decoder: %d", status); - return false; - } - return true; -} - -void CDecoder::Close() -{ - OSStatus status = kVDADecoderNoErr; - - if (m_ctx->decoder) - status = VDADecoderDestroy(m_ctx->decoder); - m_ctx->decoder = NULL; - - delete m_bitstream; - m_bitstream = NULL; -} - -bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixelFormat fmt, unsigned int surfaces) -{ - Close(); - - if(fmt != AV_PIX_FMT_VDA) - return false; - - if(avctx->codec_id != AV_CODEC_ID_H264) - return false; - - switch(avctx->profile) - { - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_10_INTRA: - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_CAVLC_444: - return false; - default: - break; - } - - if (Cocoa_GPUForDisplayIsNvidiaPureVideo3() && !CDVDCodecUtils::IsVP3CompatibleWidth(avctx->width)) - { - CLog::Log(LOGNOTICE, "%s - Nvidia 9400 GPU hardware limitation, cannot decode a width of %d", __FUNCTION__, avctx->width); - return false; - } - - if (avctx->profile == FF_PROFILE_H264_MAIN && avctx->level == 32 && avctx->refs > 4) - { - // Main@L3.2, VDA cannot handle greater than 4 reference frames - CLog::Log(LOGNOTICE, "%s - Main@L3.2 detected, VDA cannot decode.", __FUNCTION__); - return false; - } - - if (!Create(avctx)) - return false; - - avctx->pix_fmt = fmt; - avctx->hwaccel_context = m_ctx; - - mainctx->pix_fmt = fmt; - mainctx->hwaccel_context = m_ctx; - - return true; -} - -int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) -{ - int status = Check(avctx); - if(status) - return status; - - if(frame) - return VC_BUFFER | VC_PICTURE; - else - return VC_BUFFER; -} - -bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture) -{ - ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(picture); - - picture->format = RENDER_FMT_CVBREF; - picture->cvBufferRef = (CVPixelBufferRef)frame->data[3]; - return true; -} - -int CDecoder::Check(AVCodecContext* avctx) -{ - return 0; -} - -unsigned CDecoder::GetAllowedReferences() -{ - return m_renderbuffers_count; -} - -#endif diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp new file mode 100644 index 0000000000..f985593931 --- /dev/null +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2005-2016 Team XBMC + * http://xbmc.org + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ +#include "system.h" +#ifdef TARGET_DARWIN_OSX +#include "platform/darwin/osx/CocoaInterface.h" +#include "platform/darwin/DarwinUtils.h" +#include "DVDVideoCodec.h" +#include "DVDCodecs/DVDCodecUtils.h" +#include "utils/log.h" +#include "VTB.h" +#include "utils/BitstreamConverter.h" + +extern "C" { +#include "libavcodec/videotoolbox.h" +} + +using namespace VTB; + + +CDecoder::CDecoder() +{ + m_avctx = nullptr; +} + +CDecoder::~CDecoder() +{ + Close(); +} + +void CDecoder::Close() +{ + if (m_avctx) + { + av_videotoolbox_default_free(m_avctx); + m_avctx = nullptr; + } +} + +bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixelFormat fmt, unsigned int surfaces) +{ + if (avctx->codec_id == AV_CODEC_ID_H264) + { + CBitstreamConverter bs; + if (!bs.Open(avctx->codec_id, (uint8_t*)avctx->extradata, avctx->extradata_size, false)) + { + return false; + } + CFDataRef avcCData = CFDataCreate(kCFAllocatorDefault, + (const uint8_t*)bs.GetExtraData(), bs.GetExtraSize()); + bool interlaced = true; + int max_ref_frames; + uint8_t *spc = (uint8_t*)CFDataGetBytePtr(avcCData) + 6; + uint32_t sps_size = BS_RB16(spc); + if (sps_size) + bs.parseh264_sps(spc+3, sps_size-1, &interlaced, &max_ref_frames); + CFRelease(avcCData); + if (interlaced) + { + CLog::Log(LOGNOTICE, "%s - possible interlaced content.", __FUNCTION__); + return false; + } + } + + if (av_videotoolbox_default_init(avctx) < 0) + return false; + + m_avctx = avctx; + + mainctx->pix_fmt = fmt; + mainctx->hwaccel_context = avctx->hwaccel_context; + + return true; +} + +int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) +{ + int status = Check(avctx); + if(status) + return status; + + if(frame) + return VC_BUFFER | VC_PICTURE; + else + return VC_BUFFER; +} + +bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture) +{ + ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(picture); + + picture->format = RENDER_FMT_CVBREF; + picture->cvBufferRef = (CVPixelBufferRef)frame->data[3]; + return true; +} + +int CDecoder::Check(AVCodecContext* avctx) +{ + return 0; +} + +unsigned CDecoder::GetAllowedReferences() +{ + return 5; +} + +#endif diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h index 3c91f2def4..1e097d4a38 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDA.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VTB.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Team XBMC + * Copyright (C) 2005-2016 Team XBMC * http://xbmc.org * * This library is free software; you can redistribute it and/or @@ -23,10 +23,7 @@ #include "DVDVideoCodecFFmpeg.h" -struct AVVDAContext; -class CBitstreamConverter; - -namespace VDA +namespace VTB { class CDecoder @@ -40,14 +37,13 @@ public: virtual bool GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture* picture); virtual int Check(AVCodecContext* avctx); virtual void Close(); - virtual const std::string Name() { return "vda"; } + virtual const std::string Name() { return "vtb"; } virtual unsigned GetAllowedReferences(); protected: - bool Create(AVCodecContext* avctx); unsigned m_renderbuffers_count; - struct AVVDAContext* m_ctx; - CBitstreamConverter *m_bitstream; + AVCodecContext *m_avctx; + }; } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp index 83a189fb95..d3e1e034fe 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp @@ -18,7 +18,7 @@ * */ -#include "RendererVDA.h" +#include "RendererVTBGL.h" #if defined(TARGET_DARWIN_OSX) @@ -31,17 +31,17 @@ #include <OpenGL/CGLIOSurface.h> #include "windowing/WindowingFactory.h" -CRendererVDA::CRendererVDA() +CRendererVTB::CRendererVTB() { } -CRendererVDA::~CRendererVDA() +CRendererVTB::~CRendererVTB() { } -void CRendererVDA::AddVideoPictureHW(DVDVideoPicture &picture, int index) +void CRendererVTB::AddVideoPictureHW(DVDVideoPicture &picture, int index) { YUVBUFFER &buf = m_buffers[index]; if (buf.hwDec) @@ -51,7 +51,7 @@ void CRendererVDA::AddVideoPictureHW(DVDVideoPicture &picture, int index) CVBufferRetain(picture.cvBufferRef); } -void CRendererVDA::ReleaseBuffer(int idx) +void CRendererVTB::ReleaseBuffer(int idx) { YUVBUFFER &buf = m_buffers[idx]; if (buf.hwDec) @@ -60,34 +60,34 @@ void CRendererVDA::ReleaseBuffer(int idx) } -bool CRendererVDA::Supports(EINTERLACEMETHOD method) +bool CRendererVTB::Supports(EINTERLACEMETHOD method) { return false; } -bool CRendererVDA::Supports(EDEINTERLACEMODE mode) +bool CRendererVTB::Supports(EDEINTERLACEMODE mode) { return false; } -EINTERLACEMETHOD CRendererVDA::AutoInterlaceMethod() +EINTERLACEMETHOD CRendererVTB::AutoInterlaceMethod() { return VS_INTERLACEMETHOD_NONE; } -bool CRendererVDA::LoadShadersHook() +bool CRendererVTB::LoadShadersHook() { CLog::Log(LOGNOTICE, "GL: Using CVBREF render method"); - // m_renderMethod = RENDER_CVREF; + m_renderMethod = RENDER_CVREF; m_textureTarget = GL_TEXTURE_RECTANGLE_ARB; return false; } -bool CRendererVDA::CreateTexture(int index) +bool CRendererVTB::CreateTexture(int index) { YV12Image &im = m_buffers[index].image; YUVFIELDS &fields = m_buffers[index].fields; - YUVPLANE &plane = fields[0][0]; + YUVPLANES &planes = fields[0]; DeleteTexture(index); @@ -97,77 +97,112 @@ bool CRendererVDA::CreateTexture(int index) im.bpp = 1; im.width = m_sourceWidth; im.height = m_sourceHeight; - im.cshift_x = 0; - im.cshift_y = 0; + im.cshift_x = 1; + im.cshift_y = 1; - plane.pixpertex_x = 2; - plane.pixpertex_y = 1; - plane.texwidth = im.width / plane.pixpertex_x; - plane.texheight = im.height / plane.pixpertex_y; + planes[0].texwidth = im.width; + planes[0].texheight = im.height; - if(m_renderMethod & RENDER_POT) + planes[1].texwidth = planes[0].texwidth >> im.cshift_x; + planes[1].texheight = planes[0].texheight >> im.cshift_y; + planes[2].texwidth = planes[1].texwidth; + planes[2].texheight = planes[1].texheight; + + for (int p = 0; p < 3; p++) { - plane.texwidth = NP2(plane.texwidth); - plane.texheight = NP2(plane.texheight); + planes[p].pixpertex_x = 1; + planes[p].pixpertex_y = 1; } glEnable(m_textureTarget); - glGenTextures(1, &plane.id); + glGenTextures(1, &planes[0].id); + glGenTextures(1, &planes[1].id); + planes[2].id = planes[1].id; glDisable(m_textureTarget); return true; } -void CRendererVDA::DeleteTexture(int index) +void CRendererVTB::DeleteTexture(int index) { - YUVPLANE &plane = m_buffers[index].fields[0][0]; + YUVPLANES &planes = m_buffers[index].fields[0]; if (m_buffers[index].hwDec) CVBufferRelease((struct __CVBuffer *)m_buffers[index].hwDec); m_buffers[index].hwDec = NULL; - if (plane.id && glIsTexture(plane.id)) - glDeleteTextures(1, &plane.id), plane.id = 0; + if (planes[0].id && glIsTexture(planes[0].id)) + { + glDeleteTextures(1, &planes[0].id); + } + if (planes[1].id && glIsTexture(planes[1].id)) + { + glDeleteTextures(1, &planes[1].id); + } + planes[0].id = 0; + planes[1].id = 0; + planes[2].id = 0; } -bool CRendererVDA::UploadTexture(int index) +bool CRendererVTB::UploadTexture(int index) { - YUVBUFFER &buf = m_buffers[index]; + YUVBUFFER &buf = m_buffers[index]; YUVFIELDS &fields = buf.fields; + YUVPLANES &planes = fields[0]; - CVBufferRef cvBufferRef = (struct __CVBuffer *)m_buffers[index].hwDec; + CVImageBufferRef cvBufferRef = (struct __CVBuffer *)m_buffers[index].hwDec; glEnable(m_textureTarget); - if (cvBufferRef && fields[m_currentField][0].flipindex != buf.flipindex) + // It is the fastest way to render a CVPixelBuffer backed + // with an IOSurface as there is no CPU -> GPU upload. + CGLContextObj cgl_ctx = (CGLContextObj)g_Windowing.GetCGLContextObj(); + IOSurfaceRef surface = CVPixelBufferGetIOSurface(cvBufferRef); + OSType format_type = IOSurfaceGetPixelFormat(surface); + + if (format_type != kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange) { + return false; + } - // It is the fastest way to render a CVPixelBuffer backed - // with an IOSurface as there is no CPU -> GPU upload. - CGLContextObj cgl_ctx = (CGLContextObj)g_Windowing.GetCGLContextObj(); - IOSurfaceRef surface = CVPixelBufferGetIOSurface(cvBufferRef); - GLsizei texWidth = IOSurfaceGetWidth(surface); - GLsizei texHeight= IOSurfaceGetHeight(surface); - OSType format_type = IOSurfaceGetPixelFormat(surface); + GLsizei surfplanes = IOSurfaceGetPlaneCount(surface); - glBindTexture(m_textureTarget, fields[FIELD_FULL][0].id); + if (surfplanes != 2) + { + return false; + } - if (format_type == kCVPixelFormatType_422YpCbCr8) - CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_RGBA8, - texWidth / 2, texHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, surface, 0); - else if (format_type == kCVPixelFormatType_32BGRA) - CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_RGBA8, - texWidth, texHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, surface, 0); + GLsizei widthY = IOSurfaceGetWidthOfPlane(surface, 0); + GLsizei widthUV = IOSurfaceGetWidthOfPlane(surface, 1); + GLsizei heightY = IOSurfaceGetHeightOfPlane(surface, 0); + GLsizei heightUV = IOSurfaceGetHeightOfPlane(surface, 1); - glBindTexture(m_textureTarget, 0); - fields[FIELD_FULL][0].flipindex = buf.flipindex; + glBindTexture(m_textureTarget, planes[0].id); - } + CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_LUMINANCE, + widthY, heightY, GL_LUMINANCE, GL_UNSIGNED_BYTE, surface, 0); + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindTexture(m_textureTarget, planes[1].id); + + CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_LUMINANCE_ALPHA, + widthUV, heightUV, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, surface, 1); + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glBindTexture(m_textureTarget, 0); + planes[0].flipindex = buf.flipindex; - CalculateTextureSourceRects(index, 3); glDisable(m_textureTarget); + CalculateTextureSourceRects(index, 3); + + return true; } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.h index b8254e5665..7e4f693185 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.h @@ -26,11 +26,11 @@ #include "cores/VideoPlayer/VideoRenderers/LinuxRendererGL.h" -class CRendererVDA : public CLinuxRendererGL +class CRendererVTB : public CLinuxRendererGL { public: - CRendererVDA(); - virtual ~CRendererVDA(); + CRendererVTB(); + virtual ~CRendererVTB(); // Player functions virtual void AddVideoPictureHW(DVDVideoPicture &picture, int index); diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp index fbbb23c05a..e5322b65b0 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -38,7 +38,7 @@ #include "HwDecRender/RendererVAAPI.h" #include "HwDecRender/RendererVDPAU.h" #if defined(TARGET_DARWIN_OSX) -#include "HwDecRender/RendererVDA.h" +#include "HwDecRender/RendererVTBGL.h" #endif #elif HAS_GLES == 2 #include "LinuxRendererGLES.h" @@ -523,7 +523,7 @@ void CRenderManager::CreateRenderer() else if (m_format == RENDER_FMT_CVBREF) { #if defined(TARGET_DARWIN_OSX) - m_pRenderer = new CRendererVDA; + m_pRenderer = new CRendererVTB; #elif defined(HAVE_VIDEOTOOLBOXDECODER) m_pRenderer = new CRendererVTB; #endif diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShader.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShader.cpp index 60ec7b7808..fa9523a116 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShader.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShader.cpp @@ -220,12 +220,14 @@ BaseYUV2RGBGLSLShader::BaseYUV2RGBGLSLShader(bool rect, unsigned flags, ERenderF m_defines += "#define XBMC_NV12\n"; else if (m_format == RENDER_FMT_YUYV422) m_defines += "#define XBMC_YUY2\n"; - else if (m_format == RENDER_FMT_UYVY422 || m_format == RENDER_FMT_CVBREF) + else if (m_format == RENDER_FMT_UYVY422) m_defines += "#define XBMC_UYVY\n"; else if (m_format == RENDER_FMT_VDPAU_420) m_defines += "#define XBMC_NV12_RRG\n"; else if (m_format == RENDER_FMT_VAAPI) m_defines += "#define XBMC_NV12_RRG\n"; + else if (m_format == RENDER_FMT_CVBREF) + m_defines += "#define XBMC_YV12\n"; else CLog::Log(LOGERROR, "GL: BaseYUV2RGBGLSLShader - unsupported format %d", m_format); @@ -405,7 +407,7 @@ YUV2RGBProgressiveShaderARB::YUV2RGBProgressiveShaderARB(bool rect, unsigned fla else shaderfile = "yuv2rgb_basic_2d_YUY2.arb"; } - else if (m_format == RENDER_FMT_UYVY422 || m_format == RENDER_FMT_CVBREF) + else if (m_format == RENDER_FMT_UYVY422) { if(rect) shaderfile = "yuv2rgb_basic_rect_UYVY.arb"; diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp index d97b49db28..7174e3a3e3 100644 --- a/xbmc/settings/SettingConditions.cpp +++ b/xbmc/settings/SettingConditions.cpp @@ -317,7 +317,7 @@ void CSettingConditions::Initialize() m_simpleConditions.insert("hasvideotoolboxdecoder"); #endif #ifdef TARGET_DARWIN_OSX - m_simpleConditions.insert("HasVDA"); + m_simpleConditions.insert("HasVTB"); #endif #ifdef HAS_LIBAMCODEC if (aml_present()) diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index b46053f3f8..6baad2ca8c 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -175,7 +175,7 @@ const std::string CSettings::SETTING_VIDEOPLAYER_USEDXVA2 = "videoplayer.usedxva const std::string CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER = "videoplayer.useomxplayer"; const std::string CSettings::SETTING_VIDEOPLAYER_USEOMX = "videoplayer.useomx"; const std::string CSettings::SETTING_VIDEOPLAYER_USEVIDEOTOOLBOX = "videoplayer.usevideotoolbox"; -const std::string CSettings::SETTING_VIDEOPLAYER_USEVDA = "videoplayer.usevda"; +const std::string CSettings::SETTING_VIDEOPLAYER_USEVTB = "videoplayer.usevtb"; const std::string CSettings::SETTING_VIDEOPLAYER_USEMMAL = "videoplayer.usemmal"; const std::string CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT = "videoplayer.usestagefright"; const std::string CSettings::SETTING_VIDEOPLAYER_LIMITGUIUPDATE = "videoplayer.limitguiupdate"; diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index a4b8e17802..2e66b3c7f4 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -133,7 +133,7 @@ public: static const std::string SETTING_VIDEOPLAYER_USEOMXPLAYER; static const std::string SETTING_VIDEOPLAYER_USEOMX; static const std::string SETTING_VIDEOPLAYER_USEVIDEOTOOLBOX; - static const std::string SETTING_VIDEOPLAYER_USEVDA; + static const std::string SETTING_VIDEOPLAYER_USEVTB; static const std::string SETTING_VIDEOPLAYER_USEMMAL; static const std::string SETTING_VIDEOPLAYER_USESTAGEFRIGHT; static const std::string SETTING_VIDEOPLAYER_LIMITGUIUPDATE; |