diff --git a/.gitmodules b/.gitmodules index e33b2004fd..42e6350891 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,7 +7,7 @@ url=https://github.com/bazelbuild/rules_apple.git [submodule "build-system/bazel-rules/rules_swift"] path = build-system/bazel-rules/rules_swift - url = https://github.com/bazelbuild/rules_swift.git +url=https://github.com/ali-fareed/rules_swift.git [submodule "build-system/bazel-rules/apple_support"] path = build-system/bazel-rules/apple_support url = https://github.com/bazelbuild/apple_support.git @@ -17,9 +17,6 @@ url=https://github.com/bazelbuild/rules_apple.git [submodule "build-system/tulsi"] path = build-system/tulsi url=https://github.com/bazelbuild/tulsi.git -[submodule "third-party/depot_tools"] - path = third-party/depot_tools - url = https://chromium.googlesource.com/chromium/tools/depot_tools.git [submodule "third-party/webrtc/webrtc-ios"] path = third-party/webrtc/webrtc-ios url=https://github.com/ali-fareed/webrtc-ios.git diff --git a/BUCK b/BUCK deleted file mode 100644 index ea67fb9dd5..0000000000 --- a/BUCK +++ /dev/null @@ -1,553 +0,0 @@ -load("//Config:utils.bzl", - "library_configs", -) - -load("//Config:configs.bzl", - "app_binary_configs", - "share_extension_configs", - "widget_extension_configs", - "notification_content_extension_configs", - "notification_service_extension_configs", - "intents_extension_configs", - "watch_extension_binary_configs", - "watch_binary_configs", - "info_plist_substitutions", - "app_info_plist_substitutions", - "share_extension_info_plist_substitutions", - "widget_extension_info_plist_substitutions", - "notification_content_extension_info_plist_substitutions", - "notification_service_extension_info_plist_substitutions", - "intents_extension_info_plist_substitutions", - "watch_extension_info_plist_substitutions", - "watch_info_plist_substitutions", - "DEVELOPMENT_LANGUAGE", -) - -load("//Config:buck_rule_macros.bzl", - "apple_lib", - "framework_binary_dependencies", - "framework_bundle_dependencies", - "glob_map", - "glob_sub_map", - "merge_maps", -) - -framework_dependencies = [ - "//submodules/MtProtoKit:MtProtoKit", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", - "//submodules/Postbox:Postbox", - "//submodules/TelegramApi:TelegramApi", - "//submodules/SyncCore:SyncCore", - "//submodules/TelegramCore:TelegramCore", - "//submodules/AsyncDisplayKit:AsyncDisplayKit", - "//submodules/Display:Display", - "//submodules/TelegramUI:TelegramUI", -] - -resource_dependencies = [ - "//submodules/LegacyComponents:LegacyComponentsResources", - "//submodules/TelegramUI:TelegramUIAssets", - "//submodules/TelegramUI:TelegramUIResources", - #"//submodules/WalletUI:WalletUIAssets", - #"//submodules/WalletUI:WalletUIResources", - "//submodules/PasswordSetupUI:PasswordSetupUIResources", - "//submodules/PasswordSetupUI:PasswordSetupUIAssets", - "//submodules/OverlayStatusController:OverlayStatusControllerResources", - "//:AppResources", - "//:AppStringResources", - "//:InfoPlistStringResources", - "//:AppIntentVocabularyResources", - "//:Icons", - "//:AdditionalIcons", - "//:LaunchScreen", -] - -build_phase_scripts = [ -] - -apple_resource( - name = "AppResources", - files = glob([ - "Telegram-iOS/Resources/**/*", - ], exclude = ["Telegram-iOS/Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "AppStringResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/Localizable.strings", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "AppIntentVocabularyResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/AppIntentVocabulary.plist", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "InfoPlistStringResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/InfoPlist.strings", - ]), - visibility = ["PUBLIC"], -) - -apple_asset_catalog( - name = "Icons", - dirs = [ - "Telegram-iOS/Icons.xcassets", - "Telegram-iOS/AppIcons.xcassets", - ], - app_icon = "AppIconLLC", - visibility = ["PUBLIC"], -) - -apple_resource( - name = "AdditionalIcons", - files = glob([ - "Telegram-iOS/*.png", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "LaunchScreen", - files = [ - "Telegram-iOS/Base.lproj/LaunchScreen.xib", - ], - visibility = ["PUBLIC"], -) - -apple_library( - name = "AppLibrary", - visibility = [ - "//:", - "//...", - ], - configs = library_configs(), - swift_version = native.read_config("swift", "version"), - srcs = [ - "Telegram-iOS/main.m", - "Telegram-iOS/Application.swift" - ], - deps = [ - ] - + framework_binary_dependencies(framework_dependencies), -) - -apple_binary( - name = "AppBinary", - visibility = [ - "//:", - "//...", - ], - configs = app_binary_configs(), - swift_version = native.read_config("swift", "version"), - srcs = [ - "SupportFiles/Empty.swift", - ], - deps = [ - ":AppLibrary", - ] - + resource_dependencies, -) - -apple_bundle( - name = "Telegram", - visibility = [ - "//:", - ], - extension = "app", - binary = ":AppBinary", - product_name = "Telegram", - info_plist = "Telegram-iOS/Info.plist", - info_plist_substitutions = app_info_plist_substitutions(), - deps = [ - ":ShareExtension", - ":WidgetExtension", - ":NotificationContentExtension", - ":NotificationServiceExtension", - ":IntentsExtension", - ":WatchApp#watch", - ] - + framework_bundle_dependencies(framework_dependencies), -) - -# Share Extension - -apple_binary( - name = "ShareBinary", - srcs = glob([ - "Share/**/*.swift", - ]), - configs = share_extension_configs(), - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/TelegramUI:TelegramUI#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) - -apple_bundle( - name = "ShareExtension", - binary = ":ShareBinary", - extension = "appex", - info_plist = "Share/Info.plist", - info_plist_substitutions = share_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Widget - -apple_binary( - name = "WidgetBinary", - srcs = glob([ - "Widget/**/*.swift", - ]), - configs = widget_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/BuildConfig:BuildConfig", - "//submodules/WidgetItems:WidgetItems", - "//submodules/AppLockState:AppLockState", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/NotificationCenter.framework", - ], -) - -apple_bundle( - name = "WidgetExtension", - binary = ":WidgetBinary", - extension = "appex", - info_plist = "Widget/Info.plist", - info_plist_substitutions = widget_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Notification Content - -apple_binary( - name = "NotificationContentBinary", - srcs = glob([ - "NotificationContent/**/*.swift", - ]), - configs = notification_content_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/TelegramUI:TelegramUI#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UserNotificationsUI.framework", - ], -) - -apple_bundle( - name = "NotificationContentExtension", - binary = ":NotificationContentBinary", - extension = "appex", - info_plist = "NotificationContent/Info.plist", - info_plist_substitutions = notification_content_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -#Notification Service - -apple_binary( - name = "NotificationServiceBinary", - srcs = glob([ - "NotificationService/**/*.m", - "NotificationService/**/*.swift", - ]), - headers = glob([ - "NotificationService/**/*.h", - ]), - bridging_header = "NotificationService/NotificationService-Bridging-Header.h", - configs = notification_service_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/BuildConfig:BuildConfig", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/EncryptionProvider:EncryptionProvider", - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/PostboxDataTypes:PostboxDataTypes", - "//submodules/Database/MessageHistoryReadStateTable:MessageHistoryReadStateTable", - "//submodules/Database/MessageHistoryMetadataTable:MessageHistoryMetadataTable", - "//submodules/Database/PreferencesTable:PreferencesTable", - "//submodules/Database/PeerTable:PeerTable", - "//submodules/sqlcipher:sqlcipher", - "//submodules/AppLockState:AppLockState", - "//submodules/NotificationsPresentationData:NotificationsPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UserNotifications.framework", - ], -) - -apple_bundle( - name = "NotificationServiceExtension", - binary = ":NotificationServiceBinary", - extension = "appex", - info_plist = "NotificationService/Info.plist", - info_plist_substitutions = notification_service_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Intents - -apple_binary( - name = "IntentsBinary", - srcs = glob([ - "SiriIntents/**/*.swift", - ]), - configs = intents_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramApi:TelegramApi#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/BuildConfig:BuildConfig", - "//submodules/OpenSSLEncryptionProvider:OpenSSLEncryptionProvider", - "//submodules/AppLockState:AppLockState", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/Intents.framework", - "$SDKROOT/System/Library/Frameworks/Contacts.framework", - ], -) - -apple_bundle( - name = "IntentsExtension", - binary = ":IntentsBinary", - extension = "appex", - info_plist = "SiriIntents/Info.plist", - info_plist_substitutions = intents_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Watch - -apple_resource( - name = "WatchAppStringResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/Localizable.strings", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "WatchAppExtensionResources", - files = glob([ - "Watch/Extension/Resources/**/*", - ], exclude = ["Watch/Extension/Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -apple_binary( - name = "WatchAppExtensionBinary", - srcs = glob([ - "Watch/Extension/**/*.m", - "Watch/SSignalKit/**/*.m", - "Watch/Bridge/**/*.m", - "Watch/WatchCommonWatch/**/*.m", - ]), - headers = merge_maps([ - glob_map(glob([ - "Watch/Extension/*.h", - "Watch/Bridge/*.h", - ])), - glob_sub_map("Watch/Extension/", glob([ - "Watch/Extension/SSignalKit/*.h", - ])), - glob_sub_map("Watch/", glob([ - "Watch/WatchCommonWatch/*.h", - ])), - ]), - compiler_flags = [ - "-DTARGET_OS_WATCH=1", - ], - linker_flags = [ - "-e", - "_WKExtensionMain", - "-lWKExtensionMainLegacy", - ], - configs = watch_extension_binary_configs(), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UserNotifications.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework", - ], - deps = [ - ":WatchAppStringResources", - ":WatchAppExtensionResources", - ], -) - -apple_bundle( - name = "WatchAppExtension", - binary = ":WatchAppExtensionBinary", - extension = "appex", - info_plist = "Watch/Extension/Info.plist", - info_plist_substitutions = watch_extension_info_plist_substitutions(), - xcode_product_type = "com.apple.product-type.watchkit2-extension", -) - -apple_resource( - name = "WatchAppResources", - dirs = [], - files = glob(["Watch/Extension/Resources/*.png"]) -) - -apple_asset_catalog( - name = "WatchAppAssets", - dirs = [ - "Watch/App/Assets.xcassets", - ], - app_icon = "AppIcon", - visibility = ["PUBLIC"], -) - -apple_resource( - name = "WatchAppInterface", - files = [ - "Watch/App/Base.lproj/Interface.storyboard", - ], - visibility = ["PUBLIC"], -) - -apple_binary( - name = "WatchAppBinary", - configs = watch_binary_configs(), - deps = [ - ":WatchAppResources", - ":WatchAppAssets", - ":WatchAppInterface", - ":WatchAppStringResources", - ], -) - -apple_bundle( - name = "WatchApp", - binary = ":WatchAppBinary", - visibility = [ - "//:", - ], - extension = "app", - info_plist = "Watch/App/Info.plist", - info_plist_substitutions = watch_info_plist_substitutions(), - xcode_product_type = "com.apple.product-type.application.watchapp2", - deps = [ - ":WatchAppExtension", - ], -) - -# Package - -apple_package( - name = "AppPackage", - bundle = ":Telegram", -) - -xcode_workspace_config( - name = "workspace", - workspace_name = "Telegram_Buck", - src_target = ":Telegram", -) diff --git a/Config/BUCK b/Config/BUCK deleted file mode 100644 index babd7d22cd..0000000000 --- a/Config/BUCK +++ /dev/null @@ -1,10 +0,0 @@ -# This file can be depended upon for any apple_test_lib rules. -genrule( - name = "test_info_plist", - visibility = ["PUBLIC"], - srcs = [ - "BuckSupportFiles/TestInfo.plist", - ], - out = 'TestInfo.plist', - cmd = 'cp $SRCDIR/BuckSupportFiles/TestInfo.plist $OUT', -) diff --git a/Config/BuckSupportFiles/TestInfo.plist b/Config/BuckSupportFiles/TestInfo.plist deleted file mode 100644 index 6c40a6cd0c..0000000000 --- a/Config/BuckSupportFiles/TestInfo.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Config/buck_rule_macros.bzl b/Config/buck_rule_macros.bzl deleted file mode 100644 index 0c101f023a..0000000000 --- a/Config/buck_rule_macros.bzl +++ /dev/null @@ -1,321 +0,0 @@ -load("//Config:utils.bzl", - "library_configs", - "dynamic_library_configs", -) - -text_section_items = [ - "__text", -] - -text_section_rename_linker_flags = [] #["-Wl,-rename_section,__TEXT,%s,__MEXT,%s" % (name, name) for name in text_section_items] + ["-Wl,-segprot,__MEXT,rx,rx"] - -section_rename_linker_flags = text_section_rename_linker_flags - -def apple_lib( - name, - visibility = ["PUBLIC"], - srcs = [], - headers = [], - exported_headers = [], - extra_xcode_files = [], - deps = [], - exported_deps = [], - additional_linker_flags = None, - exported_preprocessor_flags = [], - exported_linker_flags = [], - frameworks = [], - weak_frameworks = [], - swift_version = None, - modular = True, - compiler_flags = None, - platform_compiler_flags = None, - swift_compiler_flags = None, - warning_as_error = False, - suppress_warnings = False, - has_cpp = False, - framework = False): - swift_version = swift_version or native.read_config('swift', 'version') - swift_compiler_flags = swift_compiler_flags or [] - - resolved_frameworks = frameworks - - if native.read_config("xcode", "beta") == "True": - warning_as_error = False - - if platform_compiler_flags != None: - if compiler_flags != None: - fail("compiler_flags and platform_compiler_flags are mutually exclusive") - compiler_flags = [] - for i in range(len(platform_compiler_flags)): - if warning_as_error: - platform_compiler_flags[i][1].append("-Werror") - elif suppress_warnings: - platform_compiler_flags[i][1].append("-w") - else: - compiler_flags = compiler_flags or [] - if warning_as_error: - compiler_flags.append("-Werror") - elif suppress_warnings: - compiler_flags.append("-w") - - if warning_as_error: - swift_compiler_flags.append("-warnings-as-errors") - elif suppress_warnings: - swift_compiler_flags.append("-suppress-warnings") - - if framework: - additional_linker_flags = additional_linker_flags or [] - if has_cpp: - linker_flags = [ - "-lc++", - "-lz" - ] - else: - linker_flags = [] - - if native.read_config("custom", "mode") == "project": - resolved_linker_flags = linker_flags + additional_linker_flags + ["-Wl,-install_name,@rpath/lib%s.dylib" % (name)] - resolved_frameworks = resolved_frameworks + ["$SDKROOT/System/Library/Frameworks/%s.framework" % x for x in weak_frameworks] - else: - resolved_linker_flags = linker_flags + additional_linker_flags + ["-Wl,-install_name,@rpath/%s.framework/%s" % (name, name)] - for framework in weak_frameworks: - resolved_linker_flags = resolved_linker_flags + ["-Wl,-weak_framework,%s" % framework] - - resolved_linker_flags = resolved_linker_flags + section_rename_linker_flags - - native.apple_library( - name = name + "", - srcs = srcs, - header_namespace = name, - module_name = name, - soname = "lib" + name + ".dylib", - headers = headers, - exported_headers = exported_headers, - deps = deps, - exported_deps = exported_deps, - extra_xcode_files = extra_xcode_files, - frameworks = resolved_frameworks, - visibility = visibility, - swift_version = swift_version, - configs = dynamic_library_configs(), - modular = modular, - compiler_flags = compiler_flags, - platform_compiler_flags = platform_compiler_flags, - swift_compiler_flags = swift_compiler_flags, - preferred_linkage = "shared", - #link_style = "static", - linker_flags = resolved_linker_flags, - ) - else: - additional_linker_flags = additional_linker_flags or [] - if has_cpp: - linker_flags = [ - "-lc++", - "-lz" - ] - else: - linker_flags = [] - - resolved_exported_linker_flags = exported_linker_flags + linker_flags + additional_linker_flags - - if native.read_config("custom", "mode") == "project": - resolved_frameworks = resolved_frameworks + ["$SDKROOT/System/Library/Frameworks/%s.framework" % x for x in weak_frameworks] - else: - for framework in weak_frameworks: - resolved_exported_linker_flags = resolved_exported_linker_flags + ["-Wl,-weak_framework,%s" % framework] - - native.apple_library( - name = name, - srcs = srcs, - headers = headers, - exported_headers = exported_headers, - deps = deps, - exported_deps = exported_deps, - exported_linker_flags = resolved_exported_linker_flags, - extra_xcode_files = extra_xcode_files, - frameworks = resolved_frameworks, - visibility = visibility, - swift_version = swift_version, - configs = library_configs(), - modular = modular, - compiler_flags = compiler_flags, - platform_compiler_flags = platform_compiler_flags, - swift_compiler_flags = swift_compiler_flags, - preferred_linkage = "static", - exported_preprocessor_flags = exported_preprocessor_flags, - ) - -def static_library( - name, - visibility = ["PUBLIC"], - has_cpp = False, - srcs = [], - headers = [], - exported_headers = [], - extra_xcode_files = [], - deps = [], - additional_linker_flags = None, - exported_preprocessor_flags = [], - exported_linker_flags = [], - frameworks = [], - weak_frameworks = [], - info_plist = None, - info_plist_substitutions = {}, - modular = True, - compiler_flags = None, - platform_compiler_flags = None, - swift_compiler_flags = None, - warning_as_error = False, - suppress_warnings = True - ): - apple_lib( - name = name, - srcs = srcs, - has_cpp = has_cpp, - exported_headers = exported_headers, - headers = headers, - modular = modular, - compiler_flags = compiler_flags, - platform_compiler_flags = platform_compiler_flags, - swift_compiler_flags = swift_compiler_flags, - extra_xcode_files = extra_xcode_files, - deps = deps, - additional_linker_flags = additional_linker_flags, - exported_preprocessor_flags = exported_preprocessor_flags, - exported_linker_flags = exported_linker_flags, - frameworks = frameworks, - weak_frameworks = weak_frameworks, - warning_as_error = warning_as_error, - suppress_warnings = suppress_warnings - ) - -def framework( - name, - visibility = ["PUBLIC"], - has_cpp = False, - srcs = [], - headers = [], - exported_headers = [], - extra_xcode_files = [], - deps = [], - exported_deps = [], - additional_linker_flags = None, - frameworks = [], - weak_frameworks = [], - info_plist = None, - info_plist_substitutions = {}, - modular = True, - compiler_flags = None, - platform_compiler_flags = None, - swift_compiler_flags = None, - warning_as_error = False, - suppress_warnings = True): - apple_lib( - name = name, - srcs = srcs, - has_cpp = has_cpp, - exported_headers = exported_headers, - headers = headers, - modular = modular, - compiler_flags = compiler_flags, - platform_compiler_flags = platform_compiler_flags, - swift_compiler_flags = swift_compiler_flags, - extra_xcode_files = extra_xcode_files, - deps = deps, - exported_deps = exported_deps, - additional_linker_flags = additional_linker_flags, - frameworks = frameworks, - weak_frameworks = weak_frameworks, - warning_as_error = warning_as_error, - suppress_warnings = suppress_warnings, - framework = True - ) - - -CXX_SRC_EXT = ["mm", "cpp", "S"] -def apple_cxx_lib( - srcs = [], - additional_exported_linker_flags = [], - **kwargs): - c_srcs, cxx_srcs = [], [] - - cxx_compile_flags = native.read_config("cxx", "cxxflags").split(" ") - cxx_compile_flags.append("-w") - - for file_ in srcs: - if file_.split(".")[-1] in CXX_SRC_EXT: - cxx_srcs.append((file_, cxx_compile_flags)) - else: - c_srcs.append(file_) - apple_lib( - srcs = c_srcs + cxx_srcs, - exported_linker_flags = [ - "-lc++", - "-lz" - ] + additional_exported_linker_flags, - **kwargs - ) - -def framework_binary_dependencies(names): - result = [] - for name in names: - result.append(name + "#shared") - return result - -def framework_bundle_dependencies(names): - result = [] - if native.read_config("custom", "mode") == "project": - for name in names: - pass - else: - for name in names: - result.append(name + "#shared") - return result - -def gen_header_targets(header_paths, prefix, flavor, source_rule, source_path): - result = dict() - for header_path in header_paths: - name = prefix + header_path.replace('/', '_sub_') - native.genrule( - name = name + flavor, - cmd = 'cp $(location :' + source_rule + ')/' + source_path + '/' + header_path + ' $OUT', - out = name, - ) - result[header_path] = ':' + name + flavor - return result - -def merge_maps(dicts): - result = dict() - for d in dicts: - for key in d: - if key in result and result[key] != d[key]: - fail( - "Conflicting files in file search paths. " + - "\"%s\" maps to both \"%s\" and \"%s\"." % - (key, result[key], d[key]), - ) - result.update(d) - return result - -def basename(p): - return p.rpartition("/")[-1] - -def glob_map(glob_results): - result = dict() - for path in glob_results: - file_name = basename(path) - if file_name in result: - fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_name, result[file_name], path)) - result[file_name] = path - return result - -def glob_sub_map(prefix, glob_specs, exclude = []): - result = dict() - for path in native.glob(glob_specs, exclude = exclude): - if not path.startswith(prefix): - fail('\"%s\" does not start with \"%s\"' % (path, prefix)) - file_key = path[len(prefix):] - if file_key in result: - fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_key, result[file_key], path)) - result[file_key] = path - return result diff --git a/Makefile b/Makefile index 77b5d6d29f..a5de52dfd4 100644 --- a/Makefile +++ b/Makefile @@ -406,6 +406,16 @@ bazel_app_debug_arm64: --watchos_cpus=armv7k,arm64_32 \ --verbose_failures +bazel_app_debug_sim_arm64: + APP_VERSION="${APP_VERSION}" \ + TELEGRAM_DISABLE_EXTENSIONS="0" \ + build-system/prepare-build.sh Telegram distribution + "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} \ + -c dbg \ + --ios_multi_cpus=sim_arm64 \ + --watchos_cpus=armv7k,arm64_32 \ + --verbose_failures + bazel_app_arm64: APP_VERSION="${APP_VERSION}" \ BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \ diff --git a/Telegram/BUCK b/Telegram/BUCK deleted file mode 100644 index 0ba80dc35b..0000000000 --- a/Telegram/BUCK +++ /dev/null @@ -1,548 +0,0 @@ -load("//Config:utils.bzl", - "library_configs", -) - -load("//Config:configs.bzl", - "app_binary_configs", - "share_extension_configs", - "widget_extension_configs", - "notification_content_extension_configs", - "notification_service_extension_configs", - "intents_extension_configs", - "watch_extension_binary_configs", - "watch_binary_configs", - "info_plist_substitutions", - "app_info_plist_substitutions", - "share_extension_info_plist_substitutions", - "widget_extension_info_plist_substitutions", - "notification_content_extension_info_plist_substitutions", - "notification_service_extension_info_plist_substitutions", - "intents_extension_info_plist_substitutions", - "watch_extension_info_plist_substitutions", - "watch_info_plist_substitutions", - "DEVELOPMENT_LANGUAGE", -) - -load("//Config:buck_rule_macros.bzl", - "apple_lib", - "framework_binary_dependencies", - "framework_bundle_dependencies", - "glob_map", - "glob_sub_map", - "merge_maps", -) - -framework_dependencies = [ - "//submodules/MtProtoKit:MtProtoKit", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", - "//submodules/Postbox:Postbox", - "//submodules/TelegramApi:TelegramApi", - "//submodules/SyncCore:SyncCore", - "//submodules/TelegramCore:TelegramCore", - "//submodules/AsyncDisplayKit:AsyncDisplayKit", - "//submodules/Display:Display", - "//submodules/TelegramUI:TelegramUI", -] - -resource_dependencies = [ - "//submodules/LegacyComponents:LegacyComponentsAssets", - "//submodules/LegacyComponents:LegacyComponentsResources", - "//submodules/TelegramUI:TelegramUIAssets", - "//submodules/TelegramUI:TelegramUIResources", - #"//submodules/WalletUI:WalletUIAssets", - #"//submodules/WalletUI:WalletUIResources", - "//submodules/PasswordSetupUI:PasswordSetupUIResources", - "//submodules/PasswordSetupUI:PasswordSetupUIAssets", - "//submodules/OverlayStatusController:OverlayStatusControllerResources", - ":AppResources", - ":AppStringResources", - ":InfoPlistStringResources", - ":AppIntentVocabularyResources", - ":Icons", - ":AdditionalIcons", - ":LaunchScreen", -] - -build_phase_scripts = [ -] - -apple_resource( - name = "AppResources", - files = glob([ - "Telegram-iOS/Resources/**/*", - ], exclude = ["Telegram-iOS/Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "AppStringResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/Localizable.strings", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "AppIntentVocabularyResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/AppIntentVocabulary.plist", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "InfoPlistStringResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/InfoPlist.strings", - ]), - visibility = ["PUBLIC"], -) - -apple_asset_catalog( - name = "Icons", - dirs = [ - "Telegram-iOS/Icons.xcassets", - "Telegram-iOS/AppIcons.xcassets", - ], - app_icon = "AppIconLLC", - visibility = ["PUBLIC"], -) - -apple_resource( - name = "AdditionalIcons", - files = glob([ - "Telegram-iOS/*.png", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "LaunchScreen", - files = [ - "Telegram-iOS/Base.lproj/LaunchScreen.xib", - ], - visibility = ["PUBLIC"], -) - -apple_library( - name = "AppLibrary", - visibility = [ - "//...", - ], - configs = library_configs(), - swift_version = native.read_config("swift", "version"), - srcs = [ - "Telegram-iOS/main.m", - "Telegram-iOS/Application.swift" - ], - deps = [ - ] - + framework_binary_dependencies(framework_dependencies), -) - -apple_binary( - name = "AppBinary", - visibility = [ - "//...", - ], - configs = app_binary_configs(), - swift_version = native.read_config("swift", "version"), - srcs = [ - "SupportFiles/Empty.swift", - ], - deps = [ - ":AppLibrary", - ] - + resource_dependencies, -) - -apple_bundle( - name = "Telegram", - visibility = [ - "//Telegram:...", - ], - extension = "app", - binary = ":AppBinary", - product_name = "Telegram", - info_plist = "Telegram-iOS/Info.plist", - info_plist_substitutions = app_info_plist_substitutions(), - deps = [ - ":ShareExtension", - ":WidgetExtension", - ":NotificationContentExtension", - ":NotificationServiceExtension", - ":IntentsExtension", - ":WatchApp#watch", - ] - + framework_bundle_dependencies(framework_dependencies), -) - -# Share Extension - -apple_binary( - name = "ShareBinary", - srcs = glob([ - "Share/**/*.swift", - ]), - configs = share_extension_configs(), - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/TelegramUI:TelegramUI#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) - -apple_bundle( - name = "ShareExtension", - binary = ":ShareBinary", - extension = "appex", - info_plist = "Share/Info.plist", - info_plist_substitutions = share_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Widget - -apple_binary( - name = "WidgetBinary", - srcs = glob([ - "Widget/**/*.swift", - ]), - configs = widget_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/BuildConfig:BuildConfig", - "//submodules/WidgetItems:WidgetItems", - "//submodules/AppLockState:AppLockState", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/NotificationCenter.framework", - ], -) - -apple_bundle( - name = "WidgetExtension", - binary = ":WidgetBinary", - extension = "appex", - info_plist = "Widget/Info.plist", - info_plist_substitutions = widget_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Notification Content - -apple_binary( - name = "NotificationContentBinary", - srcs = glob([ - "NotificationContent/**/*.swift", - ]), - configs = notification_content_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/TelegramUI:TelegramUI#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UserNotificationsUI.framework", - ], -) - -apple_bundle( - name = "NotificationContentExtension", - binary = ":NotificationContentBinary", - extension = "appex", - info_plist = "NotificationContent/Info.plist", - info_plist_substitutions = notification_content_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -#Notification Service - -apple_binary( - name = "NotificationServiceBinary", - srcs = glob([ - "NotificationService/Sources/*.swift", - ]), - configs = notification_service_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//Telegram/NotificationService/NotificationServiceObjC:NotificationServiceObjC", - "//submodules/BuildConfig:BuildConfig", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/EncryptionProvider:EncryptionProvider", - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/PostboxDataTypes:PostboxDataTypes", - "//submodules/Database/MessageHistoryReadStateTable:MessageHistoryReadStateTable", - "//submodules/Database/MessageHistoryMetadataTable:MessageHistoryMetadataTable", - "//submodules/Database/PreferencesTable:PreferencesTable", - "//submodules/Database/PeerTable:PeerTable", - "//submodules/sqlcipher:sqlcipher", - "//submodules/AppLockState:AppLockState", - "//submodules/NotificationsPresentationData:NotificationsPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UserNotifications.framework", - ], -) - -apple_bundle( - name = "NotificationServiceExtension", - binary = ":NotificationServiceBinary", - extension = "appex", - info_plist = "NotificationService/Info.plist", - info_plist_substitutions = notification_service_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Intents - -apple_binary( - name = "IntentsBinary", - srcs = glob([ - "SiriIntents/**/*.swift", - ]), - configs = intents_extension_configs(), - swift_compiler_flags = [ - "-application-extension", - ], - linker_flags = [ - "-e", - "_NSExtensionMain", - "-Xlinker", - "-rpath", - "-Xlinker", - "/usr/lib/swift", - "-Xlinker", - "-rpath", - "-Xlinker", - "@executable_path/../../Frameworks", - ], - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramApi:TelegramApi#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/BuildConfig:BuildConfig", - "//submodules/OpenSSLEncryptionProvider:OpenSSLEncryptionProvider", - "//submodules/AppLockState:AppLockState", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/Intents.framework", - "$SDKROOT/System/Library/Frameworks/Contacts.framework", - ], -) - -apple_bundle( - name = "IntentsExtension", - binary = ":IntentsBinary", - extension = "appex", - info_plist = "SiriIntents/Info.plist", - info_plist_substitutions = intents_extension_info_plist_substitutions(), - deps = [ - ], - xcode_product_type = "com.apple.product-type.app-extension", -) - -# Watch - -apple_resource( - name = "WatchAppStringResources", - files = [], - variants = glob([ - "Telegram-iOS/*.lproj/Localizable.strings", - ]), - visibility = ["PUBLIC"], -) - -apple_resource( - name = "WatchAppExtensionResources", - files = glob([ - "Watch/Extension/Resources/**/*", - ], exclude = ["Watch/Extension/Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -apple_binary( - name = "WatchAppExtensionBinary", - srcs = glob([ - "Watch/Extension/**/*.m", - "Watch/SSignalKit/**/*.m", - "Watch/Bridge/**/*.m", - "Watch/WatchCommonWatch/**/*.m", - ]), - headers = merge_maps([ - glob_map(glob([ - "Watch/Extension/*.h", - "Watch/Bridge/*.h", - ])), - glob_sub_map("Watch/Extension/", glob([ - "Watch/Extension/SSignalKit/*.h", - ])), - glob_sub_map("Watch/", glob([ - "Watch/WatchCommonWatch/*.h", - ])), - ]), - compiler_flags = [ - "-DTARGET_OS_WATCH=1", - ], - linker_flags = [ - "-e", - "_WKExtensionMain", - "-lWKExtensionMainLegacy", - ], - configs = watch_extension_binary_configs(), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/UserNotifications.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework", - ], - deps = [ - ":WatchAppStringResources", - ":WatchAppExtensionResources", - ], -) - -apple_bundle( - name = "WatchAppExtension", - binary = ":WatchAppExtensionBinary", - extension = "appex", - info_plist = "Watch/Extension/Info.plist", - info_plist_substitutions = watch_extension_info_plist_substitutions(), - xcode_product_type = "com.apple.product-type.watchkit2-extension", -) - -apple_resource( - name = "WatchAppResources", - dirs = [], - files = glob(["Watch/Extension/Resources/*.png"]) -) - -apple_asset_catalog( - name = "WatchAppAssets", - dirs = [ - "Watch/App/Assets.xcassets", - ], - app_icon = "AppIcon", - visibility = ["PUBLIC"], -) - -apple_resource( - name = "WatchAppInterface", - files = [ - "Watch/App/Base.lproj/Interface.storyboard", - ], - visibility = ["PUBLIC"], -) - -apple_binary( - name = "WatchAppBinary", - configs = watch_binary_configs(), - deps = [ - ":WatchAppResources", - ":WatchAppAssets", - ":WatchAppInterface", - ":WatchAppStringResources", - ], -) - -apple_bundle( - name = "WatchApp", - binary = ":WatchAppBinary", - visibility = [ - "//Telegram:...", - ], - extension = "app", - info_plist = "Watch/App/Info.plist", - info_plist_substitutions = watch_info_plist_substitutions(), - xcode_product_type = "com.apple.product-type.application.watchapp2", - deps = [ - ":WatchAppExtension", - ], -) - -# Package - -apple_package( - name = "AppPackage", - bundle = ":Telegram", -) - -xcode_workspace_config( - name = "workspace", - workspace_name = "Telegram_Buck", - src_target = ":Telegram", -) diff --git a/Telegram/NotificationService/NotificationServiceObjC/BUCK b/Telegram/NotificationService/NotificationServiceObjC/BUCK deleted file mode 100644 index 4c0ef51377..0000000000 --- a/Telegram/NotificationService/NotificationServiceObjC/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "NotificationServiceObjC", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/BuildConfig:BuildConfig", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/NotificationsPresentationData:NotificationsPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/WORKSPACE b/WORKSPACE index e332c39203..a270359be7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -53,6 +53,6 @@ bazel_skylib_workspace() http_file( name = "cmake_tar_gz", - urls = ["https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-Darwin-x86_64.tar.gz"], - sha256 = "9d27049660474cf134ab46fa0e0db771b263313fcb8ba82ee8b2d1a1a62f8f20", + urls = ["https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-macos-universal.tar.gz"], + sha256 = "50afa2cb66bea6a0314ef28034f3ff1647325e30cf5940f97906a56fd9640bd8", ) diff --git a/build-system/BUILD b/build-system/BUILD index e69de29bb2..b69d112b36 100644 --- a/build-system/BUILD +++ b/build-system/BUILD @@ -0,0 +1,5 @@ + +config_setting( + name = "ios_sim_arm64", + values = {"cpu": "ios_sim_arm64"}, +) diff --git a/build-system/bazel-rules/rules_swift b/build-system/bazel-rules/rules_swift index eca50db5a9..bfb54953ce 160000 --- a/build-system/bazel-rules/rules_swift +++ b/build-system/bazel-rules/rules_swift @@ -1 +1 @@ -Subproject commit eca50db5a95a50b2be8367d644aebf4d1d880c52 +Subproject commit bfb54953cee1bc985ba8113dd2e635e1d294abdb diff --git a/build-system/generate-xcode-project.sh b/build-system/generate-xcode-project.sh index 448e83add3..672450357c 100755 --- a/build-system/generate-xcode-project.sh +++ b/build-system/generate-xcode-project.sh @@ -89,3 +89,9 @@ sed -i "" -e '1h;2,$H;$!d;g' -e 's/\("sourceFilters" : \[\n[ ]*\)"\.\/\.\.\."/\1 --genconfig "$GEN_DIRECTORY/${APP_TARGET}.tulsiproj:${APP_TARGET}" \ --bazel "$BAZEL" \ --outputfolder "$GEN_DIRECTORY" \ + --no-open-xcode \ + +sed -i '' -e '1h;2,$H;$!d;g' -e 's/BUILD_SETTINGS = BazelBuildSettings(/import os\nBUILD_SETTINGS = BazelBuildSettings(/g' "$GEN_DIRECTORY/${APP_TARGET}.xcodeproj/.tulsi/Scripts/bazel_build_settings.py" +sed -i '' -e '1h;2,$H;$!d;g' -e "s/'--cpu=ios_arm64'/'--cpu=ios_arm64'.replace('ios_arm64', 'ios_sim_arm64' if os.environ.get('EFFECTIVE_PLATFORM_NAME') == '-iphonesimulator' else 'ios_arm64')/g" "$GEN_DIRECTORY/${APP_TARGET}.xcodeproj/.tulsi/Scripts/bazel_build_settings.py" + +open "$GEN_DIRECTORY/${APP_TARGET}.xcodeproj" diff --git a/build-system/xcode_version b/build-system/xcode_version index 40e6bd96a6..5807e59269 100644 --- a/build-system/xcode_version +++ b/build-system/xcode_version @@ -1 +1 @@ -12.1 +12.2 diff --git a/buildbox/buck/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch b/buildbox/buck/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch deleted file mode 100644 index fe6ee40c41..0000000000 --- a/buildbox/buck/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch +++ /dev/null @@ -1,157 +0,0 @@ -diff --git a/.gitignore b/.gitignore -index 78ce658b9a..30c0369ab7 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -3,6 +3,7 @@ - - # IntelliJ build - /intellij-out/ -+/.idea/ - - # Buck - /buck-out -diff --git a/.idea/modules.xml b/.idea/modules.xml -deleted file mode 100644 -index 7ff823b554..0000000000 ---- a/.idea/modules.xml -+++ /dev/null -@@ -1,16 +0,0 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -\ No newline at end of file -diff --git a/src/com/facebook/buck/apple/AppleBundle.java b/src/com/facebook/buck/apple/AppleBundle.java -index d895ab9a79..ad42beb302 100644 ---- a/src/com/facebook/buck/apple/AppleBundle.java -+++ b/src/com/facebook/buck/apple/AppleBundle.java -@@ -992,7 +992,11 @@ public class AppleBundle extends AbstractBuildRuleWithDeclaredAndExtraDeps - keys.put("DTPlatformName", new NSString(platform.getName())); - keys.put("DTPlatformVersion", new NSString(sdkVersion)); - keys.put("DTSDKName", new NSString(sdkName + sdkVersion)); -- keys.put("MinimumOSVersion", new NSString(minOSVersion)); -+ if (infoPlistSubstitutions.containsKey("MinimumOSVersion")) { -+ keys.put("MinimumOSVersion", new NSString(infoPlistSubstitutions.get("MinimumOSVersion"))); -+ } else { -+ keys.put("MinimumOSVersion", new NSString(minOSVersion)); -+ } - if (platformBuildVersion.isPresent()) { - keys.put("DTPlatformBuild", new NSString(platformBuildVersion.get())); - keys.put("DTSDKBuild", new NSString(platformBuildVersion.get())); -@@ -1185,9 +1189,10 @@ public class AppleBundle extends AbstractBuildRuleWithDeclaredAndExtraDeps - - // .framework bundles will be code-signed when they're copied into the containing bundle. - private boolean needCodeSign() { -- return binary.isPresent() -+ return false; -+ /*return binary.isPresent() - && ApplePlatform.needsCodeSign(platform.getName()) -- && !extension.equals(FRAMEWORK_EXTENSION); -+ && !extension.equals(FRAMEWORK_EXTENSION);*/ - } - - @Override -diff --git a/src/com/facebook/buck/apple/MultiarchFileInfos.java b/src/com/facebook/buck/apple/MultiarchFileInfos.java -index c078b2e134..030f9fc289 100644 ---- a/src/com/facebook/buck/apple/MultiarchFileInfos.java -+++ b/src/com/facebook/buck/apple/MultiarchFileInfos.java -@@ -177,7 +177,12 @@ public class MultiarchFileInfos { - cxxBuckConfig.shouldCacheLinks(), - BuildTargetPaths.getGenPath( - projectFilesystem, buildTarget, multiarchOutputPathFormat)); -- graphBuilder.addToIndex(multiarchFile); -+ Optional existingRule2 = graphBuilder.getRuleOptional(multiarchFile.getBuildTarget()); -+ if (existingRule2.isPresent()) { -+ return existingRule2.get(); -+ } else { -+ graphBuilder.addToIndex(multiarchFile); -+ } - return multiarchFile; - } else { - return new NoopBuildRule(buildTarget, projectFilesystem); -diff --git a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java -index 8db968b982..b10f793d8e 100644 ---- a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java -+++ b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java -@@ -825,6 +825,7 @@ public class ProjectGenerator { - Optional.of(xcodeDescriptions.getXCodeDescriptions())); - if (bundleRequiresRemovalOfAllTransitiveFrameworks(targetNode)) { - copiedRules = rulesWithoutFrameworkBundles(copiedRules); -+ copiedRules = rulesWithoutDylibs(copiedRules); - } else if (bundleRequiresAllTransitiveFrameworks(binaryNode, bundleLoaderNode)) { - copiedRules = - ImmutableSet.>builder() -@@ -954,6 +955,22 @@ public class ProjectGenerator { - .toImmutableList(); - } - -+ private ImmutableList> rulesWithoutDylibs( -+ Iterable> copiedRules) { -+ return RichStream.from(copiedRules) -+ .filter( -+ input -> -+ TargetNodes.castArg(input, AppleLibraryDescriptionArg.class) -+ .map(argTargetNode -> { -+ if (argTargetNode.getBuildTarget().getFlavors().contains(CxxDescriptionEnhancer.SHARED_FLAVOR)) { -+ return false; -+ } -+ return true; -+ }) -+ .orElse(true)) -+ .toImmutableList(); -+ } -+ - private ImmutableList> rulesWithoutBundleLoader( - Iterable> copiedRules, TargetNode bundleLoader) { - return RichStream.from(copiedRules).filter(x -> !bundleLoader.equals(x)).toImmutableList(); -@@ -2316,8 +2333,9 @@ public class ProjectGenerator { - .transform( - bundleExtension -> { - switch (bundleExtension) { -- case APP: - case APPEX: -+ return false; -+ case APP: - case PLUGIN: - case BUNDLE: - case XCTEST: -@@ -2515,7 +2533,7 @@ public class ProjectGenerator { - - librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift/$PLATFORM_NAME"); - if (options.shouldLinkSystemSwift()) { -- librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift-5.0/$PLATFORM_NAME"); -+ //librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift-5.0/$PLATFORM_NAME"); - } - } - -@@ -3444,7 +3462,7 @@ public class ProjectGenerator { - - PBXFileReference fileReference = getLibraryFileReference(targetNode); - PBXBuildFile buildFile = new PBXBuildFile(fileReference); -- if (fileReference.getExplicitFileType().equals(Optional.of("wrapper.framework"))) { -+ if (fileReference.getExplicitFileType().equals(Optional.of("wrapper.framework")) || fileReference.getExplicitFileType().equals(Optional.of("compiled.mach-o.dylib"))) { - UnflavoredBuildTargetView buildTarget = - targetNode.getBuildTarget().getUnflavoredBuildTarget(); - if (frameworkTargets.contains(buildTarget)) { -@@ -4696,6 +4714,9 @@ public class ProjectGenerator { - - private static boolean bundleRequiresRemovalOfAllTransitiveFrameworks( - TargetNode targetNode) { -+ if (targetNode.getConstructorArg().getXcodeProductType().equals(Optional.of("com.apple.product-type.app-extension"))) { -+ return true; -+ } - return isFrameworkBundle(targetNode.getConstructorArg()); - } - diff --git a/buildbox/buck/prepare_buck_source.sh b/buildbox/buck/prepare_buck_source.sh deleted file mode 100644 index 2430dda76e..0000000000 --- a/buildbox/buck/prepare_buck_source.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -ls [] - -if [ ! -f "" ]; then - exit 1 -fi diff --git a/submodules/AccountContext/BUCK b/submodules/AccountContext/BUCK deleted file mode 100644 index 6a3a3d431f..0000000000 --- a/submodules/AccountContext/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AccountContext", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramAudio:TelegramAudio", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/TemporaryCachedPeerDataManager:TemporaryCachedPeerDataManager", - "//submodules/DeviceLocationManager:DeviceLocationManager", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - #"//submodules/WalletCore:WalletCore", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], - weak_frameworks = [ - "Contacts", - ], -) diff --git a/submodules/AccountUtils/BUCK b/submodules/AccountUtils/BUCK deleted file mode 100644 index f5cec5d49c..0000000000 --- a/submodules/AccountUtils/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AccountUtils", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/ActionSheetPeerItem/BUCK b/submodules/ActionSheetPeerItem/BUCK deleted file mode 100644 index dcbc59dd47..0000000000 --- a/submodules/ActionSheetPeerItem/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ActionSheetPeerItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ActivityIndicator/BUCK b/submodules/ActivityIndicator/BUCK deleted file mode 100644 index 334ac6aecf..0000000000 --- a/submodules/ActivityIndicator/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ActivityIndicator", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AlertUI/BUCK b/submodules/AlertUI/BUCK deleted file mode 100644 index bde039a00d..0000000000 --- a/submodules/AlertUI/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AlertUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AnimatedAvatarSetNode/BUCK b/submodules/AnimatedAvatarSetNode/BUCK deleted file mode 100644 index e2e89ba114..0000000000 --- a/submodules/AnimatedAvatarSetNode/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AnimatedAvatarSetNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/AvatarNode:AvatarNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AnimatedCountLabelNode/BUCK b/submodules/AnimatedCountLabelNode/BUCK deleted file mode 100644 index 5943d1f49c..0000000000 --- a/submodules/AnimatedCountLabelNode/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AnimatedCountLabelNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AnimatedNavigationStripeNode/BUCK b/submodules/AnimatedNavigationStripeNode/BUCK deleted file mode 100644 index 1dd8c4bbb4..0000000000 --- a/submodules/AnimatedNavigationStripeNode/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AnimatedNavigationStripeNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AnimatedStickerNode/BUCK b/submodules/AnimatedStickerNode/BUCK deleted file mode 100644 index 1e6a948afa..0000000000 --- a/submodules/AnimatedStickerNode/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AnimatedStickerNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/YuvConversion:YuvConversion", - "//submodules/GZip:GZip", - "//submodules/rlottie:RLottieBinding", - "//submodules/MediaResources:MediaResources", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AnimationUI/BUCK b/submodules/AnimationUI/BUCK deleted file mode 100644 index 85c63613bc..0000000000 --- a/submodules/AnimationUI/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AnimationUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/YuvConversion:YuvConversion", - "//submodules/StickerResources:StickerResources", - "//submodules/MediaResources:MediaResources", - "//submodules/Tuples:Tuples", - "//submodules/GZip:GZip", - "//submodules/rlottie:RLottieBinding", - "//submodules/lottie-ios:Lottie", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework", - ], -) diff --git a/submodules/AppBundle/BUCK b/submodules/AppBundle/BUCK deleted file mode 100644 index 34e2293199..0000000000 --- a/submodules/AppBundle/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AppBundle", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AppLock/BUCK b/submodules/AppLock/BUCK deleted file mode 100644 index 65a96d1c58..0000000000 --- a/submodules/AppLock/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AppLock", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/MonotonicTime:MonotonicTime", - "//submodules/PasscodeUI:PasscodeUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/ImageBlur:ImageBlur", - "//submodules/AccountContext:AccountContext", - "//submodules/AppLockState:AppLockState", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AppLockState/BUCK b/submodules/AppLockState/BUCK deleted file mode 100644 index 26e6f4360d..0000000000 --- a/submodules/AppLockState/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AppLockState", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/MonotonicTime:MonotonicTime", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/ArchivedStickerPacksNotice/BUCK b/submodules/ArchivedStickerPacksNotice/BUCK deleted file mode 100644 index d544ffbad2..0000000000 --- a/submodules/ArchivedStickerPacksNotice/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ArchivedStickerPacksNotice", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/StickerResources:StickerResources", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/MergeLists:MergeLists", - "//submodules/ItemListUI:ItemListUI", - "//submodules/ItemListStickerPackItem:ItemListStickerPackItem", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AsyncDisplayKit/BUCK b/submodules/AsyncDisplayKit/BUCK deleted file mode 100644 index e4a512cf8e..0000000000 --- a/submodules/AsyncDisplayKit/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -public_headers = glob([ - "Source/PublicHeaders/AsyncDisplayKit/*.h", -]) - -private_headers = glob([ - "Source/*.h", -]) - -framework( - name = "AsyncDisplayKit", - srcs = glob([ - "Source/**/*.m", - "Source/**/*.mm", - ]), - headers = private_headers, - exported_headers = public_headers, - compiler_flags = [ - "-DMINIMAL_ASDK", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/QuartzCore.framework", - "$SDKROOT/System/Library/Frameworks/CoreMedia.framework", - "$SDKROOT/System/Library/Frameworks/CoreText.framework", - "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework", - ] -) diff --git a/submodules/AuthTransferUI/BUCK b/submodules/AuthTransferUI/BUCK deleted file mode 100644 index 69bd9a6a32..0000000000 --- a/submodules/AuthTransferUI/BUCK +++ /dev/null @@ -1,33 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AuthTransferUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/QrCode:QrCode", - "//submodules/Camera:Camera", - "//submodules/GlassButtonNode:GlassButtonNode", - "//submodules/AlertUI:AlertUI", - "//submodules/AppBundle:AppBundle", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/Markdown:Markdown", - "//submodules/AnimationUI:AnimationUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/UndoUI:UndoUI", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/AuthorizationUI/BUCK b/submodules/AuthorizationUI/BUCK deleted file mode 100644 index 7559527e89..0000000000 --- a/submodules/AuthorizationUI/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AuthorizationUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Display:Display#shared", - "//submodules/TextFormat:TextFormat", - "//submodules/Markdown:Markdown", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/AvatarNode/BUCK b/submodules/AvatarNode/BUCK deleted file mode 100644 index b4aa0ab0df..0000000000 --- a/submodules/AvatarNode/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "AvatarNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AnimationUI:AnimationUI", - "//submodules/AppBundle:AppBundle", - "//submodules/AccountContext:AccountContext", - "//submodules/Emoji:Emoji", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/BotPaymentsUI/BUCK b/submodules/BotPaymentsUI/BUCK deleted file mode 100644 index e8c0210d0e..0000000000 --- a/submodules/BotPaymentsUI/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "BotPaymentsUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/LocalAuth:LocalAuth", - "//submodules/AccountContext:AccountContext", - "//submodules/ItemListUI:ItemListUI", - "//submodules/PasswordSetupUI:PasswordSetupUI", - "//submodules/PhotoResources:PhotoResources", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/Stripe:Stripe", - "//submodules/CountrySelectionUI:CountrySelectionUI", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/BuildConfig/BUCK b/submodules/BuildConfig/BUCK deleted file mode 100644 index 8214c78f99..0000000000 --- a/submodules/BuildConfig/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") -load("//Config:app_configuration.bzl", "appConfig") - -static_library( - name = "BuildConfig", - srcs = glob([ - "Sources/*.m", - ]), - compiler_flags = [ - '-DAPP_CONFIG_API_ID=' + appConfig()["apiId"], - '-DAPP_CONFIG_API_HASH="' + appConfig()["apiHash"] + '"', - '-DAPP_CONFIG_APP_CENTER_ID="' + appConfig()["appCenterId"] + '"', - '-DAPP_CONFIG_IS_INTERNAL_BUILD=' + appConfig()["isInternalBuild"], - '-DAPP_CONFIG_IS_APPSTORE_BUILD=' + appConfig()["isAppStoreBuild"], - '-DAPP_CONFIG_APPSTORE_ID=' + appConfig()["appStoreId"], - '-DAPP_SPECIFIC_URL_SCHEME="' + appConfig()["appSpecificUrlScheme"] + '"', - ], - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/BuildConfigExtra/BUCK b/submodules/BuildConfigExtra/BUCK deleted file mode 100644 index 7c4e20f519..0000000000 --- a/submodules/BuildConfigExtra/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "BuildConfigExtra", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/PKCS:PKCS", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/CallListUI/BUCK b/submodules/CallListUI/BUCK deleted file mode 100644 index 5499fccd86..0000000000 --- a/submodules/CallListUI/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CallListUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/MergeLists:MergeLists", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Camera/BUCK b/submodules/Camera/BUCK deleted file mode 100644 index 186174ee4c..0000000000 --- a/submodules/Camera/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Camera", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/ChatInterfaceState/BUCK b/submodules/ChatInterfaceState/BUCK deleted file mode 100644 index 13b14d8c7b..0000000000 --- a/submodules/ChatInterfaceState/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatInterfaceState", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TextFormat:TextFormat", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatListFilterSettingsHeaderItem/BUCK b/submodules/ChatListFilterSettingsHeaderItem/BUCK deleted file mode 100644 index de34d12381..0000000000 --- a/submodules/ChatListFilterSettingsHeaderItem/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatListFilterSettingsHeaderItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatListSearchItemHeader/BUCK b/submodules/ChatListSearchItemHeader/BUCK deleted file mode 100644 index a72c11eea8..0000000000 --- a/submodules/ChatListSearchItemHeader/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatListSearchItemHeader", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatListSearchItemNode/BUCK b/submodules/ChatListSearchItemNode/BUCK deleted file mode 100644 index b6b530bc87..0000000000 --- a/submodules/ChatListSearchItemNode/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatListSearchItemNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/SearchBarNode:SearchBarNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatListSearchRecentPeersNode/BUCK b/submodules/ChatListSearchRecentPeersNode/BUCK deleted file mode 100644 index 6aefe829e5..0000000000 --- a/submodules/ChatListSearchRecentPeersNode/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatListSearchRecentPeersNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/HorizontalPeerItem:HorizontalPeerItem", - "//submodules/MergeLists:MergeLists", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ContextUI:ContextUI", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatListUI/BUCK b/submodules/ChatListUI/BUCK deleted file mode 100644 index 84d1f8d7f1..0000000000 --- a/submodules/ChatListUI/BUCK +++ /dev/null @@ -1,64 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatListUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramBaseController:TelegramBaseController", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/UndoUI:UndoUI", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/SearchUI:SearchUI", - "//submodules/MergeLists:MergeLists", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/ChatListSearchRecentPeersNode:ChatListSearchRecentPeersNode", - "//submodules/ChatListSearchItemNode:ChatListSearchItemNode", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/TemporaryCachedPeerDataManager:TemporaryCachedPeerDataManager", - "//submodules/PeerPresenceStatusManager:PeerPresenceStatusManager", - "//submodules/PeerOnlineMarkerNode:PeerOnlineMarkerNode", - "//submodules/LocalizedPeerData:LocalizedPeerData", - "//submodules/ChatTitleActivityNode:ChatTitleActivityNode", - "//submodules/DeleteChatPeerActionSheetItem:DeleteChatPeerActionSheetItem", - "//submodules/LanguageSuggestionUI:LanguageSuggestionUI", - "//submodules/ContactsPeerItem:ContactsPeerItem", - "//submodules/ContactListUI:ContactListUI", - "//submodules/PhotoResources:PhotoResources", - "//submodules/AppBundle:AppBundle", - "//submodules/ContextUI:ContextUI", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/TelegramIntents:TelegramIntents", - "//submodules/ItemListPeerActionItem:ItemListPeerActionItem", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/TooltipUI:TooltipUI", - "//submodules/ListMessageItem:ListMessageItem", - "//submodules/ChatMessageInteractiveMediaBadge:ChatMessageInteractiveMediaBadge", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/GalleryData:GalleryData", - "//submodules/InstantPageUI:InstantPageUI", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/ChatInterfaceState:ChatInterfaceState", - "//submodules/GridMessageSelectionNode:GridMessageSelectionNode", - "//submodules/ChatListFilterSettingsHeaderItem:ChatListFilterSettingsHeaderItem", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatMessageInteractiveMediaBadge/BUCK b/submodules/ChatMessageInteractiveMediaBadge/BUCK deleted file mode 100644 index 37339b5f96..0000000000 --- a/submodules/ChatMessageInteractiveMediaBadge/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatMessageInteractiveMediaBadge", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TextFormat:TextFormat", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ChatTitleActivityNode/BUCK b/submodules/ChatTitleActivityNode/BUCK deleted file mode 100644 index f573138541..0000000000 --- a/submodules/ChatTitleActivityNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ChatTitleActivityNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/CheckNode/BUCK b/submodules/CheckNode/BUCK deleted file mode 100644 index 78852663a9..0000000000 --- a/submodules/CheckNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CheckNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/CloudData/BUCK b/submodules/CloudData/BUCK deleted file mode 100644 index 61dc3a640e..0000000000 --- a/submodules/CloudData/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CloudData", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/EncryptionProvider:EncryptionProvider", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], - weak_frameworks = [ - "CloudKit", - ], -) diff --git a/submodules/ComposePollUI/BUCK b/submodules/ComposePollUI/BUCK deleted file mode 100644 index 7b414c169d..0000000000 --- a/submodules/ComposePollUI/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ComposePollUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AccountContext:AccountContext", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/TextFormat:TextFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ContactListUI/BUCK b/submodules/ContactListUI/BUCK deleted file mode 100644 index 6a6691d744..0000000000 --- a/submodules/ContactListUI/BUCK +++ /dev/null @@ -1,38 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ContactListUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/MergeLists:MergeLists", - "//submodules/SearchUI:SearchUI", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/ContactsPeerItem:ContactsPeerItem", - "//submodules/ChatListSearchItemNode:ChatListSearchItemNode", - "//submodules/TelegramPermissionsUI:TelegramPermissionsUI", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/ShareController:ShareController", - "//submodules/AppBundle:AppBundle", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ContactsPeerItem/BUCK b/submodules/ContactsPeerItem/BUCK deleted file mode 100644 index 3a6eea69dc..0000000000 --- a/submodules/ContactsPeerItem/BUCK +++ /dev/null @@ -1,32 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ContactsPeerItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/CheckNode:CheckNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/PeerPresenceStatusManager:PeerPresenceStatusManager", - "//submodules/ItemListUI:ItemListUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/ContextUI:ContextUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ContextUI/BUCK b/submodules/ContextUI/BUCK deleted file mode 100644 index 9249d703dd..0000000000 --- a/submodules/ContextUI/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ContextUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TextSelectionNode:TextSelectionNode", - "//submodules/ReactionSelectionNode:ReactionSelectionNode", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/CounterContollerTitleView/BUCK b/submodules/CounterContollerTitleView/BUCK deleted file mode 100644 index 72f2ca552a..0000000000 --- a/submodules/CounterContollerTitleView/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CounterContollerTitleView", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/CountrySelectionUI/BUCK b/submodules/CountrySelectionUI/BUCK deleted file mode 100644 index 06b334d255..0000000000 --- a/submodules/CountrySelectionUI/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CountrySelectionUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Crc32/BUCK b/submodules/Crc32/BUCK deleted file mode 100644 index 5380c8191d..0000000000 --- a/submodules/Crc32/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Crc32", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/CryptoUtils/BUCK b/submodules/CryptoUtils/BUCK deleted file mode 100644 index 411184de09..0000000000 --- a/submodules/CryptoUtils/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CryptoUtils", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/Buffers/BUCK b/submodules/Database/Buffers/BUCK deleted file mode 100644 index 9a4ddc96ff..0000000000 --- a/submodules/Database/Buffers/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Buffers", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/MessageHistoryMetadataTable/BUCK b/submodules/Database/MessageHistoryMetadataTable/BUCK deleted file mode 100644 index cc4d7c555c..0000000000 --- a/submodules/Database/MessageHistoryMetadataTable/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MessageHistoryMetadataTable", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/Table:Table", - "//submodules/Database/PostboxDataTypes:PostboxDataTypes", - "//submodules/Database/PostboxCoding:PostboxCoding", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/MessageHistoryReadStateTable/BUCK b/submodules/Database/MessageHistoryReadStateTable/BUCK deleted file mode 100644 index 39fda20a59..0000000000 --- a/submodules/Database/MessageHistoryReadStateTable/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MessageHistoryReadStateTable", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/Table:Table", - "//submodules/Database/PostboxDataTypes:PostboxDataTypes", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/MurmurHash/BUCK b/submodules/Database/MurmurHash/BUCK deleted file mode 100644 index 0879c6a67f..0000000000 --- a/submodules/Database/MurmurHash/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MurmurHash", - srcs = glob([ - "Sources/**/*.swift", - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "Sources/**/*.h", - ]), - deps = [ - "//submodules/Database/MurmurHash/Impl:MurMurHashObjC", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/MurmurHash/Impl/BUCK b/submodules/Database/MurmurHash/Impl/BUCK deleted file mode 100644 index d6c57bb02b..0000000000 --- a/submodules/Database/MurmurHash/Impl/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MurMurHashObjC", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Database/PeerTable/BUCK b/submodules/Database/PeerTable/BUCK deleted file mode 100644 index b046daaa62..0000000000 --- a/submodules/Database/PeerTable/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeerTable", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/Table:Table", - "//submodules/Database/PostboxCoding:PostboxCoding", - "//submodules/Database/PostboxDataTypes:PostboxDataTypes", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/PostboxCoding/BUCK b/submodules/Database/PostboxCoding/BUCK deleted file mode 100644 index 585d78b981..0000000000 --- a/submodules/Database/PostboxCoding/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PostboxCoding", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/Buffers:Buffers", - "//submodules/Database/MurmurHash:MurmurHash", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/PostboxDataTypes/BUCK b/submodules/Database/PostboxDataTypes/BUCK deleted file mode 100644 index 837af3a0a7..0000000000 --- a/submodules/Database/PostboxDataTypes/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PostboxDataTypes", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/PostboxCoding:PostboxCoding", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/PreferencesTable/BUCK b/submodules/Database/PreferencesTable/BUCK deleted file mode 100644 index 8da2151e7a..0000000000 --- a/submodules/Database/PreferencesTable/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PreferencesTable", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/ValueBox:ValueBox", - "//submodules/Database/Table:Table", - "//submodules/Database/PostboxCoding:PostboxCoding", - "//submodules/Database/PostboxDataTypes:PostboxDataTypes", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/Table/BUCK b/submodules/Database/Table/BUCK deleted file mode 100644 index fd0bf366e4..0000000000 --- a/submodules/Database/Table/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Table", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Database/ValueBox:ValueBox", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Database/ValueBox/BUCK b/submodules/Database/ValueBox/BUCK deleted file mode 100644 index a12e9c0e07..0000000000 --- a/submodules/Database/ValueBox/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ValueBox", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/sqlcipher:sqlcipher", - "//submodules/Database/Buffers:Buffers", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/DateSelectionUI/BUCK b/submodules/DateSelectionUI/BUCK deleted file mode 100644 index a5a27f0595..0000000000 --- a/submodules/DateSelectionUI/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "DateSelectionUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/DeleteChatPeerActionSheetItem/BUCK b/submodules/DeleteChatPeerActionSheetItem/BUCK deleted file mode 100644 index 578a972961..0000000000 --- a/submodules/DeleteChatPeerActionSheetItem/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "DeleteChatPeerActionSheetItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/DeviceAccess/BUCK b/submodules/DeviceAccess/BUCK deleted file mode 100644 index 89cb4a25f6..0000000000 --- a/submodules/DeviceAccess/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "DeviceAccess", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - ], -) diff --git a/submodules/DeviceLocationManager/BUCK b/submodules/DeviceLocationManager/BUCK deleted file mode 100644 index 7bd20856a8..0000000000 --- a/submodules/DeviceLocationManager/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "DeviceLocationManager", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - ], -) diff --git a/submodules/DeviceProximity/BUCK b/submodules/DeviceProximity/BUCK deleted file mode 100644 index 94392f0568..0000000000 --- a/submodules/DeviceProximity/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "DeviceProximity", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/DirectionalPanGesture/BUCK b/submodules/DirectionalPanGesture/BUCK deleted file mode 100644 index c2ce482cf9..0000000000 --- a/submodules/DirectionalPanGesture/BUCK +++ /dev/null @@ -1,12 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "DirectionalPanGesture", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Display/BUCK b/submodules/Display/BUCK deleted file mode 100644 index 6fb664021d..0000000000 --- a/submodules/Display/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "Display", - srcs = glob([ - "Source/**/*.swift", - ]), - deps = [ - "//submodules/ObjCRuntimeUtils:ObjCRuntimeUtils", - "//submodules/UIKitRuntimeUtils:UIKitRuntimeUtils", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AppBundle:AppBundle", - "//submodules/Markdown:Markdown", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Emoji/BUCK b/submodules/Emoji/BUCK deleted file mode 100644 index 35e87da39c..0000000000 --- a/submodules/Emoji/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Emoji", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/CoreText.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/EncryptionKeyVisualization/BUCK b/submodules/EncryptionKeyVisualization/BUCK deleted file mode 100644 index 72ecc6e1db..0000000000 --- a/submodules/EncryptionKeyVisualization/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "EncryptionKeyVisualization", - srcs = glob([ - "Sources/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/EncryptionKeyVisualization/Impl:EncryptionKeyVisualizationImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/EncryptionKeyVisualization/Impl/BUCK b/submodules/EncryptionKeyVisualization/Impl/BUCK deleted file mode 100644 index 19d1462ea0..0000000000 --- a/submodules/EncryptionKeyVisualization/Impl/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "EncryptionKeyVisualizationImpl", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/EncryptionProvider/BUCK b/submodules/EncryptionProvider/BUCK deleted file mode 100644 index c99c089695..0000000000 --- a/submodules/EncryptionProvider/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "EncryptionProvider", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "PublicHeaders/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/FFMpegBinding/BUCK b/submodules/FFMpegBinding/BUCK deleted file mode 100644 index b011e6c299..0000000000 --- a/submodules/FFMpegBinding/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "FFMpegBinding", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "Public/**/*.h", - ]), - deps = [ - "//submodules/ffmpeg:ffmpeg", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/FastBlur/BUCK b/submodules/FastBlur/BUCK deleted file mode 100644 index 5e2cc7b602..0000000000 --- a/submodules/FastBlur/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "FastBlur", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/FileMediaResourceStatus/BUCK b/submodules/FileMediaResourceStatus/BUCK deleted file mode 100644 index 1fa2f38081..0000000000 --- a/submodules/FileMediaResourceStatus/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "FileMediaResourceStatus", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/MediaPlayer:UniversalMediaPlayer", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/WebKit.framework", - ], -) diff --git a/submodules/GZip/BUCK b/submodules/GZip/BUCK deleted file mode 100644 index e15e4b1bd4..0000000000 --- a/submodules/GZip/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GZip", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "Sources/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/GalleryData/BUCK b/submodules/GalleryData/BUCK deleted file mode 100644 index 34c899e95f..0000000000 --- a/submodules/GalleryData/BUCK +++ /dev/null @@ -1,31 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GalleryData", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/InstantPageUI:InstantPageUI", - "//submodules/GalleryUI:GalleryUI", - "//submodules/PeerAvatarGalleryUI:PeerAvatarGalleryUI", - "//submodules/MediaResources:MediaResources", - "//submodules/WebsiteType:WebsiteType", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/QuickLook.framework", - "$SDKROOT/System/Library/Frameworks/SafariServices.framework", - ], -) diff --git a/submodules/GalleryUI/BUCK b/submodules/GalleryUI/BUCK deleted file mode 100644 index 7b4130c6ab..0000000000 --- a/submodules/GalleryUI/BUCK +++ /dev/null @@ -1,36 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GalleryUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TextFormat:TextFormat", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUniversalVideoContent:TelegramUniversalVideoContent", - "//submodules/WebsiteType:WebsiteType", - "//submodules/ScreenCaptureDetection:ScreenCaptureDetection", - "//submodules/OpenInExternalAppUI:OpenInExternalAppUI", - "//submodules/ShareController:ShareController", - "//submodules/SwipeToDismissGesture:SwipeToDismissGesture", - "//submodules/CheckNode:CheckNode", - "//submodules/AppBundle:AppBundle", - "//submodules/StickerPackPreviewUI:StickerPackPreviewUI", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/QuickLook.framework", - "$SDKROOT/System/Library/Frameworks/SafariServices.framework", - ], -) diff --git a/submodules/GameUI/BUCK b/submodules/GameUI/BUCK deleted file mode 100644 index 4c37fd8b55..0000000000 --- a/submodules/GameUI/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GameUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/ShareController:ShareController", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/WebKit.framework", - ], -) diff --git a/submodules/Geocoding/BUCK b/submodules/Geocoding/BUCK deleted file mode 100644 index 3c03b57353..0000000000 --- a/submodules/Geocoding/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Geocoding", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - ], -) diff --git a/submodules/GlassButtonNode/BUCK b/submodules/GlassButtonNode/BUCK deleted file mode 100644 index 4127cf308e..0000000000 --- a/submodules/GlassButtonNode/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GlassButtonNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/GraphCore/BUCK b/submodules/GraphCore/BUCK deleted file mode 100644 index a43e82f354..0000000000 --- a/submodules/GraphCore/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GraphCore", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/GraphUI/BUCK b/submodules/GraphUI/BUCK deleted file mode 100644 index f395853a92..0000000000 --- a/submodules/GraphUI/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GraphUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/AppBundle:AppBundle", - "//submodules/GraphCore:GraphCore", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/GridMessageSelectionNode/BUCK b/submodules/GridMessageSelectionNode/BUCK deleted file mode 100644 index 47bdff99c9..0000000000 --- a/submodules/GridMessageSelectionNode/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "GridMessageSelectionNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/CheckNode:CheckNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/HashtagSearchUI/BUCK b/submodules/HashtagSearchUI/BUCK deleted file mode 100644 index 430c1f9319..0000000000 --- a/submodules/HashtagSearchUI/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "HashtagSearchUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramBaseController:TelegramBaseController", - "//submodules/ChatListUI:ChatListUI", - "//submodules/SegmentedControlNode:SegmentedControlNode", - "//submodules/ListMessageItem:ListMessageItem", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/HexColor/BUCK b/submodules/HexColor/BUCK deleted file mode 100644 index 2909a5aba5..0000000000 --- a/submodules/HexColor/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "HexColor", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TextFormat:TextFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/HorizontalPeerItem/BUCK b/submodules/HorizontalPeerItem/BUCK deleted file mode 100644 index 20a7708257..0000000000 --- a/submodules/HorizontalPeerItem/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "HorizontalPeerItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/SelectablePeerNode:SelectablePeerNode", - "//submodules/PeerOnlineMarkerNode:PeerOnlineMarkerNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/ContextUI:ContextUI", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ImageBlur/BUCK b/submodules/ImageBlur/BUCK deleted file mode 100644 index 092d53065b..0000000000 --- a/submodules/ImageBlur/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ImageBlur", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/FastBlur:FastBlur", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Accelerate.framework", - ], -) diff --git a/submodules/ImageCompression/BUCK b/submodules/ImageCompression/BUCK deleted file mode 100644 index 49136e92c4..0000000000 --- a/submodules/ImageCompression/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ImageCompression", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/MozjpegBinding:MozjpegBinding", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/ImageTransparency/BUCK b/submodules/ImageTransparency/BUCK deleted file mode 100644 index 28d47290df..0000000000 --- a/submodules/ImageTransparency/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ImageTransparency", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/Accelerate.framework", - ], -) diff --git a/submodules/InstantPageCache/BUCK b/submodules/InstantPageCache/BUCK deleted file mode 100644 index 18ecb10b55..0000000000 --- a/submodules/InstantPageCache/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "InstantPageCache", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/PersistentStringHash:PersistentStringHash", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/InstantPageUI/BUCK b/submodules/InstantPageUI/BUCK deleted file mode 100644 index 52ef2dc662..0000000000 --- a/submodules/InstantPageUI/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "InstantPageUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/GalleryUI:GalleryUI", - "//submodules/MusicAlbumArtResources:MusicAlbumArtResources", - "//submodules/LiveLocationPositionNode:LiveLocationPositionNode", - "//submodules/MosaicLayout:MosaicLayout", - "//submodules/LocationUI:LocationUI", - "//submodules/AppBundle:AppBundle", - "//submodules/LocationResources:LocationResources", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListAddressItem/BUCK b/submodules/ItemListAddressItem/BUCK deleted file mode 100644 index ec8a651a03..0000000000 --- a/submodules/ItemListAddressItem/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListAddressItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AccountContext:AccountContext", - "//submodules/TextFormat:TextFormat", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListAvatarAndNameInfoItem/BUCK b/submodules/ItemListAvatarAndNameInfoItem/BUCK deleted file mode 100644 index 6dadb44c97..0000000000 --- a/submodules/ItemListAvatarAndNameInfoItem/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListAvatarAndNameInfoItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/PeerPresenceStatusManager:PeerPresenceStatusManager", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/AvatarNode:AvatarNode", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListPeerActionItem/BUCK b/submodules/ItemListPeerActionItem/BUCK deleted file mode 100644 index 604dc5c10a..0000000000 --- a/submodules/ItemListPeerActionItem/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListPeerActionItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListPeerItem/BUCK b/submodules/ItemListPeerItem/BUCK deleted file mode 100644 index ef054e0bec..0000000000 --- a/submodules/ItemListPeerItem/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListPeerItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/PeerPresenceStatusManager:PeerPresenceStatusManager", - "//submodules/ItemListUI:ItemListUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/ContextUI:ContextUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListStickerPackItem/BUCK b/submodules/ItemListStickerPackItem/BUCK deleted file mode 100644 index 75bb09d26c..0000000000 --- a/submodules/ItemListStickerPackItem/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListStickerPackItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/StickerResources:StickerResources", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListUI/BUCK b/submodules/ItemListUI/BUCK deleted file mode 100644 index 30e7128bb3..0000000000 --- a/submodules/ItemListUI/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/MergeLists:MergeLists", - "//submodules/TextFormat:TextFormat", - "//submodules/Markdown:Markdown", - "//submodules/ProgressNavigationButtonNode:ProgressNavigationButtonNode", - "//submodules/SwitchNode:SwitchNode", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/CheckNode:CheckNode", - "//submodules/SegmentedControlNode:SegmentedControlNode", - "//submodules/AccountContext:AccountContext", - "//submodules/AnimationUI:AnimationUI", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ItemListVenueItem/BUCK b/submodules/ItemListVenueItem/BUCK deleted file mode 100644 index c7570bcf89..0000000000 --- a/submodules/ItemListVenueItem/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ItemListVenueItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/LocationResources:LocationResources", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/JoinLinkPreviewUI/BUCK b/submodules/JoinLinkPreviewUI/BUCK deleted file mode 100644 index 2871179be6..0000000000 --- a/submodules/JoinLinkPreviewUI/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "JoinLinkPreviewUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/ShareController:ShareController", - "//submodules/SelectablePeerNode:SelectablePeerNode", - "//submodules/PeerInfoUI:PeerInfoUI", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LanguageLinkPreviewUI/BUCK b/submodules/LanguageLinkPreviewUI/BUCK deleted file mode 100644 index fae07dd0cc..0000000000 --- a/submodules/LanguageLinkPreviewUI/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LanguageLinkPreviewUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TextFormat:TextFormat", - "//submodules/Markdown:Markdown", - "//submodules/ShareController:ShareController", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LanguageSuggestionUI/BUCK b/submodules/LanguageSuggestionUI/BUCK deleted file mode 100644 index 2e76df58b8..0000000000 --- a/submodules/LanguageSuggestionUI/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LanguageSuggestionUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/ActivityIndicator:ActivityIndicator", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LegacyComponents/BUCK b/submodules/LegacyComponents/BUCK deleted file mode 100644 index 8e1dbc2173..0000000000 --- a/submodules/LegacyComponents/BUCK +++ /dev/null @@ -1,44 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -apple_resource( - name = "LegacyComponentsResources", - dirs = [ - "Resources/LegacyComponentsResources.bundle", - ], - visibility = ["PUBLIC"], -) - -apple_asset_catalog( - name = 'LegacyComponentsAssets', - dirs = [ - "LegacyImages.xcassets", - ], - visibility = ["PUBLIC"], -) - -static_library( - name = "LegacyComponents", - srcs = glob([ - "Sources/*.m", - "Sources/*.mm", - "Sources/*.c", - "Sources/*.cpp", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/SSignalKit/SSignalKit:SSignalKit", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], - weak_frameworks = [ - "Vision", - ], -) diff --git a/submodules/LegacyDataImport/BUCK b/submodules/LegacyDataImport/BUCK deleted file mode 100644 index 3ca8359f67..0000000000 --- a/submodules/LegacyDataImport/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LegacyDataImport", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LegacyDataImport/Impl:LegacyDataImportImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LegacyDataImport/Impl/BUCK b/submodules/LegacyDataImport/Impl/BUCK deleted file mode 100644 index 4ec9c8c66a..0000000000 --- a/submodules/LegacyDataImport/Impl/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LegacyDataImportImpl", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LegacyMediaPickerUI/BUCK b/submodules/LegacyMediaPickerUI/BUCK deleted file mode 100644 index e1d07d37f2..0000000000 --- a/submodules/LegacyMediaPickerUI/BUCK +++ /dev/null @@ -1,32 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LegacyMediaPickerUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LegacyUI:LegacyUI", - "//submodules/MimeTypes:MimeTypes", - "//submodules/LocalMediaResources:LocalMediaResources", - "//submodules/SearchPeerMembers:SearchPeerMembers", - "//submodules/SaveToCameraRoll:SaveToCameraRoll", - "//submodules/LegacyMediaPickerUI/LegacyImageProcessors:LegacyImageProcessors", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/StickerResources:StickerResources", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LegacyMediaPickerUI/LegacyImageProcessors/BUCK b/submodules/LegacyMediaPickerUI/LegacyImageProcessors/BUCK deleted file mode 100644 index ffaba87aaf..0000000000 --- a/submodules/LegacyMediaPickerUI/LegacyImageProcessors/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LegacyImageProcessors", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LegacyUI/BUCK b/submodules/LegacyUI/BUCK deleted file mode 100644 index 9ad361eab1..0000000000 --- a/submodules/LegacyUI/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LegacyUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramAudio:TelegramAudio", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/StickerResources:StickerResources", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LightweightAccountData/BUCK b/submodules/LightweightAccountData/BUCK deleted file mode 100644 index d74ce3fa82..0000000000 --- a/submodules/LightweightAccountData/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LightweightAccountData", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/ListMessageItem/BUCK b/submodules/ListMessageItem/BUCK deleted file mode 100644 index 64f9dd50e7..0000000000 --- a/submodules/ListMessageItem/BUCK +++ /dev/null @@ -1,36 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ListMessageItem", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AccountContext:AccountContext", - "//submodules/TextFormat:TextFormat", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/UrlHandling:UrlHandling", - "//submodules/UrlWhitelist:UrlWhitelist", - "//submodules/WebsiteType:WebsiteType", - "//submodules/PhotoResources:PhotoResources", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/SemanticStatusNode:SemanticStatusNode", - "//submodules/MusicAlbumArtResources:MusicAlbumArtResources", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/ContextUI:ContextUI", - "//submodules/FileMediaResourceStatus:FileMediaResourceStatus", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ListSectionHeaderNode/BUCK b/submodules/ListSectionHeaderNode/BUCK deleted file mode 100644 index 25fbe0526c..0000000000 --- a/submodules/ListSectionHeaderNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ListSectionHeaderNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LiveLocationManager/BUCK b/submodules/LiveLocationManager/BUCK deleted file mode 100644 index ac29a1feee..0000000000 --- a/submodules/LiveLocationManager/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LiveLocationManager", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/DeviceLocationManager:DeviceLocationManager", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - ], -) diff --git a/submodules/LiveLocationPositionNode/BUCK b/submodules/LiveLocationPositionNode/BUCK deleted file mode 100644 index f3bb9e3c8b..0000000000 --- a/submodules/LiveLocationPositionNode/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LiveLocationPositionNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AvatarNode:AvatarNode", - "//submodules/AppBundle:AppBundle", - "//submodules/LocationResources:LocationResources", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LiveLocationTimerNode/BUCK b/submodules/LiveLocationTimerNode/BUCK deleted file mode 100644 index 90f16ad856..0000000000 --- a/submodules/LiveLocationTimerNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LiveLocationTimerNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/LocalAuth/BUCK b/submodules/LocalAuth/BUCK deleted file mode 100644 index 7d9d8d639b..0000000000 --- a/submodules/LocalAuth/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LocalAuth", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/LocalAuthentication.framework", - ], -) diff --git a/submodules/LocalMediaResources/BUCK b/submodules/LocalMediaResources/BUCK deleted file mode 100644 index 12b32376f0..0000000000 --- a/submodules/LocalMediaResources/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LocalMediaResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/ImageCompression:ImageCompression", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], - weak_frameworks = [ - "Photos", - ], -) diff --git a/submodules/LocalizedPeerData/BUCK b/submodules/LocalizedPeerData/BUCK deleted file mode 100644 index 150c58a399..0000000000 --- a/submodules/LocalizedPeerData/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LocalizedPeerData", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/LocationResources/BUCK b/submodules/LocationResources/BUCK deleted file mode 100644 index be15ac9649..0000000000 --- a/submodules/LocationResources/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LocationResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MapKit.framework", - ], -) diff --git a/submodules/LocationUI/BUCK b/submodules/LocationUI/BUCK deleted file mode 100644 index 3424f578b2..0000000000 --- a/submodules/LocationUI/BUCK +++ /dev/null @@ -1,49 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "LocationUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/ShareController:ShareController", - "//submodules/AccountContext:AccountContext", - "//submodules/OpenInExternalAppUI:OpenInExternalAppUI", - "//submodules/ItemListUI:ItemListUI", - "//submodules/LegacyUI:LegacyUI", - "//submodules/AppBundle:AppBundle", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/LocationResources:LocationResources", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/SegmentedControlNode:SegmentedControlNode", - "//submodules/Geocoding:Geocoding", - "//submodules/ItemListVenueItem:ItemListVenueItem", - "//submodules/MergeLists:MergeLists", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/PersistentStringHash:PersistentStringHash", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/LiveLocationTimerNode:LiveLocationTimerNode", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/TooltipUI:TooltipUI", - "//submodules/UndoUI:UndoUI", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - "$SDKROOT/System/Library/Frameworks/MapKit.framework", - ], -) diff --git a/submodules/ManagedAnimationNode/BUCK b/submodules/ManagedAnimationNode/BUCK deleted file mode 100644 index 932e9cbb9c..0000000000 --- a/submodules/ManagedAnimationNode/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ManagedAnimationNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/GZip:GZip", - "//submodules/rlottie:RLottieBinding", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/MapResourceToAvatarSizes/BUCK b/submodules/MapResourceToAvatarSizes/BUCK deleted file mode 100644 index 42e165bed4..0000000000 --- a/submodules/MapResourceToAvatarSizes/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MapResourceToAvatarSizes", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Markdown/BUCK b/submodules/Markdown/BUCK deleted file mode 100644 index 8b9ed246b4..0000000000 --- a/submodules/Markdown/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Markdown", - srcs = glob([ - "Source/**/*.swift", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/MediaPlayer/BUCK b/submodules/MediaPlayer/BUCK deleted file mode 100644 index e041921605..0000000000 --- a/submodules/MediaPlayer/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "UniversalMediaPlayer", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramAudio:TelegramAudio", - "//submodules/FFMpegBinding:FFMpegBinding", - "//submodules/RingBuffer:RingBuffer", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/MediaResources/BUCK b/submodules/MediaResources/BUCK deleted file mode 100644 index 8635efccea..0000000000 --- a/submodules/MediaResources/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MediaResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/MergeLists/BUCK b/submodules/MergeLists/BUCK deleted file mode 100644 index 813a560b49..0000000000 --- a/submodules/MergeLists/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MergeLists", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/MessageReactionListUI/BUCK b/submodules/MessageReactionListUI/BUCK deleted file mode 100644 index 3543f9575f..0000000000 --- a/submodules/MessageReactionListUI/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MessageReactionListUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/MergeLists:MergeLists", - "//submodules/ItemListPeerItem:ItemListPeerItem", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/MimeTypes/BUCK b/submodules/MimeTypes/BUCK deleted file mode 100644 index 50ea70b1fa..0000000000 --- a/submodules/MimeTypes/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MimeTypes", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/MonotonicTime/BUCK b/submodules/MonotonicTime/BUCK deleted file mode 100644 index efe65d52c5..0000000000 --- a/submodules/MonotonicTime/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MonotonicTime", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/MosaicLayout/BUCK b/submodules/MosaicLayout/BUCK deleted file mode 100644 index e28de70b95..0000000000 --- a/submodules/MosaicLayout/BUCK +++ /dev/null @@ -1,12 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MosaicLayout", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/MozjpegBinding/BUCK b/submodules/MozjpegBinding/BUCK deleted file mode 100644 index 64759fab2b..0000000000 --- a/submodules/MozjpegBinding/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MozjpegBinding", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "Public/**/*.h", - ]), - deps = [ - "//third-party/mozjpeg:mozjpeg", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/MtProtoKit/BUCK b/submodules/MtProtoKit/BUCK deleted file mode 100644 index e7c782ef4e..0000000000 --- a/submodules/MtProtoKit/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "framework", "glob_map", "merge_maps") - -framework( - name = "MtProtoKit", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - visibility = ["PUBLIC"], - deps = [ - "//submodules/EncryptionProvider:EncryptionProvider", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/Security.framework", - ], -) diff --git a/submodules/MurMurHash32/BUCK b/submodules/MurMurHash32/BUCK deleted file mode 100644 index 970767e33a..0000000000 --- a/submodules/MurMurHash32/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MurMurHash32", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/MusicAlbumArtResources/BUCK b/submodules/MusicAlbumArtResources/BUCK deleted file mode 100644 index 2fd400400c..0000000000 --- a/submodules/MusicAlbumArtResources/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "MusicAlbumArtResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/UrlEscaping:UrlEscaping", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/NetworkLogging/BUCK b/submodules/NetworkLogging/BUCK deleted file mode 100644 index 4c1c68fe8b..0000000000 --- a/submodules/NetworkLogging/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "NetworkLogging", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/MtProtoKit:MtProtoKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/NotificationMuteSettingsUI/BUCK b/submodules/NotificationMuteSettingsUI/BUCK deleted file mode 100644 index bf51c73ceb..0000000000 --- a/submodules/NotificationMuteSettingsUI/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "NotificationMuteSettingsUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/NotificationSoundSelectionUI/BUCK b/submodules/NotificationSoundSelectionUI/BUCK deleted file mode 100644 index 74a73a3abd..0000000000 --- a/submodules/NotificationSoundSelectionUI/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "NotificationSoundSelectionUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/NotificationsPresentationData/BUCK b/submodules/NotificationsPresentationData/BUCK deleted file mode 100644 index b58e009f65..0000000000 --- a/submodules/NotificationsPresentationData/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "NotificationsPresentationData", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/NumberPluralizationForm/BUCK b/submodules/NumberPluralizationForm/BUCK deleted file mode 100644 index 53a8e7cd9f..0000000000 --- a/submodules/NumberPluralizationForm/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "NumberPluralizationForm", - srcs = glob([ - "Sources/*.m", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/ObjCRuntimeUtils/BUCK b/submodules/ObjCRuntimeUtils/BUCK deleted file mode 100644 index 5e8f8d4084..0000000000 --- a/submodules/ObjCRuntimeUtils/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ObjCRuntimeUtils", - srcs = glob([ - "Source/ObjCRuntimeUtils/*.m", - ]), - exported_headers = glob([ - "Source/ObjCRuntimeUtils/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/OpenInExternalAppUI/BUCK b/submodules/OpenInExternalAppUI/BUCK deleted file mode 100644 index a1dc0b605c..0000000000 --- a/submodules/OpenInExternalAppUI/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "OpenInExternalAppUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/PhotoResources:PhotoResources", - "//submodules/UrlEscaping:UrlEscaping", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - "$SDKROOT/System/Library/Frameworks/MapKit.framework", - ], -) diff --git a/submodules/OpenSSLEncryptionProvider/BUCK b/submodules/OpenSSLEncryptionProvider/BUCK deleted file mode 100644 index 6c38b32dc0..0000000000 --- a/submodules/OpenSSLEncryptionProvider/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "OpenSSLEncryptionProvider", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/EncryptionProvider:EncryptionProvider", - "//submodules/openssl:openssl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Opus/BUCK b/submodules/Opus/BUCK deleted file mode 100644 index 5d0591fb7f..0000000000 --- a/submodules/Opus/BUCK +++ /dev/null @@ -1,41 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -genrule( - name = "opus_lib_file", - visibility = [ - "//submodules/Opus:..." - ], - srcs = [ - "Sources/opus/lib/libopus.a", - ], - bash = "mkdir -p $OUT; cp $SRCS $OUT/", - out = "opus_lib_file", -) - -apple_library( - name = "opus_lib", - visibility = [ - "//submodules/Opus:..." - ], - header_namespace = "opus", - exported_headers = glob([ - "Sources/**/*.h", - ]), - exported_linker_flags = [ - "-lopus", - "-L$(location :opus_lib_file)", - ], -) - -static_library( - name = "opus", - srcs = glob([ - "Sources/**/*.swift", - ]), - exported_headers = glob([ - "Public/**/*.h", - ]), - deps = [ - ":opus_lib", - ], -) diff --git a/submodules/Opus/BUILD b/submodules/Opus/BUILD deleted file mode 100644 index cf947785f6..0000000000 --- a/submodules/Opus/BUILD +++ /dev/null @@ -1,26 +0,0 @@ - -cc_library( - name = "opus_lib", - srcs = [ - "Sources/opus/lib/libopus.a", - ], -) - -objc_library( - name = "opus", - module_name = "opus", - enable_modules = True, - hdrs = glob([ - "Public/**/*.h", - ]), - includes = [ - "Public", - "Public/opus", - ], - deps = [ - ":opus_lib", - ], - visibility = [ - "//visibility:public", - ] -) diff --git a/submodules/Opus/Public/opus/opus.h b/submodules/Opus/Public/opus/opus.h deleted file mode 100644 index dd5a8fe2d2..0000000000 --- a/submodules/Opus/Public/opus/opus.h +++ /dev/null @@ -1,981 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus.h - * @brief Opus reference implementation API - */ - -#ifndef OPUS_H -#define OPUS_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @mainpage Opus - * - * The Opus codec is designed for interactive speech and audio transmission over the Internet. - * It is designed by the IETF Codec Working Group and incorporates technology from - * Skype's SILK codec and Xiph.Org's CELT codec. - * - * The Opus codec is designed to handle a wide range of interactive audio applications, - * including Voice over IP, videoconferencing, in-game chat, and even remote live music - * performances. It can scale from low bit-rate narrowband speech to very high quality - * stereo music. Its main features are: - - * @li Sampling rates from 8 to 48 kHz - * @li Bit-rates from 6 kb/s to 510 kb/s - * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) - * @li Audio bandwidth from narrowband to full-band - * @li Support for speech and music - * @li Support for mono and stereo - * @li Support for multichannel (up to 255 channels) - * @li Frame sizes from 2.5 ms to 60 ms - * @li Good loss robustness and packet loss concealment (PLC) - * @li Floating point and fixed-point implementation - * - * Documentation sections: - * @li @ref opus_encoder - * @li @ref opus_decoder - * @li @ref opus_repacketizer - * @li @ref opus_multistream - * @li @ref opus_libinfo - * @li @ref opus_custom - */ - -/** @defgroup opus_encoder Opus Encoder - * @{ - * - * @brief This page describes the process and functions used to encode Opus. - * - * Since Opus is a stateful codec, the encoding process starts with creating an encoder - * state. This can be done with: - * - * @code - * int error; - * OpusEncoder *enc; - * enc = opus_encoder_create(Fs, channels, application, &error); - * @endcode - * - * From this point, @c enc can be used for encoding an audio stream. An encoder state - * @b must @b not be used for more than one stream at the same time. Similarly, the encoder - * state @b must @b not be re-initialized for each frame. - * - * While opus_encoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * - * @code - * int size; - * int error; - * OpusEncoder *enc; - * size = opus_encoder_get_size(channels); - * enc = malloc(size); - * error = opus_encoder_init(enc, Fs, channels, application); - * @endcode - * - * where opus_encoder_get_size() returns the required size for the encoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The encoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * It is possible to change some of the encoder's settings using the opus_encoder_ctl() - * interface. All these settings already default to the recommended value, so they should - * only be changed when necessary. The most common settings one may want to change are: - * - * @code - * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); - * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); - * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); - * @endcode - * - * where - * - * @arg bitrate is in bits per second (b/s) - * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest - * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC - * - * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. - * - * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: - * @code - * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); - * @endcode - * - * where - *
    - *
  • audio_frame is the audio data in opus_int16 (or float for opus_encode_float())
  • - *
  • frame_size is the duration of the frame in samples (per channel)
  • - *
  • packet is the byte array to which the compressed data is written
  • - *
  • max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). - * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.
  • - *
- * - * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. - * The return value can be negative, which indicates that an error has occurred. If the return value - * is 2 bytes or less, then the packet does not need to be transmitted (DTX). - * - * Once the encoder state if no longer needed, it can be destroyed with - * - * @code - * opus_encoder_destroy(enc); - * @endcode - * - * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), - * then no action is required aside from potentially freeing the memory that was manually - * allocated for it (calling free(enc) for the example above) - * - */ - -/** Opus encoder state. - * This contains the complete state of an Opus encoder. - * It is position independent and can be freely copied. - * @see opus_encoder_create,opus_encoder_init - */ -typedef struct OpusEncoder OpusEncoder; - -/** Gets the size of an OpusEncoder structure. - * @param[in] channels int: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); - -/** - */ - -/** Allocates and initializes an encoder state. - * There are three coding modes: - * - * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice - * signals. It enhances the input signal by high-pass filtering and - * emphasizing formants and harmonics. Optionally it includes in-band - * forward error correction to protect against packet loss. Use this - * mode for typical VoIP applications. Because of the enhancement, - * even at high bitrates the output may sound different from the input. - * - * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most - * non-voice signals like music. Use this mode for music and mixed - * (music/voice) content, broadcast, and applications requiring less - * than 15 ms of coding delay. - * - * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that - * disables the speech-optimized mode in exchange for slightly reduced delay. - * This mode can only be set on an newly initialized or freshly reset encoder - * because it changes the codec delay. - * - * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). - * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) in input signal - * @param [in] application int: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @param [out] error int*: @ref opus_errorcodes - * @note Regardless of the sampling rate and number channels selected, the Opus encoder - * can switch to a lower audio bandwidth or number of channels if the bitrate - * selected is too low. This also means that it is safe to always use 48 kHz stereo input - * and let the encoder optimize the encoding. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( - opus_int32 Fs, - int channels, - int application, - int *error -); - -/** Initializes a previously allocated encoder state - * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. - * @see opus_encoder_create(),opus_encoder_get_size() - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) in input signal - * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_encoder_init( - OpusEncoder *st, - opus_int32 Fs, - int channels, - int application -) OPUS_ARG_NONNULL(1); - -/** Encodes an Opus frame. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size int: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( - OpusEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes an Opus frame from floating point input. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. - * Samples with a range beyond +/-1.0 are supported but will - * be clipped by decoders using the integer API and should - * only be used if it is known that the far end supports - * extended dynamic range. - * length is frame_size*channels*sizeof(float) - * @param [in] frame_size int: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( - OpusEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an OpusEncoder allocated by opus_encoder_create(). - * @param[in] st OpusEncoder*: State to be freed. - */ -OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); - -/** Perform a CTL function on an Opus encoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st OpusEncoder*: Encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_encoderctls. - * @see opus_genericctls - * @see opus_encoderctls - */ -OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); -/**@}*/ - -/** @defgroup opus_decoder Opus Decoder - * @{ - * - * @brief This page describes the process and functions used to decode Opus. - * - * The decoding process also starts with creating a decoder - * state. This can be done with: - * @code - * int error; - * OpusDecoder *dec; - * dec = opus_decoder_create(Fs, channels, &error); - * @endcode - * where - * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 - * @li channels is the number of channels (1 or 2) - * @li error will hold the error code in case of failure (or #OPUS_OK on success) - * @li the return value is a newly created decoder state to be used for decoding - * - * While opus_decoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * @code - * int size; - * int error; - * OpusDecoder *dec; - * size = opus_decoder_get_size(channels); - * dec = malloc(size); - * error = opus_decoder_init(dec, Fs, channels); - * @endcode - * where opus_decoder_get_size() returns the required size for the decoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The decoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: - * @code - * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); - * @endcode - * where - * - * @li packet is the byte array containing the compressed data - * @li len is the exact number of bytes contained in the packet - * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) - * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array - * - * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. - * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio - * buffer is too small to hold the decoded audio. - * - * Opus is a stateful codec with overlapping blocks and as a result Opus - * packets are not coded independently of each other. Packets must be - * passed into the decoder serially and in the correct order for a correct - * decode. Lost packets can be replaced with loss concealment by calling - * the decoder with a null pointer and zero length for the missing packet. - * - * A single codec state may only be accessed from a single thread at - * a time and any required locking must be performed by the caller. Separate - * streams must be decoded with separate decoder states and can be decoded - * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK - * defined. - * - */ - -/** Opus decoder state. - * This contains the complete state of an Opus decoder. - * It is position independent and can be freely copied. - * @see opus_decoder_create,opus_decoder_init - */ -typedef struct OpusDecoder OpusDecoder; - -/** Gets the size of an OpusDecoder structure. - * @param [in] channels int: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); - -/** Allocates and initializes a decoder state. - * @param [in] Fs opus_int32: Sample rate to decode at (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) to decode - * @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes - * - * Internally Opus stores data at 48000 Hz, so that should be the default - * value for Fs. However, the decoder can efficiently decode to buffers - * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use - * data at the full sample rate, or knows the compressed data doesn't - * use the full frequency range, it can request decoding at a reduced - * rate. Likewise, the decoder is capable of filling in either mono or - * interleaved stereo pcm buffers, at the caller's request. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( - opus_int32 Fs, - int channels, - int *error -); - -/** Initializes a previously allocated decoder state. - * The state must be at least the size returned by opus_decoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st OpusDecoder*: Decoder state. - * @param [in] Fs opus_int32: Sampling rate to decode to (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) to decode - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_decoder_init( - OpusDecoder *st, - opus_int32 Fs, - int channels -) OPUS_ARG_NONNULL(1); - -/** Decode an Opus packet. - * @param [in] st OpusDecoder*: Decoder state - * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len opus_int32: Number of bytes in payload* - * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size must be a multiple of 2.5 ms. - * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available, the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode an Opus packet with floating point output. - * @param [in] st OpusDecoder*: Decoder state - * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len opus_int32: Number of bytes in payload - * @param [out] pcm float*: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(float) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size must be a multiple of 2.5 ms. - * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on an Opus decoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st OpusDecoder*: Decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_decoderctls. - * @see opus_genericctls - * @see opus_decoderctls - */ -OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an OpusDecoder allocated by opus_decoder_create(). - * @param[in] st OpusDecoder*: State to be freed. - */ -OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); - -/** Parse an opus packet into one or more frames. - * Opus_decode will perform this operation internally so most applications do - * not need to use this function. - * This function does not copy the frames, the returned pointers are pointers into - * the input packet. - * @param [in] data char*: Opus packet to be parsed - * @param [in] len opus_int32: size of data - * @param [out] out_toc char*: TOC pointer - * @param [out] frames char*[48] encapsulated frames - * @param [out] size opus_int16[48] sizes of the encapsulated frames - * @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) - * @returns number of frames - */ -OPUS_EXPORT int opus_packet_parse( - const unsigned char *data, - opus_int32 len, - unsigned char *out_toc, - const unsigned char *frames[48], - opus_int16 size[48], - int *payload_offset -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5); - -/** Gets the bandwidth of an Opus packet. - * @param [in] data char*: Opus packet - * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) - * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) - * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) - * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) - * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples per frame from an Opus packet. - * @param [in] data char*: Opus packet. - * This must contain at least one byte of - * data. - * @param [in] Fs opus_int32: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples per frame. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of channels from an Opus packet. - * @param [in] data char*: Opus packet - * @returns Number of channels - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of frames in an Opus packet. - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @returns Number of frames - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @param [in] Fs opus_int32: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] dec OpusDecoder*: Decoder state - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - -/** Applies soft-clipping to bring a float signal within the [-1,1] range. If - * the signal is already in that range, nothing is done. If there are values - * outside of [-1,1], then the signal is clipped as smoothly as possible to - * both fit in the range and avoid creating excessive distortion in the - * process. - * @param [in,out] pcm float*: Input PCM and modified PCM - * @param [in] frame_size int Number of samples per channel to process - * @param [in] channels int: Number of channels - * @param [in,out] softclip_mem float*: State memory for the soft clipping process (one float per channel, initialized to zero) - */ -OPUS_EXPORT void opus_pcm_soft_clip(float *pcm, int frame_size, int channels, float *softclip_mem); - - -/**@}*/ - -/** @defgroup opus_repacketizer Repacketizer - * @{ - * - * The repacketizer can be used to merge multiple Opus packets into a single - * packet or alternatively to split Opus packets that have previously been - * merged. Splitting valid Opus packets is always guaranteed to succeed, - * whereas merging valid packets only succeeds if all frames have the same - * mode, bandwidth, and frame size, and when the total duration of the merged - * packet is no more than 120 ms. The 120 ms limit comes from the - * specification and limits decoder memory requirements at a point where - * framing overhead becomes negligible. - * - * The repacketizer currently only operates on elementary Opus - * streams. It will not manipualte multistream packets successfully, except in - * the degenerate case where they consist of data from a single stream. - * - * The repacketizing process starts with creating a repacketizer state, either - * by calling opus_repacketizer_create() or by allocating the memory yourself, - * e.g., - * @code - * OpusRepacketizer *rp; - * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); - * if (rp != NULL) - * opus_repacketizer_init(rp); - * @endcode - * - * Then the application should submit packets with opus_repacketizer_cat(), - * extract new packets with opus_repacketizer_out() or - * opus_repacketizer_out_range(), and then reset the state for the next set of - * input packets via opus_repacketizer_init(). - * - * For example, to split a sequence of packets into individual frames: - * @code - * unsigned char *data; - * int len; - * while (get_next_packet(&data, &len)) - * { - * unsigned char out[1276]; - * opus_int32 out_len; - * int nb_frames; - * int err; - * int i; - * err = opus_repacketizer_cat(rp, data, len); - * if (err != OPUS_OK) - * { - * release_packet(data); - * return err; - * } - * nb_frames = opus_repacketizer_get_nb_frames(rp); - * for (i = 0; i < nb_frames; i++) - * { - * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packet(data); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * } - * opus_repacketizer_init(rp); - * release_packet(data); - * } - * @endcode - * - * Alternatively, to combine a sequence of frames into packets that each - * contain up to TARGET_DURATION_MS milliseconds of data: - * @code - * // The maximum number of packets with duration TARGET_DURATION_MS occurs - * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) - * // packets. - * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; - * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; - * int nb_packets; - * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; - * opus_int32 out_len; - * int prev_toc; - * nb_packets = 0; - * while (get_next_packet(data+nb_packets, len+nb_packets)) - * { - * int nb_frames; - * int err; - * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); - * if (nb_frames < 1) - * { - * release_packets(data, nb_packets+1); - * return nb_frames; - * } - * nb_frames += opus_repacketizer_get_nb_frames(rp); - * // If adding the next packet would exceed our target, or it has an - * // incompatible TOC sequence, output the packets we already have before - * // submitting it. - * // N.B., The nb_packets > 0 check ensures we've submitted at least one - * // packet since the last call to opus_repacketizer_init(). Otherwise a - * // single packet longer than TARGET_DURATION_MS would cause us to try to - * // output an (invalid) empty packet. It also ensures that prev_toc has - * // been set to a valid value. Additionally, len[nb_packets] > 0 is - * // guaranteed by the call to opus_packet_get_nb_frames() above, so the - * // reference to data[nb_packets][0] should be valid. - * if (nb_packets > 0 && ( - * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || - * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > - * TARGET_DURATION_MS*48)) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packets(data, nb_packets+1); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * opus_repacketizer_init(rp); - * release_packets(data, nb_packets); - * data[0] = data[nb_packets]; - * len[0] = len[nb_packets]; - * nb_packets = 0; - * } - * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); - * if (err != OPUS_OK) - * { - * release_packets(data, nb_packets+1); - * return err; - * } - * prev_toc = data[nb_packets][0]; - * nb_packets++; - * } - * // Output the final, partial packet. - * if (nb_packets > 0) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * release_packets(data, nb_packets); - * if (out_len < 0) - * return (int)out_len; - * output_next_packet(out, out_len); - * } - * @endcode - * - * An alternate way of merging packets is to simply call opus_repacketizer_cat() - * unconditionally until it fails. At that point, the merged packet can be - * obtained with opus_repacketizer_out() and the input packet for which - * opus_repacketizer_cat() needs to be re-added to a newly reinitialized - * repacketizer state. - */ - -typedef struct OpusRepacketizer OpusRepacketizer; - -/** Gets the size of an OpusRepacketizer structure. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); - -/** (Re)initializes a previously allocated repacketizer state. - * The state must be at least the size returned by opus_repacketizer_get_size(). - * This can be used for applications which use their own allocator instead of - * malloc(). - * It must also be called to reset the queue of packets waiting to be - * repacketized, which is necessary if the maximum packet duration of 120 ms - * is reached or if you wish to submit packets with a different Opus - * configuration (coding mode, audio bandwidth, frame size, or channel count). - * Failure to do so will prevent a new packet from being added with - * opus_repacketizer_cat(). - * @see opus_repacketizer_create - * @see opus_repacketizer_get_size - * @see opus_repacketizer_cat - * @param rp OpusRepacketizer*: The repacketizer state to - * (re)initialize. - * @returns A pointer to the same repacketizer state that was passed in. - */ -OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Allocates memory and initializes the new repacketizer with - * opus_repacketizer_init(). - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); - -/** Frees an OpusRepacketizer allocated by - * opus_repacketizer_create(). - * @param[in] rp OpusRepacketizer*: State to be freed. - */ -OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); - -/** Add a packet to the current repacketizer state. - * This packet must match the configuration of any packets already submitted - * for repacketization since the last call to opus_repacketizer_init(). - * This means that it must have the same coding mode, audio bandwidth, frame - * size, and channel count. - * This can be checked in advance by examining the top 6 bits of the first - * byte of the packet, and ensuring they match the top 6 bits of the first - * byte of any previously submitted packet. - * The total duration of audio in the repacketizer state also must not exceed - * 120 ms, the maximum duration of a single packet, after adding this packet. - * - * The contents of the current repacketizer state can be extracted into new - * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). - * - * In order to add a packet with a different configuration or to add more - * audio beyond 120 ms, you must clear the repacketizer state by calling - * opus_repacketizer_init(). - * If a packet is too large to add to the current repacketizer state, no part - * of it is added, even if it contains multiple frames, some of which might - * fit. - * If you wish to be able to add parts of such packets, you should first use - * another repacketizer to split the packet into pieces and add them - * individually. - * @see opus_repacketizer_out_range - * @see opus_repacketizer_out - * @see opus_repacketizer_init - * @param rp OpusRepacketizer*: The repacketizer state to which to - * add the packet. - * @param[in] data const unsigned char*: The packet data. - * The application must ensure - * this pointer remains valid - * until the next call to - * opus_repacketizer_init() or - * opus_repacketizer_destroy(). - * @param len opus_int32: The number of bytes in the packet data. - * @returns An error code indicating whether or not the operation succeeded. - * @retval #OPUS_OK The packet's contents have been added to the repacketizer - * state. - * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, - * the packet's TOC sequence was not compatible - * with previously submitted packets (because - * the coding mode, audio bandwidth, frame size, - * or channel count did not match), or adding - * this packet would increase the total amount of - * audio stored in the repacketizer state to more - * than 120 ms. - */ -OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * @param rp OpusRepacketizer*: The repacketizer state from which to - * construct the new packet. - * @param begin int: The index of the first frame in the current - * repacketizer state to include in the output. - * @param end int: One past the index of the last frame in the - * current repacketizer state to include in the - * output. - * @param[out] data const unsigned char*: The buffer in which to - * store the output packet. - * @param maxlen opus_int32: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * 1276 for a single frame, - * or for multiple frames, - * 1277*(end-begin). - * However, 1*(end-begin) plus - * the size of all packet data submitted to - * the repacketizer since the last call to - * opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG [begin,end) was an invalid range of - * frames (begin < 0, begin >= end, or end > - * opus_repacketizer_get_nb_frames()). - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Return the total number of frames contained in packet data submitted to - * the repacketizer state so far via opus_repacketizer_cat() since the last - * call to opus_repacketizer_init() or opus_repacketizer_create(). - * This defines the valid range of packets that can be extracted with - * opus_repacketizer_out_range() or opus_repacketizer_out(). - * @param rp OpusRepacketizer*: The repacketizer state containing the - * frames. - * @returns The total number of frames contained in the packet data submitted - * to the repacketizer state. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * This is a convenience routine that returns all the data submitted so far - * in a single packet. - * It is equivalent to calling - * @code - * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), - * data, maxlen) - * @endcode - * @param rp OpusRepacketizer*: The repacketizer state from which to - * construct the new packet. - * @param[out] data const unsigned char*: The buffer in which to - * store the output packet. - * @param maxlen opus_int32: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * 1277*opus_repacketizer_get_nb_frames(rp). - * However, - * 1*opus_repacketizer_get_nb_frames(rp) - * plus the size of all packet data - * submitted to the repacketizer since the - * last call to opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); - -/** Pads a given Opus packet to a larger size (possibly changing the TOC sequence). - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to pad. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param new_len opus_int32: The desired size of the packet after padding. - * This must be at least as large as len. - * @returns an error code - * @retval #OPUS_OK \a on success. - * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len); - -/** Remove all padding from a given Opus packet and rewrite the TOC sequence to - * minimize space usage. - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to strip. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @returns The new size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG \a len was less than 1. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_packet_unpad(unsigned char *data, opus_int32 len); - -/** Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence). - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to pad. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param new_len opus_int32: The desired size of the packet after padding. - * This must be at least 1. - * @param nb_streams opus_int32: The number of streams (not channels) in the packet. - * This must be at least as large as len. - * @returns an error code - * @retval #OPUS_OK \a on success. - * @retval #OPUS_BAD_ARG \a len was less than 1. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT int opus_multistream_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len, int nb_streams); - -/** Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to - * minimize space usage. - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to strip. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param nb_streams opus_int32: The number of streams (not channels) in the packet. - * This must be at least 1. - * @returns The new size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, int nb_streams); - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_H */ diff --git a/submodules/Opus/Public/opus/opus_defines.h b/submodules/Opus/Public/opus/opus_defines.h deleted file mode 100644 index 2239c3ec50..0000000000 --- a/submodules/Opus/Public/opus/opus_defines.h +++ /dev/null @@ -1,788 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_defines.h - * @brief Opus reference implementation constants - */ - -#ifndef OPUS_DEFINES_H -#define OPUS_DEFINES_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup opus_errorcodes Error codes - * @{ - */ -/** No error @hideinitializer*/ -#define OPUS_OK 0 -/** One or more invalid/out of range arguments @hideinitializer*/ -#define OPUS_BAD_ARG -1 -/** Not enough bytes allocated in the buffer @hideinitializer*/ -#define OPUS_BUFFER_TOO_SMALL -2 -/** An internal error was detected @hideinitializer*/ -#define OPUS_INTERNAL_ERROR -3 -/** The compressed data passed is corrupted @hideinitializer*/ -#define OPUS_INVALID_PACKET -4 -/** Invalid/unsupported request number @hideinitializer*/ -#define OPUS_UNIMPLEMENTED -5 -/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ -#define OPUS_INVALID_STATE -6 -/** Memory allocation has failed @hideinitializer*/ -#define OPUS_ALLOC_FAIL -7 -/**@}*/ - -/** @cond OPUS_INTERNAL_DOC */ -/**Export control for opus functions */ - -#ifndef OPUS_EXPORT -# if defined(WIN32) -# if defined(OPUS_BUILD) && defined(DLL_EXPORT) -# define OPUS_EXPORT __declspec(dllexport) -# else -# define OPUS_EXPORT -# endif -# elif defined(__GNUC__) && defined(OPUS_BUILD) -# define OPUS_EXPORT __attribute__ ((visibility ("default"))) -# else -# define OPUS_EXPORT -# endif -#endif - -# if !defined(OPUS_GNUC_PREREQ) -# if defined(__GNUC__)&&defined(__GNUC_MINOR__) -# define OPUS_GNUC_PREREQ(_maj,_min) \ - ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) -# else -# define OPUS_GNUC_PREREQ(_maj,_min) 0 -# endif -# endif - -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(3,0) -# define OPUS_RESTRICT __restrict__ -# elif (defined(_MSC_VER) && _MSC_VER >= 1400) -# define OPUS_RESTRICT __restrict -# else -# define OPUS_RESTRICT -# endif -#else -# define OPUS_RESTRICT restrict -#endif - -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(2,7) -# define OPUS_INLINE __inline__ -# elif (defined(_MSC_VER)) -# define OPUS_INLINE __inline -# else -# define OPUS_INLINE -# endif -#else -# define OPUS_INLINE inline -#endif - -/**Warning attributes for opus functions - * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out - * some paranoid null checks. */ -#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) -#else -# define OPUS_WARN_UNUSED_RESULT -#endif -#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) -#else -# define OPUS_ARG_NONNULL(_x) -#endif - -/** These are the actual Encoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -#define OPUS_SET_APPLICATION_REQUEST 4000 -#define OPUS_GET_APPLICATION_REQUEST 4001 -#define OPUS_SET_BITRATE_REQUEST 4002 -#define OPUS_GET_BITRATE_REQUEST 4003 -#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 -#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 -#define OPUS_SET_VBR_REQUEST 4006 -#define OPUS_GET_VBR_REQUEST 4007 -#define OPUS_SET_BANDWIDTH_REQUEST 4008 -#define OPUS_GET_BANDWIDTH_REQUEST 4009 -#define OPUS_SET_COMPLEXITY_REQUEST 4010 -#define OPUS_GET_COMPLEXITY_REQUEST 4011 -#define OPUS_SET_INBAND_FEC_REQUEST 4012 -#define OPUS_GET_INBAND_FEC_REQUEST 4013 -#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 -#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 -#define OPUS_SET_DTX_REQUEST 4016 -#define OPUS_GET_DTX_REQUEST 4017 -#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 -#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 -#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 -#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 -#define OPUS_SET_SIGNAL_REQUEST 4024 -#define OPUS_GET_SIGNAL_REQUEST 4025 -#define OPUS_GET_LOOKAHEAD_REQUEST 4027 -/* #define OPUS_RESET_STATE 4028 */ -#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 -#define OPUS_GET_FINAL_RANGE_REQUEST 4031 -#define OPUS_GET_PITCH_REQUEST 4033 -#define OPUS_SET_GAIN_REQUEST 4034 -#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ -#define OPUS_SET_LSB_DEPTH_REQUEST 4036 -#define OPUS_GET_LSB_DEPTH_REQUEST 4037 -#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 -#define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040 -#define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041 -#define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042 -#define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043 -/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ -#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046 -#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047 - -/** Defines for the presence of extended APIs. */ -#define OPUS_HAVE_OPUS_PROJECTION_H - -/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ -#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) -#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) -#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) -#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr))) -/** @endcond */ - -/** @defgroup opus_ctlvalues Pre-defined values for CTL interface - * @see opus_genericctls, opus_encoderctls - * @{ - */ -/* Values for the various encoder CTLs */ -#define OPUS_AUTO -1000 /**opus_int32: Allowed values: 0-10, inclusive. - * - * @hideinitializer */ -#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) -/** Gets the encoder's complexity configuration. - * @see OPUS_SET_COMPLEXITY - * @param[out] x opus_int32 *: Returns a value in the range 0-10, - * inclusive. - * @hideinitializer */ -#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) - -/** Configures the bitrate in the encoder. - * Rates from 500 to 512000 bits per second are meaningful, as well as the - * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. - * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much - * rate as it can, which is useful for controlling the rate by adjusting the - * output buffer size. - * @see OPUS_GET_BITRATE - * @param[in] x opus_int32: Bitrate in bits per second. The default - * is determined based on the number of - * channels and the input sampling rate. - * @hideinitializer */ -#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) -/** Gets the encoder's bitrate configuration. - * @see OPUS_SET_BITRATE - * @param[out] x opus_int32 *: Returns the bitrate in bits per second. - * The default is determined based on the - * number of channels and the input - * sampling rate. - * @hideinitializer */ -#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables variable bitrate (VBR) in the encoder. - * The configured bitrate may not be met exactly because frames must - * be an integer number of bytes in length. - * @see OPUS_GET_VBR - * @see OPUS_SET_VBR_CONSTRAINT - * @param[in] x opus_int32: Allowed values: - *
- *
0
Hard CBR. For LPC/hybrid modes at very low bit-rate, this can - * cause noticeable quality degradation.
- *
1
VBR (default). The exact type of VBR is controlled by - * #OPUS_SET_VBR_CONSTRAINT.
- *
- * @hideinitializer */ -#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) -/** Determine if variable bitrate (VBR) is enabled in the encoder. - * @see OPUS_SET_VBR - * @see OPUS_GET_VBR_CONSTRAINT - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Hard CBR.
- *
1
VBR (default). The exact type of VBR may be retrieved via - * #OPUS_GET_VBR_CONSTRAINT.
- *
- * @hideinitializer */ -#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables constrained VBR in the encoder. - * This setting is ignored when the encoder is in CBR mode. - * @warning Only the MDCT mode of Opus currently heeds the constraint. - * Speech mode ignores it completely, hybrid mode may fail to obey it - * if the LPC layer uses more bitrate than the constraint would have - * permitted. - * @see OPUS_GET_VBR_CONSTRAINT - * @see OPUS_SET_VBR - * @param[in] x opus_int32: Allowed values: - *
- *
0
Unconstrained VBR.
- *
1
Constrained VBR (default). This creates a maximum of one - * frame of buffering delay assuming a transport with a - * serialization speed of the nominal bitrate.
- *
- * @hideinitializer */ -#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) -/** Determine if constrained VBR is enabled in the encoder. - * @see OPUS_SET_VBR_CONSTRAINT - * @see OPUS_GET_VBR - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Unconstrained VBR.
- *
1
Constrained VBR (default).
- *
- * @hideinitializer */ -#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) - -/** Configures mono/stereo forcing in the encoder. - * This can force the encoder to produce packets encoded as either mono or - * stereo, regardless of the format of the input audio. This is useful when - * the caller knows that the input signal is currently a mono source embedded - * in a stereo stream. - * @see OPUS_GET_FORCE_CHANNELS - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
Not forced (default)
- *
1
Forced mono
- *
2
Forced stereo
- *
- * @hideinitializer */ -#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) -/** Gets the encoder's forced channel configuration. - * @see OPUS_SET_FORCE_CHANNELS - * @param[out] x opus_int32 *: - *
- *
#OPUS_AUTO
Not forced (default)
- *
1
Forced mono
- *
2
Forced stereo
- *
- * @hideinitializer */ -#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) - -/** Configures the maximum bandpass that the encoder will select automatically. - * Applications should normally use this instead of #OPUS_SET_BANDWIDTH - * (leaving that set to the default, #OPUS_AUTO). This allows the - * application to set an upper bound based on the type of input it is - * providing, but still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_MAX_BANDWIDTH - * @param[in] x opus_int32: Allowed values: - *
- *
OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
- *
- * @hideinitializer */ -#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Gets the encoder's configured maximum allowed bandpass. - * @see OPUS_SET_MAX_BANDWIDTH - * @param[out] x opus_int32 *: Allowed values: - *
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
- *
- * @hideinitializer */ -#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Sets the encoder's bandpass to a specific value. - * This prevents the encoder from automatically selecting the bandpass based - * on the available bitrate. If an application knows the bandpass of the input - * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH - * instead, which still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_BANDWIDTH - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
- *
- * @hideinitializer */ -#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Configures the type of signal being encoded. - * This is a hint which helps the encoder's mode selection. - * @see OPUS_GET_SIGNAL - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
- *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
- *
- * @hideinitializer */ -#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal type. - * @see OPUS_SET_SIGNAL - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
- *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
- *
- * @hideinitializer */ -#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) - - -/** Configures the encoder's intended application. - * The initial value is a mandatory argument to the encoder_create function. - * @see OPUS_GET_APPLICATION - * @param[in] x opus_int32: Returns one of the following values: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @hideinitializer */ -#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured application. - * @see OPUS_SET_APPLICATION - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @hideinitializer */ -#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the total samples of delay added by the entire codec. - * This can be queried by the encoder and then the provided number of samples can be - * skipped on from the start of the decoder's output to provide time aligned input - * and output. From the perspective of a decoding application the real data begins this many - * samples late. - * - * The decoder contribution to this delay is identical for all decoders, but the - * encoder portion of the delay may vary from implementation to implementation, - * version to version, or even depend on the encoder's initial configuration. - * Applications needing delay compensation should call this CTL rather than - * hard-coding a value. - * @param[out] x opus_int32 *: Number of lookahead samples - * @hideinitializer */ -#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of inband forward error correction (FEC). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_INBAND_FEC - * @param[in] x opus_int32: Allowed values: - *
- *
0
Disable inband FEC (default).
- *
1
Enable inband FEC.
- *
- * @hideinitializer */ -#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of inband forward error correction. - * @see OPUS_SET_INBAND_FEC - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Inband FEC disabled (default).
- *
1
Inband FEC enabled.
- *
- * @hideinitializer */ -#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's expected packet loss percentage. - * Higher values trigger progressively more loss resistant behavior in the encoder - * at the expense of quality at a given bitrate in the absence of packet loss, but - * greater quality under loss. - * @see OPUS_GET_PACKET_LOSS_PERC - * @param[in] x opus_int32: Loss percentage in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured packet loss percentage. - * @see OPUS_SET_PACKET_LOSS_PERC - * @param[out] x opus_int32 *: Returns the configured loss percentage - * in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of discontinuous transmission (DTX). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_DTX - * @param[in] x opus_int32: Allowed values: - *
- *
0
Disable DTX (default).
- *
1
Enabled DTX.
- *
- * @hideinitializer */ -#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of discontinuous transmission. - * @see OPUS_SET_DTX - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
DTX disabled (default).
- *
1
DTX enabled.
- *
- * @hideinitializer */ -#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) -/** Configures the depth of signal being encoded. - * - * This is a hint which helps the encoder identify silence and near-silence. - * It represents the number of significant bits of linear intensity below - * which the signal contains ignorable quantization or other noise. - * - * For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting - * for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate - * for 16-bit linear pcm input with opus_encode_float(). - * - * When using opus_encode() instead of opus_encode_float(), or when libopus - * is compiled for fixed-point, the encoder uses the minimum of the value - * set here and the value 16. - * - * @see OPUS_GET_LSB_DEPTH - * @param[in] x opus_int32: Input precision in bits, between 8 and 24 - * (default: 24). - * @hideinitializer */ -#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal depth. - * @see OPUS_SET_LSB_DEPTH - * @param[out] x opus_int32 *: Input precision in bits, between 8 and - * 24 (default: 24). - * @hideinitializer */ -#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of variable duration frames. - * When variable duration is enabled, the encoder is free to use a shorter frame - * size than the one requested in the opus_encode*() call. - * It is then the user's responsibility - * to verify how much audio was encoded by checking the ToC byte of the encoded - * packet. The part of the audio that was not encoded needs to be resent to the - * encoder for the next call. Do not use this option unless you really - * know what you are doing. - * @see OPUS_GET_EXPERT_FRAME_DURATION - * @param[in] x opus_int32: Allowed values: - *
- *
OPUS_FRAMESIZE_ARG
Select frame size from the argument (default).
- *
OPUS_FRAMESIZE_2_5_MS
Use 2.5 ms frames.
- *
OPUS_FRAMESIZE_5_MS
Use 5 ms frames.
- *
OPUS_FRAMESIZE_10_MS
Use 10 ms frames.
- *
OPUS_FRAMESIZE_20_MS
Use 20 ms frames.
- *
OPUS_FRAMESIZE_40_MS
Use 40 ms frames.
- *
OPUS_FRAMESIZE_60_MS
Use 60 ms frames.
- *
OPUS_FRAMESIZE_80_MS
Use 80 ms frames.
- *
OPUS_FRAMESIZE_100_MS
Use 100 ms frames.
- *
OPUS_FRAMESIZE_120_MS
Use 120 ms frames.
- *
- * @hideinitializer */ -#define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured use of variable duration frames. - * @see OPUS_SET_EXPERT_FRAME_DURATION - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
OPUS_FRAMESIZE_ARG
Select frame size from the argument (default).
- *
OPUS_FRAMESIZE_2_5_MS
Use 2.5 ms frames.
- *
OPUS_FRAMESIZE_5_MS
Use 5 ms frames.
- *
OPUS_FRAMESIZE_10_MS
Use 10 ms frames.
- *
OPUS_FRAMESIZE_20_MS
Use 20 ms frames.
- *
OPUS_FRAMESIZE_40_MS
Use 40 ms frames.
- *
OPUS_FRAMESIZE_60_MS
Use 60 ms frames.
- *
OPUS_FRAMESIZE_80_MS
Use 80 ms frames.
- *
OPUS_FRAMESIZE_100_MS
Use 100 ms frames.
- *
OPUS_FRAMESIZE_120_MS
Use 120 ms frames.
- *
- * @hideinitializer */ -#define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x) - -/** If set to 1, disables almost all use of prediction, making frames almost - * completely independent. This reduces quality. - * @see OPUS_GET_PREDICTION_DISABLED - * @param[in] x opus_int32: Allowed values: - *
- *
0
Enable prediction (default).
- *
1
Disable prediction.
- *
- * @hideinitializer */ -#define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured prediction status. - * @see OPUS_SET_PREDICTION_DISABLED - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Prediction enabled (default).
- *
1
Prediction disabled.
- *
- * @hideinitializer */ -#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_genericctls Generic CTLs - * - * These macros are used with the \c opus_decoder_ctl and - * \c opus_encoder_ctl calls to generate a particular - * request. - * - * When called on an \c OpusDecoder they apply to that - * particular decoder instance. When called on an - * \c OpusEncoder they apply to the corresponding setting - * on that encoder instance, if present. - * - * Some usage examples: - * - * @code - * int ret; - * opus_int32 pitch; - * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); - * if (ret == OPUS_OK) return ret; - * - * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); - * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); - * - * opus_int32 enc_bw, dec_bw; - * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); - * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); - * if (enc_bw != dec_bw) { - * printf("packet bandwidth mismatch!\n"); - * } - * @endcode - * - * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls - * @{ - */ - -/** Resets the codec state to be equivalent to a freshly initialized state. - * This should be called when switching streams in order to prevent - * the back to back decoding from giving different results from - * one at a time decoding. - * @hideinitializer */ -#define OPUS_RESET_STATE 4028 - -/** Gets the final state of the codec's entropy coder. - * This is used for testing purposes, - * The encoder and decoder state should be identical after coding a payload - * (assuming no data corruption or software bugs) - * - * @param[out] x opus_uint32 *: Entropy coder state - * - * @hideinitializer */ -#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) - -/** Gets the encoder's configured bandpass or the decoder's last bandpass. - * @see OPUS_SET_BANDWIDTH - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
- *
- * @hideinitializer */ -#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Gets the sampling rate the encoder or decoder was initialized with. - * This simply returns the Fs value passed to opus_encoder_init() - * or opus_decoder_init(). - * @param[out] x opus_int32 *: Sampling rate of encoder or decoder. - * @hideinitializer - */ -#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) - -/** If set to 1, disables the use of phase inversion for intensity stereo, - * improving the quality of mono downmixes, but slightly reducing normal - * stereo quality. Disabling phase inversion in the decoder does not comply - * with RFC 6716, although it does not cause any interoperability issue and - * is expected to become part of the Opus standard once RFC 6716 is updated - * by draft-ietf-codec-opus-update. - * @see OPUS_GET_PHASE_INVERSION_DISABLED - * @param[in] x opus_int32: Allowed values: - *
- *
0
Enable phase inversion (default).
- *
1
Disable phase inversion.
- *
- * @hideinitializer */ -#define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured phase inversion status. - * @see OPUS_SET_PHASE_INVERSION_DISABLED - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Stereo phase inversion enabled (default).
- *
1
Stereo phase inversion disabled.
- *
- * @hideinitializer */ -#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_decoderctls Decoder related CTLs - * @see opus_genericctls, opus_encoderctls, opus_decoder - * @{ - */ - -/** Configures decoder gain adjustment. - * Scales the decoded output by a factor specified in Q8 dB units. - * This has a maximum range of -32768 to 32767 inclusive, and returns - * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. - * This setting survives decoder reset. - * - * gain = pow(10, x/(20.0*256)) - * - * @param[in] x opus_int32: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) -/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN - * - * @param[out] x opus_int32 *: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) - -/** Gets the duration (in samples) of the last packet successfully decoded or concealed. - * @param[out] x opus_int32 *: Number of samples (at current sampling rate). - * @hideinitializer */ -#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the pitch of the last decoded frame, if available. - * This can be used for any post-processing algorithm requiring the use of pitch, - * e.g. time stretching/shortening. If the last frame was not voiced, or if the - * pitch was not coded in the frame, then zero is returned. - * - * This CTL is only implemented for decoder instances. - * - * @param[out] x opus_int32 *: pitch period at 48 kHz (or 0 if not available) - * - * @hideinitializer */ -#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_libinfo Opus library information functions - * @{ - */ - -/** Converts an opus error code into a human readable string. - * - * @param[in] error int: Error number - * @returns Error string - */ -OPUS_EXPORT const char *opus_strerror(int error); - -/** Gets the libopus version string. - * - * Applications may look for the substring "-fixed" in the version string to - * determine whether they have a fixed-point or floating-point build at - * runtime. - * - * @returns Version string - */ -OPUS_EXPORT const char *opus_get_version_string(void); -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_DEFINES_H */ diff --git a/submodules/Opus/Public/opus/opus_multistream.h b/submodules/Opus/Public/opus/opus_multistream.h deleted file mode 100644 index 0347310a00..0000000000 --- a/submodules/Opus/Public/opus/opus_multistream.h +++ /dev/null @@ -1,660 +0,0 @@ -/* Copyright (c) 2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_multistream.h - * @brief Opus reference implementation multistream API - */ - -#ifndef OPUS_MULTISTREAM_H -#define OPUS_MULTISTREAM_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** Macros to trigger compilation errors when the wrong types are provided to a - * CTL. */ -/**@{*/ -#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) -#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) -/**@}*/ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 -#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 -/**@}*/ - -/** @endcond */ - -/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and - * @ref opus_decoderctls may be applied to a multistream encoder or decoder as - * well. - * In addition, you may retrieve the encoder or decoder state for an specific - * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or - * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. - */ -/**@{*/ - -/** Gets the encoder state for an individual stream of a multistream encoder. - * @param[in] x opus_int32: The index of the stream whose encoder you - * wish to retrieve. - * This must be non-negative and less than - * the streams parameter used - * to initialize the encoder. - * @param[out] y OpusEncoder**: Returns a pointer to the given - * encoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) - -/** Gets the decoder state for an individual stream of a multistream decoder. - * @param[in] x opus_int32: The index of the stream whose decoder you - * wish to retrieve. - * This must be non-negative and less than - * the streams parameter used - * to initialize the decoder. - * @param[out] y OpusDecoder**: Returns a pointer to the given - * decoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) - -/**@}*/ - -/** @defgroup opus_multistream Opus Multistream API - * @{ - * - * The multistream API allows individual Opus streams to be combined into a - * single packet, enabling support for up to 255 channels. Unlike an - * elementary Opus stream, the encoder and decoder must negotiate the channel - * configuration before the decoder can successfully interpret the data in the - * packets produced by the encoder. Some basic information, such as packet - * duration, can be computed without any special negotiation. - * - * The format for multistream Opus packets is defined in - * RFC 7845 - * and is based on the self-delimited Opus framing described in Appendix B of - * RFC 6716. - * Normal Opus packets are just a degenerate case of multistream Opus packets, - * and can be encoded or decoded with the multistream API by setting - * streams to 1 when initializing the encoder or - * decoder. - * - * Multistream Opus streams can contain up to 255 elementary Opus streams. - * These may be either "uncoupled" or "coupled", indicating that the decoder - * is configured to decode them to either 1 or 2 channels, respectively. - * The streams are ordered so that all coupled streams appear at the - * beginning. - * - * A mapping table defines which decoded channel i - * should be used for each input/output (I/O) channel j. This table is - * typically provided as an unsigned char array. - * Let i = mapping[j] be the index for I/O channel j. - * If i < 2*coupled_streams, then I/O channel j is - * encoded as the left channel of stream (i/2) if i - * is even, or as the right channel of stream (i/2) if - * i is odd. Otherwise, I/O channel j is encoded as - * mono in stream (i - coupled_streams), unless it has the special - * value 255, in which case it is omitted from the encoding entirely (the - * decoder will reproduce it as silence). Each value i must either - * be the special value 255 or be less than streams + coupled_streams. - * - * The output channels specified by the encoder - * should use the - * Vorbis - * channel ordering. A decoder may wish to apply an additional permutation - * to the mapping the encoder used to achieve a different output channel - * order (e.g. for outputing in WAV order). - * - * Each multistream packet contains an Opus packet for each stream, and all of - * the Opus packets in a single multistream packet must have the same - * duration. Therefore the duration of a multistream packet can be extracted - * from the TOC sequence of the first stream, which is located at the - * beginning of the packet, just like an elementary Opus stream: - * - * @code - * int nb_samples; - * int nb_frames; - * nb_frames = opus_packet_get_nb_frames(data, len); - * if (nb_frames < 1) - * return nb_frames; - * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; - * @endcode - * - * The general encoding and decoding process proceeds exactly the same as in - * the normal @ref opus_encoder and @ref opus_decoder APIs. - * See their documentation for an overview of how to use the corresponding - * multistream functions. - */ - -/** Opus multistream encoder state. - * This contains the complete state of a multistream Opus encoder. - * It is position independent and can be freely copied. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_init - */ -typedef struct OpusMSEncoder OpusMSEncoder; - -/** Opus multistream decoder state. - * This contains the complete state of a multistream Opus decoder. - * It is position independent and can be freely copied. - * @see opus_multistream_decoder_create - * @see opus_multistream_decoder_init - */ -typedef struct OpusMSDecoder OpusMSDecoder; - -/**\name Multistream encoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSEncoder structure. - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( - int streams, - int coupled_streams -); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a multistream encoder state. - * Call opus_multistream_encoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param[in] mapping const unsigned char[channels]: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(5); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); - -/** Initialize a previously allocated multistream encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_get_size - * @param st OpusMSEncoder*: Multistream encoder state to initialize. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param[in] mapping const unsigned char[channels]: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -OPUS_EXPORT int opus_multistream_surround_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6) OPUS_ARG_NONNULL(7); - -/** Encodes a multistream Opus frame. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param[in] pcm const opus_int16*: The input signal as interleaved - * samples. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( - OpusMSEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes a multistream Opus frame from floating point input. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param[in] pcm const float*: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( - OpusMSEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an OpusMSEncoder allocated by - * opus_multistream_encoder_create(). - * @param st OpusMSEncoder*: Multistream encoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); - -/** Perform a CTL function on a multistream Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/**@}*/ - -/**\name Multistream decoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSDecoder structure. - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( - int streams, - int coupled_streams -); - -/** Allocates and initializes a multistream decoder state. - * Call opus_multistream_decoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] mapping const unsigned char[channels]: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int *error -) OPUS_ARG_NONNULL(5); - -/** Intialize a previously allocated decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_decoder_create - * @see opus_multistream_deocder_get_size - * @param st OpusMSEncoder*: Multistream encoder state to initialize. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] mapping const unsigned char[channels]: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_decoder_init( - OpusMSDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -/** Decode a multistream Opus packet. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode a multistream Opus packet with floating point output. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on a multistream Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an OpusMSDecoder allocated by - * opus_multistream_decoder_create(). - * @param st OpusMSDecoder: Multistream decoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_MULTISTREAM_H */ diff --git a/submodules/Opus/Public/opus/opus_projection.h b/submodules/Opus/Public/opus/opus_projection.h deleted file mode 100644 index d33d9e332c..0000000000 --- a/submodules/Opus/Public/opus/opus_projection.h +++ /dev/null @@ -1,568 +0,0 @@ -/* Copyright (c) 2017 Google Inc. - Written by Andrew Allen */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_projection.h - * @brief Opus projection reference API - */ - -#ifndef OPUS_PROJECTION_H -#define OPUS_PROJECTION_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications.c - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST 6001 -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST 6003 -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST 6005 -/**@}*/ - - -/** @endcond */ - -/** @defgroup opus_projection_ctls Projection specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_projection_encoder_ctl() and opus_projection_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, - * @ref opus_decoderctls, and @ref opus_multistream_ctls may be applied to a - * projection encoder or decoder as well. - */ -/**@{*/ - -/** Gets the gain (in dB. S7.8-format) of the demixing matrix from the encoder. - * @param[out] x opus_int32 *: Returns the gain (in dB. S7.8-format) - * of the demixing matrix. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST, __opus_check_int_ptr(x) - - -/** Gets the size in bytes of the demixing matrix from the encoder. - * @param[out] x opus_int32 *: Returns the size in bytes of the - * demixing matrix. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST, __opus_check_int_ptr(x) - - -/** Copies the demixing matrix to the supplied pointer location. - * @param[out] x unsigned char *: Returns the demixing matrix to the - * supplied pointer location. - * @param y opus_int32: The size in bytes of the reserved memory at the - * pointer location. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX(x,y) OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST, x, __opus_check_int(y) - - -/**@}*/ - -/** Opus projection encoder state. - * This contains the complete state of a projection Opus encoder. - * It is position independent and can be freely copied. - * @see opus_projection_ambisonics_encoder_create - */ -typedef struct OpusProjectionEncoder OpusProjectionEncoder; - - -/** Opus projection decoder state. - * This contains the complete state of a projection Opus decoder. - * It is position independent and can be freely copied. - * @see opus_projection_decoder_create - * @see opus_projection_decoder_init - */ -typedef struct OpusProjectionDecoder OpusProjectionDecoder; - - -/**\name Projection encoder functions */ -/**@{*/ - -/** Gets the size of an OpusProjectionEncoder structure. - * @param channels int: The total number of input channels to encode. - * This must be no more than 255. - * @param mapping_family int: The mapping family to use for selecting - * the appropriate projection. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_ambisonics_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a projection encoder state. - * Call opus_projection_encoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param mapping_family int: The mapping family to use for selecting - * the appropriate projection. - * @param[out] streams int *: The total number of streams that will - * be encoded from the input. - * @param[out] coupled_streams int *: Number of coupled (2 channel) - * streams that will be encoded from the input. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionEncoder *opus_projection_ambisonics_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - int application, - int *error -) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5); - - -/** Initialize a previously allocated projection encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_projection_ambisonics_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_projection_ambisonics_encoder_create - * @see opus_projection_ambisonics_encoder_get_size - * @param st OpusProjectionEncoder*: Projection encoder state to initialize. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_projection_ambisonics_encoder_init( - OpusProjectionEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); - - -/** Encodes a projection Opus frame. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param[in] pcm const opus_int16*: The input signal as interleaved - * samples. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode( - OpusProjectionEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - - -/** Encodes a projection Opus frame from floating point input. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param[in] pcm const float*: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode_float( - OpusProjectionEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - - -/** Frees an OpusProjectionEncoder allocated by - * opus_projection_ambisonics_encoder_create(). - * @param st OpusProjectionEncoder*: Projection encoder state to be freed. - */ -OPUS_EXPORT void opus_projection_encoder_destroy(OpusProjectionEncoder *st); - - -/** Perform a CTL function on a projection Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, @ref opus_multistream_ctls, or - * @ref opus_projection_ctls - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - * @see opus_projection_ctls - */ -OPUS_EXPORT int opus_projection_encoder_ctl(OpusProjectionEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - - -/**@}*/ - -/**\name Projection decoder functions */ -/**@{*/ - -/** Gets the size of an OpusProjectionDecoder structure. - * @param channels int: The total number of output channels. - * This must be no more than 255. - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_decoder_get_size( - int channels, - int streams, - int coupled_streams -); - - -/** Allocates and initializes a projection decoder state. - * Call opus_projection_decoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] demixing_matrix const unsigned char[demixing_matrix_size]: Demixing matrix - * that mapping from coded channels to output channels, - * as described in @ref opus_projection and - * @ref opus_projection_ctls. - * @param demixing_matrix_size opus_int32: The size in bytes of the - * demixing matrix, as - * described in @ref - * opus_projection_ctls. - * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionDecoder *opus_projection_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - unsigned char *demixing_matrix, - opus_int32 demixing_matrix_size, - int *error -) OPUS_ARG_NONNULL(5); - - -/** Intialize a previously allocated projection decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_projection_decoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_projection_decoder_create - * @see opus_projection_deocder_get_size - * @param st OpusProjectionDecoder*: Projection encoder state to initialize. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] demixing_matrix const unsigned char[demixing_matrix_size]: Demixing matrix - * that mapping from coded channels to output channels, - * as described in @ref opus_projection and - * @ref opus_projection_ctls. - * @param demixing_matrix_size opus_int32: The size in bytes of the - * demixing matrix, as - * described in @ref - * opus_projection_ctls. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_projection_decoder_init( - OpusProjectionDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - unsigned char *demixing_matrix, - opus_int32 demixing_matrix_size -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - - -/** Decode a projection Opus packet. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode( - OpusProjectionDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - - -/** Decode a projection Opus packet with floating point output. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode_float( - OpusProjectionDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - - -/** Perform a CTL function on a projection Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, @ref opus_multistream_ctls, or - * @ref opus_projection_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - * @see opus_projection_ctls - */ -OPUS_EXPORT int opus_projection_decoder_ctl(OpusProjectionDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - - -/** Frees an OpusProjectionDecoder allocated by - * opus_projection_decoder_create(). - * @param st OpusProjectionDecoder: Projection decoder state to be freed. - */ -OPUS_EXPORT void opus_projection_decoder_destroy(OpusProjectionDecoder *st); - - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_PROJECTION_H */ diff --git a/submodules/Opus/Public/opus/opus_types.h b/submodules/Opus/Public/opus/opus_types.h deleted file mode 100644 index 7cf675580f..0000000000 --- a/submodules/Opus/Public/opus/opus_types.h +++ /dev/null @@ -1,166 +0,0 @@ -/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ -/* Modified by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* opus_types.h based on ogg_types.h from libogg */ - -/** - @file opus_types.h - @brief Opus reference implementation types -*/ -#ifndef OPUS_TYPES_H -#define OPUS_TYPES_H - -#define opus_int int /* used for counters etc; at least 16 bits */ -#define opus_int64 long long -#define opus_int8 signed char - -#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ -#define opus_uint64 unsigned long long -#define opus_uint8 unsigned char - -/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ -#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) -#include -# undef opus_int64 -# undef opus_int8 -# undef opus_uint64 -# undef opus_uint8 - typedef int8_t opus_int8; - typedef uint8_t opus_uint8; - typedef int16_t opus_int16; - typedef uint16_t opus_uint16; - typedef int32_t opus_int32; - typedef uint32_t opus_uint32; - typedef int64_t opus_int64; - typedef uint64_t opus_uint64; -#elif defined(_WIN32) - -# if defined(__CYGWIN__) -# include <_G_config.h> - typedef _G_int32_t opus_int32; - typedef _G_uint32_t opus_uint32; - typedef _G_int16 opus_int16; - typedef _G_uint16 opus_uint16; -# elif defined(__MINGW32__) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; -# elif defined(__MWERKS__) - typedef int opus_int32; - typedef unsigned int opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; -# else - /* MSVC/Borland */ - typedef __int32 opus_int32; - typedef unsigned __int32 opus_uint32; - typedef __int16 opus_int16; - typedef unsigned __int16 opus_uint16; -# endif - -#elif defined(__MACOS__) - -# include - typedef SInt16 opus_int16; - typedef UInt16 opus_uint16; - typedef SInt32 opus_int32; - typedef UInt32 opus_uint32; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include - typedef int16_t opus_int16; - typedef u_int16_t opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined(__BEOS__) - - /* Be */ -# include - typedef int16 opus_int16; - typedef u_int16 opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(R5900) - - /* PS2 EE */ - typedef int opus_int32; - typedef unsigned opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short opus_int16; - typedef unsigned short opus_uint16; - typedef signed int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef long opus_int32; - typedef unsigned long opus_uint32; - -#elif defined(CONFIG_TI_C6X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#else - - /* Give up, take a reasonable guess */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#endif - -#endif /* OPUS_TYPES_H */ diff --git a/submodules/Opus/Sources/opus/lib/libopus.a b/submodules/Opus/Sources/opus/lib/libopus.a deleted file mode 100644 index 01624b7a6c..0000000000 Binary files a/submodules/Opus/Sources/opus/lib/libopus.a and /dev/null differ diff --git a/submodules/OpusBinding/BUCK b/submodules/OpusBinding/BUCK deleted file mode 100644 index 165c852e46..0000000000 --- a/submodules/OpusBinding/BUCK +++ /dev/null @@ -1,32 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "OpusBinding", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.c", - ]), - headers = { - "ogg/ogg.h": "Sources/ogg/ogg.h", - "ogg/os_types.h": "Sources/ogg/os_types.h", - "OggOpusReader.h": "PublicHeaders/OpusBinding/OggOpusReader.h", - "TGDataItem.h": "PublicHeaders/OpusBinding/TGDataItem.h", - "TGOggOpusWriter.h": "PublicHeaders/OpusBinding/TGOggOpusWriter.h", - "opusenc/diag_range.h": "Sources/opusenc/diag_range.h", - "opusenc/opus_header.h": "Sources/opusenc/opus_header.h", - "opusenc/picture.h": "Sources/opusenc/picture.h", - "opusenc/wav_io.h": "Sources/opusenc/wav_io.h", - "opusfile/internal.h": "Sources/opusfile/internal.h", - "OpusBinding/opusfile.h": "Sources/opusfile/opusfile.h", - }, - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/Opus:opus", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/OpusBinding/BUILD b/submodules/OpusBinding/BUILD index 4fe2766388..f65be5a84a 100644 --- a/submodules/OpusBinding/BUILD +++ b/submodules/OpusBinding/BUILD @@ -20,7 +20,7 @@ objc_library( "-I{}/PublicHeaders/OpusBinding".format(package_name()), ], deps = [ - "//submodules/Opus:opus", + "//third-party/opus:opus", ], sdk_frameworks = [ "Foundation", diff --git a/submodules/OverlayStatusController/BUCK b/submodules/OverlayStatusController/BUCK deleted file mode 100644 index 4345130a54..0000000000 --- a/submodules/OverlayStatusController/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -apple_resource( - name = "OverlayStatusControllerResources", - files = glob([ - "Resources/**/*", - ], exclude = ["Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -static_library( - name = "OverlayStatusController", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/OverlayStatusController/Impl:OverlayStatusControllerImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/OverlayStatusController/Impl/BUCK b/submodules/OverlayStatusController/Impl/BUCK deleted file mode 100644 index a6b891f28b..0000000000 --- a/submodules/OverlayStatusController/Impl/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "OverlayStatusControllerImpl", - srcs = glob([ - "Sources/**/*.m", - ]), - exported_headers = glob([ - "Sources/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PKCS/BUCK b/submodules/PKCS/BUCK deleted file mode 100644 index e30546631f..0000000000 --- a/submodules/PKCS/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PKCS", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/openssl:openssl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/PasscodeInputFieldNode/BUCK b/submodules/PasscodeInputFieldNode/BUCK deleted file mode 100644 index 980622a33b..0000000000 --- a/submodules/PasscodeInputFieldNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PasscodeInputFieldNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PasscodeUI/BUCK b/submodules/PasscodeUI/BUCK deleted file mode 100644 index 4ef81d0bff..0000000000 --- a/submodules/PasscodeUI/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PasscodeUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/LocalAuth:LocalAuth", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/ImageBlur:ImageBlur", - "//submodules/AppBundle:AppBundle", - "//submodules/PasscodeInputFieldNode:PasscodeInputFieldNode", - "//submodules/MonotonicTime:MonotonicTime", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PassportUI/BUCK b/submodules/PassportUI/BUCK deleted file mode 100644 index a6d147e4f9..0000000000 --- a/submodules/PassportUI/BUCK +++ /dev/null @@ -1,34 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PassportUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/PhoneInputNode:PhoneInputNode", - "//submodules/CountrySelectionUI:CountrySelectionUI", - "//submodules/GalleryUI:GalleryUI", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/LegacyUI:LegacyUI", - "//submodules/ImageCompression:ImageCompression", - "//submodules/DateSelectionUI:DateSelectionUI", - "//submodules/PasswordSetupUI:PasswordSetupUI", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/Markdown:Markdown", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PasswordSetupUI/BUCK b/submodules/PasswordSetupUI/BUCK deleted file mode 100644 index d71e12400b..0000000000 --- a/submodules/PasswordSetupUI/BUCK +++ /dev/null @@ -1,51 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -apple_resource( - name = "PasswordSetupUIResources", - files = glob([ - "Resources/**/*", - ], exclude = ["Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -apple_asset_catalog( - name = "PasswordSetupUIAssets", - dirs = [ - "PasswordSetupUIImages.xcassets", - ], - visibility = ["PUBLIC"], -) - -static_library( - name = "PasswordSetupUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ProgressNavigationButtonNode:ProgressNavigationButtonNode", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/AppBundle:AppBundle", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/rlottie:RLottieBinding", - "//submodules/ManagedAnimationNode:ManagedAnimationNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/CoreLocation.framework", - "$SDKROOT/System/Library/Frameworks/MapKit.framework", - ], -) diff --git a/submodules/Pdf/BUCK b/submodules/Pdf/BUCK deleted file mode 100644 index ee8b2ebc72..0000000000 --- a/submodules/Pdf/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Pdf", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PeerAvatarGalleryUI/BUCK b/submodules/PeerAvatarGalleryUI/BUCK deleted file mode 100644 index e0a9dd6fcb..0000000000 --- a/submodules/PeerAvatarGalleryUI/BUCK +++ /dev/null @@ -1,36 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeerAvatarGalleryUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/GalleryUI:GalleryUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/PhotoResources:PhotoResources", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/ShareController:ShareController", - "//submodules/AppBundle:AppBundle", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LegacyMediaPickerUI:LegacyMediaPickerUI", - "//submodules/SaveToCameraRoll:SaveToCameraRoll", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/QuickLook.framework", - ], - weak_frameworks = [ - "Photos", - ], -) diff --git a/submodules/PeerInfoUI/BUCK b/submodules/PeerInfoUI/BUCK deleted file mode 100644 index 1372054787..0000000000 --- a/submodules/PeerInfoUI/BUCK +++ /dev/null @@ -1,77 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeerInfoUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/ItemListAvatarAndNameInfoItem:ItemListAvatarAndNameInfoItem", - "//submodules/UndoUI:UndoUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/TemporaryCachedPeerDataManager:TemporaryCachedPeerDataManager", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/ItemListPeerActionItem:ItemListPeerActionItem", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/SearchUI:SearchUI", - "//submodules/MergeLists:MergeLists", - "//submodules/TextFormat:TextFormat", - "//submodules/LegacyUI:LegacyUI", - "//submodules/GalleryUI:GalleryUI", - "//submodules/ShareController:ShareController", - "//submodules/WebSearchUI:WebSearchUI", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/ContactsPeerItem:ContactsPeerItem", - "//submodules/PasswordSetupUI:PasswordSetupUI", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/TelegramPermissionsUI:TelegramPermissionsUI", - "//submodules/ProgressNavigationButtonNode:ProgressNavigationButtonNode", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/PhotoResources:PhotoResources", - "//submodules/MediaResources:MediaResources", - "//submodules/LocationResources:LocationResources", - "//submodules/Geocoding:Geocoding", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LocationUI:LocationUI", - "//submodules/StickerResources:StickerResources", - "//submodules/StickerPackPreviewUI:StickerPackPreviewUI", - "//submodules/PeerAvatarGalleryUI:PeerAvatarGalleryUI", - "//submodules/Emoji:Emoji", - "//submodules/ItemListStickerPackItem:ItemListStickerPackItem", - "//submodules/NotificationMuteSettingsUI:NotificationMuteSettingsUI", - "//submodules/SinglePhoneInputNode:SinglePhoneInputNode", - "//submodules/MapResourceToAvatarSizes:MapResourceToAvatarSizes", - "//submodules/NotificationSoundSelectionUI:NotificationSoundSelectionUI", - "//submodules/EncryptionKeyVisualization:EncryptionKeyVisualization", - "//submodules/ItemListAddressItem:ItemListAddressItem", - "//submodules/ContactListUI:ContactListUI", - "//submodules/ContextUI:ContextUI", - "//submodules/AppBundle:AppBundle", - "//submodules/Markdown:Markdown", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/TelegramIntents:TelegramIntents", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/StatisticsUI:StatisticsUI", - "//submodules/ChatListFilterSettingsHeaderItem:ChatListFilterSettingsHeaderItem", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MessageUI.framework", - "$SDKROOT/System/Library/Frameworks/WebKit.framework", - "$SDKROOT/System/Library/Frameworks/SafariServices.framework", - ], -) diff --git a/submodules/PeerOnlineMarkerNode/BUCK b/submodules/PeerOnlineMarkerNode/BUCK deleted file mode 100644 index b66a884732..0000000000 --- a/submodules/PeerOnlineMarkerNode/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeerOnlineMarkerNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PeerPresenceStatusManager/BUCK b/submodules/PeerPresenceStatusManager/BUCK deleted file mode 100644 index 9c0b44b7ea..0000000000 --- a/submodules/PeerPresenceStatusManager/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeerPresenceStatusManager", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/PeersNearbyIconNode/BUCK b/submodules/PeersNearbyIconNode/BUCK deleted file mode 100644 index fc85af9a70..0000000000 --- a/submodules/PeersNearbyIconNode/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeersNearbyIconNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PeersNearbyUI/BUCK b/submodules/PeersNearbyUI/BUCK deleted file mode 100644 index b8e216e8a7..0000000000 --- a/submodules/PeersNearbyUI/BUCK +++ /dev/null @@ -1,38 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PeersNearbyUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/ItemListUI:ItemListUI", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/DeviceLocationManager:DeviceLocationManager", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/TelegramPermissionsUI:TelegramPermissionsUI", - "//submodules/ItemListPeerActionItem:ItemListPeerActionItem", - "//submodules/PeersNearbyIconNode:PeersNearbyIconNode", - "//submodules/Geocoding:Geocoding", - "//submodules/AppBundle:AppBundle", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/TelegramNotices:TelegramNotices", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MapKit.framework", - ], -) diff --git a/submodules/PersistentStringHash/BUCK b/submodules/PersistentStringHash/BUCK deleted file mode 100644 index 1774e12b5b..0000000000 --- a/submodules/PersistentStringHash/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PersistentStringHash", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/PhoneInputNode/BUCK b/submodules/PhoneInputNode/BUCK deleted file mode 100644 index 0f44d274af..0000000000 --- a/submodules/PhoneInputNode/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PhoneInputNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/PhoneNumberFormat/BUCK b/submodules/PhoneNumberFormat/BUCK deleted file mode 100644 index 29b61419da..0000000000 --- a/submodules/PhoneNumberFormat/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PhoneNumberFormat", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/libphonenumber:libphonenumber", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/PhotoResources/BUCK b/submodules/PhotoResources/BUCK deleted file mode 100644 index 5cf1d06502..0000000000 --- a/submodules/PhotoResources/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PhotoResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/ImageTransparency:ImageTransparency", - "//submodules/TinyThumbnail:TinyThumbnail", - "//submodules/ImageBlur:ImageBlur", - "//submodules/Tuples:Tuples", - "//submodules/AccountContext:AccountContext", - "//submodules/MediaResources:MediaResources", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/WebPBinding:WebPBinding", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/ImageIO.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/PlatformRestrictionMatching/BUCK b/submodules/PlatformRestrictionMatching/BUCK deleted file mode 100644 index 61d8d39123..0000000000 --- a/submodules/PlatformRestrictionMatching/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PlatformRestrictionMatching", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Postbox/BUCK b/submodules/Postbox/BUCK deleted file mode 100644 index cdfea7881a..0000000000 --- a/submodules/Postbox/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "Postbox", - srcs = glob([ - "Sources/*.swift", - ]), - deps = [ - "//submodules/Crc32:Crc32", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/sqlcipher:sqlcipher", - "//submodules/MurMurHash32:MurMurHash32", - "//submodules/StringTransliteration:StringTransliteration", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/Security.framework", - ], -) diff --git a/submodules/PresentationDataUtils/BUCK b/submodules/PresentationDataUtils/BUCK deleted file mode 100644 index 84fa4c2fdc..0000000000 --- a/submodules/PresentationDataUtils/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "PresentationDataUtils", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AlertUI:AlertUI", - "//submodules/ItemListUI:ItemListUI", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/UrlWhitelist:UrlWhitelist", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ProgressNavigationButtonNode/BUCK b/submodules/ProgressNavigationButtonNode/BUCK deleted file mode 100644 index d4d1b91f29..0000000000 --- a/submodules/ProgressNavigationButtonNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ProgressNavigationButtonNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/ActivityIndicator:ActivityIndicator", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/QrCode/BUCK b/submodules/QrCode/BUCK deleted file mode 100644 index 1661dd7beb..0000000000 --- a/submodules/QrCode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "QrCode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/CoreImage.framework", - ], -) diff --git a/submodules/RMIntro/BUCK b/submodules/RMIntro/BUCK deleted file mode 100644 index b69acbdcdb..0000000000 --- a/submodules/RMIntro/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "RMIntro", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.c", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m b/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m index 0341e55f4d..e45854cf61 100644 --- a/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m +++ b/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m @@ -236,6 +236,10 @@ static void TGDispatchOnMainThread(dispatch_block_t block) { - (void)loadGL { +#if TARGET_OS_SIMULATOR && defined(__aarch64__) + return; +#endif + if (/*[[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground*/true && !_isOpenGLLoaded) { context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; diff --git a/submodules/RadialStatusNode/BUCK b/submodules/RadialStatusNode/BUCK deleted file mode 100644 index c16bac1717..0000000000 --- a/submodules/RadialStatusNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "RadialStatusNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/RaiseToListen/BUCK b/submodules/RaiseToListen/BUCK deleted file mode 100644 index ae88e727e0..0000000000 --- a/submodules/RaiseToListen/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "RaiseToListen", - srcs = glob([ - "Sources/*.swift", - ]), - deps = [ - "//submodules/RaiseToListen/Impl:RaiseToListenImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/RaiseToListen/Impl/BUCK b/submodules/RaiseToListen/Impl/BUCK deleted file mode 100644 index 93e01caeeb..0000000000 --- a/submodules/RaiseToListen/Impl/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "RaiseToListenImpl", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/DeviceProximity:DeviceProximity", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Reachability/BUCK b/submodules/Reachability/BUCK deleted file mode 100644 index 341dbb890f..0000000000 --- a/submodules/Reachability/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Reachability", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/SystemConfiguration.framework", - ], -) diff --git a/submodules/ReactionSelectionNode/BUCK b/submodules/ReactionSelectionNode/BUCK deleted file mode 100644 index 2ba94127f9..0000000000 --- a/submodules/ReactionSelectionNode/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ReactionSelectionNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/RingBuffer/BUCK b/submodules/RingBuffer/BUCK deleted file mode 100644 index 8896626f86..0000000000 --- a/submodules/RingBuffer/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "RingBuffer", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/SSignalKit/SSignalKit/BUCK b/submodules/SSignalKit/SSignalKit/BUCK deleted file mode 100644 index 1fbeb1d9b4..0000000000 --- a/submodules/SSignalKit/SSignalKit/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SSignalKit", - srcs = glob([ - "Source/SSignalKit/*.m", - ]), - exported_headers = glob([ - "Source/SSignalKit/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/SSignalKit/SwiftSignalKit/BUCK b/submodules/SSignalKit/SwiftSignalKit/BUCK deleted file mode 100644 index b6e6e39b8c..0000000000 --- a/submodules/SSignalKit/SwiftSignalKit/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "SwiftSignalKit", - srcs = glob([ - "Source/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/SaveToCameraRoll/BUCK b/submodules/SaveToCameraRoll/BUCK deleted file mode 100644 index b75130a540..0000000000 --- a/submodules/SaveToCameraRoll/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SaveToCameraRoll", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Display:Display#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/DeviceAccess:DeviceAccess", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework", - ], - weak_frameworks = [ - "Photos", - ], -) diff --git a/submodules/ScreenCaptureDetection/BUCK b/submodules/ScreenCaptureDetection/BUCK deleted file mode 100644 index 4a993a81a1..0000000000 --- a/submodules/ScreenCaptureDetection/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ScreenCaptureDetection", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SearchBarNode/BUCK b/submodules/SearchBarNode/BUCK deleted file mode 100644 index b84e9214e4..0000000000 --- a/submodules/SearchBarNode/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SearchBarNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SearchPeerMembers/BUCK b/submodules/SearchPeerMembers/BUCK deleted file mode 100644 index 5c92914c2f..0000000000 --- a/submodules/SearchPeerMembers/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SearchPeerMembers", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/SearchUI/BUCK b/submodules/SearchUI/BUCK deleted file mode 100644 index ac67194edf..0000000000 --- a/submodules/SearchUI/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SearchUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/ChatListSearchItemNode:ChatListSearchItemNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SegmentedControlNode/BUCK b/submodules/SegmentedControlNode/BUCK deleted file mode 100644 index f5b679832c..0000000000 --- a/submodules/SegmentedControlNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SegmentedControlNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SelectablePeerNode/BUCK b/submodules/SelectablePeerNode/BUCK deleted file mode 100644 index c8179d3371..0000000000 --- a/submodules/SelectablePeerNode/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SelectablePeerNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/PeerOnlineMarkerNode:PeerOnlineMarkerNode", - "//submodules/AvatarNode:AvatarNode", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/ContextUI:ContextUI", - "//submodules/LocalizedPeerData:LocalizedPeerData", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SemanticStatusNode/BUCK b/submodules/SemanticStatusNode/BUCK deleted file mode 100644 index f2874d0b0a..0000000000 --- a/submodules/SemanticStatusNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SemanticStatusNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Display:Display#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SettingsUI/BUCK b/submodules/SettingsUI/BUCK deleted file mode 100644 index a60dc14f82..0000000000 --- a/submodules/SettingsUI/BUCK +++ /dev/null @@ -1,101 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SettingsUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/AvatarNode:AvatarNode", - "//submodules/CallListUI:CallListUI", - "//submodules/ChatListSearchItemNode:ChatListSearchItemNode", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/ChatListUI:ChatListUI", - "//submodules/ContactsPeerItem:ContactsPeerItem", - "//submodules/CountrySelectionUI:CountrySelectionUI", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/DeviceLocationManager:DeviceLocationManager", - "//submodules/GalleryUI:GalleryUI", - "//submodules/Geocoding:Geocoding", - "//submodules/ItemListUI:ItemListUI", - "//submodules/ItemListStickerPackItem:ItemListStickerPackItem", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/ItemListPeerActionItem:ItemListPeerActionItem", - "//submodules/ItemListAvatarAndNameInfoItem:ItemListAvatarAndNameInfoItem", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LegacyUI:LegacyUI", - "//submodules/LegacyMediaPickerUI:LegacyMediaPickerUI", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/LocalMediaResources:LocalMediaResources", - "//submodules/LocalizedPeerData:LocalizedPeerData", - "//submodules/LocalAuth:LocalAuth", - "//submodules/MapResourceToAvatarSizes:MapResourceToAvatarSizes", - "//submodules/MediaResources:MediaResources", - "//submodules/MergeLists:MergeLists", - "//submodules/NotificationSoundSelectionUI:NotificationSoundSelectionUI", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/PasswordSetupUI:PasswordSetupUI", - "//submodules/PassportUI:PassportUI", - "//submodules/PasscodeUI:PasscodeUI", - "//submodules/PeerAvatarGalleryUI:PeerAvatarGalleryUI", - "//submodules/PhoneInputNode:PhoneInputNode", - "//submodules/PhotoResources:PhotoResources", - "//submodules/ProgressNavigationButtonNode:ProgressNavigationButtonNode", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/SearchUI:SearchUI", - "//submodules/ShareController:ShareController", - "//submodules/StickerPackPreviewUI:StickerPackPreviewUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/TelegramCallsUI:TelegramCallsUI", - "//submodules/TextFormat:TextFormat", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/UrlEscaping:UrlEscaping", - "//submodules/WebSearchUI:WebSearchUI", - "//submodules/UrlHandling:UrlHandling", - "//submodules/HexColor:HexColor", - "//submodules/QrCode:QrCode", - "//submodules/WallpaperResources:WallpaperResources", - "//submodules/AuthorizationUI:AuthorizationUI", - "//submodules/InstantPageUI:InstantPageUI", - "//submodules/CheckNode:CheckNode", - "//submodules/CounterContollerTitleView:CounterContollerTitleView", - "//submodules/GridMessageSelectionNode:GridMessageSelectionNode", - "//submodules/InstantPageCache:InstantPageCache", - "//submodules/AppBundle:AppBundle", - "//submodules/ContextUI:ContextUI", - #"//submodules/WalletUI:WalletUI", - "//submodules/Markdown:Markdown", - "//submodules/UndoUI:UndoUI", - "//submodules/DeleteChatPeerActionSheetItem:DeleteChatPeerActionSheetItem", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/OpenInExternalAppUI:OpenInExternalAppUI", - "//submodules/AccountUtils:AccountUtils", - "//submodules/AuthTransferUI:AuthTransferUI", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MessageUI.framework", - "$SDKROOT/System/Library/Frameworks/LocalAuthentication.framework", - "$SDKROOT/System/Library/Frameworks/QuickLook.framework", - "$SDKROOT/System/Library/Frameworks/CoreTelephony.framework", - ], - weak_frameworks = [ - "Photos", - ], -) diff --git a/submodules/ShareController/BUCK b/submodules/ShareController/BUCK deleted file mode 100644 index 64238e15fe..0000000000 --- a/submodules/ShareController/BUCK +++ /dev/null @@ -1,33 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ShareController", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/SaveToCameraRoll:SaveToCameraRoll", - "//submodules/StickerResources:StickerResources", - "//submodules/UrlEscaping:UrlEscaping", - "//submodules/LocalizedPeerData:LocalizedPeerData", - "//submodules/ActionSheetPeerItem:ActionSheetPeerItem", - "//submodules/ChatListSearchRecentPeersNode:ChatListSearchRecentPeersNode", - "//submodules/PeerPresenceStatusManager:PeerPresenceStatusManager", - "//submodules/SelectablePeerNode:SelectablePeerNode", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/AppBundle:AppBundle", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/TelegramIntents:TelegramIntents", - "//submodules/AccountContext:AccountContext", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ShareItems/BUCK b/submodules/ShareItems/BUCK deleted file mode 100644 index 0787170e22..0000000000 --- a/submodules/ShareItems/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ShareItems", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/Display:Display#shared", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LocalMediaResources:LocalMediaResources", - "//submodules/Pdf:Pdf", - "//submodules/AccountContext:AccountContext", - "//submodules/MimeTypes:MimeTypes", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/ShareItems/Impl:ShareItemsImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/ShareItems/Impl/BUCK b/submodules/ShareItems/Impl/BUCK deleted file mode 100644 index 54d762b8e8..0000000000 --- a/submodules/ShareItems/Impl/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ShareItemsImpl", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/MimeTypes:MimeTypes", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework", - "$SDKROOT/System/Library/Frameworks/AddressBook.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - "$SDKROOT/System/Library/Frameworks/PassKit.framework", - ], -) diff --git a/submodules/ShimmerEffect/BUCK b/submodules/ShimmerEffect/BUCK deleted file mode 100644 index 0b768d1ef4..0000000000 --- a/submodules/ShimmerEffect/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "ShimmerEffect", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SinglePhoneInputNode/BUCK b/submodules/SinglePhoneInputNode/BUCK deleted file mode 100644 index 6b4f664937..0000000000 --- a/submodules/SinglePhoneInputNode/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SinglePhoneInputNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SlotMachineAnimationNode/BUCK b/submodules/SlotMachineAnimationNode/BUCK deleted file mode 100644 index 12c1e43148..0000000000 --- a/submodules/SlotMachineAnimationNode/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SlotMachineAnimationNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/StickerResources:StickerResources", - "//submodules/ManagedAnimationNode:ManagedAnimationNode", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SolidRoundedButtonNode/BUCK b/submodules/SolidRoundedButtonNode/BUCK deleted file mode 100644 index 3ef457d48d..0000000000 --- a/submodules/SolidRoundedButtonNode/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SolidRoundedButtonNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SpotlightSupport/BUCK b/submodules/SpotlightSupport/BUCK deleted file mode 100644 index abda309429..0000000000 --- a/submodules/SpotlightSupport/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "SpotlightSupport", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/CoreSpotlight.framework", - ], -) diff --git a/submodules/StatisticsUI/BUCK b/submodules/StatisticsUI/BUCK deleted file mode 100644 index 82d042bcb2..0000000000 --- a/submodules/StatisticsUI/BUCK +++ /dev/null @@ -1,35 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "StatisticsUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/ItemListUI:ItemListUI", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/MergeLists:MergeLists", - "//submodules/PhotoResources:PhotoResources", - "//submodules/GraphCore:GraphCore", - "//submodules/GraphUI:GraphUI", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/ItemListPeerActionItem:ItemListPeerActionItem", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/StickerPackPreviewUI/BUCK b/submodules/StickerPackPreviewUI/BUCK deleted file mode 100644 index b24e205b94..0000000000 --- a/submodules/StickerPackPreviewUI/BUCK +++ /dev/null @@ -1,34 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "StickerPackPreviewUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/ShareController:ShareController", - "//submodules/StickerResources:StickerResources", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/TextFormat:TextFormat", - "//submodules/MergeLists:MergeLists", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/ArchivedStickerPacksNotice:ArchivedStickerPacksNotice", - "//submodules/ShimmerEffect:ShimmerEffect", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/StickerResources/BUCK b/submodules/StickerResources/BUCK deleted file mode 100644 index d832be586d..0000000000 --- a/submodules/StickerResources/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "StickerResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/ImageBlur:ImageBlur", - "//submodules/Tuples:Tuples", - "//submodules/MediaResources:MediaResources", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/WebPBinding:WebPBinding", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/StringPluralization/BUCK b/submodules/StringPluralization/BUCK deleted file mode 100644 index 74014a41d7..0000000000 --- a/submodules/StringPluralization/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "StringPluralization", - srcs = glob([ - "Sources/**/*.swift", - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "Sources/*.h", - ]), - deps = [ - "//submodules/AppBundle:AppBundle", - "//submodules/NumberPluralizationForm:NumberPluralizationForm", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/StringTransliteration/BUCK b/submodules/StringTransliteration/BUCK deleted file mode 100644 index a1ce2b1f75..0000000000 --- a/submodules/StringTransliteration/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "StringTransliteration", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Stripe/BUCK b/submodules/Stripe/BUCK deleted file mode 100644 index d2fcfd3501..0000000000 --- a/submodules/Stripe/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Stripe", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Sunrise/BUCK b/submodules/Sunrise/BUCK deleted file mode 100644 index 9c9d4a0fce..0000000000 --- a/submodules/Sunrise/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Sunrise", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/Svg/BUCK b/submodules/Svg/BUCK deleted file mode 100644 index a3a62ebc99..0000000000 --- a/submodules/Svg/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Svg", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.mm", - "Sources/**/*.c", - "Sources/**/*.cpp", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), -) diff --git a/submodules/SwipeToDismissGesture/BUCK b/submodules/SwipeToDismissGesture/BUCK deleted file mode 100644 index 301beb14e2..0000000000 --- a/submodules/SwipeToDismissGesture/BUCK +++ /dev/null @@ -1,12 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SwipeToDismissGesture", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SwitchNode/BUCK b/submodules/SwitchNode/BUCK deleted file mode 100644 index bf28484904..0000000000 --- a/submodules/SwitchNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "SwitchNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/LegacyComponents:LegacyComponents", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/SyncCore/BUCK b/submodules/SyncCore/BUCK deleted file mode 100644 index 7236134381..0000000000 --- a/submodules/SyncCore/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "SyncCore", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramAnimatedStickerNode/BUCK b/submodules/TelegramAnimatedStickerNode/BUCK deleted file mode 100644 index efb6000d45..0000000000 --- a/submodules/TelegramAnimatedStickerNode/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramAnimatedStickerNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/StickerResources:StickerResources", - "//submodules/MediaResources:MediaResources", - "//submodules/Tuples:Tuples", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/rlottie:RLottieBinding", - "//submodules/YuvConversion:YuvConversion", - "//submodules/GZip:GZip", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework", - ], -) diff --git a/submodules/TelegramApi/BUCK b/submodules/TelegramApi/BUCK deleted file mode 100644 index 31294125b4..0000000000 --- a/submodules/TelegramApi/BUCK +++ /dev/null @@ -1,13 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "TelegramApi", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramAudio/BUCK b/submodules/TelegramAudio/BUCK deleted file mode 100644 index cbe05806ce..0000000000 --- a/submodules/TelegramAudio/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramAudio", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramBaseController/BUCK b/submodules/TelegramBaseController/BUCK deleted file mode 100644 index 330f4ac86a..0000000000 --- a/submodules/TelegramBaseController/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramBaseController", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AvatarNode:AvatarNode", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/LiveLocationTimerNode:LiveLocationTimerNode", - "//submodules/AccountContext:AccountContext", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/Markdown:Markdown", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TelegramCallsUI/BUCK b/submodules/TelegramCallsUI/BUCK deleted file mode 100644 index 618ee191c6..0000000000 --- a/submodules/TelegramCallsUI/BUCK +++ /dev/null @@ -1,31 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramCallsUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/PhotoResources:PhotoResources", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/TelegramAudio:TelegramAudio", - "//submodules/TelegramVoip:TelegramVoip", - "//submodules/ItemListUI:ItemListUI", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/TelegramCallsUI/CallsEmoji:CallsEmoji", - "//submodules/SemanticStatusNode:SemanticStatusNode", - "//submodules/TooltipUI:TooltipUI", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TelegramCallsUI/CallsEmoji/BUCK b/submodules/TelegramCallsUI/CallsEmoji/BUCK deleted file mode 100644 index 7ccbc5c193..0000000000 --- a/submodules/TelegramCallsUI/CallsEmoji/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "CallsEmoji", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramCore/BUCK b/submodules/TelegramCore/BUCK deleted file mode 100644 index c54f8b3bd5..0000000000 --- a/submodules/TelegramCore/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -framework( - name = "TelegramCore", - srcs = glob([ - "Sources/*.swift", - ]), - deps = [ - "//submodules/TelegramApi:TelegramApi#shared", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/CloudData:CloudData", - "//submodules/EncryptionProvider:EncryptionProvider", - "//submodules/CryptoUtils:CryptoUtils", - "//submodules/NetworkLogging:NetworkLogging", - "//submodules/Reachability:Reachability", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramCore/Sources/InvitationLinks.swift b/submodules/TelegramCore/Sources/InvitationLinks.swift index 516ba47d0b..00de49bdd1 100644 --- a/submodules/TelegramCore/Sources/InvitationLinks.swift +++ b/submodules/TelegramCore/Sources/InvitationLinks.swift @@ -6,8 +6,8 @@ import MtProtoKit import SyncCore -public func ensuredExistingPeerExportedInvitation(account: Account, peerId: PeerId, revokeExisted: Bool = false) -> Signal { - return account.postbox.transaction { transaction -> Signal in +public func ensuredExistingPeerExportedInvitation(account: Account, peerId: PeerId, revokeExisted: Bool = false) -> Signal { + return account.postbox.transaction { transaction -> Signal in if let peer = transaction.getPeer(peerId), let inputPeer = apiInputPeer(peer) { if let _ = peer as? TelegramChannel { if let cachedData = transaction.getPeerCachedData(peerId: peerId) as? CachedChannelData, cachedData.exportedInvitation != nil && !revokeExisted { @@ -15,8 +15,8 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer } else { return account.network.request(Api.functions.messages.exportChatInvite(peer: inputPeer)) |> retryRequest - |> mapToSignal { result -> Signal in - return account.postbox.transaction { transaction -> Void in + |> mapToSignal { result -> Signal in + return account.postbox.transaction { transaction -> String? in if let invitation = ExportedInvitation(apiExportedInvite: result) { transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in if let current = current as? CachedChannelData { @@ -25,6 +25,9 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer return CachedChannelData().withUpdatedExportedInvitation(invitation) } }) + return invitation.link + } else { + return nil } } } @@ -35,8 +38,8 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer } else { return account.network.request(Api.functions.messages.exportChatInvite(peer: inputPeer)) |> retryRequest - |> mapToSignal { result -> Signal in - return account.postbox.transaction { transaction -> Void in + |> mapToSignal { result -> Signal in + return account.postbox.transaction { transaction -> String? in if let invitation = ExportedInvitation(apiExportedInvite: result) { transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in if let current = current as? CachedGroupData { @@ -45,6 +48,9 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer return current } }) + return invitation.link + } else { + return nil } } } diff --git a/submodules/TelegramIntents/BUCK b/submodules/TelegramIntents/BUCK deleted file mode 100644 index 0c6544dc69..0000000000 --- a/submodules/TelegramIntents/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramIntents", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AvatarNode:AvatarNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], - weak_frameworks = [ - "Intents", - ], -) diff --git a/submodules/TelegramNotices/BUCK b/submodules/TelegramNotices/BUCK deleted file mode 100644 index 7341e6b408..0000000000 --- a/submodules/TelegramNotices/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramNotices", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramPermissions:TelegramPermissions", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramPermissions/BUCK b/submodules/TelegramPermissions/BUCK deleted file mode 100644 index f7f575af60..0000000000 --- a/submodules/TelegramPermissions/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramPermissions", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/DeviceAccess:DeviceAccess", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramPermissionsUI/BUCK b/submodules/TelegramPermissionsUI/BUCK deleted file mode 100644 index 291a9e9997..0000000000 --- a/submodules/TelegramPermissionsUI/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramPermissionsUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/TextFormat:TextFormat", - "//submodules/Markdown:Markdown", - "//submodules/TelegramPermissions:TelegramPermissions", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/PeersNearbyIconNode:PeersNearbyIconNode", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TelegramPresentationData/BUCK b/submodules/TelegramPresentationData/BUCK deleted file mode 100644 index 9d32fb134e..0000000000 --- a/submodules/TelegramPresentationData/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramPresentationData", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/Display:Display#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/MediaResources:MediaResources", - "//submodules/AppBundle:AppBundle", - "//submodules/StringPluralization:StringPluralization", - "//submodules/Sunrise:Sunrise", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TelegramStringFormatting/BUCK b/submodules/TelegramStringFormatting/BUCK deleted file mode 100644 index 8d7de8961a..0000000000 --- a/submodules/TelegramStringFormatting/BUCK +++ /dev/null @@ -1,25 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramStringFormatting", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/Display:Display#shared", - "//submodules/PlatformRestrictionMatching:PlatformRestrictionMatching", - "//submodules/LocalizedPeerData:LocalizedPeerData", - "//submodules/TextFormat:TextFormat", - "//submodules/Markdown:Markdown", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/MapKit.framework", - ], -) diff --git a/submodules/TelegramUI/BUCK b/submodules/TelegramUI/BUCK deleted file mode 100644 index 8831168ba1..0000000000 --- a/submodules/TelegramUI/BUCK +++ /dev/null @@ -1,231 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "framework") - -apple_asset_catalog( - name = 'TelegramUIAssets', - dirs = [ - "Images.xcassets", - ], - visibility = ["PUBLIC"], -) - -apple_resource( - name = "TelegramUIResources", - files = glob([ - "Sounds/**/*", - "Resources/**/*", - ], exclude = ["Sounds/**/.*", "Resources/**/.*"]), - visibility = ["PUBLIC"], -) - -framework( - name = "TelegramUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/SSignalKit/SSignalKit:SSignalKit", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/TgVoip:TgVoip", - "//submodules/lottie-ios:Lottie", - "//submodules/FFMpegBinding:FFMpegBinding", - "//submodules/WebPBinding:WebPBinding", - "//submodules/RMIntro:RMIntro", - "//submodules/GZip:GZip", - "//submodules/TelegramCallsUI:TelegramCallsUI", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/TelegramVoip:TelegramVoip", - "//submodules/DeviceAccess:DeviceAccess", - "//submodules/WatchCommon/Host:WatchCommon", - "//submodules/LightweightAccountData:LightweightAccountData", - "//submodules/BuildConfig:BuildConfig", - "//submodules/BuildConfigExtra:BuildConfigExtra", - "//submodules/rlottie:RLottieBinding", - "//submodules/TelegramUpdateUI:TelegramUpdateUI", - "//submodules/MergeLists:MergeLists", - "//submodules/ActivityIndicator:ActivityIndicator", - "//submodules/ProgressNavigationButtonNode:ProgressNavigationButtonNode", - "//submodules/ItemListUI:ItemListUI", - "//submodules/TelegramBaseController:TelegramBaseController", - "//submodules/DeviceLocationManager:DeviceLocationManager", - "//submodules/AvatarNode:AvatarNode", - "//submodules/OverlayStatusController:OverlayStatusController", - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/LiveLocationManager:LiveLocationManager", - "//submodules/LiveLocationTimerNode:LiveLocationTimerNode", - "//submodules/TemporaryCachedPeerDataManager:TemporaryCachedPeerDataManager", - "//submodules/ShareController:ShareController", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/PeerOnlineMarkerNode:PeerOnlineMarkerNode", - "//submodules/PeerPresenceStatusManager:PeerPresenceStatusManager", - "//submodules/ChatListSearchRecentPeersNode:ChatListSearchRecentPeersNode", - "//submodules/ImageBlur:ImageBlur", - "//submodules/ContextUI:ContextUI", - "//submodules/MediaResources:MediaResources", - "//submodules/TelegramAudio:TelegramAudio", - "//submodules/UrlEscaping:UrlEscaping", - "//submodules/Tuples:Tuples", - "//submodules/TextFormat:TextFormat", - "//submodules/SwitchNode:SwitchNode", - "//submodules/StickerResources:StickerResources", - "//submodules/SelectablePeerNode:SelectablePeerNode", - "//submodules/SaveToCameraRoll:SaveToCameraRoll", - "//submodules/LocalizedPeerData:LocalizedPeerData", - "//submodules/ListSectionHeaderNode:ListSectionHeaderNode", - "//submodules/HorizontalPeerItem:HorizontalPeerItem", - "//submodules/CheckNode:CheckNode", - "//submodules/AnimationUI:AnimationUI", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/ActionSheetPeerItem:ActionSheetPeerItem", - "//submodules/AccountContext:AccountContext", - "//submodules/ComposePollUI:ComposePollUI", - "//submodules/AlertUI:AlertUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - "//submodules/TouchDownGesture:TouchDownGesture", - "//submodules/SwipeToDismissGesture:SwipeToDismissGesture", - "//submodules/DirectionalPanGesture:DirectionalPanGesture", - "//submodules/UndoUI:UndoUI", - "//submodules/PhotoResources:PhotoResources", - "//submodules/TinyThumbnail:TinyThumbnail", - "//submodules/ImageTransparency:ImageTransparency", - "//submodules/TelegramNotices:TelegramNotices", - "//submodules/TelegramPermissions:TelegramPermissions", - "//submodules/GameUI:GameUI", - "//submodules/WebUI:WebUI", - "//submodules/PassportUI:PassportUI", - "//submodules/PhoneInputNode:PhoneInputNode", - "//submodules/CountrySelectionUI:CountrySelectionUI", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/GalleryUI:GalleryUI", - "//submodules/TelegramUniversalVideoContent:TelegramUniversalVideoContent", - "//submodules/WebsiteType:WebsiteType", - "//submodules/ScreenCaptureDetection:ScreenCaptureDetection", - "//submodules/OpenInExternalAppUI:OpenInExternalAppUI", - "//submodules/LegacyUI:LegacyUI", - "//submodules/ImageCompression:ImageCompression", - "//submodules/DateSelectionUI:DateSelectionUI", - "//submodules/PasswordSetupUI:PasswordSetupUI", - "//submodules/Pdf:Pdf", - "//submodules/InstantPageUI:InstantPageUI", - "//submodules/MusicAlbumArtResources:MusicAlbumArtResources", - "//submodules/LiveLocationPositionNode:LiveLocationPositionNode", - "//submodules/MosaicLayout:MosaicLayout", - "//submodules/LocationUI:LocationUI", - "//submodules/Stripe:Stripe", - "//submodules/BotPaymentsUI:BotPaymentsUI", - "//submodules/LocalAuth:LocalAuth", - "//submodules/ContactListUI:ContactListUI", - "//submodules/SearchUI:SearchUI", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/ItemListPeerItem:ItemListPeerItem", - "//submodules/ContactsPeerItem:ContactsPeerItem", - "//submodules/ChatListSearchItemNode:ChatListSearchItemNode", - "//submodules/TelegramPermissionsUI:TelegramPermissionsUI", - "//submodules/PeersNearbyIconNode:PeersNearbyIconNode", - "//submodules/SolidRoundedButtonNode:SolidRoundedButtonNode", - "//submodules/PasscodeUI:PasscodeUI", - "//submodules/CallListUI:CallListUI", - "//submodules/ChatListUI:ChatListUI", - "//submodules/ChatTitleActivityNode:ChatTitleActivityNode", - "//submodules/DeleteChatPeerActionSheetItem:DeleteChatPeerActionSheetItem", - "//submodules/LanguageSuggestionUI:LanguageSuggestionUI", - "//submodules/TextSelectionNode:TextSelectionNode", - "//submodules/PlatformRestrictionMatching:PlatformRestrictionMatching", - "//submodules/HashtagSearchUI:HashtagSearchUI", - "//submodules/ItemListAvatarAndNameInfoItem:ItemListAvatarAndNameInfoItem", - "//submodules/ItemListPeerActionItem:ItemListPeerActionItem", - "//submodules/StickerPackPreviewUI:StickerPackPreviewUI", - "//submodules/YuvConversion:YuvConversion", - "//submodules/JoinLinkPreviewUI:JoinLinkPreviewUI", - "//submodules/LanguageLinkPreviewUI:LanguageLinkPreviewUI", - "//submodules/WebSearchUI:WebSearchUI", - "//submodules/LegacyMediaPickerUI:LegacyMediaPickerUI", - "//submodules/MimeTypes:MimeTypes", - "//submodules/LocalMediaResources:LocalMediaResources", - "//submodules/PeersNearbyUI:PeersNearbyUI", - "//submodules/Geocoding:Geocoding", - "//submodules/PeerInfoUI:PeerInfoUI", - "//submodules/PeerAvatarGalleryUI:PeerAvatarGalleryUI", - "//submodules/Emoji:Emoji", - "//submodules/ItemListStickerPackItem:ItemListStickerPackItem", - "//submodules/NotificationMuteSettingsUI:NotificationMuteSettingsUI", - "//submodules/SinglePhoneInputNode:SinglePhoneInputNode", - "//submodules/MapResourceToAvatarSizes:MapResourceToAvatarSizes", - "//submodules/NotificationSoundSelectionUI:NotificationSoundSelectionUI", - "//submodules/EncryptionKeyVisualization:EncryptionKeyVisualization", - "//submodules/ItemListAddressItem:ItemListAddressItem", - "//submodules/DeviceProximity:DeviceProximity", - "//submodules/RaiseToListen:RaiseToListen", - "//submodules/OpusBinding:OpusBinding", - "//submodules/Opus:opus", - "//submodules/WatchBridgeAudio:WatchBridgeAudio", - "//submodules/WatchBridge:WatchBridge", - "//submodules/LegacyDataImport:LegacyDataImport", - "//submodules/ShareItems:ShareItems", - "//submodules/ReactionSelectionNode:ReactionSelectionNode", - "//submodules/SettingsUI:SettingsUI", - "//submodules/UrlHandling:UrlHandling", - "//submodules/HexColor:HexColor", - "//submodules/QrCode:QrCode", - "//submodules/WallpaperResources:WallpaperResources", - "//submodules/AuthorizationUI:AuthorizationUI", - "//submodules/CounterContollerTitleView:CounterContollerTitleView", - "//submodules/GridMessageSelectionNode:GridMessageSelectionNode", - "//submodules/InstantPageCache:InstantPageCache", - "//submodules/PersistentStringHash:PersistentStringHash", - "//submodules/MessageReactionListUI:MessageReactionListUI", - "//submodules/SegmentedControlNode:SegmentedControlNode", - "//submodules/AppBundle:AppBundle", - "//submodules/Markdown:Markdown", - "//submodules/SearchPeerMembers:SearchPeerMembers", - "//submodules/WidgetItems:WidgetItems", - "//submodules/OpenSSLEncryptionProvider:OpenSSLEncryptionProvider", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/AppLock:AppLock", - "//submodules/NotificationsPresentationData:NotificationsPresentationData", - "//submodules/UrlWhitelist:UrlWhitelist", - "//submodules/TelegramIntents:TelegramIntents", - "//submodules/LocationResources:LocationResources", - "//submodules/ItemListVenueItem:ItemListVenueItem", - "//submodules/SemanticStatusNode:SemanticStatusNode", - "//submodules/AccountUtils:AccountUtils", - "//submodules/Svg:Svg", - "//submodules/StatisticsUI:StatisticsUI", - "//submodules/ManagedAnimationNode:ManagedAnimationNode", - "//submodules/TooltipUI:TooltipUI", - "//submodules/AuthTransferUI:AuthTransferUI", - "//submodules/ListMessageItem:ListMessageItem", - "//submodules/FileMediaResourceStatus:FileMediaResourceStatus", - "//submodules/ChatMessageInteractiveMediaBadge:ChatMessageInteractiveMediaBadge", - "//submodules/GalleryData:GalleryData", - "//submodules/ChatInterfaceState:ChatInterfaceState", - "//submodules/AnimatedCountLabelNode:AnimatedCountLabelNode", - "//submodules/AnimatedAvatarSetNode:AnimatedAvatarSetNode", - "//submodules/SlotMachineAnimationNode:SlotMachineAnimationNode", - "//submodules/AnimatedNavigationStripeNode:AnimatedNavigationStripeNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/CoreAudio.framework", - "$SDKROOT/System/Library/Frameworks/WebKit.framework", - ], - weak_frameworks = [ - "Vision", - "PushKit", - "CallKit", - "PassKit", - "Contacts", - "Intents", - ], -) diff --git a/submodules/TelegramUI/BUILD b/submodules/TelegramUI/BUILD index f3b815faa3..112616c6f1 100644 --- a/submodules/TelegramUI/BUILD +++ b/submodules/TelegramUI/BUILD @@ -164,7 +164,7 @@ swift_library( "//submodules/DeviceProximity:DeviceProximity", "//submodules/RaiseToListen:RaiseToListen", "//submodules/OpusBinding:OpusBinding", - "//submodules/Opus:opus", + "//third-party/opus:opus", "//submodules/WatchBridgeAudio:WatchBridgeAudio", "//submodules/WatchBridge:WatchBridge", "//submodules/LegacyDataImport:LegacyDataImport", diff --git a/submodules/TelegramUIPreferences/BUCK b/submodules/TelegramUIPreferences/BUCK deleted file mode 100644 index a74fe185d2..0000000000 --- a/submodules/TelegramUIPreferences/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramUIPreferences", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TelegramUniversalVideoContent/BUCK b/submodules/TelegramUniversalVideoContent/BUCK deleted file mode 100644 index e8c9d6e379..0000000000 --- a/submodules/TelegramUniversalVideoContent/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramUniversalVideoContent", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/MediaPlayer:UniversalMediaPlayer", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/PhotoResources:PhotoResources", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/AppBundle:AppBundle", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TelegramUpdateUI/BUCK b/submodules/TelegramUpdateUI/BUCK deleted file mode 100644 index 0d8ad6cce8..0000000000 --- a/submodules/TelegramUpdateUI/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramUpdateUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/ItemListUI:ItemListUI", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TelegramVoip/BUCK b/submodules/TelegramVoip/BUCK deleted file mode 100644 index 9868b8dfa1..0000000000 --- a/submodules/TelegramVoip/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TelegramVoip", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/TgVoip:TgVoip", - "//submodules/TgVoipWebrtc:TgVoipWebrtc", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TemporaryCachedPeerDataManager/BUCK b/submodules/TemporaryCachedPeerDataManager/BUCK deleted file mode 100644 index ee728d71c6..0000000000 --- a/submodules/TemporaryCachedPeerDataManager/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TemporaryCachedPeerDataManager", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramStringFormatting:TelegramStringFormatting", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TextFormat/BUCK b/submodules/TextFormat/BUCK deleted file mode 100644 index a5feabed0b..0000000000 --- a/submodules/TextFormat/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TextFormat", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/Markdown:Markdown", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TextSelectionNode/BUCK b/submodules/TextSelectionNode/BUCK deleted file mode 100644 index 55ad79a53c..0000000000 --- a/submodules/TextSelectionNode/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TextSelectionNode", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TgVoip/BUCK b/submodules/TgVoip/BUCK deleted file mode 100644 index 4b42a4b211..0000000000 --- a/submodules/TgVoip/BUCK +++ /dev/null @@ -1,107 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "glob_map", "glob_sub_map", "merge_maps") - -replace_symbols = [ - "WebRtcAgc_Process", - "rtc_FatalMessage", - "WebRtcAgc_UpdateAgcThresholds", - "WebRtcAgc_Init", - "WebRtcAgc_GetAddFarendError", - "WebRtcAgc_ZeroCtrl", - "WebRtcAgc_SaturationCtrl", - "WebRtcAgc_SpeakerInactiveCtrl", - "WebRtcAgc_ProcessAnalog", - "WebRtcAgc_set_config", - "WebRtcAgc_get_config", - "WebRtcAgc_ExpCurve", - "WebRtcAgc_Create", - "WebRtcAgc_Free", - "WebRtcAgc_AddFarend", - "WebRtcAgc_VirtualMic", - "WebRtcAgc_AddMic", - "WebRtcAgc_InitDigital", - "WebRtcAgc_AddFarendToDigital", - "WebRtcAgc_CalculateGainTable", - "WebRtcAgc_InitVad", - "WebRtcAgc_ProcessVad", - "rtc", - "webrtc", -] - -shared_compiler_flags = [ - "-DTGVOIP_INCLUDE_OPUS_PACKAGE", -] + ["-D{symbol}={symbol}1".format(symbol=symbol) for symbol in replace_symbols] - -static_library( - name = "TgVoip", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.mm", - "Sources/**/*.h", - "libtgvoip/*.m", - "libtgvoip/*.mm", - "libtgvoip/*.cpp", - "libtgvoip/audio/*.cpp", - "libtgvoip/video/*.cpp", - "libtgvoip/os/darwin/*.m", - "libtgvoip/os/darwin/*.mm", - "libtgvoip/os/darwin/*.cpp", - "libtgvoip/os/posix/*.cpp", - "libtgvoip/webrtc_dsp/**/*.c", - "libtgvoip/webrtc_dsp/**/*.cc", - "libtgvoip/webrtc_dsp/**/*.cpp", - ], exclude = ["libtgvoip/os/darwin/*OSX*"]), - has_cpp = True, - headers = merge_maps([ - glob_sub_map("libtgvoip/", [ - "libtgvoip/*.h", - "libtgvoip/*.hpp", - "libtgvoip/audio/*.h", - "libtgvoip/audio/*.hpp", - "libtgvoip/video/*.h", - "libtgvoip/video/*.hpp", - ]), - glob_sub_map("libtgvoip/", [ - "libtgvoip/os/darwin/*.h", - ], exclude = ["libtgvoip/os/darwin/*OSX*"]), - glob_sub_map("libtgvoip/webrtc_dsp/", [ - "libtgvoip/webrtc_dsp/**/*.h", - ]), - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - platform_compiler_flags = [ - ('arm.*', [ - '-DTGVOIP_USE_CUSTOM_CRYPTO', - '-DTGVOIP_USE_INSTALLED_OPUS', - '-DWEBRTC_APM_DEBUG_DUMP=0', - '-DWEBRTC_POSIX', - '-DTGVOIP_HAVE_TGLOG', - '-DWEBRTC_NS_FLOAT', - '-DWEBRTC_IOS', - '-DWEBRTC_HAS_NEON', - ] + shared_compiler_flags), - ('.*', [ - '-DTGVOIP_USE_CUSTOM_CRYPTO', - '-DTGVOIP_USE_INSTALLED_OPUS', - '-DWEBRTC_APM_DEBUG_DUMP=0', - '-DWEBRTC_POSIX', - '-DTGVOIP_HAVE_TGLOG', - '-DWEBRTC_NS_FLOAT', - '-DWEBRTC_IOS', - ] + shared_compiler_flags), - ], - deps = [ - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/Opus:opus", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/AudioToolbox.framework", - "$SDKROOT/System/Library/Frameworks/VideoToolbox.framework", - "$SDKROOT/System/Library/Frameworks/CoreTelephony.framework", - "$SDKROOT/System/Library/Frameworks/CoreMedia.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) \ No newline at end of file diff --git a/submodules/TgVoip/BUILD b/submodules/TgVoip/BUILD index 6d87f66345..4f6632ff94 100644 --- a/submodules/TgVoip/BUILD +++ b/submodules/TgVoip/BUILD @@ -7,6 +7,7 @@ copts_arm = [ "-DWEBRTC_NS_FLOAT", "-DWEBRTC_IOS", "-DWEBRTC_HAS_NEON", + "-DTGVOIP_NO_DSP", ] copts_x86 = [ @@ -14,52 +15,11 @@ copts_x86 = [ "-DWEBRTC_APM_DEBUG_DUMP=0", "-DWEBRTC_POSIX", "-DTGVOIP_HAVE_TGLOG", + "-DTGVOIP_NO_DSP", "-DWEBRTC_NS_FLOAT", "-DWEBRTC_IOS", ] -replace_symbols = [ - "WebRtcAgc_Process", - "rtc_FatalMessage", - "WebRtcAgc_UpdateAgcThresholds", - "WebRtcAgc_Init", - "WebRtcAgc_GetAddFarendError", - "WebRtcAgc_ZeroCtrl", - "WebRtcAgc_SaturationCtrl", - "WebRtcAgc_SpeakerInactiveCtrl", - "WebRtcAgc_ProcessAnalog", - "WebRtcAgc_set_config", - "WebRtcAgc_get_config", - "WebRtcAgc_ExpCurve", - "WebRtcAgc_Create", - "WebRtcAgc_Free", - "WebRtcAgc_AddFarend", - "WebRtcAgc_VirtualMic", - "WebRtcAgc_AddMic", - "WebRtcAgc_InitDigital", - "WebRtcAgc_AddFarendToDigital", - "WebRtcAgc_CalculateGainTable", - "WebRtcAgc_InitVad", - "WebRtcAgc_ProcessVad", - "TimeDiff", - "TimeAfter", - "TimeMicros", - "TimeUTCMicros", - "SystemTimeNanos", - "TimeNanos", - "SystemTimeMillis", - "TimeMillis", - "TimeUTCMillis", - "GetClockForTesting", - "TimestampWrapAroundHandler", - "Time32", - "TmToSeconds", - "TimeDiff32", - "TimestampWrapAroundHandler", - "g_clock", - "SetClockForTesting", -] - objc_library( name = "TgVoip", enable_modules = True, @@ -77,9 +37,6 @@ objc_library( "libtgvoip/os/darwin/*.mm", "libtgvoip/os/darwin/*.cpp", "libtgvoip/os/posix/*.cpp", - "libtgvoip/webrtc_dsp/**/*.c", - "libtgvoip/webrtc_dsp/**/*.cc", - "libtgvoip/webrtc_dsp/**/*.cpp", ], exclude = ["libtgvoip/os/darwin/*OSX*"]), hdrs = glob([ "PublicHeaders/**/*.h", @@ -87,14 +44,15 @@ objc_library( copts = [ "-I{}/PublicHeaders/TgVoip".format(package_name()), "-I{}/libtgvoip".format(package_name()), - "-I{}/libtgvoip/webrtc_dsp".format(package_name()), + "-I{}/third-party/webrtc/webrtc-ios/src".format(package_name()), "-Isubmodules/Opus/Public/opus", "-DTGVOIP_USE_INSTALLED_OPUS", "-Drtc=rtc1", "-Dwebrtc=webrtc1", - ] + ["-D{symbol}={symbol}1".format(symbol=symbol) for symbol in replace_symbols] + select({ + ] + select({ "@build_bazel_rules_apple//apple:ios_armv7": copts_arm, "@build_bazel_rules_apple//apple:ios_arm64": copts_arm, + "//build-system:ios_sim_arm64": copts_arm, "@build_bazel_rules_apple//apple:ios_x86_64": copts_x86, }), includes = [ @@ -102,7 +60,7 @@ objc_library( ], deps = [ "//submodules/MtProtoKit:MtProtoKit", - "//submodules/Opus:opus", + "//third-party/opus:opus", ], sdk_frameworks = [ "Foundation", diff --git a/submodules/TgVoip/Sources/OngoingCallThreadLocalContext.mm b/submodules/TgVoip/Sources/OngoingCallThreadLocalContext.mm index 7479f6cec8..ce673b433c 100644 --- a/submodules/TgVoip/Sources/OngoingCallThreadLocalContext.mm +++ b/submodules/TgVoip/Sources/OngoingCallThreadLocalContext.mm @@ -127,7 +127,7 @@ static void withContext(int32_t contextId, void (^f)(OngoingCallThreadLocalConte NSTimeInterval _callConnectTimeout; NSTimeInterval _callPacketTimeout; - TgVoip *_tgVoip; + std::unique_ptr _tgVoip; OngoingCallState _state; int32_t _signalBars; @@ -262,45 +262,32 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL; endpoints.push_back(endpoint); } - TgVoipConfig config = { - .initializationTimeout = _callConnectTimeout, - .receiveTimeout = _callPacketTimeout, - .dataSaving = callControllerDataSavingForType(dataSaving), - .enableP2P = static_cast(allowP2P), - .enableAEC = false, - .enableNS = true, - .enableAGC = true, - .enableCallUpgrade = false, - .logPath = logPath.length == 0 ? "" : std::string(logPath.UTF8String), - .maxApiLayer = [OngoingCallThreadLocalContext maxLayer] - }; + TgVoipConfig config; + config.initializationTimeout = _callConnectTimeout; + config.receiveTimeout = _callPacketTimeout; + config.dataSaving = callControllerDataSavingForType(dataSaving); + config.enableP2P = static_cast(allowP2P); + config.enableAEC = false; + config.enableNS = true; + config.enableAGC = true; + config.enableVolumeControl = false; + config.enableCallUpgrade = false; + config.logPath = logPath.length == 0 ? "" : std::string(logPath.UTF8String); + config.maxApiLayer = [OngoingCallThreadLocalContext maxLayer]; std::vector encryptionKeyValue; encryptionKeyValue.resize(key.length); memcpy(encryptionKeyValue.data(), key.bytes, key.length); - TgVoipEncryptionKey encryptionKey = { - .value = encryptionKeyValue, - .isOutgoing = isOutgoing, - }; - - /* - TgVoipConfig const &config, - TgVoipPersistentState const &persistentState, - std::vector const &endpoints, - std::unique_ptr const &proxy, - TgVoipNetworkType initialNetworkType, - TgVoipEncryptionKey const &encryptionKey - #ifdef TGVOIP_USE_CUSTOM_CRYPTO - , - TgVoipCrypto const &crypto - */ + TgVoipEncryptionKey encryptionKey; + encryptionKey.value = encryptionKeyValue; + encryptionKey.isOutgoing = isOutgoing; _tgVoip = TgVoip::makeInstance( config, { derivedStateValue }, endpoints, - proxyValue, + proxyValue.get(), callControllerNetworkTypeForType(networkType), encryptionKey, crypto @@ -341,8 +328,7 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL; NSString *debugLog = [NSString stringWithUTF8String:finalState.debugLog.c_str()]; _lastDerivedState = [[NSData alloc] initWithBytes:finalState.persistentState.value.data() length:finalState.persistentState.value.size()]; - delete _tgVoip; - _tgVoip = NULL; + _tgVoip.reset(); if (completion) { completion(debugLog, finalState.trafficStats.bytesSentWifi, finalState.trafficStats.bytesReceivedWifi, finalState.trafficStats.bytesSentMobile, finalState.trafficStats.bytesReceivedMobile); @@ -381,7 +367,7 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL; - (void)controllerStateChanged:(TgVoipState)state { OngoingCallState callState = OngoingCallStateInitializing; switch (state) { - case TgVoipState::Estabilished: + case TgVoipState::Established: callState = OngoingCallStateConnected; break; case TgVoipState::Failed: diff --git a/submodules/TgVoip/libtgvoip b/submodules/TgVoip/libtgvoip index dc4e9ec482..37d98e984f 160000 --- a/submodules/TgVoip/libtgvoip +++ b/submodules/TgVoip/libtgvoip @@ -1 +1 @@ -Subproject commit dc4e9ec48207388e41db1c2ef1cccf9899d9765f +Subproject commit 37d98e984fd6fa389262307db826d52ab86c8241 diff --git a/submodules/TgVoipWebrtc/BUCK b/submodules/TgVoipWebrtc/BUCK deleted file mode 100644 index 4b2e1816ca..0000000000 --- a/submodules/TgVoipWebrtc/BUCK +++ /dev/null @@ -1,65 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "glob_map", "glob_sub_map", "merge_maps") - -webrtc_include_prefix = "-I../../" if native.read_config("custom", "mode") == "project" else "-I" - -static_library( - name = "TgVoipWebrtc", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.mm", - "tgcalls/tgcalls/**/*.cpp", - "tgcalls/tgcalls/**/*.mm", - "tgcalls/tgcalls/**/*.m", - ], exclude = [ - "tgcalls/tgcalls/legacy/**", - "tgcalls/tgcalls/platform/tdesktop/**", - "tgcalls/tgcalls/platform/windows/**", - "tgcalls/tgcalls/platform/android/**", - "tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.*", - "tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.*", - "tgcalls/tgcalls/platform/darwin/GLVideoViewMac.*", - "tgcalls/tgcalls/platform/darwin/ScreenCapturer.*", - ]), - has_cpp = True, - headers = merge_maps([ - glob_sub_map("PublicHeaders/", [ - "PublicHeaders/**/*.h", - ]), - glob_sub_map("tgcalls/tgcalls/", [ - "tgcalls/tgcalls/**/*.h", - ]), - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - compiler_flags = [ - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/third_party/abseil-cpp", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/sdk/objc", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/sdk/objc/base", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/sdk/objc/components/renderer/metal", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/sdk/objc/components/renderer/opengl", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/sdk/objc/components/video_codec", - webrtc_include_prefix + "third-party/webrtc/webrtc-ios/src/third_party/libyuv/include", - webrtc_include_prefix + "third-party/submodules/TgVoipWebrtc/PublicHeaders", - "-DWEBRTC_IOS", - "-DWEBRTC_MAC", - "-DWEBRTC_POSIX", - "-DRTC_ENABLE_VP9", - ], - deps = [ - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/Opus:opus", - "//submodules/openssl:openssl", - "//third-party/webrtc:webrtc_lib", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/AudioToolbox.framework", - "$SDKROOT/System/Library/Frameworks/VideoToolbox.framework", - "$SDKROOT/System/Library/Frameworks/CoreTelephony.framework", - "$SDKROOT/System/Library/Frameworks/CoreMedia.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/TinyThumbnail/BUCK b/submodules/TinyThumbnail/BUCK deleted file mode 100644 index e472166ecd..0000000000 --- a/submodules/TinyThumbnail/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TinyThumbnail", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TonBinding/BUCK b/submodules/TonBinding/BUCK deleted file mode 100644 index 07e0b121d2..0000000000 --- a/submodules/TonBinding/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TonBinding", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.mm", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "Sources/**/*.h", - ]), - visibility = ["PUBLIC"], - deps = [ - "//submodules/SSignalKit/SSignalKit:SSignalKit", - "//submodules/openssl:openssl", - "//submodules/ton:ton", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/TooltipUI/BUCK b/submodules/TooltipUI/BUCK deleted file mode 100644 index ee83e7145d..0000000000 --- a/submodules/TooltipUI/BUCK +++ /dev/null @@ -1,23 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TooltipUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AppBundle:AppBundle", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/TextFormat:TextFormat", - "//submodules/UrlEscaping:UrlEscaping", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/TouchDownGesture/BUCK b/submodules/TouchDownGesture/BUCK deleted file mode 100644 index f5bba578ab..0000000000 --- a/submodules/TouchDownGesture/BUCK +++ /dev/null @@ -1,12 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "TouchDownGesture", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/Tuples/BUCK b/submodules/Tuples/BUCK deleted file mode 100644 index b2ffac741a..0000000000 --- a/submodules/Tuples/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "Tuples", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/UIKitRuntimeUtils/BUCK b/submodules/UIKitRuntimeUtils/BUCK deleted file mode 100644 index 5438bad157..0000000000 --- a/submodules/UIKitRuntimeUtils/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "UIKitRuntimeUtils", - srcs = glob([ - "Source/UIKitRuntimeUtils/*.m", - ]), - exported_headers = glob([ - "Source/UIKitRuntimeUtils/*.h", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/ObjCRuntimeUtils:ObjCRuntimeUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/UndoUI/BUCK b/submodules/UndoUI/BUCK deleted file mode 100644 index 43cf11da9a..0000000000 --- a/submodules/UndoUI/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "UndoUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TextFormat:TextFormat", - "//submodules/Markdown:Markdown", - "//submodules/RadialStatusNode:RadialStatusNode", - "//submodules/AnimationUI:AnimationUI", - "//submodules/AnimatedStickerNode:AnimatedStickerNode", - "//submodules/AppBundle:AppBundle", - "//submodules/StickerResources:StickerResources", - "//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode", - "//submodules/SlotMachineAnimationNode:SlotMachineAnimationNode", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/UrlEscaping/BUCK b/submodules/UrlEscaping/BUCK deleted file mode 100644 index 541c96168a..0000000000 --- a/submodules/UrlEscaping/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "UrlEscaping", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/UrlHandling/BUCK b/submodules/UrlHandling/BUCK deleted file mode 100644 index faa86f1b36..0000000000 --- a/submodules/UrlHandling/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "UrlHandling", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/MtProtoKit:MtProtoKit#shared", - "//submodules/AccountContext:AccountContext", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/WalletUrl:WalletUrl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/UrlWhitelist/BUCK b/submodules/UrlWhitelist/BUCK deleted file mode 100644 index 870382826f..0000000000 --- a/submodules/UrlWhitelist/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "UrlWhitelist", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/WallpaperResources/BUCK b/submodules/WallpaperResources/BUCK deleted file mode 100644 index c1aa1769d7..0000000000 --- a/submodules/WallpaperResources/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WallpaperResources", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/Display:Display#shared", - "//submodules/LocalMediaResources:LocalMediaResources", - "//submodules/TinyThumbnail:TinyThumbnail", - "//submodules/ImageBlur:ImageBlur", - "//submodules/MediaResources:MediaResources", - "//submodules/PhotoResources:PhotoResources", - "//submodules/PersistentStringHash:PersistentStringHash", - "//submodules/AppBundle:AppBundle", - "//submodules/Svg:Svg", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/WatchBridge/BUCK b/submodules/WatchBridge/BUCK deleted file mode 100644 index 43887ef484..0000000000 --- a/submodules/WatchBridge/BUCK +++ /dev/null @@ -1,32 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WatchBridge", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/SSignalKit/SSignalKit:SSignalKit", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/WatchCommon/Host:WatchCommon", - "//submodules/WatchBridgeAudio:WatchBridgeAudio", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/AvatarNode:AvatarNode", - "//submodules/StickerResources:StickerResources", - "//submodules/PhotoResources:PhotoResources", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LegacyUI:LegacyUI", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - "//submodules/WatchBridge/Impl:WatchBridgeImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/WatchConnectivity.framework", - ], -) diff --git a/submodules/WatchBridge/Impl/BUCK b/submodules/WatchBridge/Impl/BUCK deleted file mode 100644 index 0fffa19506..0000000000 --- a/submodules/WatchBridge/Impl/BUCK +++ /dev/null @@ -1,38 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WatchBridgeImpl", - srcs = glob([ - "Sources/**/*.swift", - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/SSignalKit/SSignalKit:SSignalKit", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/WatchCommon/Host:WatchCommon", - "//submodules/WatchBridgeAudio:WatchBridgeAudio", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/AccountContext:AccountContext", - "//submodules/AvatarNode:AvatarNode", - "//submodules/StickerResources:StickerResources", - "//submodules/PhotoResources:PhotoResources", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/LegacyUI:LegacyUI", - "//submodules/PhoneNumberFormat:PhoneNumberFormat", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/WatchConnectivity.framework", - ], -) diff --git a/submodules/WatchBridgeAudio/BUCK b/submodules/WatchBridgeAudio/BUCK deleted file mode 100644 index c344d50cd6..0000000000 --- a/submodules/WatchBridgeAudio/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WatchBridgeAudio", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/WatchBridgeAudio/Impl:WatchBridgeAudioImpl", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - "$SDKROOT/System/Library/Frameworks/AudioToolbox.framework", - ], -) diff --git a/submodules/WatchBridgeAudio/Impl/BUCK b/submodules/WatchBridgeAudio/Impl/BUCK deleted file mode 100644 index 68519a7f3e..0000000000 --- a/submodules/WatchBridgeAudio/Impl/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WatchBridgeAudioImpl", - srcs = glob([ - "Sources/**/*.m", - "Sources/**/*.mm", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/SSignalKit/SSignalKit:SSignalKit", - "//submodules/OpusBinding:OpusBinding", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - "$SDKROOT/System/Library/Frameworks/AudioToolbox.framework", - ], -) diff --git a/submodules/WatchCommon/BUCK b/submodules/WatchCommon/BUCK deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/submodules/WatchCommon/Host/BUCK b/submodules/WatchCommon/Host/BUCK deleted file mode 100644 index 56fb1a1683..0000000000 --- a/submodules/WatchCommon/Host/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WatchCommon", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/WatchCommon/Watch/BUCK b/submodules/WatchCommon/Watch/BUCK deleted file mode 100644 index 77c74a57f5..0000000000 --- a/submodules/WatchCommon/Watch/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WatchCommonWatch", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ], exclude = ["Sources/WatchCommon.h", "Sources/WatchCommon.h"]), - exported_headers = glob([ - "Sources/*.h", - ], exclude = ["Sources/WatchCommon.h", "Sources/WatchCommon.h"]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/WebPBinding/BUCK b/submodules/WebPBinding/BUCK deleted file mode 100644 index 7e23c440ec..0000000000 --- a/submodules/WebPBinding/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "framework") - -static_library( - name = "WebPBinding", - srcs = glob([ - "Sources/**/*.m", - ]), - headers = glob([ - "Sources/**/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - "//submodules/webp:webp", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/WebPBinding/BUILD b/submodules/WebPBinding/BUILD index 892bb6cf46..171e072408 100644 --- a/submodules/WebPBinding/BUILD +++ b/submodules/WebPBinding/BUILD @@ -14,7 +14,7 @@ objc_library( "PublicHeaders", ], deps = [ - "//submodules/webp:webp", + "//third-party/webp:webp", ], sdk_frameworks = [ "Foundation", diff --git a/submodules/WebSearchUI/BUCK b/submodules/WebSearchUI/BUCK deleted file mode 100644 index 53ad3af445..0000000000 --- a/submodules/WebSearchUI/BUCK +++ /dev/null @@ -1,37 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WebSearchUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit#shared", - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - "//submodules/Postbox:Postbox#shared", - "//submodules/TelegramCore:TelegramCore#shared", - "//submodules/SyncCore:SyncCore#shared", - "//submodules/TelegramPresentationData:TelegramPresentationData", - "//submodules/AccountContext:AccountContext", - "//submodules/LegacyComponents:LegacyComponents", - "//submodules/TelegramUIPreferences:TelegramUIPreferences", - "//submodules/MergeLists:MergeLists", - "//submodules/GalleryUI:GalleryUI", - "//submodules/ChatListSearchItemHeader:ChatListSearchItemHeader", - "//submodules/TelegramUniversalVideoContent:TelegramUniversalVideoContent", - "//submodules/CheckNode:CheckNode", - "//submodules/PhotoResources:PhotoResources", - "//submodules/SearchBarNode:SearchBarNode", - "//submodules/ItemListUI:ItemListUI", - "//submodules/LegacyMediaPickerUI:LegacyMediaPickerUI", - "//submodules/SegmentedControlNode:SegmentedControlNode", - "//submodules/AppBundle:AppBundle", - "//submodules/PresentationDataUtils:PresentationDataUtils", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/QuickLook.framework", - ], -) diff --git a/submodules/WebUI/BUCK b/submodules/WebUI/BUCK deleted file mode 100644 index 73067e9373..0000000000 --- a/submodules/WebUI/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WebUI", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/AsyncDisplayKit:AsyncDisplayKit#shared", - "//submodules/Display:Display#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/WebKit.framework", - ], -) diff --git a/submodules/WebsiteType/BUCK b/submodules/WebsiteType/BUCK deleted file mode 100644 index 7c8ecfbdd2..0000000000 --- a/submodules/WebsiteType/BUCK +++ /dev/null @@ -1,14 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WebsiteType", - srcs = glob([ - "Sources/**/*.swift", - ]), - deps = [ - "//submodules/SyncCore:SyncCore#shared", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/WidgetItems/BUCK b/submodules/WidgetItems/BUCK deleted file mode 100644 index 5a23f7b104..0000000000 --- a/submodules/WidgetItems/BUCK +++ /dev/null @@ -1,11 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "WidgetItems", - srcs = glob([ - "Sources/**/*.swift", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/YuvConversion/BUCK b/submodules/YuvConversion/BUCK deleted file mode 100644 index 2d4675cff4..0000000000 --- a/submodules/YuvConversion/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "YuvConversion", - srcs = glob([ - "Sources/*.m", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/Accelerate.framework", - ], -) diff --git a/submodules/ffmpeg/BUCK b/submodules/ffmpeg/BUCK deleted file mode 100644 index 67e9c161eb..0000000000 --- a/submodules/ffmpeg/BUCK +++ /dev/null @@ -1,180 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "gen_header_targets", "merge_maps") - -ffmpeg_header_paths = [ - "libavutil/hwcontext.h", - "libavutil/time.h", - "libavutil/hwcontext_cuda.h", - "libavutil/intfloat.h", - "libavutil/error.h", - "libavutil/fifo.h", - "libavutil/blowfish.h", - "libavutil/hwcontext_mediacodec.h", - "libavutil/replaygain.h", - "libavutil/version.h", - "libavutil/murmur3.h", - "libavutil/stereo3d.h", - "libavutil/samplefmt.h", - "libavutil/pixdesc.h", - "libavutil/base64.h", - "libavutil/rational.h", - "libavutil/sha.h", - "libavutil/motion_vector.h", - "libavutil/avconfig.h", - "libavutil/lfg.h", - "libavutil/avutil.h", - "libavutil/xtea.h", - "libavutil/crc.h", - "libavutil/hwcontext_vdpau.h", - "libavutil/frame.h", - "libavutil/file.h", - "libavutil/md5.h", - "libavutil/cast5.h", - "libavutil/hwcontext_vaapi.h", - "libavutil/spherical.h", - "libavutil/ffversion.h", - "libavutil/audio_fifo.h", - "libavutil/tree.h", - "libavutil/threadmessage.h", - "libavutil/attributes.h", - "libavutil/adler32.h", - "libavutil/hwcontext_d3d11va.h", - "libavutil/timecode.h", - "libavutil/sha512.h", - "libavutil/hwcontext_dxva2.h", - "libavutil/display.h", - "libavutil/buffer.h", - "libavutil/camellia.h", - "libavutil/pixelutils.h", - "libavutil/hwcontext_drm.h", - "libavutil/common.h", - "libavutil/hmac.h", - "libavutil/eval.h", - "libavutil/dict.h", - "libavutil/random_seed.h", - "libavutil/opt.h", - "libavutil/mastering_display_metadata.h", - "libavutil/log.h", - "libavutil/aes.h", - "libavutil/macros.h", - "libavutil/bswap.h", - "libavutil/rc4.h", - "libavutil/tea.h", - "libavutil/cpu.h", - "libavutil/lzo.h", - "libavutil/des.h", - "libavutil/channel_layout.h", - "libavutil/encryption_info.h", - "libavutil/twofish.h", - "libavutil/imgutils.h", - "libavutil/hwcontext_videotoolbox.h", - "libavutil/mem.h", - "libavutil/parseutils.h", - "libavutil/ripemd.h", - "libavutil/bprint.h", - "libavutil/hwcontext_qsv.h", - "libavutil/pixfmt.h", - "libavutil/aes_ctr.h", - "libavutil/timestamp.h", - "libavutil/downmix_info.h", - "libavutil/avassert.h", - "libavutil/hash.h", - "libavutil/mathematics.h", - "libavutil/intreadwrite.h", - "libavutil/avstring.h", - "libavformat/version.h", - "libavformat/avio.h", - "libavformat/avformat.h", - "libavcodec/adts_parser.h", - "libavcodec/avcodec.h", - "libavcodec/version.h", - "libavcodec/vdpau.h", - "libavcodec/qsv.h", - "libavcodec/vaapi.h", - "libavcodec/videotoolbox.h", - "libavcodec/xvmc.h", - "libavcodec/mediacodec.h", - "libavcodec/d3d11va.h", - "libavcodec/avfft.h", - "libavcodec/jni.h", - "libavcodec/dirac.h", - "libavcodec/avdct.h", - "libavcodec/ac3_parser.h", - "libavcodec/vorbis_parser.h", - "libavcodec/dxva2.h", - "libavcodec/dv_profile.h", - "libswresample/version.h", - "libswresample/swresample.h", -] - -library_archs = "arm64 armv7 x86_64" - -genrule( - name = "libffmpeg_build", - srcs = glob([ - "Sources/FFMpeg/**/*", - ], exclude = ["Sources/FFMpeg/**/.*"]), - bash = - "PATH=\"$PATH:$(location //third-party/yasm:yasm)/yasm-1.3.0/build\" " + - "$SRCDIR/Sources/FFMpeg/build-ffmpeg-buck.sh release \"" + library_archs + "\" $OUT $SRCDIR/Sources/FFMpeg", - out = "libffmpeg", - visibility = [ - "//submodules/ffmpeg:FFMpeg", - "//submodules/ffmpeg:libffmpeg", - ] -) - -ffmpeg_header_targets = gen_header_targets(ffmpeg_header_paths, "ffmpeg_header_", "", "libffmpeg_build", "FFmpeg-iOS/include") - -apple_library( - name = "libffmpeg", - visibility = [ - "//submodules/ffmpeg:FFMpeg" - ], - header_namespace = "ffmpeg", - exported_headers = ffmpeg_header_targets, - linker_flags = [ - "-L$(location :libffmpeg_build)/FFmpeg-iOS/lib", - "-lavutil", - "-lavcodec", - "-lavformat", - "-lswresample", - "-lbz2", - "-liconv", - "-lz", - ], - exported_linker_flags = [ - "-L$(location :libffmpeg_build)/FFmpeg-iOS/lib", - "-lavutil", - "-lavcodec", - "-lavformat", - "-lswresample", - "-lbz2", - "-liconv", - "-lz", - ], - deps = [ - ":libffmpeg_build", - "//submodules/Opus:opus", - ], -) - -static_library( - name = "ffmpeg", - exported_headers = merge_maps([ - { - "ffmpeg/ffmpeg.h": "PublicHeaders/ffmpeg/ffmpeg.h", - }, - ffmpeg_header_targets, - ]), - deps = [ - ":libffmpeg_build", - ":libffmpeg", - "//submodules/Opus:opus", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - "$SDKROOT/System/Library/Frameworks/CoreMedia.framework", - "$SDKROOT/System/Library/Frameworks/AVFoundation.framework", - ], -) diff --git a/submodules/ffmpeg/BUILD b/submodules/ffmpeg/BUILD index 555ffe79a7..8ba94fb0b2 100644 --- a/submodules/ffmpeg/BUILD +++ b/submodules/ffmpeg/BUILD @@ -120,15 +120,29 @@ filegroup( srcs = source_files, ) +opus_headers = [ + "opus.h", + "opus_defines.h", + "opus_multistream.h", + "opus_projection.h", + "opus_types.h", +] + +opus_libs = [ + "opus", +] + genrule( name = "libffmpeg_build", srcs = [ - ":FFMpegSources", + ":FFMpegSources" + ] + [ + "//third-party/opus:Public/opus/{}".format(x) for x in opus_headers + ] + [ + "//third-party/opus:Public/opus/lib/lib{}.a".format(x) for x in opus_libs ], cmd_bash = """ - #random:2 - set -x ABS_RULEDIR="$$(pwd)/$(RULEDIR)" @@ -139,6 +153,20 @@ genrule( cp -R "submodules/ffmpeg/Sources/FFMpeg" "$$SOURCE_PATH" + mkdir "$$SOURCE_PATH/libopus" + mkdir -p "$$SOURCE_PATH/libopus/include/opus" + mkdir -p "$$SOURCE_PATH/libopus/lib" + """ + + "\n" + + "\n".join([ + "cp $(location //third-party/opus:Public/opus/{}) $$SOURCE_PATH/libopus/include/opus/".format(x) for x in opus_headers + ]) + + "\n" + + "\n".join([ + "cp $(location //third-party/opus:Public/opus/lib/lib{}.a) $$SOURCE_PATH/libopus/lib/".format(x) for x in opus_libs + ]) + + "\n" + + """ BUILD_DIR="$$ABS_RULEDIR/build" rm -rf "$$BUILD_DIR" mkdir -p "$$BUILD_DIR" @@ -151,6 +179,8 @@ genrule( BUILD_ARCH="armv7" elif [ "$(TARGET_CPU)" == "ios_arm64" ]; then BUILD_ARCH="arm64" + elif [ "$(TARGET_CPU)" == "ios_sim_arm64" ]; then + BUILD_ARCH="sim_arm64" elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then BUILD_ARCH="x86_64" else @@ -197,7 +227,7 @@ objc_library( ], deps = [ ":ffmpeg_lib", - "//submodules/Opus:opus", + "//third-party/opus:opus", ], visibility = [ "//visibility:public", diff --git a/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-bazel.sh b/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-bazel.sh index 19ab1b51e9..7391972e92 100755 --- a/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-bazel.sh +++ b/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-bazel.sh @@ -1,21 +1,13 @@ #!/bin/sh +set -x + RAW_ARCHS="$2" ARCHS="" for RAW_ARCH in $RAW_ARCHS; do ARCH_NAME="$RAW_ARCH" - if [ "$ARCH_NAME" == "iphoneos-arm64" ]; then - ARCH_NAME="arm64" - elif [ "$ARCH_NAME" == "iphoneos-armv7" ]; then - ARCH_NAME="armv7" - elif [ "$ARCH_NAME" == "iphonesimulator-x86_64" ]; then - ARCH_NAME="x86_64" - elif [ "$ARCH_NAME" == "iphonesimulator-i386" ]; then - ARCH_NAME="i386" - fi - - if [ "$ARCH_NAME" = "i386" -o "$ARCH_NAME" = "x86_64" -o "$ARCH_NAME" = "arm64" -o "$ARCH_NAME" = "armv7" ] + if [ "$ARCH_NAME" = "i386" -o "$ARCH_NAME" = "x86_64" -o "$ARCH_NAME" = "arm64" -o "$ARCH_NAME" = "armv7" -o "$ARCH_NAME" = "sim_arm64" ] then ARCHS="$ARCHS $ARCH_NAME" else @@ -78,7 +70,7 @@ fi COMPILE="y" -DEPLOYMENT_TARGET="8.0" +DEPLOYMENT_TARGET="9.0" LIBS_HASH="" for ARCH in $ARCHS @@ -116,19 +108,27 @@ then exit 1 fi - for ARCH in $ARCHS + for RAW_ARCH in $ARCHS do - echo "building $ARCH..." - mkdir -p "$SCRATCH/$ARCH" - pushd "$SCRATCH/$ARCH" + ARCH="$RAW_ARCH" + if [ "$RAW_ARCH" == "sim_arm64" ]; then + ARCH="arm64" + fi + + echo "building $RAW_ARCH..." + mkdir -p "$SCRATCH/$RAW_ARCH" + pushd "$SCRATCH/$RAW_ARCH" LIBOPUS_PATH="$SOURCE_DIR/libopus" CFLAGS="-arch $ARCH" - if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ] + if [ "$RAW_ARCH" = "i386" -o "$RAW_ARCH" = "x86_64" ] then PLATFORM="iPhoneSimulator" CFLAGS="$CFLAGS -mios-simulator-version-min=$DEPLOYMENT_TARGET" + elif [ "$RAW_ARCH" = "sim_arm64" ]; then + PLATFORM="iPhoneSimulator" + CFLAGS="$CFLAGS -mios-simulator-version-min=$DEPLOYMENT_TARGET --target=arm64-apple-ios$DEPLOYMENT_TARGET-simulator" else PLATFORM="iPhoneOS" CFLAGS="$CFLAGS -mios-version-min=$DEPLOYMENT_TARGET" @@ -141,7 +141,7 @@ then XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'` CC="xcrun -sdk $XCRUN_SDK clang" - if [ "$ARCH" = "arm64" ] + if [ "$RAW_ARCH" = "arm64" ] || [ "$RAW_ARCH" = "sim_arm64" ] then AS="$GAS_PREPROCESSOR_PATH -arch aarch64 -- $CC" else @@ -151,7 +151,7 @@ then CXXFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" - CONFIGURED_MARKER="$THIN/$ARCH/configured_marker" + CONFIGURED_MARKER="$THIN/$RAW_ARCH/configured_marker" CONFIGURED_MARKER_CONTENTS="" if [ -r "$CONFIGURED_MARKER" ] then @@ -161,7 +161,7 @@ then then echo "1" >/dev/null else - mkdir -p "$THIN/$ARCH" + mkdir -p "$THIN/$RAW_ARCH" TMPDIR=${TMPDIR/%\/} "$SOURCE/configure" \ --target-os=darwin \ --arch=$ARCH \ @@ -170,7 +170,7 @@ then $CONFIGURE_FLAGS \ --extra-cflags="$CFLAGS" \ --extra-ldflags="$LDFLAGS" \ - --prefix="$THIN/$ARCH" \ + --prefix="$THIN/$RAW_ARCH" \ --pkg-config="$PKG_CONFIG" \ --pkg-config-flags="--libopus_path $LIBOPUS_PATH" \ || exit 1 diff --git a/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-buck.sh b/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-buck.sh deleted file mode 100755 index cc7f8a753b..0000000000 --- a/submodules/ffmpeg/Sources/FFMpeg/build-ffmpeg-buck.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/sh - -RAW_ARCHS="$2" -ARCHS="" - -for RAW_ARCH in $RAW_ARCHS; do - ARCH_NAME="$RAW_ARCH" - if [ "$ARCH_NAME" == "iphoneos-arm64" ]; then - ARCH_NAME="arm64" - elif [ "$ARCH_NAME" == "iphoneos-armv7" ]; then - ARCH_NAME="armv7" - elif [ "$ARCH_NAME" == "iphonesimulator-x86_64" ]; then - ARCH_NAME="x86_64" - elif [ "$ARCH_NAME" == "iphonesimulator-i386" ]; then - ARCH_NAME="i386" - fi - - if [ "$ARCH_NAME" = "i386" -o "$ARCH_NAME" = "x86_64" -o "$ARCH_NAME" = "arm64" -o "$ARCH_NAME" = "armv7" ] - then - ARCHS="$ARCHS $ARCH_NAME" - else - echo "Invalid architecture $ARCH" - exit 1 - fi -done - -BUILD_DIR=$3 -SOURCE_DIR=$4 - -FF_VERSION="4.1" -SOURCE="$SOURCE_DIR/ffmpeg-$FF_VERSION" - -GAS_PREPROCESSOR_PATH="$SOURCE_DIR/gas-preprocessor.pl" - -FAT="$BUILD_DIR/FFmpeg-iOS" - -SCRATCH="$BUILD_DIR/scratch" -THIN="$BUILD_DIR/thin" - -PKG_CONFIG="$SOURCE_DIR/pkg-config" - -export PATH="$SOURCE_DIR:$PATH" - -LIB_NAMES="libavcodec libavformat libavutil libswresample" - -set -e - -CONFIGURE_FLAGS="--enable-cross-compile --disable-programs \ - --disable-armv5te --disable-armv6 --disable-armv6t2 \ - --disable-doc --enable-pic --disable-all --disable-everything \ - --enable-avcodec \ - --enable-swresample \ - --enable-avformat \ - --disable-xlib \ - --enable-libopus \ - --enable-audiotoolbox \ - --enable-bsf=aac_adtstoasc \ - --enable-decoder=h264,hevc,libopus,mp3_at,aac,flac,alac_at,pcm_s16le,pcm_s24le,gsm_ms_at \ - --enable-demuxer=aac,mov,m4v,mp3,ogg,libopus,flac,wav,aiff,matroska \ - --enable-parser=aac,h264,mp3,libopus \ - --enable-protocol=file \ - --enable-muxer=mp4 \ - " - - -#--enable-hwaccel=h264_videotoolbox,hevc_videotoolbox \ - -if [ "$1" = "debug" ]; -then - CONFIGURE_FLAGS="$CONFIGURE_FLAGS --disable-optimizations --disable-stripping" -elif [ "$1" = "release" ]; -then - CONFIGURE_FLAGS="$CONFIGURE_FLAGS --disable-debug" -else - echo "No configuration specified (debug / release)" - exit 1 -fi - -COMPILE="y" - -DEPLOYMENT_TARGET="8.0" - -LIBS_HASH="" -for ARCH in $ARCHS -do - for LIB_NAME in $LIB_NAMES - do - LIB="$SCRATCH/$ARCH/$LIB_NAME/$LIB_NAME.a" - if [ -e "$LIB" ] - then - LIB_DATE=`crc32 "$LIB"` - LIBS_HASH="$LIBS_HASH $ARCH/$LIB:$LIB_DATE" - fi - done -done - -if [ "$COMPILE" ] -then - if [ ! `which yasm` ]; then - echo 'Yasm not found' - exit 1 - fi - if [ ! `which pkg-config` ]; then - echo 'pkg-config not found' - exit 1 - else - echo "PATH=$PATH" - echo "pkg-config=$(which pkg-config)" - fi - if [ ! `which "$GAS_PREPROCESSOR_PATH"` ]; then - echo '$GAS_PREPROCESSOR_PATH not found.' - exit 1 - fi - - if [ ! -r $SOURCE ]; then - echo "FFmpeg source not found at $SOURCE" - exit 1 - fi - - CWD="$BUILD_DIR" - for ARCH in $ARCHS - do - echo "building $ARCH..." - mkdir -p "$SCRATCH/$ARCH" - cd "$SCRATCH/$ARCH" - - LIBOPUS_PATH="$SOURCE_DIR/libopus" - - CFLAGS="-arch $ARCH" - if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ] - then - PLATFORM="iPhoneSimulator" - CFLAGS="$CFLAGS -mios-simulator-version-min=$DEPLOYMENT_TARGET" - else - PLATFORM="iPhoneOS" - CFLAGS="$CFLAGS -mios-version-min=$DEPLOYMENT_TARGET" - if [ "$ARCH" = "arm64" ] - then - EXPORT="GASPP_FIX_XCODE5=1" - fi - fi - - XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'` - CC="xcrun -sdk $XCRUN_SDK clang" - - if [ "$ARCH" = "arm64" ] - then - AS="$GAS_PREPROCESSOR_PATH -arch aarch64 -- $CC" - else - AS="$GAS_PREPROCESSOR_PATH -- $CC" - fi - - CXXFLAGS="$CFLAGS" - LDFLAGS="$CFLAGS" - - CONFIGURED_MARKER="$THIN/$ARCH/configured_marker" - CONFIGURED_MARKER_CONTENTS="" - if [ -r "$CONFIGURED_MARKER" ] - then - CONFIGURED_MARKER_CONTENTS=`cat "$CONFIGURED_MARKER"` - fi - if [ "$CONFIGURED_MARKER_CONTENTS" = "$CONFIGURE_FLAGS" ] - then - echo "1" >/dev/null - else - mkdir -p "$THIN/$ARCH" - TMPDIR=${TMPDIR/%\/} "$SOURCE/configure" \ - --target-os=darwin \ - --arch=$ARCH \ - --cc="$CC" \ - --as="$AS" \ - $CONFIGURE_FLAGS \ - --extra-cflags="$CFLAGS" \ - --extra-ldflags="$LDFLAGS" \ - --prefix="$THIN/$ARCH" \ - --pkg-config="$PKG_CONFIG" \ - --pkg-config-flags="--libopus_path $LIBOPUS_PATH" \ - || exit 1 - echo "$CONFIGURE_FLAGS" > "$CONFIGURED_MARKER" - fi - - CORE_COUNT=`sysctl -n hw.logicalcpu` - make -j$CORE_COUNT install $EXPORT || exit 1 - cd "$CWD" - done -fi - -UPDATED_LIBS_HASH="" -for ARCH in $ARCHS -do - for LIB_NAME in $LIB_NAMES - do - LIB="$SCRATCH/$ARCH/$LIB_NAME/$LIB_NAME.a" - if [ -e "$LIB" ] - then - LIB_DATE=`crc32 "$LIB"` - UPDATED_LIBS_HASH="$UPDATED_LIBS_HASH $ARCH/$LIB:$LIB_DATE" - fi - done -done - -if [ "$UPDATED_LIBS_HASH" = "$LIBS_HASH" ] -then - echo "Libs aren't changed, skipping lipo" -else - echo "UPDATED_LIBS_HASH=$UPDATED_LIBS_HASH" - echo "LIBS_HASH=$LIBS_HASH" - LIPO="y" -fi - -if [ "$LIPO" ] -then - echo "building fat binaries..." - mkdir -p "$FAT"/lib - set - $ARCHS - CWD="$BUILD_DIR" - cd "$THIN/$1/lib" - for LIB in *.a - do - cd "$CWD" - echo lipo -create `find "$THIN" -name "$LIB"` -output "$FAT/lib/$LIB" 1>&2 - LIPO_INPUT=`find "$THIN" -name "$LIB"` - lipo -create $LIPO_INPUT -output "$FAT/lib/$LIB" || exit 1 - done - - cd "$CWD" - cp -rf "$THIN/$1/include" "$FAT" -fi - -echo Done diff --git a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus.h b/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus.h deleted file mode 100644 index d282f21d25..0000000000 --- a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus.h +++ /dev/null @@ -1,981 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus.h - * @brief Opus reference implementation API - */ - -#ifndef OPUS_H -#define OPUS_H - -#include "opus_types.h" -#include "opus_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @mainpage Opus - * - * The Opus codec is designed for interactive speech and audio transmission over the Internet. - * It is designed by the IETF Codec Working Group and incorporates technology from - * Skype's SILK codec and Xiph.Org's CELT codec. - * - * The Opus codec is designed to handle a wide range of interactive audio applications, - * including Voice over IP, videoconferencing, in-game chat, and even remote live music - * performances. It can scale from low bit-rate narrowband speech to very high quality - * stereo music. Its main features are: - - * @li Sampling rates from 8 to 48 kHz - * @li Bit-rates from 6 kb/s to 510 kb/s - * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) - * @li Audio bandwidth from narrowband to full-band - * @li Support for speech and music - * @li Support for mono and stereo - * @li Support for multichannel (up to 255 channels) - * @li Frame sizes from 2.5 ms to 60 ms - * @li Good loss robustness and packet loss concealment (PLC) - * @li Floating point and fixed-point implementation - * - * Documentation sections: - * @li @ref opus_encoder - * @li @ref opus_decoder - * @li @ref opus_repacketizer - * @li @ref opus_multistream - * @li @ref opus_libinfo - * @li @ref opus_custom - */ - -/** @defgroup opus_encoder Opus Encoder - * @{ - * - * @brief This page describes the process and functions used to encode Opus. - * - * Since Opus is a stateful codec, the encoding process starts with creating an encoder - * state. This can be done with: - * - * @code - * int error; - * OpusEncoder *enc; - * enc = opus_encoder_create(Fs, channels, application, &error); - * @endcode - * - * From this point, @c enc can be used for encoding an audio stream. An encoder state - * @b must @b not be used for more than one stream at the same time. Similarly, the encoder - * state @b must @b not be re-initialized for each frame. - * - * While opus_encoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * - * @code - * int size; - * int error; - * OpusEncoder *enc; - * size = opus_encoder_get_size(channels); - * enc = malloc(size); - * error = opus_encoder_init(enc, Fs, channels, application); - * @endcode - * - * where opus_encoder_get_size() returns the required size for the encoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The encoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * It is possible to change some of the encoder's settings using the opus_encoder_ctl() - * interface. All these settings already default to the recommended value, so they should - * only be changed when necessary. The most common settings one may want to change are: - * - * @code - * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); - * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); - * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); - * @endcode - * - * where - * - * @arg bitrate is in bits per second (b/s) - * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest - * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC - * - * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. - * - * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: - * @code - * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); - * @endcode - * - * where - *
    - *
  • audio_frame is the audio data in opus_int16 (or float for opus_encode_float())
  • - *
  • frame_size is the duration of the frame in samples (per channel)
  • - *
  • packet is the byte array to which the compressed data is written
  • - *
  • max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). - * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.
  • - *
- * - * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. - * The return value can be negative, which indicates that an error has occurred. If the return value - * is 2 bytes or less, then the packet does not need to be transmitted (DTX). - * - * Once the encoder state if no longer needed, it can be destroyed with - * - * @code - * opus_encoder_destroy(enc); - * @endcode - * - * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), - * then no action is required aside from potentially freeing the memory that was manually - * allocated for it (calling free(enc) for the example above) - * - */ - -/** Opus encoder state. - * This contains the complete state of an Opus encoder. - * It is position independent and can be freely copied. - * @see opus_encoder_create,opus_encoder_init - */ -typedef struct OpusEncoder OpusEncoder; - -/** Gets the size of an OpusEncoder structure. - * @param[in] channels int: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); - -/** - */ - -/** Allocates and initializes an encoder state. - * There are three coding modes: - * - * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice - * signals. It enhances the input signal by high-pass filtering and - * emphasizing formants and harmonics. Optionally it includes in-band - * forward error correction to protect against packet loss. Use this - * mode for typical VoIP applications. Because of the enhancement, - * even at high bitrates the output may sound different from the input. - * - * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most - * non-voice signals like music. Use this mode for music and mixed - * (music/voice) content, broadcast, and applications requiring less - * than 15 ms of coding delay. - * - * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that - * disables the speech-optimized mode in exchange for slightly reduced delay. - * This mode can only be set on an newly initialized or freshly reset encoder - * because it changes the codec delay. - * - * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). - * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) in input signal - * @param [in] application int: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @param [out] error int*: @ref opus_errorcodes - * @note Regardless of the sampling rate and number channels selected, the Opus encoder - * can switch to a lower audio bandwidth or number of channels if the bitrate - * selected is too low. This also means that it is safe to always use 48 kHz stereo input - * and let the encoder optimize the encoding. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( - opus_int32 Fs, - int channels, - int application, - int *error -); - -/** Initializes a previously allocated encoder state - * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. - * @see opus_encoder_create(),opus_encoder_get_size() - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) in input signal - * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_encoder_init( - OpusEncoder *st, - opus_int32 Fs, - int channels, - int application -) OPUS_ARG_NONNULL(1); - -/** Encodes an Opus frame. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size int: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( - OpusEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes an Opus frame from floating point input. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. - * Samples with a range beyond +/-1.0 are supported but will - * be clipped by decoders using the integer API and should - * only be used if it is known that the far end supports - * extended dynamic range. - * length is frame_size*channels*sizeof(float) - * @param [in] frame_size int: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( - OpusEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an OpusEncoder allocated by opus_encoder_create(). - * @param[in] st OpusEncoder*: State to be freed. - */ -OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); - -/** Perform a CTL function on an Opus encoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st OpusEncoder*: Encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_encoderctls. - * @see opus_genericctls - * @see opus_encoderctls - */ -OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); -/**@}*/ - -/** @defgroup opus_decoder Opus Decoder - * @{ - * - * @brief This page describes the process and functions used to decode Opus. - * - * The decoding process also starts with creating a decoder - * state. This can be done with: - * @code - * int error; - * OpusDecoder *dec; - * dec = opus_decoder_create(Fs, channels, &error); - * @endcode - * where - * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 - * @li channels is the number of channels (1 or 2) - * @li error will hold the error code in case of failure (or #OPUS_OK on success) - * @li the return value is a newly created decoder state to be used for decoding - * - * While opus_decoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * @code - * int size; - * int error; - * OpusDecoder *dec; - * size = opus_decoder_get_size(channels); - * dec = malloc(size); - * error = opus_decoder_init(dec, Fs, channels); - * @endcode - * where opus_decoder_get_size() returns the required size for the decoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The decoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: - * @code - * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); - * @endcode - * where - * - * @li packet is the byte array containing the compressed data - * @li len is the exact number of bytes contained in the packet - * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) - * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array - * - * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. - * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio - * buffer is too small to hold the decoded audio. - * - * Opus is a stateful codec with overlapping blocks and as a result Opus - * packets are not coded independently of each other. Packets must be - * passed into the decoder serially and in the correct order for a correct - * decode. Lost packets can be replaced with loss concealment by calling - * the decoder with a null pointer and zero length for the missing packet. - * - * A single codec state may only be accessed from a single thread at - * a time and any required locking must be performed by the caller. Separate - * streams must be decoded with separate decoder states and can be decoded - * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK - * defined. - * - */ - -/** Opus decoder state. - * This contains the complete state of an Opus decoder. - * It is position independent and can be freely copied. - * @see opus_decoder_create,opus_decoder_init - */ -typedef struct OpusDecoder OpusDecoder; - -/** Gets the size of an OpusDecoder structure. - * @param [in] channels int: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); - -/** Allocates and initializes a decoder state. - * @param [in] Fs opus_int32: Sample rate to decode at (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) to decode - * @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes - * - * Internally Opus stores data at 48000 Hz, so that should be the default - * value for Fs. However, the decoder can efficiently decode to buffers - * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use - * data at the full sample rate, or knows the compressed data doesn't - * use the full frequency range, it can request decoding at a reduced - * rate. Likewise, the decoder is capable of filling in either mono or - * interleaved stereo pcm buffers, at the caller's request. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( - opus_int32 Fs, - int channels, - int *error -); - -/** Initializes a previously allocated decoder state. - * The state must be at least the size returned by opus_decoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st OpusDecoder*: Decoder state. - * @param [in] Fs opus_int32: Sampling rate to decode to (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) to decode - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_decoder_init( - OpusDecoder *st, - opus_int32 Fs, - int channels -) OPUS_ARG_NONNULL(1); - -/** Decode an Opus packet. - * @param [in] st OpusDecoder*: Decoder state - * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len opus_int32: Number of bytes in payload* - * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size must be a multiple of 2.5 ms. - * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available, the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode an Opus packet with floating point output. - * @param [in] st OpusDecoder*: Decoder state - * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len opus_int32: Number of bytes in payload - * @param [out] pcm float*: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(float) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size must be a multiple of 2.5 ms. - * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on an Opus decoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st OpusDecoder*: Decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_decoderctls. - * @see opus_genericctls - * @see opus_decoderctls - */ -OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an OpusDecoder allocated by opus_decoder_create(). - * @param[in] st OpusDecoder*: State to be freed. - */ -OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); - -/** Parse an opus packet into one or more frames. - * Opus_decode will perform this operation internally so most applications do - * not need to use this function. - * This function does not copy the frames, the returned pointers are pointers into - * the input packet. - * @param [in] data char*: Opus packet to be parsed - * @param [in] len opus_int32: size of data - * @param [out] out_toc char*: TOC pointer - * @param [out] frames char*[48] encapsulated frames - * @param [out] size opus_int16[48] sizes of the encapsulated frames - * @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) - * @returns number of frames - */ -OPUS_EXPORT int opus_packet_parse( - const unsigned char *data, - opus_int32 len, - unsigned char *out_toc, - const unsigned char *frames[48], - opus_int16 size[48], - int *payload_offset -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5); - -/** Gets the bandwidth of an Opus packet. - * @param [in] data char*: Opus packet - * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) - * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) - * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) - * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) - * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples per frame from an Opus packet. - * @param [in] data char*: Opus packet. - * This must contain at least one byte of - * data. - * @param [in] Fs opus_int32: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples per frame. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of channels from an Opus packet. - * @param [in] data char*: Opus packet - * @returns Number of channels - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of frames in an Opus packet. - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @returns Number of frames - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @param [in] Fs opus_int32: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] dec OpusDecoder*: Decoder state - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - -/** Applies soft-clipping to bring a float signal within the [-1,1] range. If - * the signal is already in that range, nothing is done. If there are values - * outside of [-1,1], then the signal is clipped as smoothly as possible to - * both fit in the range and avoid creating excessive distortion in the - * process. - * @param [in,out] pcm float*: Input PCM and modified PCM - * @param [in] frame_size int Number of samples per channel to process - * @param [in] channels int: Number of channels - * @param [in,out] softclip_mem float*: State memory for the soft clipping process (one float per channel, initialized to zero) - */ -OPUS_EXPORT void opus_pcm_soft_clip(float *pcm, int frame_size, int channels, float *softclip_mem); - - -/**@}*/ - -/** @defgroup opus_repacketizer Repacketizer - * @{ - * - * The repacketizer can be used to merge multiple Opus packets into a single - * packet or alternatively to split Opus packets that have previously been - * merged. Splitting valid Opus packets is always guaranteed to succeed, - * whereas merging valid packets only succeeds if all frames have the same - * mode, bandwidth, and frame size, and when the total duration of the merged - * packet is no more than 120 ms. The 120 ms limit comes from the - * specification and limits decoder memory requirements at a point where - * framing overhead becomes negligible. - * - * The repacketizer currently only operates on elementary Opus - * streams. It will not manipualte multistream packets successfully, except in - * the degenerate case where they consist of data from a single stream. - * - * The repacketizing process starts with creating a repacketizer state, either - * by calling opus_repacketizer_create() or by allocating the memory yourself, - * e.g., - * @code - * OpusRepacketizer *rp; - * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); - * if (rp != NULL) - * opus_repacketizer_init(rp); - * @endcode - * - * Then the application should submit packets with opus_repacketizer_cat(), - * extract new packets with opus_repacketizer_out() or - * opus_repacketizer_out_range(), and then reset the state for the next set of - * input packets via opus_repacketizer_init(). - * - * For example, to split a sequence of packets into individual frames: - * @code - * unsigned char *data; - * int len; - * while (get_next_packet(&data, &len)) - * { - * unsigned char out[1276]; - * opus_int32 out_len; - * int nb_frames; - * int err; - * int i; - * err = opus_repacketizer_cat(rp, data, len); - * if (err != OPUS_OK) - * { - * release_packet(data); - * return err; - * } - * nb_frames = opus_repacketizer_get_nb_frames(rp); - * for (i = 0; i < nb_frames; i++) - * { - * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packet(data); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * } - * opus_repacketizer_init(rp); - * release_packet(data); - * } - * @endcode - * - * Alternatively, to combine a sequence of frames into packets that each - * contain up to TARGET_DURATION_MS milliseconds of data: - * @code - * // The maximum number of packets with duration TARGET_DURATION_MS occurs - * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) - * // packets. - * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; - * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; - * int nb_packets; - * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; - * opus_int32 out_len; - * int prev_toc; - * nb_packets = 0; - * while (get_next_packet(data+nb_packets, len+nb_packets)) - * { - * int nb_frames; - * int err; - * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); - * if (nb_frames < 1) - * { - * release_packets(data, nb_packets+1); - * return nb_frames; - * } - * nb_frames += opus_repacketizer_get_nb_frames(rp); - * // If adding the next packet would exceed our target, or it has an - * // incompatible TOC sequence, output the packets we already have before - * // submitting it. - * // N.B., The nb_packets > 0 check ensures we've submitted at least one - * // packet since the last call to opus_repacketizer_init(). Otherwise a - * // single packet longer than TARGET_DURATION_MS would cause us to try to - * // output an (invalid) empty packet. It also ensures that prev_toc has - * // been set to a valid value. Additionally, len[nb_packets] > 0 is - * // guaranteed by the call to opus_packet_get_nb_frames() above, so the - * // reference to data[nb_packets][0] should be valid. - * if (nb_packets > 0 && ( - * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || - * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > - * TARGET_DURATION_MS*48)) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packets(data, nb_packets+1); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * opus_repacketizer_init(rp); - * release_packets(data, nb_packets); - * data[0] = data[nb_packets]; - * len[0] = len[nb_packets]; - * nb_packets = 0; - * } - * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); - * if (err != OPUS_OK) - * { - * release_packets(data, nb_packets+1); - * return err; - * } - * prev_toc = data[nb_packets][0]; - * nb_packets++; - * } - * // Output the final, partial packet. - * if (nb_packets > 0) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * release_packets(data, nb_packets); - * if (out_len < 0) - * return (int)out_len; - * output_next_packet(out, out_len); - * } - * @endcode - * - * An alternate way of merging packets is to simply call opus_repacketizer_cat() - * unconditionally until it fails. At that point, the merged packet can be - * obtained with opus_repacketizer_out() and the input packet for which - * opus_repacketizer_cat() needs to be re-added to a newly reinitialized - * repacketizer state. - */ - -typedef struct OpusRepacketizer OpusRepacketizer; - -/** Gets the size of an OpusRepacketizer structure. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); - -/** (Re)initializes a previously allocated repacketizer state. - * The state must be at least the size returned by opus_repacketizer_get_size(). - * This can be used for applications which use their own allocator instead of - * malloc(). - * It must also be called to reset the queue of packets waiting to be - * repacketized, which is necessary if the maximum packet duration of 120 ms - * is reached or if you wish to submit packets with a different Opus - * configuration (coding mode, audio bandwidth, frame size, or channel count). - * Failure to do so will prevent a new packet from being added with - * opus_repacketizer_cat(). - * @see opus_repacketizer_create - * @see opus_repacketizer_get_size - * @see opus_repacketizer_cat - * @param rp OpusRepacketizer*: The repacketizer state to - * (re)initialize. - * @returns A pointer to the same repacketizer state that was passed in. - */ -OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Allocates memory and initializes the new repacketizer with - * opus_repacketizer_init(). - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); - -/** Frees an OpusRepacketizer allocated by - * opus_repacketizer_create(). - * @param[in] rp OpusRepacketizer*: State to be freed. - */ -OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); - -/** Add a packet to the current repacketizer state. - * This packet must match the configuration of any packets already submitted - * for repacketization since the last call to opus_repacketizer_init(). - * This means that it must have the same coding mode, audio bandwidth, frame - * size, and channel count. - * This can be checked in advance by examining the top 6 bits of the first - * byte of the packet, and ensuring they match the top 6 bits of the first - * byte of any previously submitted packet. - * The total duration of audio in the repacketizer state also must not exceed - * 120 ms, the maximum duration of a single packet, after adding this packet. - * - * The contents of the current repacketizer state can be extracted into new - * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). - * - * In order to add a packet with a different configuration or to add more - * audio beyond 120 ms, you must clear the repacketizer state by calling - * opus_repacketizer_init(). - * If a packet is too large to add to the current repacketizer state, no part - * of it is added, even if it contains multiple frames, some of which might - * fit. - * If you wish to be able to add parts of such packets, you should first use - * another repacketizer to split the packet into pieces and add them - * individually. - * @see opus_repacketizer_out_range - * @see opus_repacketizer_out - * @see opus_repacketizer_init - * @param rp OpusRepacketizer*: The repacketizer state to which to - * add the packet. - * @param[in] data const unsigned char*: The packet data. - * The application must ensure - * this pointer remains valid - * until the next call to - * opus_repacketizer_init() or - * opus_repacketizer_destroy(). - * @param len opus_int32: The number of bytes in the packet data. - * @returns An error code indicating whether or not the operation succeeded. - * @retval #OPUS_OK The packet's contents have been added to the repacketizer - * state. - * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, - * the packet's TOC sequence was not compatible - * with previously submitted packets (because - * the coding mode, audio bandwidth, frame size, - * or channel count did not match), or adding - * this packet would increase the total amount of - * audio stored in the repacketizer state to more - * than 120 ms. - */ -OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * @param rp OpusRepacketizer*: The repacketizer state from which to - * construct the new packet. - * @param begin int: The index of the first frame in the current - * repacketizer state to include in the output. - * @param end int: One past the index of the last frame in the - * current repacketizer state to include in the - * output. - * @param[out] data const unsigned char*: The buffer in which to - * store the output packet. - * @param maxlen opus_int32: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * 1276 for a single frame, - * or for multiple frames, - * 1277*(end-begin). - * However, 1*(end-begin) plus - * the size of all packet data submitted to - * the repacketizer since the last call to - * opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG [begin,end) was an invalid range of - * frames (begin < 0, begin >= end, or end > - * opus_repacketizer_get_nb_frames()). - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Return the total number of frames contained in packet data submitted to - * the repacketizer state so far via opus_repacketizer_cat() since the last - * call to opus_repacketizer_init() or opus_repacketizer_create(). - * This defines the valid range of packets that can be extracted with - * opus_repacketizer_out_range() or opus_repacketizer_out(). - * @param rp OpusRepacketizer*: The repacketizer state containing the - * frames. - * @returns The total number of frames contained in the packet data submitted - * to the repacketizer state. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * This is a convenience routine that returns all the data submitted so far - * in a single packet. - * It is equivalent to calling - * @code - * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), - * data, maxlen) - * @endcode - * @param rp OpusRepacketizer*: The repacketizer state from which to - * construct the new packet. - * @param[out] data const unsigned char*: The buffer in which to - * store the output packet. - * @param maxlen opus_int32: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * 1277*opus_repacketizer_get_nb_frames(rp). - * However, - * 1*opus_repacketizer_get_nb_frames(rp) - * plus the size of all packet data - * submitted to the repacketizer since the - * last call to opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); - -/** Pads a given Opus packet to a larger size (possibly changing the TOC sequence). - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to pad. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param new_len opus_int32: The desired size of the packet after padding. - * This must be at least as large as len. - * @returns an error code - * @retval #OPUS_OK \a on success. - * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len); - -/** Remove all padding from a given Opus packet and rewrite the TOC sequence to - * minimize space usage. - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to strip. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @returns The new size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG \a len was less than 1. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_packet_unpad(unsigned char *data, opus_int32 len); - -/** Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence). - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to pad. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param new_len opus_int32: The desired size of the packet after padding. - * This must be at least 1. - * @param nb_streams opus_int32: The number of streams (not channels) in the packet. - * This must be at least as large as len. - * @returns an error code - * @retval #OPUS_OK \a on success. - * @retval #OPUS_BAD_ARG \a len was less than 1. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT int opus_multistream_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len, int nb_streams); - -/** Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to - * minimize space usage. - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to strip. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param nb_streams opus_int32: The number of streams (not channels) in the packet. - * This must be at least 1. - * @returns The new size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, int nb_streams); - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_H */ diff --git a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_defines.h b/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_defines.h deleted file mode 100644 index fbf5d0eb74..0000000000 --- a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_defines.h +++ /dev/null @@ -1,788 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_defines.h - * @brief Opus reference implementation constants - */ - -#ifndef OPUS_DEFINES_H -#define OPUS_DEFINES_H - -#include "opus_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup opus_errorcodes Error codes - * @{ - */ -/** No error @hideinitializer*/ -#define OPUS_OK 0 -/** One or more invalid/out of range arguments @hideinitializer*/ -#define OPUS_BAD_ARG -1 -/** Not enough bytes allocated in the buffer @hideinitializer*/ -#define OPUS_BUFFER_TOO_SMALL -2 -/** An internal error was detected @hideinitializer*/ -#define OPUS_INTERNAL_ERROR -3 -/** The compressed data passed is corrupted @hideinitializer*/ -#define OPUS_INVALID_PACKET -4 -/** Invalid/unsupported request number @hideinitializer*/ -#define OPUS_UNIMPLEMENTED -5 -/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ -#define OPUS_INVALID_STATE -6 -/** Memory allocation has failed @hideinitializer*/ -#define OPUS_ALLOC_FAIL -7 -/**@}*/ - -/** @cond OPUS_INTERNAL_DOC */ -/**Export control for opus functions */ - -#ifndef OPUS_EXPORT -# if defined(WIN32) -# if defined(OPUS_BUILD) && defined(DLL_EXPORT) -# define OPUS_EXPORT __declspec(dllexport) -# else -# define OPUS_EXPORT -# endif -# elif defined(__GNUC__) && defined(OPUS_BUILD) -# define OPUS_EXPORT __attribute__ ((visibility ("default"))) -# else -# define OPUS_EXPORT -# endif -#endif - -# if !defined(OPUS_GNUC_PREREQ) -# if defined(__GNUC__)&&defined(__GNUC_MINOR__) -# define OPUS_GNUC_PREREQ(_maj,_min) \ - ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) -# else -# define OPUS_GNUC_PREREQ(_maj,_min) 0 -# endif -# endif - -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(3,0) -# define OPUS_RESTRICT __restrict__ -# elif (defined(_MSC_VER) && _MSC_VER >= 1400) -# define OPUS_RESTRICT __restrict -# else -# define OPUS_RESTRICT -# endif -#else -# define OPUS_RESTRICT restrict -#endif - -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(2,7) -# define OPUS_INLINE __inline__ -# elif (defined(_MSC_VER)) -# define OPUS_INLINE __inline -# else -# define OPUS_INLINE -# endif -#else -# define OPUS_INLINE inline -#endif - -/**Warning attributes for opus functions - * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out - * some paranoid null checks. */ -#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) -#else -# define OPUS_WARN_UNUSED_RESULT -#endif -#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) -#else -# define OPUS_ARG_NONNULL(_x) -#endif - -/** These are the actual Encoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -#define OPUS_SET_APPLICATION_REQUEST 4000 -#define OPUS_GET_APPLICATION_REQUEST 4001 -#define OPUS_SET_BITRATE_REQUEST 4002 -#define OPUS_GET_BITRATE_REQUEST 4003 -#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 -#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 -#define OPUS_SET_VBR_REQUEST 4006 -#define OPUS_GET_VBR_REQUEST 4007 -#define OPUS_SET_BANDWIDTH_REQUEST 4008 -#define OPUS_GET_BANDWIDTH_REQUEST 4009 -#define OPUS_SET_COMPLEXITY_REQUEST 4010 -#define OPUS_GET_COMPLEXITY_REQUEST 4011 -#define OPUS_SET_INBAND_FEC_REQUEST 4012 -#define OPUS_GET_INBAND_FEC_REQUEST 4013 -#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 -#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 -#define OPUS_SET_DTX_REQUEST 4016 -#define OPUS_GET_DTX_REQUEST 4017 -#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 -#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 -#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 -#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 -#define OPUS_SET_SIGNAL_REQUEST 4024 -#define OPUS_GET_SIGNAL_REQUEST 4025 -#define OPUS_GET_LOOKAHEAD_REQUEST 4027 -/* #define OPUS_RESET_STATE 4028 */ -#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 -#define OPUS_GET_FINAL_RANGE_REQUEST 4031 -#define OPUS_GET_PITCH_REQUEST 4033 -#define OPUS_SET_GAIN_REQUEST 4034 -#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ -#define OPUS_SET_LSB_DEPTH_REQUEST 4036 -#define OPUS_GET_LSB_DEPTH_REQUEST 4037 -#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 -#define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040 -#define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041 -#define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042 -#define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043 -/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ -#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046 -#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047 - -/** Defines for the presence of extended APIs. */ -#define OPUS_HAVE_OPUS_PROJECTION_H - -/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ -#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) -#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) -#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) -#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr))) -/** @endcond */ - -/** @defgroup opus_ctlvalues Pre-defined values for CTL interface - * @see opus_genericctls, opus_encoderctls - * @{ - */ -/* Values for the various encoder CTLs */ -#define OPUS_AUTO -1000 /**opus_int32: Allowed values: 0-10, inclusive. - * - * @hideinitializer */ -#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) -/** Gets the encoder's complexity configuration. - * @see OPUS_SET_COMPLEXITY - * @param[out] x opus_int32 *: Returns a value in the range 0-10, - * inclusive. - * @hideinitializer */ -#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) - -/** Configures the bitrate in the encoder. - * Rates from 500 to 512000 bits per second are meaningful, as well as the - * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. - * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much - * rate as it can, which is useful for controlling the rate by adjusting the - * output buffer size. - * @see OPUS_GET_BITRATE - * @param[in] x opus_int32: Bitrate in bits per second. The default - * is determined based on the number of - * channels and the input sampling rate. - * @hideinitializer */ -#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) -/** Gets the encoder's bitrate configuration. - * @see OPUS_SET_BITRATE - * @param[out] x opus_int32 *: Returns the bitrate in bits per second. - * The default is determined based on the - * number of channels and the input - * sampling rate. - * @hideinitializer */ -#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables variable bitrate (VBR) in the encoder. - * The configured bitrate may not be met exactly because frames must - * be an integer number of bytes in length. - * @see OPUS_GET_VBR - * @see OPUS_SET_VBR_CONSTRAINT - * @param[in] x opus_int32: Allowed values: - *
- *
0
Hard CBR. For LPC/hybrid modes at very low bit-rate, this can - * cause noticeable quality degradation.
- *
1
VBR (default). The exact type of VBR is controlled by - * #OPUS_SET_VBR_CONSTRAINT.
- *
- * @hideinitializer */ -#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) -/** Determine if variable bitrate (VBR) is enabled in the encoder. - * @see OPUS_SET_VBR - * @see OPUS_GET_VBR_CONSTRAINT - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Hard CBR.
- *
1
VBR (default). The exact type of VBR may be retrieved via - * #OPUS_GET_VBR_CONSTRAINT.
- *
- * @hideinitializer */ -#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables constrained VBR in the encoder. - * This setting is ignored when the encoder is in CBR mode. - * @warning Only the MDCT mode of Opus currently heeds the constraint. - * Speech mode ignores it completely, hybrid mode may fail to obey it - * if the LPC layer uses more bitrate than the constraint would have - * permitted. - * @see OPUS_GET_VBR_CONSTRAINT - * @see OPUS_SET_VBR - * @param[in] x opus_int32: Allowed values: - *
- *
0
Unconstrained VBR.
- *
1
Constrained VBR (default). This creates a maximum of one - * frame of buffering delay assuming a transport with a - * serialization speed of the nominal bitrate.
- *
- * @hideinitializer */ -#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) -/** Determine if constrained VBR is enabled in the encoder. - * @see OPUS_SET_VBR_CONSTRAINT - * @see OPUS_GET_VBR - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Unconstrained VBR.
- *
1
Constrained VBR (default).
- *
- * @hideinitializer */ -#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) - -/** Configures mono/stereo forcing in the encoder. - * This can force the encoder to produce packets encoded as either mono or - * stereo, regardless of the format of the input audio. This is useful when - * the caller knows that the input signal is currently a mono source embedded - * in a stereo stream. - * @see OPUS_GET_FORCE_CHANNELS - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
Not forced (default)
- *
1
Forced mono
- *
2
Forced stereo
- *
- * @hideinitializer */ -#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) -/** Gets the encoder's forced channel configuration. - * @see OPUS_SET_FORCE_CHANNELS - * @param[out] x opus_int32 *: - *
- *
#OPUS_AUTO
Not forced (default)
- *
1
Forced mono
- *
2
Forced stereo
- *
- * @hideinitializer */ -#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) - -/** Configures the maximum bandpass that the encoder will select automatically. - * Applications should normally use this instead of #OPUS_SET_BANDWIDTH - * (leaving that set to the default, #OPUS_AUTO). This allows the - * application to set an upper bound based on the type of input it is - * providing, but still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_MAX_BANDWIDTH - * @param[in] x opus_int32: Allowed values: - *
- *
OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
- *
- * @hideinitializer */ -#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Gets the encoder's configured maximum allowed bandpass. - * @see OPUS_SET_MAX_BANDWIDTH - * @param[out] x opus_int32 *: Allowed values: - *
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
- *
- * @hideinitializer */ -#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Sets the encoder's bandpass to a specific value. - * This prevents the encoder from automatically selecting the bandpass based - * on the available bitrate. If an application knows the bandpass of the input - * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH - * instead, which still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_BANDWIDTH - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
- *
- * @hideinitializer */ -#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Configures the type of signal being encoded. - * This is a hint which helps the encoder's mode selection. - * @see OPUS_GET_SIGNAL - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
- *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
- *
- * @hideinitializer */ -#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal type. - * @see OPUS_SET_SIGNAL - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
- *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
- *
- * @hideinitializer */ -#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) - - -/** Configures the encoder's intended application. - * The initial value is a mandatory argument to the encoder_create function. - * @see OPUS_GET_APPLICATION - * @param[in] x opus_int32: Returns one of the following values: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @hideinitializer */ -#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured application. - * @see OPUS_SET_APPLICATION - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @hideinitializer */ -#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the total samples of delay added by the entire codec. - * This can be queried by the encoder and then the provided number of samples can be - * skipped on from the start of the decoder's output to provide time aligned input - * and output. From the perspective of a decoding application the real data begins this many - * samples late. - * - * The decoder contribution to this delay is identical for all decoders, but the - * encoder portion of the delay may vary from implementation to implementation, - * version to version, or even depend on the encoder's initial configuration. - * Applications needing delay compensation should call this CTL rather than - * hard-coding a value. - * @param[out] x opus_int32 *: Number of lookahead samples - * @hideinitializer */ -#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of inband forward error correction (FEC). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_INBAND_FEC - * @param[in] x opus_int32: Allowed values: - *
- *
0
Disable inband FEC (default).
- *
1
Enable inband FEC.
- *
- * @hideinitializer */ -#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of inband forward error correction. - * @see OPUS_SET_INBAND_FEC - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Inband FEC disabled (default).
- *
1
Inband FEC enabled.
- *
- * @hideinitializer */ -#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's expected packet loss percentage. - * Higher values trigger progressively more loss resistant behavior in the encoder - * at the expense of quality at a given bitrate in the absence of packet loss, but - * greater quality under loss. - * @see OPUS_GET_PACKET_LOSS_PERC - * @param[in] x opus_int32: Loss percentage in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured packet loss percentage. - * @see OPUS_SET_PACKET_LOSS_PERC - * @param[out] x opus_int32 *: Returns the configured loss percentage - * in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of discontinuous transmission (DTX). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_DTX - * @param[in] x opus_int32: Allowed values: - *
- *
0
Disable DTX (default).
- *
1
Enabled DTX.
- *
- * @hideinitializer */ -#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of discontinuous transmission. - * @see OPUS_SET_DTX - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
DTX disabled (default).
- *
1
DTX enabled.
- *
- * @hideinitializer */ -#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) -/** Configures the depth of signal being encoded. - * - * This is a hint which helps the encoder identify silence and near-silence. - * It represents the number of significant bits of linear intensity below - * which the signal contains ignorable quantization or other noise. - * - * For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting - * for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate - * for 16-bit linear pcm input with opus_encode_float(). - * - * When using opus_encode() instead of opus_encode_float(), or when libopus - * is compiled for fixed-point, the encoder uses the minimum of the value - * set here and the value 16. - * - * @see OPUS_GET_LSB_DEPTH - * @param[in] x opus_int32: Input precision in bits, between 8 and 24 - * (default: 24). - * @hideinitializer */ -#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal depth. - * @see OPUS_SET_LSB_DEPTH - * @param[out] x opus_int32 *: Input precision in bits, between 8 and - * 24 (default: 24). - * @hideinitializer */ -#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of variable duration frames. - * When variable duration is enabled, the encoder is free to use a shorter frame - * size than the one requested in the opus_encode*() call. - * It is then the user's responsibility - * to verify how much audio was encoded by checking the ToC byte of the encoded - * packet. The part of the audio that was not encoded needs to be resent to the - * encoder for the next call. Do not use this option unless you really - * know what you are doing. - * @see OPUS_GET_EXPERT_FRAME_DURATION - * @param[in] x opus_int32: Allowed values: - *
- *
OPUS_FRAMESIZE_ARG
Select frame size from the argument (default).
- *
OPUS_FRAMESIZE_2_5_MS
Use 2.5 ms frames.
- *
OPUS_FRAMESIZE_5_MS
Use 5 ms frames.
- *
OPUS_FRAMESIZE_10_MS
Use 10 ms frames.
- *
OPUS_FRAMESIZE_20_MS
Use 20 ms frames.
- *
OPUS_FRAMESIZE_40_MS
Use 40 ms frames.
- *
OPUS_FRAMESIZE_60_MS
Use 60 ms frames.
- *
OPUS_FRAMESIZE_80_MS
Use 80 ms frames.
- *
OPUS_FRAMESIZE_100_MS
Use 100 ms frames.
- *
OPUS_FRAMESIZE_120_MS
Use 120 ms frames.
- *
- * @hideinitializer */ -#define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured use of variable duration frames. - * @see OPUS_SET_EXPERT_FRAME_DURATION - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
OPUS_FRAMESIZE_ARG
Select frame size from the argument (default).
- *
OPUS_FRAMESIZE_2_5_MS
Use 2.5 ms frames.
- *
OPUS_FRAMESIZE_5_MS
Use 5 ms frames.
- *
OPUS_FRAMESIZE_10_MS
Use 10 ms frames.
- *
OPUS_FRAMESIZE_20_MS
Use 20 ms frames.
- *
OPUS_FRAMESIZE_40_MS
Use 40 ms frames.
- *
OPUS_FRAMESIZE_60_MS
Use 60 ms frames.
- *
OPUS_FRAMESIZE_80_MS
Use 80 ms frames.
- *
OPUS_FRAMESIZE_100_MS
Use 100 ms frames.
- *
OPUS_FRAMESIZE_120_MS
Use 120 ms frames.
- *
- * @hideinitializer */ -#define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x) - -/** If set to 1, disables almost all use of prediction, making frames almost - * completely independent. This reduces quality. - * @see OPUS_GET_PREDICTION_DISABLED - * @param[in] x opus_int32: Allowed values: - *
- *
0
Enable prediction (default).
- *
1
Disable prediction.
- *
- * @hideinitializer */ -#define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured prediction status. - * @see OPUS_SET_PREDICTION_DISABLED - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Prediction enabled (default).
- *
1
Prediction disabled.
- *
- * @hideinitializer */ -#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_genericctls Generic CTLs - * - * These macros are used with the \c opus_decoder_ctl and - * \c opus_encoder_ctl calls to generate a particular - * request. - * - * When called on an \c OpusDecoder they apply to that - * particular decoder instance. When called on an - * \c OpusEncoder they apply to the corresponding setting - * on that encoder instance, if present. - * - * Some usage examples: - * - * @code - * int ret; - * opus_int32 pitch; - * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); - * if (ret == OPUS_OK) return ret; - * - * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); - * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); - * - * opus_int32 enc_bw, dec_bw; - * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); - * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); - * if (enc_bw != dec_bw) { - * printf("packet bandwidth mismatch!\n"); - * } - * @endcode - * - * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls - * @{ - */ - -/** Resets the codec state to be equivalent to a freshly initialized state. - * This should be called when switching streams in order to prevent - * the back to back decoding from giving different results from - * one at a time decoding. - * @hideinitializer */ -#define OPUS_RESET_STATE 4028 - -/** Gets the final state of the codec's entropy coder. - * This is used for testing purposes, - * The encoder and decoder state should be identical after coding a payload - * (assuming no data corruption or software bugs) - * - * @param[out] x opus_uint32 *: Entropy coder state - * - * @hideinitializer */ -#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) - -/** Gets the encoder's configured bandpass or the decoder's last bandpass. - * @see OPUS_SET_BANDWIDTH - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
- *
- * @hideinitializer */ -#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Gets the sampling rate the encoder or decoder was initialized with. - * This simply returns the Fs value passed to opus_encoder_init() - * or opus_decoder_init(). - * @param[out] x opus_int32 *: Sampling rate of encoder or decoder. - * @hideinitializer - */ -#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) - -/** If set to 1, disables the use of phase inversion for intensity stereo, - * improving the quality of mono downmixes, but slightly reducing normal - * stereo quality. Disabling phase inversion in the decoder does not comply - * with RFC 6716, although it does not cause any interoperability issue and - * is expected to become part of the Opus standard once RFC 6716 is updated - * by draft-ietf-codec-opus-update. - * @see OPUS_GET_PHASE_INVERSION_DISABLED - * @param[in] x opus_int32: Allowed values: - *
- *
0
Enable phase inversion (default).
- *
1
Disable phase inversion.
- *
- * @hideinitializer */ -#define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured phase inversion status. - * @see OPUS_SET_PHASE_INVERSION_DISABLED - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Stereo phase inversion enabled (default).
- *
1
Stereo phase inversion disabled.
- *
- * @hideinitializer */ -#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_decoderctls Decoder related CTLs - * @see opus_genericctls, opus_encoderctls, opus_decoder - * @{ - */ - -/** Configures decoder gain adjustment. - * Scales the decoded output by a factor specified in Q8 dB units. - * This has a maximum range of -32768 to 32767 inclusive, and returns - * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. - * This setting survives decoder reset. - * - * gain = pow(10, x/(20.0*256)) - * - * @param[in] x opus_int32: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) -/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN - * - * @param[out] x opus_int32 *: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) - -/** Gets the duration (in samples) of the last packet successfully decoded or concealed. - * @param[out] x opus_int32 *: Number of samples (at current sampling rate). - * @hideinitializer */ -#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the pitch of the last decoded frame, if available. - * This can be used for any post-processing algorithm requiring the use of pitch, - * e.g. time stretching/shortening. If the last frame was not voiced, or if the - * pitch was not coded in the frame, then zero is returned. - * - * This CTL is only implemented for decoder instances. - * - * @param[out] x opus_int32 *: pitch period at 48 kHz (or 0 if not available) - * - * @hideinitializer */ -#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_libinfo Opus library information functions - * @{ - */ - -/** Converts an opus error code into a human readable string. - * - * @param[in] error int: Error number - * @returns Error string - */ -OPUS_EXPORT const char *opus_strerror(int error); - -/** Gets the libopus version string. - * - * Applications may look for the substring "-fixed" in the version string to - * determine whether they have a fixed-point or floating-point build at - * runtime. - * - * @returns Version string - */ -OPUS_EXPORT const char *opus_get_version_string(void); -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_DEFINES_H */ diff --git a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_multistream.h b/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_multistream.h deleted file mode 100644 index babcee6905..0000000000 --- a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_multistream.h +++ /dev/null @@ -1,660 +0,0 @@ -/* Copyright (c) 2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_multistream.h - * @brief Opus reference implementation multistream API - */ - -#ifndef OPUS_MULTISTREAM_H -#define OPUS_MULTISTREAM_H - -#include "opus.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** Macros to trigger compilation errors when the wrong types are provided to a - * CTL. */ -/**@{*/ -#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) -#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) -/**@}*/ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 -#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 -/**@}*/ - -/** @endcond */ - -/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and - * @ref opus_decoderctls may be applied to a multistream encoder or decoder as - * well. - * In addition, you may retrieve the encoder or decoder state for an specific - * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or - * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. - */ -/**@{*/ - -/** Gets the encoder state for an individual stream of a multistream encoder. - * @param[in] x opus_int32: The index of the stream whose encoder you - * wish to retrieve. - * This must be non-negative and less than - * the streams parameter used - * to initialize the encoder. - * @param[out] y OpusEncoder**: Returns a pointer to the given - * encoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) - -/** Gets the decoder state for an individual stream of a multistream decoder. - * @param[in] x opus_int32: The index of the stream whose decoder you - * wish to retrieve. - * This must be non-negative and less than - * the streams parameter used - * to initialize the decoder. - * @param[out] y OpusDecoder**: Returns a pointer to the given - * decoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) - -/**@}*/ - -/** @defgroup opus_multistream Opus Multistream API - * @{ - * - * The multistream API allows individual Opus streams to be combined into a - * single packet, enabling support for up to 255 channels. Unlike an - * elementary Opus stream, the encoder and decoder must negotiate the channel - * configuration before the decoder can successfully interpret the data in the - * packets produced by the encoder. Some basic information, such as packet - * duration, can be computed without any special negotiation. - * - * The format for multistream Opus packets is defined in - * RFC 7845 - * and is based on the self-delimited Opus framing described in Appendix B of - * RFC 6716. - * Normal Opus packets are just a degenerate case of multistream Opus packets, - * and can be encoded or decoded with the multistream API by setting - * streams to 1 when initializing the encoder or - * decoder. - * - * Multistream Opus streams can contain up to 255 elementary Opus streams. - * These may be either "uncoupled" or "coupled", indicating that the decoder - * is configured to decode them to either 1 or 2 channels, respectively. - * The streams are ordered so that all coupled streams appear at the - * beginning. - * - * A mapping table defines which decoded channel i - * should be used for each input/output (I/O) channel j. This table is - * typically provided as an unsigned char array. - * Let i = mapping[j] be the index for I/O channel j. - * If i < 2*coupled_streams, then I/O channel j is - * encoded as the left channel of stream (i/2) if i - * is even, or as the right channel of stream (i/2) if - * i is odd. Otherwise, I/O channel j is encoded as - * mono in stream (i - coupled_streams), unless it has the special - * value 255, in which case it is omitted from the encoding entirely (the - * decoder will reproduce it as silence). Each value i must either - * be the special value 255 or be less than streams + coupled_streams. - * - * The output channels specified by the encoder - * should use the - * Vorbis - * channel ordering. A decoder may wish to apply an additional permutation - * to the mapping the encoder used to achieve a different output channel - * order (e.g. for outputing in WAV order). - * - * Each multistream packet contains an Opus packet for each stream, and all of - * the Opus packets in a single multistream packet must have the same - * duration. Therefore the duration of a multistream packet can be extracted - * from the TOC sequence of the first stream, which is located at the - * beginning of the packet, just like an elementary Opus stream: - * - * @code - * int nb_samples; - * int nb_frames; - * nb_frames = opus_packet_get_nb_frames(data, len); - * if (nb_frames < 1) - * return nb_frames; - * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; - * @endcode - * - * The general encoding and decoding process proceeds exactly the same as in - * the normal @ref opus_encoder and @ref opus_decoder APIs. - * See their documentation for an overview of how to use the corresponding - * multistream functions. - */ - -/** Opus multistream encoder state. - * This contains the complete state of a multistream Opus encoder. - * It is position independent and can be freely copied. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_init - */ -typedef struct OpusMSEncoder OpusMSEncoder; - -/** Opus multistream decoder state. - * This contains the complete state of a multistream Opus decoder. - * It is position independent and can be freely copied. - * @see opus_multistream_decoder_create - * @see opus_multistream_decoder_init - */ -typedef struct OpusMSDecoder OpusMSDecoder; - -/**\name Multistream encoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSEncoder structure. - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( - int streams, - int coupled_streams -); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a multistream encoder state. - * Call opus_multistream_encoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param[in] mapping const unsigned char[channels]: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(5); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); - -/** Initialize a previously allocated multistream encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_get_size - * @param st OpusMSEncoder*: Multistream encoder state to initialize. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param[in] mapping const unsigned char[channels]: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -OPUS_EXPORT int opus_multistream_surround_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6) OPUS_ARG_NONNULL(7); - -/** Encodes a multistream Opus frame. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param[in] pcm const opus_int16*: The input signal as interleaved - * samples. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( - OpusMSEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes a multistream Opus frame from floating point input. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param[in] pcm const float*: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( - OpusMSEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an OpusMSEncoder allocated by - * opus_multistream_encoder_create(). - * @param st OpusMSEncoder*: Multistream encoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); - -/** Perform a CTL function on a multistream Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/**@}*/ - -/**\name Multistream decoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSDecoder structure. - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( - int streams, - int coupled_streams -); - -/** Allocates and initializes a multistream decoder state. - * Call opus_multistream_decoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] mapping const unsigned char[channels]: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int *error -) OPUS_ARG_NONNULL(5); - -/** Intialize a previously allocated decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_decoder_create - * @see opus_multistream_deocder_get_size - * @param st OpusMSEncoder*: Multistream encoder state to initialize. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] mapping const unsigned char[channels]: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_decoder_init( - OpusMSDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -/** Decode a multistream Opus packet. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode a multistream Opus packet with floating point output. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on a multistream Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an OpusMSDecoder allocated by - * opus_multistream_decoder_create(). - * @param st OpusMSDecoder: Multistream decoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_MULTISTREAM_H */ diff --git a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_projection.h b/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_projection.h deleted file mode 100644 index 9dabf4e85c..0000000000 --- a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_projection.h +++ /dev/null @@ -1,568 +0,0 @@ -/* Copyright (c) 2017 Google Inc. - Written by Andrew Allen */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_projection.h - * @brief Opus projection reference API - */ - -#ifndef OPUS_PROJECTION_H -#define OPUS_PROJECTION_H - -#include "opus_multistream.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications.c - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST 6001 -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST 6003 -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST 6005 -/**@}*/ - - -/** @endcond */ - -/** @defgroup opus_projection_ctls Projection specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_projection_encoder_ctl() and opus_projection_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, - * @ref opus_decoderctls, and @ref opus_multistream_ctls may be applied to a - * projection encoder or decoder as well. - */ -/**@{*/ - -/** Gets the gain (in dB. S7.8-format) of the demixing matrix from the encoder. - * @param[out] x opus_int32 *: Returns the gain (in dB. S7.8-format) - * of the demixing matrix. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST, __opus_check_int_ptr(x) - - -/** Gets the size in bytes of the demixing matrix from the encoder. - * @param[out] x opus_int32 *: Returns the size in bytes of the - * demixing matrix. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST, __opus_check_int_ptr(x) - - -/** Copies the demixing matrix to the supplied pointer location. - * @param[out] x unsigned char *: Returns the demixing matrix to the - * supplied pointer location. - * @param y opus_int32: The size in bytes of the reserved memory at the - * pointer location. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX(x,y) OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST, x, __opus_check_int(y) - - -/**@}*/ - -/** Opus projection encoder state. - * This contains the complete state of a projection Opus encoder. - * It is position independent and can be freely copied. - * @see opus_projection_ambisonics_encoder_create - */ -typedef struct OpusProjectionEncoder OpusProjectionEncoder; - - -/** Opus projection decoder state. - * This contains the complete state of a projection Opus decoder. - * It is position independent and can be freely copied. - * @see opus_projection_decoder_create - * @see opus_projection_decoder_init - */ -typedef struct OpusProjectionDecoder OpusProjectionDecoder; - - -/**\name Projection encoder functions */ -/**@{*/ - -/** Gets the size of an OpusProjectionEncoder structure. - * @param channels int: The total number of input channels to encode. - * This must be no more than 255. - * @param mapping_family int: The mapping family to use for selecting - * the appropriate projection. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_ambisonics_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a projection encoder state. - * Call opus_projection_encoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param mapping_family int: The mapping family to use for selecting - * the appropriate projection. - * @param[out] streams int *: The total number of streams that will - * be encoded from the input. - * @param[out] coupled_streams int *: Number of coupled (2 channel) - * streams that will be encoded from the input. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionEncoder *opus_projection_ambisonics_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - int application, - int *error -) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5); - - -/** Initialize a previously allocated projection encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_projection_ambisonics_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_projection_ambisonics_encoder_create - * @see opus_projection_ambisonics_encoder_get_size - * @param st OpusProjectionEncoder*: Projection encoder state to initialize. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_projection_ambisonics_encoder_init( - OpusProjectionEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); - - -/** Encodes a projection Opus frame. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param[in] pcm const opus_int16*: The input signal as interleaved - * samples. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode( - OpusProjectionEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - - -/** Encodes a projection Opus frame from floating point input. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param[in] pcm const float*: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode_float( - OpusProjectionEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - - -/** Frees an OpusProjectionEncoder allocated by - * opus_projection_ambisonics_encoder_create(). - * @param st OpusProjectionEncoder*: Projection encoder state to be freed. - */ -OPUS_EXPORT void opus_projection_encoder_destroy(OpusProjectionEncoder *st); - - -/** Perform a CTL function on a projection Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, @ref opus_multistream_ctls, or - * @ref opus_projection_ctls - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - * @see opus_projection_ctls - */ -OPUS_EXPORT int opus_projection_encoder_ctl(OpusProjectionEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - - -/**@}*/ - -/**\name Projection decoder functions */ -/**@{*/ - -/** Gets the size of an OpusProjectionDecoder structure. - * @param channels int: The total number of output channels. - * This must be no more than 255. - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_decoder_get_size( - int channels, - int streams, - int coupled_streams -); - - -/** Allocates and initializes a projection decoder state. - * Call opus_projection_decoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] demixing_matrix const unsigned char[demixing_matrix_size]: Demixing matrix - * that mapping from coded channels to output channels, - * as described in @ref opus_projection and - * @ref opus_projection_ctls. - * @param demixing_matrix_size opus_int32: The size in bytes of the - * demixing matrix, as - * described in @ref - * opus_projection_ctls. - * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionDecoder *opus_projection_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - unsigned char *demixing_matrix, - opus_int32 demixing_matrix_size, - int *error -) OPUS_ARG_NONNULL(5); - - -/** Intialize a previously allocated projection decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_projection_decoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_projection_decoder_create - * @see opus_projection_deocder_get_size - * @param st OpusProjectionDecoder*: Projection encoder state to initialize. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] demixing_matrix const unsigned char[demixing_matrix_size]: Demixing matrix - * that mapping from coded channels to output channels, - * as described in @ref opus_projection and - * @ref opus_projection_ctls. - * @param demixing_matrix_size opus_int32: The size in bytes of the - * demixing matrix, as - * described in @ref - * opus_projection_ctls. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_projection_decoder_init( - OpusProjectionDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - unsigned char *demixing_matrix, - opus_int32 demixing_matrix_size -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - - -/** Decode a projection Opus packet. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode( - OpusProjectionDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - - -/** Decode a projection Opus packet with floating point output. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode_float( - OpusProjectionDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - - -/** Perform a CTL function on a projection Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, @ref opus_multistream_ctls, or - * @ref opus_projection_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - * @see opus_projection_ctls - */ -OPUS_EXPORT int opus_projection_decoder_ctl(OpusProjectionDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - - -/** Frees an OpusProjectionDecoder allocated by - * opus_projection_decoder_create(). - * @param st OpusProjectionDecoder: Projection decoder state to be freed. - */ -OPUS_EXPORT void opus_projection_decoder_destroy(OpusProjectionDecoder *st); - - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_PROJECTION_H */ diff --git a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_types.h b/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_types.h deleted file mode 100644 index 7cf675580f..0000000000 --- a/submodules/ffmpeg/Sources/FFMpeg/libopus/include/opus/opus_types.h +++ /dev/null @@ -1,166 +0,0 @@ -/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ -/* Modified by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* opus_types.h based on ogg_types.h from libogg */ - -/** - @file opus_types.h - @brief Opus reference implementation types -*/ -#ifndef OPUS_TYPES_H -#define OPUS_TYPES_H - -#define opus_int int /* used for counters etc; at least 16 bits */ -#define opus_int64 long long -#define opus_int8 signed char - -#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ -#define opus_uint64 unsigned long long -#define opus_uint8 unsigned char - -/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ -#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) -#include -# undef opus_int64 -# undef opus_int8 -# undef opus_uint64 -# undef opus_uint8 - typedef int8_t opus_int8; - typedef uint8_t opus_uint8; - typedef int16_t opus_int16; - typedef uint16_t opus_uint16; - typedef int32_t opus_int32; - typedef uint32_t opus_uint32; - typedef int64_t opus_int64; - typedef uint64_t opus_uint64; -#elif defined(_WIN32) - -# if defined(__CYGWIN__) -# include <_G_config.h> - typedef _G_int32_t opus_int32; - typedef _G_uint32_t opus_uint32; - typedef _G_int16 opus_int16; - typedef _G_uint16 opus_uint16; -# elif defined(__MINGW32__) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; -# elif defined(__MWERKS__) - typedef int opus_int32; - typedef unsigned int opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; -# else - /* MSVC/Borland */ - typedef __int32 opus_int32; - typedef unsigned __int32 opus_uint32; - typedef __int16 opus_int16; - typedef unsigned __int16 opus_uint16; -# endif - -#elif defined(__MACOS__) - -# include - typedef SInt16 opus_int16; - typedef UInt16 opus_uint16; - typedef SInt32 opus_int32; - typedef UInt32 opus_uint32; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include - typedef int16_t opus_int16; - typedef u_int16_t opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined(__BEOS__) - - /* Be */ -# include - typedef int16 opus_int16; - typedef u_int16 opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(R5900) - - /* PS2 EE */ - typedef int opus_int32; - typedef unsigned opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short opus_int16; - typedef unsigned short opus_uint16; - typedef signed int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef long opus_int32; - typedef unsigned long opus_uint32; - -#elif defined(CONFIG_TI_C6X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#else - - /* Give up, take a reasonable guess */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#endif - -#endif /* OPUS_TYPES_H */ diff --git a/submodules/ffmpeg/Sources/FFMpeg/libopus/lib/libopus.a b/submodules/ffmpeg/Sources/FFMpeg/libopus/lib/libopus.a deleted file mode 100644 index 01624b7a6c..0000000000 Binary files a/submodules/ffmpeg/Sources/FFMpeg/libopus/lib/libopus.a and /dev/null differ diff --git a/submodules/ffmpeg/Sources/opus/include/opus/opus.h b/submodules/ffmpeg/Sources/opus/include/opus/opus.h deleted file mode 100644 index d282f21d25..0000000000 --- a/submodules/ffmpeg/Sources/opus/include/opus/opus.h +++ /dev/null @@ -1,981 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus.h - * @brief Opus reference implementation API - */ - -#ifndef OPUS_H -#define OPUS_H - -#include "opus_types.h" -#include "opus_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @mainpage Opus - * - * The Opus codec is designed for interactive speech and audio transmission over the Internet. - * It is designed by the IETF Codec Working Group and incorporates technology from - * Skype's SILK codec and Xiph.Org's CELT codec. - * - * The Opus codec is designed to handle a wide range of interactive audio applications, - * including Voice over IP, videoconferencing, in-game chat, and even remote live music - * performances. It can scale from low bit-rate narrowband speech to very high quality - * stereo music. Its main features are: - - * @li Sampling rates from 8 to 48 kHz - * @li Bit-rates from 6 kb/s to 510 kb/s - * @li Support for both constant bit-rate (CBR) and variable bit-rate (VBR) - * @li Audio bandwidth from narrowband to full-band - * @li Support for speech and music - * @li Support for mono and stereo - * @li Support for multichannel (up to 255 channels) - * @li Frame sizes from 2.5 ms to 60 ms - * @li Good loss robustness and packet loss concealment (PLC) - * @li Floating point and fixed-point implementation - * - * Documentation sections: - * @li @ref opus_encoder - * @li @ref opus_decoder - * @li @ref opus_repacketizer - * @li @ref opus_multistream - * @li @ref opus_libinfo - * @li @ref opus_custom - */ - -/** @defgroup opus_encoder Opus Encoder - * @{ - * - * @brief This page describes the process and functions used to encode Opus. - * - * Since Opus is a stateful codec, the encoding process starts with creating an encoder - * state. This can be done with: - * - * @code - * int error; - * OpusEncoder *enc; - * enc = opus_encoder_create(Fs, channels, application, &error); - * @endcode - * - * From this point, @c enc can be used for encoding an audio stream. An encoder state - * @b must @b not be used for more than one stream at the same time. Similarly, the encoder - * state @b must @b not be re-initialized for each frame. - * - * While opus_encoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * - * @code - * int size; - * int error; - * OpusEncoder *enc; - * size = opus_encoder_get_size(channels); - * enc = malloc(size); - * error = opus_encoder_init(enc, Fs, channels, application); - * @endcode - * - * where opus_encoder_get_size() returns the required size for the encoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The encoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * It is possible to change some of the encoder's settings using the opus_encoder_ctl() - * interface. All these settings already default to the recommended value, so they should - * only be changed when necessary. The most common settings one may want to change are: - * - * @code - * opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrate)); - * opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(complexity)); - * opus_encoder_ctl(enc, OPUS_SET_SIGNAL(signal_type)); - * @endcode - * - * where - * - * @arg bitrate is in bits per second (b/s) - * @arg complexity is a value from 1 to 10, where 1 is the lowest complexity and 10 is the highest - * @arg signal_type is either OPUS_AUTO (default), OPUS_SIGNAL_VOICE, or OPUS_SIGNAL_MUSIC - * - * See @ref opus_encoderctls and @ref opus_genericctls for a complete list of parameters that can be set or queried. Most parameters can be set or changed at any time during a stream. - * - * To encode a frame, opus_encode() or opus_encode_float() must be called with exactly one frame (2.5, 5, 10, 20, 40 or 60 ms) of audio data: - * @code - * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet); - * @endcode - * - * where - *
    - *
  • audio_frame is the audio data in opus_int16 (or float for opus_encode_float())
  • - *
  • frame_size is the duration of the frame in samples (per channel)
  • - *
  • packet is the byte array to which the compressed data is written
  • - *
  • max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended). - * Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.
  • - *
- * - * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. - * The return value can be negative, which indicates that an error has occurred. If the return value - * is 2 bytes or less, then the packet does not need to be transmitted (DTX). - * - * Once the encoder state if no longer needed, it can be destroyed with - * - * @code - * opus_encoder_destroy(enc); - * @endcode - * - * If the encoder was created with opus_encoder_init() rather than opus_encoder_create(), - * then no action is required aside from potentially freeing the memory that was manually - * allocated for it (calling free(enc) for the example above) - * - */ - -/** Opus encoder state. - * This contains the complete state of an Opus encoder. - * It is position independent and can be freely copied. - * @see opus_encoder_create,opus_encoder_init - */ -typedef struct OpusEncoder OpusEncoder; - -/** Gets the size of an OpusEncoder structure. - * @param[in] channels int: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); - -/** - */ - -/** Allocates and initializes an encoder state. - * There are three coding modes: - * - * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice - * signals. It enhances the input signal by high-pass filtering and - * emphasizing formants and harmonics. Optionally it includes in-band - * forward error correction to protect against packet loss. Use this - * mode for typical VoIP applications. Because of the enhancement, - * even at high bitrates the output may sound different from the input. - * - * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most - * non-voice signals like music. Use this mode for music and mixed - * (music/voice) content, broadcast, and applications requiring less - * than 15 ms of coding delay. - * - * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that - * disables the speech-optimized mode in exchange for slightly reduced delay. - * This mode can only be set on an newly initialized or freshly reset encoder - * because it changes the codec delay. - * - * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). - * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) in input signal - * @param [in] application int: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @param [out] error int*: @ref opus_errorcodes - * @note Regardless of the sampling rate and number channels selected, the Opus encoder - * can switch to a lower audio bandwidth or number of channels if the bitrate - * selected is too low. This also means that it is safe to always use 48 kHz stereo input - * and let the encoder optimize the encoding. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( - opus_int32 Fs, - int channels, - int application, - int *error -); - -/** Initializes a previously allocated encoder state - * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. - * @see opus_encoder_create(),opus_encoder_get_size() - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] Fs opus_int32: Sampling rate of input signal (Hz) - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) in input signal - * @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_encoder_init( - OpusEncoder *st, - opus_int32 Fs, - int channels, - int application -) OPUS_ARG_NONNULL(1); - -/** Encodes an Opus frame. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size int: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( - OpusEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes an Opus frame from floating point input. - * @param [in] st OpusEncoder*: Encoder state - * @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. - * Samples with a range beyond +/-1.0 are supported but will - * be clipped by decoders using the integer API and should - * only be used if it is known that the far end supports - * extended dynamic range. - * length is frame_size*channels*sizeof(float) - * @param [in] frame_size int: Number of samples per channel in the - * input signal. - * This must be an Opus frame size for - * the encoder's sampling rate. - * For example, at 48 kHz the permitted - * values are 120, 240, 480, 960, 1920, - * and 2880. - * Passing in a duration of less than - * 10 ms (480 samples at 48 kHz) will - * prevent the encoder from using the LPC - * or hybrid modes. - * @param [out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( - OpusEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an OpusEncoder allocated by opus_encoder_create(). - * @param[in] st OpusEncoder*: State to be freed. - */ -OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); - -/** Perform a CTL function on an Opus encoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st OpusEncoder*: Encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_encoderctls. - * @see opus_genericctls - * @see opus_encoderctls - */ -OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); -/**@}*/ - -/** @defgroup opus_decoder Opus Decoder - * @{ - * - * @brief This page describes the process and functions used to decode Opus. - * - * The decoding process also starts with creating a decoder - * state. This can be done with: - * @code - * int error; - * OpusDecoder *dec; - * dec = opus_decoder_create(Fs, channels, &error); - * @endcode - * where - * @li Fs is the sampling rate and must be 8000, 12000, 16000, 24000, or 48000 - * @li channels is the number of channels (1 or 2) - * @li error will hold the error code in case of failure (or #OPUS_OK on success) - * @li the return value is a newly created decoder state to be used for decoding - * - * While opus_decoder_create() allocates memory for the state, it's also possible - * to initialize pre-allocated memory: - * @code - * int size; - * int error; - * OpusDecoder *dec; - * size = opus_decoder_get_size(channels); - * dec = malloc(size); - * error = opus_decoder_init(dec, Fs, channels); - * @endcode - * where opus_decoder_get_size() returns the required size for the decoder state. Note that - * future versions of this code may change the size, so no assuptions should be made about it. - * - * The decoder state is always continuous in memory and only a shallow copy is sufficient - * to copy it (e.g. memcpy()) - * - * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data: - * @code - * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0); - * @endcode - * where - * - * @li packet is the byte array containing the compressed data - * @li len is the exact number of bytes contained in the packet - * @li decoded is the decoded audio data in opus_int16 (or float for opus_decode_float()) - * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array - * - * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet. - * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio - * buffer is too small to hold the decoded audio. - * - * Opus is a stateful codec with overlapping blocks and as a result Opus - * packets are not coded independently of each other. Packets must be - * passed into the decoder serially and in the correct order for a correct - * decode. Lost packets can be replaced with loss concealment by calling - * the decoder with a null pointer and zero length for the missing packet. - * - * A single codec state may only be accessed from a single thread at - * a time and any required locking must be performed by the caller. Separate - * streams must be decoded with separate decoder states and can be decoded - * in parallel unless the library was compiled with NONTHREADSAFE_PSEUDOSTACK - * defined. - * - */ - -/** Opus decoder state. - * This contains the complete state of an Opus decoder. - * It is position independent and can be freely copied. - * @see opus_decoder_create,opus_decoder_init - */ -typedef struct OpusDecoder OpusDecoder; - -/** Gets the size of an OpusDecoder structure. - * @param [in] channels int: Number of channels. - * This must be 1 or 2. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); - -/** Allocates and initializes a decoder state. - * @param [in] Fs opus_int32: Sample rate to decode at (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) to decode - * @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes - * - * Internally Opus stores data at 48000 Hz, so that should be the default - * value for Fs. However, the decoder can efficiently decode to buffers - * at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use - * data at the full sample rate, or knows the compressed data doesn't - * use the full frequency range, it can request decoding at a reduced - * rate. Likewise, the decoder is capable of filling in either mono or - * interleaved stereo pcm buffers, at the caller's request. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( - opus_int32 Fs, - int channels, - int *error -); - -/** Initializes a previously allocated decoder state. - * The state must be at least the size returned by opus_decoder_get_size(). - * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @param [in] st OpusDecoder*: Decoder state. - * @param [in] Fs opus_int32: Sampling rate to decode to (Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param [in] channels int: Number of channels (1 or 2) to decode - * @retval #OPUS_OK Success or @ref opus_errorcodes - */ -OPUS_EXPORT int opus_decoder_init( - OpusDecoder *st, - opus_int32 Fs, - int channels -) OPUS_ARG_NONNULL(1); - -/** Decode an Opus packet. - * @param [in] st OpusDecoder*: Decoder state - * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len opus_int32: Number of bytes in payload* - * @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(opus_int16) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size must be a multiple of 2.5 ms. - * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available, the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode an Opus packet with floating point output. - * @param [in] st OpusDecoder*: Decoder state - * @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss - * @param [in] len opus_int32: Number of bytes in payload - * @param [out] pcm float*: Output signal (interleaved if 2 channels). length - * is frame_size*channels*sizeof(float) - * @param [in] frame_size Number of samples per channel of available space in \a pcm. - * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will - * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), - * then frame_size needs to be exactly the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and - * FEC cases, frame_size must be a multiple of 2.5 ms. - * @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be - * decoded. If no such data is available the frame is decoded as if it were lost. - * @returns Number of decoded samples or @ref opus_errorcodes - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( - OpusDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on an Opus decoder. - * - * Generally the request and subsequent arguments are generated - * by a convenience macro. - * @param st OpusDecoder*: Decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls or - * @ref opus_decoderctls. - * @see opus_genericctls - * @see opus_decoderctls - */ -OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an OpusDecoder allocated by opus_decoder_create(). - * @param[in] st OpusDecoder*: State to be freed. - */ -OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); - -/** Parse an opus packet into one or more frames. - * Opus_decode will perform this operation internally so most applications do - * not need to use this function. - * This function does not copy the frames, the returned pointers are pointers into - * the input packet. - * @param [in] data char*: Opus packet to be parsed - * @param [in] len opus_int32: size of data - * @param [out] out_toc char*: TOC pointer - * @param [out] frames char*[48] encapsulated frames - * @param [out] size opus_int16[48] sizes of the encapsulated frames - * @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) - * @returns number of frames - */ -OPUS_EXPORT int opus_packet_parse( - const unsigned char *data, - opus_int32 len, - unsigned char *out_toc, - const unsigned char *frames[48], - opus_int16 size[48], - int *payload_offset -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5); - -/** Gets the bandwidth of an Opus packet. - * @param [in] data char*: Opus packet - * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) - * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) - * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) - * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) - * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples per frame from an Opus packet. - * @param [in] data char*: Opus packet. - * This must contain at least one byte of - * data. - * @param [in] Fs opus_int32: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples per frame. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of channels from an Opus packet. - * @param [in] data char*: Opus packet - * @returns Number of channels - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); - -/** Gets the number of frames in an Opus packet. - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @returns Number of frames - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @param [in] Fs opus_int32: Sampling rate in Hz. - * This must be a multiple of 400, or - * inaccurate results will be returned. - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1); - -/** Gets the number of samples of an Opus packet. - * @param [in] dec OpusDecoder*: Decoder state - * @param [in] packet char*: Opus packet - * @param [in] len opus_int32: Length of packet - * @returns Number of samples - * @retval OPUS_BAD_ARG Insufficient data was passed to the function - * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - -/** Applies soft-clipping to bring a float signal within the [-1,1] range. If - * the signal is already in that range, nothing is done. If there are values - * outside of [-1,1], then the signal is clipped as smoothly as possible to - * both fit in the range and avoid creating excessive distortion in the - * process. - * @param [in,out] pcm float*: Input PCM and modified PCM - * @param [in] frame_size int Number of samples per channel to process - * @param [in] channels int: Number of channels - * @param [in,out] softclip_mem float*: State memory for the soft clipping process (one float per channel, initialized to zero) - */ -OPUS_EXPORT void opus_pcm_soft_clip(float *pcm, int frame_size, int channels, float *softclip_mem); - - -/**@}*/ - -/** @defgroup opus_repacketizer Repacketizer - * @{ - * - * The repacketizer can be used to merge multiple Opus packets into a single - * packet or alternatively to split Opus packets that have previously been - * merged. Splitting valid Opus packets is always guaranteed to succeed, - * whereas merging valid packets only succeeds if all frames have the same - * mode, bandwidth, and frame size, and when the total duration of the merged - * packet is no more than 120 ms. The 120 ms limit comes from the - * specification and limits decoder memory requirements at a point where - * framing overhead becomes negligible. - * - * The repacketizer currently only operates on elementary Opus - * streams. It will not manipualte multistream packets successfully, except in - * the degenerate case where they consist of data from a single stream. - * - * The repacketizing process starts with creating a repacketizer state, either - * by calling opus_repacketizer_create() or by allocating the memory yourself, - * e.g., - * @code - * OpusRepacketizer *rp; - * rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()); - * if (rp != NULL) - * opus_repacketizer_init(rp); - * @endcode - * - * Then the application should submit packets with opus_repacketizer_cat(), - * extract new packets with opus_repacketizer_out() or - * opus_repacketizer_out_range(), and then reset the state for the next set of - * input packets via opus_repacketizer_init(). - * - * For example, to split a sequence of packets into individual frames: - * @code - * unsigned char *data; - * int len; - * while (get_next_packet(&data, &len)) - * { - * unsigned char out[1276]; - * opus_int32 out_len; - * int nb_frames; - * int err; - * int i; - * err = opus_repacketizer_cat(rp, data, len); - * if (err != OPUS_OK) - * { - * release_packet(data); - * return err; - * } - * nb_frames = opus_repacketizer_get_nb_frames(rp); - * for (i = 0; i < nb_frames; i++) - * { - * out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packet(data); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * } - * opus_repacketizer_init(rp); - * release_packet(data); - * } - * @endcode - * - * Alternatively, to combine a sequence of frames into packets that each - * contain up to TARGET_DURATION_MS milliseconds of data: - * @code - * // The maximum number of packets with duration TARGET_DURATION_MS occurs - * // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) - * // packets. - * unsigned char *data[(TARGET_DURATION_MS*2/5)+1]; - * opus_int32 len[(TARGET_DURATION_MS*2/5)+1]; - * int nb_packets; - * unsigned char out[1277*(TARGET_DURATION_MS*2/2)]; - * opus_int32 out_len; - * int prev_toc; - * nb_packets = 0; - * while (get_next_packet(data+nb_packets, len+nb_packets)) - * { - * int nb_frames; - * int err; - * nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]); - * if (nb_frames < 1) - * { - * release_packets(data, nb_packets+1); - * return nb_frames; - * } - * nb_frames += opus_repacketizer_get_nb_frames(rp); - * // If adding the next packet would exceed our target, or it has an - * // incompatible TOC sequence, output the packets we already have before - * // submitting it. - * // N.B., The nb_packets > 0 check ensures we've submitted at least one - * // packet since the last call to opus_repacketizer_init(). Otherwise a - * // single packet longer than TARGET_DURATION_MS would cause us to try to - * // output an (invalid) empty packet. It also ensures that prev_toc has - * // been set to a valid value. Additionally, len[nb_packets] > 0 is - * // guaranteed by the call to opus_packet_get_nb_frames() above, so the - * // reference to data[nb_packets][0] should be valid. - * if (nb_packets > 0 && ( - * ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || - * opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > - * TARGET_DURATION_MS*48)) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * if (out_len < 0) - * { - * release_packets(data, nb_packets+1); - * return (int)out_len; - * } - * output_next_packet(out, out_len); - * opus_repacketizer_init(rp); - * release_packets(data, nb_packets); - * data[0] = data[nb_packets]; - * len[0] = len[nb_packets]; - * nb_packets = 0; - * } - * err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]); - * if (err != OPUS_OK) - * { - * release_packets(data, nb_packets+1); - * return err; - * } - * prev_toc = data[nb_packets][0]; - * nb_packets++; - * } - * // Output the final, partial packet. - * if (nb_packets > 0) - * { - * out_len = opus_repacketizer_out(rp, out, sizeof(out)); - * release_packets(data, nb_packets); - * if (out_len < 0) - * return (int)out_len; - * output_next_packet(out, out_len); - * } - * @endcode - * - * An alternate way of merging packets is to simply call opus_repacketizer_cat() - * unconditionally until it fails. At that point, the merged packet can be - * obtained with opus_repacketizer_out() and the input packet for which - * opus_repacketizer_cat() needs to be re-added to a newly reinitialized - * repacketizer state. - */ - -typedef struct OpusRepacketizer OpusRepacketizer; - -/** Gets the size of an OpusRepacketizer structure. - * @returns The size in bytes. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); - -/** (Re)initializes a previously allocated repacketizer state. - * The state must be at least the size returned by opus_repacketizer_get_size(). - * This can be used for applications which use their own allocator instead of - * malloc(). - * It must also be called to reset the queue of packets waiting to be - * repacketized, which is necessary if the maximum packet duration of 120 ms - * is reached or if you wish to submit packets with a different Opus - * configuration (coding mode, audio bandwidth, frame size, or channel count). - * Failure to do so will prevent a new packet from being added with - * opus_repacketizer_cat(). - * @see opus_repacketizer_create - * @see opus_repacketizer_get_size - * @see opus_repacketizer_cat - * @param rp OpusRepacketizer*: The repacketizer state to - * (re)initialize. - * @returns A pointer to the same repacketizer state that was passed in. - */ -OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Allocates memory and initializes the new repacketizer with - * opus_repacketizer_init(). - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); - -/** Frees an OpusRepacketizer allocated by - * opus_repacketizer_create(). - * @param[in] rp OpusRepacketizer*: State to be freed. - */ -OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); - -/** Add a packet to the current repacketizer state. - * This packet must match the configuration of any packets already submitted - * for repacketization since the last call to opus_repacketizer_init(). - * This means that it must have the same coding mode, audio bandwidth, frame - * size, and channel count. - * This can be checked in advance by examining the top 6 bits of the first - * byte of the packet, and ensuring they match the top 6 bits of the first - * byte of any previously submitted packet. - * The total duration of audio in the repacketizer state also must not exceed - * 120 ms, the maximum duration of a single packet, after adding this packet. - * - * The contents of the current repacketizer state can be extracted into new - * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). - * - * In order to add a packet with a different configuration or to add more - * audio beyond 120 ms, you must clear the repacketizer state by calling - * opus_repacketizer_init(). - * If a packet is too large to add to the current repacketizer state, no part - * of it is added, even if it contains multiple frames, some of which might - * fit. - * If you wish to be able to add parts of such packets, you should first use - * another repacketizer to split the packet into pieces and add them - * individually. - * @see opus_repacketizer_out_range - * @see opus_repacketizer_out - * @see opus_repacketizer_init - * @param rp OpusRepacketizer*: The repacketizer state to which to - * add the packet. - * @param[in] data const unsigned char*: The packet data. - * The application must ensure - * this pointer remains valid - * until the next call to - * opus_repacketizer_init() or - * opus_repacketizer_destroy(). - * @param len opus_int32: The number of bytes in the packet data. - * @returns An error code indicating whether or not the operation succeeded. - * @retval #OPUS_OK The packet's contents have been added to the repacketizer - * state. - * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, - * the packet's TOC sequence was not compatible - * with previously submitted packets (because - * the coding mode, audio bandwidth, frame size, - * or channel count did not match), or adding - * this packet would increase the total amount of - * audio stored in the repacketizer state to more - * than 120 ms. - */ -OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); - - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * @param rp OpusRepacketizer*: The repacketizer state from which to - * construct the new packet. - * @param begin int: The index of the first frame in the current - * repacketizer state to include in the output. - * @param end int: One past the index of the last frame in the - * current repacketizer state to include in the - * output. - * @param[out] data const unsigned char*: The buffer in which to - * store the output packet. - * @param maxlen opus_int32: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * 1276 for a single frame, - * or for multiple frames, - * 1277*(end-begin). - * However, 1*(end-begin) plus - * the size of all packet data submitted to - * the repacketizer since the last call to - * opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG [begin,end) was an invalid range of - * frames (begin < 0, begin >= end, or end > - * opus_repacketizer_get_nb_frames()). - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Return the total number of frames contained in packet data submitted to - * the repacketizer state so far via opus_repacketizer_cat() since the last - * call to opus_repacketizer_init() or opus_repacketizer_create(). - * This defines the valid range of packets that can be extracted with - * opus_repacketizer_out_range() or opus_repacketizer_out(). - * @param rp OpusRepacketizer*: The repacketizer state containing the - * frames. - * @returns The total number of frames contained in the packet data submitted - * to the repacketizer state. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); - -/** Construct a new packet from data previously submitted to the repacketizer - * state via opus_repacketizer_cat(). - * This is a convenience routine that returns all the data submitted so far - * in a single packet. - * It is equivalent to calling - * @code - * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), - * data, maxlen) - * @endcode - * @param rp OpusRepacketizer*: The repacketizer state from which to - * construct the new packet. - * @param[out] data const unsigned char*: The buffer in which to - * store the output packet. - * @param maxlen opus_int32: The maximum number of bytes to store in - * the output buffer. In order to guarantee - * success, this should be at least - * 1277*opus_repacketizer_get_nb_frames(rp). - * However, - * 1*opus_repacketizer_get_nb_frames(rp) - * plus the size of all packet data - * submitted to the repacketizer since the - * last call to opus_repacketizer_init() or - * opus_repacketizer_create() is also - * sufficient, and possibly much smaller. - * @returns The total size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the - * complete output packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); - -/** Pads a given Opus packet to a larger size (possibly changing the TOC sequence). - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to pad. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param new_len opus_int32: The desired size of the packet after padding. - * This must be at least as large as len. - * @returns an error code - * @retval #OPUS_OK \a on success. - * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len); - -/** Remove all padding from a given Opus packet and rewrite the TOC sequence to - * minimize space usage. - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to strip. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @returns The new size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG \a len was less than 1. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_packet_unpad(unsigned char *data, opus_int32 len); - -/** Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence). - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to pad. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param new_len opus_int32: The desired size of the packet after padding. - * This must be at least 1. - * @param nb_streams opus_int32: The number of streams (not channels) in the packet. - * This must be at least as large as len. - * @returns an error code - * @retval #OPUS_OK \a on success. - * @retval #OPUS_BAD_ARG \a len was less than 1. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT int opus_multistream_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len, int nb_streams); - -/** Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to - * minimize space usage. - * @param[in,out] data const unsigned char*: The buffer containing the - * packet to strip. - * @param len opus_int32: The size of the packet. - * This must be at least 1. - * @param nb_streams opus_int32: The number of streams (not channels) in the packet. - * This must be at least 1. - * @returns The new size of the output packet on success, or an error code - * on failure. - * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. - * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, int nb_streams); - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_H */ diff --git a/submodules/ffmpeg/Sources/opus/include/opus/opus_defines.h b/submodules/ffmpeg/Sources/opus/include/opus/opus_defines.h deleted file mode 100644 index fbf5d0eb74..0000000000 --- a/submodules/ffmpeg/Sources/opus/include/opus/opus_defines.h +++ /dev/null @@ -1,788 +0,0 @@ -/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited - Written by Jean-Marc Valin and Koen Vos */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_defines.h - * @brief Opus reference implementation constants - */ - -#ifndef OPUS_DEFINES_H -#define OPUS_DEFINES_H - -#include "opus_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup opus_errorcodes Error codes - * @{ - */ -/** No error @hideinitializer*/ -#define OPUS_OK 0 -/** One or more invalid/out of range arguments @hideinitializer*/ -#define OPUS_BAD_ARG -1 -/** Not enough bytes allocated in the buffer @hideinitializer*/ -#define OPUS_BUFFER_TOO_SMALL -2 -/** An internal error was detected @hideinitializer*/ -#define OPUS_INTERNAL_ERROR -3 -/** The compressed data passed is corrupted @hideinitializer*/ -#define OPUS_INVALID_PACKET -4 -/** Invalid/unsupported request number @hideinitializer*/ -#define OPUS_UNIMPLEMENTED -5 -/** An encoder or decoder structure is invalid or already freed @hideinitializer*/ -#define OPUS_INVALID_STATE -6 -/** Memory allocation has failed @hideinitializer*/ -#define OPUS_ALLOC_FAIL -7 -/**@}*/ - -/** @cond OPUS_INTERNAL_DOC */ -/**Export control for opus functions */ - -#ifndef OPUS_EXPORT -# if defined(WIN32) -# if defined(OPUS_BUILD) && defined(DLL_EXPORT) -# define OPUS_EXPORT __declspec(dllexport) -# else -# define OPUS_EXPORT -# endif -# elif defined(__GNUC__) && defined(OPUS_BUILD) -# define OPUS_EXPORT __attribute__ ((visibility ("default"))) -# else -# define OPUS_EXPORT -# endif -#endif - -# if !defined(OPUS_GNUC_PREREQ) -# if defined(__GNUC__)&&defined(__GNUC_MINOR__) -# define OPUS_GNUC_PREREQ(_maj,_min) \ - ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) -# else -# define OPUS_GNUC_PREREQ(_maj,_min) 0 -# endif -# endif - -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(3,0) -# define OPUS_RESTRICT __restrict__ -# elif (defined(_MSC_VER) && _MSC_VER >= 1400) -# define OPUS_RESTRICT __restrict -# else -# define OPUS_RESTRICT -# endif -#else -# define OPUS_RESTRICT restrict -#endif - -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) -# if OPUS_GNUC_PREREQ(2,7) -# define OPUS_INLINE __inline__ -# elif (defined(_MSC_VER)) -# define OPUS_INLINE __inline -# else -# define OPUS_INLINE -# endif -#else -# define OPUS_INLINE inline -#endif - -/**Warning attributes for opus functions - * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out - * some paranoid null checks. */ -#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) -#else -# define OPUS_WARN_UNUSED_RESULT -#endif -#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4) -# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x))) -#else -# define OPUS_ARG_NONNULL(_x) -#endif - -/** These are the actual Encoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -#define OPUS_SET_APPLICATION_REQUEST 4000 -#define OPUS_GET_APPLICATION_REQUEST 4001 -#define OPUS_SET_BITRATE_REQUEST 4002 -#define OPUS_GET_BITRATE_REQUEST 4003 -#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004 -#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005 -#define OPUS_SET_VBR_REQUEST 4006 -#define OPUS_GET_VBR_REQUEST 4007 -#define OPUS_SET_BANDWIDTH_REQUEST 4008 -#define OPUS_GET_BANDWIDTH_REQUEST 4009 -#define OPUS_SET_COMPLEXITY_REQUEST 4010 -#define OPUS_GET_COMPLEXITY_REQUEST 4011 -#define OPUS_SET_INBAND_FEC_REQUEST 4012 -#define OPUS_GET_INBAND_FEC_REQUEST 4013 -#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014 -#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 -#define OPUS_SET_DTX_REQUEST 4016 -#define OPUS_GET_DTX_REQUEST 4017 -#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 -#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 -#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 -#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023 -#define OPUS_SET_SIGNAL_REQUEST 4024 -#define OPUS_GET_SIGNAL_REQUEST 4025 -#define OPUS_GET_LOOKAHEAD_REQUEST 4027 -/* #define OPUS_RESET_STATE 4028 */ -#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 -#define OPUS_GET_FINAL_RANGE_REQUEST 4031 -#define OPUS_GET_PITCH_REQUEST 4033 -#define OPUS_SET_GAIN_REQUEST 4034 -#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ -#define OPUS_SET_LSB_DEPTH_REQUEST 4036 -#define OPUS_GET_LSB_DEPTH_REQUEST 4037 -#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 -#define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040 -#define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041 -#define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042 -#define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043 -/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ -#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046 -#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047 - -/** Defines for the presence of extended APIs. */ -#define OPUS_HAVE_OPUS_PROJECTION_H - -/* Macros to trigger compilation errors when the wrong types are provided to a CTL */ -#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) -#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) -#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) -#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr))) -/** @endcond */ - -/** @defgroup opus_ctlvalues Pre-defined values for CTL interface - * @see opus_genericctls, opus_encoderctls - * @{ - */ -/* Values for the various encoder CTLs */ -#define OPUS_AUTO -1000 /**opus_int32: Allowed values: 0-10, inclusive. - * - * @hideinitializer */ -#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x) -/** Gets the encoder's complexity configuration. - * @see OPUS_SET_COMPLEXITY - * @param[out] x opus_int32 *: Returns a value in the range 0-10, - * inclusive. - * @hideinitializer */ -#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x) - -/** Configures the bitrate in the encoder. - * Rates from 500 to 512000 bits per second are meaningful, as well as the - * special values #OPUS_AUTO and #OPUS_BITRATE_MAX. - * The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much - * rate as it can, which is useful for controlling the rate by adjusting the - * output buffer size. - * @see OPUS_GET_BITRATE - * @param[in] x opus_int32: Bitrate in bits per second. The default - * is determined based on the number of - * channels and the input sampling rate. - * @hideinitializer */ -#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x) -/** Gets the encoder's bitrate configuration. - * @see OPUS_SET_BITRATE - * @param[out] x opus_int32 *: Returns the bitrate in bits per second. - * The default is determined based on the - * number of channels and the input - * sampling rate. - * @hideinitializer */ -#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables variable bitrate (VBR) in the encoder. - * The configured bitrate may not be met exactly because frames must - * be an integer number of bytes in length. - * @see OPUS_GET_VBR - * @see OPUS_SET_VBR_CONSTRAINT - * @param[in] x opus_int32: Allowed values: - *
- *
0
Hard CBR. For LPC/hybrid modes at very low bit-rate, this can - * cause noticeable quality degradation.
- *
1
VBR (default). The exact type of VBR is controlled by - * #OPUS_SET_VBR_CONSTRAINT.
- *
- * @hideinitializer */ -#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x) -/** Determine if variable bitrate (VBR) is enabled in the encoder. - * @see OPUS_SET_VBR - * @see OPUS_GET_VBR_CONSTRAINT - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Hard CBR.
- *
1
VBR (default). The exact type of VBR may be retrieved via - * #OPUS_GET_VBR_CONSTRAINT.
- *
- * @hideinitializer */ -#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x) - -/** Enables or disables constrained VBR in the encoder. - * This setting is ignored when the encoder is in CBR mode. - * @warning Only the MDCT mode of Opus currently heeds the constraint. - * Speech mode ignores it completely, hybrid mode may fail to obey it - * if the LPC layer uses more bitrate than the constraint would have - * permitted. - * @see OPUS_GET_VBR_CONSTRAINT - * @see OPUS_SET_VBR - * @param[in] x opus_int32: Allowed values: - *
- *
0
Unconstrained VBR.
- *
1
Constrained VBR (default). This creates a maximum of one - * frame of buffering delay assuming a transport with a - * serialization speed of the nominal bitrate.
- *
- * @hideinitializer */ -#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x) -/** Determine if constrained VBR is enabled in the encoder. - * @see OPUS_SET_VBR_CONSTRAINT - * @see OPUS_GET_VBR - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Unconstrained VBR.
- *
1
Constrained VBR (default).
- *
- * @hideinitializer */ -#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x) - -/** Configures mono/stereo forcing in the encoder. - * This can force the encoder to produce packets encoded as either mono or - * stereo, regardless of the format of the input audio. This is useful when - * the caller knows that the input signal is currently a mono source embedded - * in a stereo stream. - * @see OPUS_GET_FORCE_CHANNELS - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
Not forced (default)
- *
1
Forced mono
- *
2
Forced stereo
- *
- * @hideinitializer */ -#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x) -/** Gets the encoder's forced channel configuration. - * @see OPUS_SET_FORCE_CHANNELS - * @param[out] x opus_int32 *: - *
- *
#OPUS_AUTO
Not forced (default)
- *
1
Forced mono
- *
2
Forced stereo
- *
- * @hideinitializer */ -#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x) - -/** Configures the maximum bandpass that the encoder will select automatically. - * Applications should normally use this instead of #OPUS_SET_BANDWIDTH - * (leaving that set to the default, #OPUS_AUTO). This allows the - * application to set an upper bound based on the type of input it is - * providing, but still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_MAX_BANDWIDTH - * @param[in] x opus_int32: Allowed values: - *
- *
OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
- *
- * @hideinitializer */ -#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Gets the encoder's configured maximum allowed bandpass. - * @see OPUS_SET_MAX_BANDWIDTH - * @param[out] x opus_int32 *: Allowed values: - *
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband (default)
- *
- * @hideinitializer */ -#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Sets the encoder's bandpass to a specific value. - * This prevents the encoder from automatically selecting the bandpass based - * on the available bitrate. If an application knows the bandpass of the input - * audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH - * instead, which still gives the encoder the freedom to reduce the bandpass - * when the bitrate becomes too low, for better overall quality. - * @see OPUS_GET_BANDWIDTH - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
- *
- * @hideinitializer */ -#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x) - -/** Configures the type of signal being encoded. - * This is a hint which helps the encoder's mode selection. - * @see OPUS_GET_SIGNAL - * @param[in] x opus_int32: Allowed values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
- *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
- *
- * @hideinitializer */ -#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal type. - * @see OPUS_SET_SIGNAL - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_SIGNAL_VOICE
Bias thresholds towards choosing LPC or Hybrid modes.
- *
#OPUS_SIGNAL_MUSIC
Bias thresholds towards choosing MDCT modes.
- *
- * @hideinitializer */ -#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) - - -/** Configures the encoder's intended application. - * The initial value is a mandatory argument to the encoder_create function. - * @see OPUS_GET_APPLICATION - * @param[in] x opus_int32: Returns one of the following values: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @hideinitializer */ -#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured application. - * @see OPUS_SET_APPLICATION - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @hideinitializer */ -#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the total samples of delay added by the entire codec. - * This can be queried by the encoder and then the provided number of samples can be - * skipped on from the start of the decoder's output to provide time aligned input - * and output. From the perspective of a decoding application the real data begins this many - * samples late. - * - * The decoder contribution to this delay is identical for all decoders, but the - * encoder portion of the delay may vary from implementation to implementation, - * version to version, or even depend on the encoder's initial configuration. - * Applications needing delay compensation should call this CTL rather than - * hard-coding a value. - * @param[out] x opus_int32 *: Number of lookahead samples - * @hideinitializer */ -#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of inband forward error correction (FEC). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_INBAND_FEC - * @param[in] x opus_int32: Allowed values: - *
- *
0
Disable inband FEC (default).
- *
1
Enable inband FEC.
- *
- * @hideinitializer */ -#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of inband forward error correction. - * @see OPUS_SET_INBAND_FEC - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Inband FEC disabled (default).
- *
1
Inband FEC enabled.
- *
- * @hideinitializer */ -#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's expected packet loss percentage. - * Higher values trigger progressively more loss resistant behavior in the encoder - * at the expense of quality at a given bitrate in the absence of packet loss, but - * greater quality under loss. - * @see OPUS_GET_PACKET_LOSS_PERC - * @param[in] x opus_int32: Loss percentage in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured packet loss percentage. - * @see OPUS_SET_PACKET_LOSS_PERC - * @param[out] x opus_int32 *: Returns the configured loss percentage - * in the range 0-100, inclusive (default: 0). - * @hideinitializer */ -#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of discontinuous transmission (DTX). - * @note This is only applicable to the LPC layer - * @see OPUS_GET_DTX - * @param[in] x opus_int32: Allowed values: - *
- *
0
Disable DTX (default).
- *
1
Enabled DTX.
- *
- * @hideinitializer */ -#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x) -/** Gets encoder's configured use of discontinuous transmission. - * @see OPUS_SET_DTX - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
DTX disabled (default).
- *
1
DTX enabled.
- *
- * @hideinitializer */ -#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) -/** Configures the depth of signal being encoded. - * - * This is a hint which helps the encoder identify silence and near-silence. - * It represents the number of significant bits of linear intensity below - * which the signal contains ignorable quantization or other noise. - * - * For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting - * for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate - * for 16-bit linear pcm input with opus_encode_float(). - * - * When using opus_encode() instead of opus_encode_float(), or when libopus - * is compiled for fixed-point, the encoder uses the minimum of the value - * set here and the value 16. - * - * @see OPUS_GET_LSB_DEPTH - * @param[in] x opus_int32: Input precision in bits, between 8 and 24 - * (default: 24). - * @hideinitializer */ -#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured signal depth. - * @see OPUS_SET_LSB_DEPTH - * @param[out] x opus_int32 *: Input precision in bits, between 8 and - * 24 (default: 24). - * @hideinitializer */ -#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x) - -/** Configures the encoder's use of variable duration frames. - * When variable duration is enabled, the encoder is free to use a shorter frame - * size than the one requested in the opus_encode*() call. - * It is then the user's responsibility - * to verify how much audio was encoded by checking the ToC byte of the encoded - * packet. The part of the audio that was not encoded needs to be resent to the - * encoder for the next call. Do not use this option unless you really - * know what you are doing. - * @see OPUS_GET_EXPERT_FRAME_DURATION - * @param[in] x opus_int32: Allowed values: - *
- *
OPUS_FRAMESIZE_ARG
Select frame size from the argument (default).
- *
OPUS_FRAMESIZE_2_5_MS
Use 2.5 ms frames.
- *
OPUS_FRAMESIZE_5_MS
Use 5 ms frames.
- *
OPUS_FRAMESIZE_10_MS
Use 10 ms frames.
- *
OPUS_FRAMESIZE_20_MS
Use 20 ms frames.
- *
OPUS_FRAMESIZE_40_MS
Use 40 ms frames.
- *
OPUS_FRAMESIZE_60_MS
Use 60 ms frames.
- *
OPUS_FRAMESIZE_80_MS
Use 80 ms frames.
- *
OPUS_FRAMESIZE_100_MS
Use 100 ms frames.
- *
OPUS_FRAMESIZE_120_MS
Use 120 ms frames.
- *
- * @hideinitializer */ -#define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured use of variable duration frames. - * @see OPUS_SET_EXPERT_FRAME_DURATION - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
OPUS_FRAMESIZE_ARG
Select frame size from the argument (default).
- *
OPUS_FRAMESIZE_2_5_MS
Use 2.5 ms frames.
- *
OPUS_FRAMESIZE_5_MS
Use 5 ms frames.
- *
OPUS_FRAMESIZE_10_MS
Use 10 ms frames.
- *
OPUS_FRAMESIZE_20_MS
Use 20 ms frames.
- *
OPUS_FRAMESIZE_40_MS
Use 40 ms frames.
- *
OPUS_FRAMESIZE_60_MS
Use 60 ms frames.
- *
OPUS_FRAMESIZE_80_MS
Use 80 ms frames.
- *
OPUS_FRAMESIZE_100_MS
Use 100 ms frames.
- *
OPUS_FRAMESIZE_120_MS
Use 120 ms frames.
- *
- * @hideinitializer */ -#define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x) - -/** If set to 1, disables almost all use of prediction, making frames almost - * completely independent. This reduces quality. - * @see OPUS_GET_PREDICTION_DISABLED - * @param[in] x opus_int32: Allowed values: - *
- *
0
Enable prediction (default).
- *
1
Disable prediction.
- *
- * @hideinitializer */ -#define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured prediction status. - * @see OPUS_SET_PREDICTION_DISABLED - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Prediction enabled (default).
- *
1
Prediction disabled.
- *
- * @hideinitializer */ -#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_genericctls Generic CTLs - * - * These macros are used with the \c opus_decoder_ctl and - * \c opus_encoder_ctl calls to generate a particular - * request. - * - * When called on an \c OpusDecoder they apply to that - * particular decoder instance. When called on an - * \c OpusEncoder they apply to the corresponding setting - * on that encoder instance, if present. - * - * Some usage examples: - * - * @code - * int ret; - * opus_int32 pitch; - * ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch)); - * if (ret == OPUS_OK) return ret; - * - * opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE); - * opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE); - * - * opus_int32 enc_bw, dec_bw; - * opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw)); - * opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw)); - * if (enc_bw != dec_bw) { - * printf("packet bandwidth mismatch!\n"); - * } - * @endcode - * - * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls - * @{ - */ - -/** Resets the codec state to be equivalent to a freshly initialized state. - * This should be called when switching streams in order to prevent - * the back to back decoding from giving different results from - * one at a time decoding. - * @hideinitializer */ -#define OPUS_RESET_STATE 4028 - -/** Gets the final state of the codec's entropy coder. - * This is used for testing purposes, - * The encoder and decoder state should be identical after coding a payload - * (assuming no data corruption or software bugs) - * - * @param[out] x opus_uint32 *: Entropy coder state - * - * @hideinitializer */ -#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x) - -/** Gets the encoder's configured bandpass or the decoder's last bandpass. - * @see OPUS_SET_BANDWIDTH - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
#OPUS_AUTO
(default)
- *
#OPUS_BANDWIDTH_NARROWBAND
4 kHz passband
- *
#OPUS_BANDWIDTH_MEDIUMBAND
6 kHz passband
- *
#OPUS_BANDWIDTH_WIDEBAND
8 kHz passband
- *
#OPUS_BANDWIDTH_SUPERWIDEBAND
12 kHz passband
- *
#OPUS_BANDWIDTH_FULLBAND
20 kHz passband
- *
- * @hideinitializer */ -#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x) - -/** Gets the sampling rate the encoder or decoder was initialized with. - * This simply returns the Fs value passed to opus_encoder_init() - * or opus_decoder_init(). - * @param[out] x opus_int32 *: Sampling rate of encoder or decoder. - * @hideinitializer - */ -#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) - -/** If set to 1, disables the use of phase inversion for intensity stereo, - * improving the quality of mono downmixes, but slightly reducing normal - * stereo quality. Disabling phase inversion in the decoder does not comply - * with RFC 6716, although it does not cause any interoperability issue and - * is expected to become part of the Opus standard once RFC 6716 is updated - * by draft-ietf-codec-opus-update. - * @see OPUS_GET_PHASE_INVERSION_DISABLED - * @param[in] x opus_int32: Allowed values: - *
- *
0
Enable phase inversion (default).
- *
1
Disable phase inversion.
- *
- * @hideinitializer */ -#define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured phase inversion status. - * @see OPUS_SET_PHASE_INVERSION_DISABLED - * @param[out] x opus_int32 *: Returns one of the following values: - *
- *
0
Stereo phase inversion enabled (default).
- *
1
Stereo phase inversion disabled.
- *
- * @hideinitializer */ -#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_decoderctls Decoder related CTLs - * @see opus_genericctls, opus_encoderctls, opus_decoder - * @{ - */ - -/** Configures decoder gain adjustment. - * Scales the decoded output by a factor specified in Q8 dB units. - * This has a maximum range of -32768 to 32767 inclusive, and returns - * OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. - * This setting survives decoder reset. - * - * gain = pow(10, x/(20.0*256)) - * - * @param[in] x opus_int32: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x) -/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN - * - * @param[out] x opus_int32 *: Amount to scale PCM signal by in Q8 dB units. - * @hideinitializer */ -#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x) - -/** Gets the duration (in samples) of the last packet successfully decoded or concealed. - * @param[out] x opus_int32 *: Number of samples (at current sampling rate). - * @hideinitializer */ -#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) - -/** Gets the pitch of the last decoded frame, if available. - * This can be used for any post-processing algorithm requiring the use of pitch, - * e.g. time stretching/shortening. If the last frame was not voiced, or if the - * pitch was not coded in the frame, then zero is returned. - * - * This CTL is only implemented for decoder instances. - * - * @param[out] x opus_int32 *: pitch period at 48 kHz (or 0 if not available) - * - * @hideinitializer */ -#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x) - -/**@}*/ - -/** @defgroup opus_libinfo Opus library information functions - * @{ - */ - -/** Converts an opus error code into a human readable string. - * - * @param[in] error int: Error number - * @returns Error string - */ -OPUS_EXPORT const char *opus_strerror(int error); - -/** Gets the libopus version string. - * - * Applications may look for the substring "-fixed" in the version string to - * determine whether they have a fixed-point or floating-point build at - * runtime. - * - * @returns Version string - */ -OPUS_EXPORT const char *opus_get_version_string(void); -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_DEFINES_H */ diff --git a/submodules/ffmpeg/Sources/opus/include/opus/opus_multistream.h b/submodules/ffmpeg/Sources/opus/include/opus/opus_multistream.h deleted file mode 100644 index babcee6905..0000000000 --- a/submodules/ffmpeg/Sources/opus/include/opus/opus_multistream.h +++ /dev/null @@ -1,660 +0,0 @@ -/* Copyright (c) 2011 Xiph.Org Foundation - Written by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_multistream.h - * @brief Opus reference implementation multistream API - */ - -#ifndef OPUS_MULTISTREAM_H -#define OPUS_MULTISTREAM_H - -#include "opus.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** Macros to trigger compilation errors when the wrong types are provided to a - * CTL. */ -/**@{*/ -#define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr))) -#define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr))) -/**@}*/ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications. - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120 -#define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122 -/**@}*/ - -/** @endcond */ - -/** @defgroup opus_multistream_ctls Multistream specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_multistream_encoder_ctl() and opus_multistream_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, and - * @ref opus_decoderctls may be applied to a multistream encoder or decoder as - * well. - * In addition, you may retrieve the encoder or decoder state for an specific - * stream via #OPUS_MULTISTREAM_GET_ENCODER_STATE or - * #OPUS_MULTISTREAM_GET_DECODER_STATE and apply CTLs to it individually. - */ -/**@{*/ - -/** Gets the encoder state for an individual stream of a multistream encoder. - * @param[in] x opus_int32: The index of the stream whose encoder you - * wish to retrieve. - * This must be non-negative and less than - * the streams parameter used - * to initialize the encoder. - * @param[out] y OpusEncoder**: Returns a pointer to the given - * encoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y) - -/** Gets the decoder state for an individual stream of a multistream decoder. - * @param[in] x opus_int32: The index of the stream whose decoder you - * wish to retrieve. - * This must be non-negative and less than - * the streams parameter used - * to initialize the decoder. - * @param[out] y OpusDecoder**: Returns a pointer to the given - * decoder state. - * @retval OPUS_BAD_ARG The index of the requested stream was out of range. - * @hideinitializer - */ -#define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y) - -/**@}*/ - -/** @defgroup opus_multistream Opus Multistream API - * @{ - * - * The multistream API allows individual Opus streams to be combined into a - * single packet, enabling support for up to 255 channels. Unlike an - * elementary Opus stream, the encoder and decoder must negotiate the channel - * configuration before the decoder can successfully interpret the data in the - * packets produced by the encoder. Some basic information, such as packet - * duration, can be computed without any special negotiation. - * - * The format for multistream Opus packets is defined in - * RFC 7845 - * and is based on the self-delimited Opus framing described in Appendix B of - * RFC 6716. - * Normal Opus packets are just a degenerate case of multistream Opus packets, - * and can be encoded or decoded with the multistream API by setting - * streams to 1 when initializing the encoder or - * decoder. - * - * Multistream Opus streams can contain up to 255 elementary Opus streams. - * These may be either "uncoupled" or "coupled", indicating that the decoder - * is configured to decode them to either 1 or 2 channels, respectively. - * The streams are ordered so that all coupled streams appear at the - * beginning. - * - * A mapping table defines which decoded channel i - * should be used for each input/output (I/O) channel j. This table is - * typically provided as an unsigned char array. - * Let i = mapping[j] be the index for I/O channel j. - * If i < 2*coupled_streams, then I/O channel j is - * encoded as the left channel of stream (i/2) if i - * is even, or as the right channel of stream (i/2) if - * i is odd. Otherwise, I/O channel j is encoded as - * mono in stream (i - coupled_streams), unless it has the special - * value 255, in which case it is omitted from the encoding entirely (the - * decoder will reproduce it as silence). Each value i must either - * be the special value 255 or be less than streams + coupled_streams. - * - * The output channels specified by the encoder - * should use the - * Vorbis - * channel ordering. A decoder may wish to apply an additional permutation - * to the mapping the encoder used to achieve a different output channel - * order (e.g. for outputing in WAV order). - * - * Each multistream packet contains an Opus packet for each stream, and all of - * the Opus packets in a single multistream packet must have the same - * duration. Therefore the duration of a multistream packet can be extracted - * from the TOC sequence of the first stream, which is located at the - * beginning of the packet, just like an elementary Opus stream: - * - * @code - * int nb_samples; - * int nb_frames; - * nb_frames = opus_packet_get_nb_frames(data, len); - * if (nb_frames < 1) - * return nb_frames; - * nb_samples = opus_packet_get_samples_per_frame(data, 48000) * nb_frames; - * @endcode - * - * The general encoding and decoding process proceeds exactly the same as in - * the normal @ref opus_encoder and @ref opus_decoder APIs. - * See their documentation for an overview of how to use the corresponding - * multistream functions. - */ - -/** Opus multistream encoder state. - * This contains the complete state of a multistream Opus encoder. - * It is position independent and can be freely copied. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_init - */ -typedef struct OpusMSEncoder OpusMSEncoder; - -/** Opus multistream decoder state. - * This contains the complete state of a multistream Opus decoder. - * It is position independent and can be freely copied. - * @see opus_multistream_decoder_create - * @see opus_multistream_decoder_init - */ -typedef struct OpusMSDecoder OpusMSDecoder; - -/**\name Multistream encoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSEncoder structure. - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( - int streams, - int coupled_streams -); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a multistream encoder state. - * Call opus_multistream_encoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param[in] mapping const unsigned char[channels]: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(5); - -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application, - int *error -) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); - -/** Initialize a previously allocated multistream encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_encoder_create - * @see opus_multistream_encoder_get_size - * @param st OpusMSEncoder*: Multistream encoder state to initialize. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param[in] mapping const unsigned char[channels]: Mapping from - * encoded channels to input channels, as described in - * @ref opus_multistream. As an extra constraint, the - * multistream encoder does not allow encoding coupled - * streams for which one channel is unused since this - * is never a good idea. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -OPUS_EXPORT int opus_multistream_surround_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6) OPUS_ARG_NONNULL(7); - -/** Encodes a multistream Opus frame. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param[in] pcm const opus_int16*: The input signal as interleaved - * samples. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( - OpusMSEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Encodes a multistream Opus frame from floating point input. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param[in] pcm const float*: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( - OpusMSEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - -/** Frees an OpusMSEncoder allocated by - * opus_multistream_encoder_create(). - * @param st OpusMSEncoder*: Multistream encoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st); - -/** Perform a CTL function on a multistream Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusMSEncoder*: Multistream encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/**@}*/ - -/**\name Multistream decoder functions */ -/**@{*/ - -/** Gets the size of an OpusMSDecoder structure. - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( - int streams, - int coupled_streams -); - -/** Allocates and initializes a multistream decoder state. - * Call opus_multistream_decoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] mapping const unsigned char[channels]: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int *error -) OPUS_ARG_NONNULL(5); - -/** Intialize a previously allocated decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_multistream_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_multistream_decoder_create - * @see opus_multistream_deocder_get_size - * @param st OpusMSEncoder*: Multistream encoder state to initialize. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] mapping const unsigned char[channels]: Mapping from - * coded channels to output channels, as described in - * @ref opus_multistream. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_multistream_decoder_init( - OpusMSDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - -/** Decode a multistream Opus packet. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Decode a multistream Opus packet with floating point output. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float( - OpusMSDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - -/** Perform a CTL function on a multistream Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusMSDecoder*: Multistream decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, or @ref opus_multistream_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - */ -OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - -/** Frees an OpusMSDecoder allocated by - * opus_multistream_decoder_create(). - * @param st OpusMSDecoder: Multistream decoder state to be freed. - */ -OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st); - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_MULTISTREAM_H */ diff --git a/submodules/ffmpeg/Sources/opus/include/opus/opus_projection.h b/submodules/ffmpeg/Sources/opus/include/opus/opus_projection.h deleted file mode 100644 index 9dabf4e85c..0000000000 --- a/submodules/ffmpeg/Sources/opus/include/opus/opus_projection.h +++ /dev/null @@ -1,568 +0,0 @@ -/* Copyright (c) 2017 Google Inc. - Written by Andrew Allen */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/** - * @file opus_projection.h - * @brief Opus projection reference API - */ - -#ifndef OPUS_PROJECTION_H -#define OPUS_PROJECTION_H - -#include "opus_multistream.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond OPUS_INTERNAL_DOC */ - -/** These are the actual encoder and decoder CTL ID numbers. - * They should not be used directly by applications.c - * In general, SETs should be even and GETs should be odd.*/ -/**@{*/ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST 6001 -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST 6003 -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST 6005 -/**@}*/ - - -/** @endcond */ - -/** @defgroup opus_projection_ctls Projection specific encoder and decoder CTLs - * - * These are convenience macros that are specific to the - * opus_projection_encoder_ctl() and opus_projection_decoder_ctl() - * interface. - * The CTLs from @ref opus_genericctls, @ref opus_encoderctls, - * @ref opus_decoderctls, and @ref opus_multistream_ctls may be applied to a - * projection encoder or decoder as well. - */ -/**@{*/ - -/** Gets the gain (in dB. S7.8-format) of the demixing matrix from the encoder. - * @param[out] x opus_int32 *: Returns the gain (in dB. S7.8-format) - * of the demixing matrix. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST, __opus_check_int_ptr(x) - - -/** Gets the size in bytes of the demixing matrix from the encoder. - * @param[out] x opus_int32 *: Returns the size in bytes of the - * demixing matrix. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST, __opus_check_int_ptr(x) - - -/** Copies the demixing matrix to the supplied pointer location. - * @param[out] x unsigned char *: Returns the demixing matrix to the - * supplied pointer location. - * @param y opus_int32: The size in bytes of the reserved memory at the - * pointer location. - * @hideinitializer - */ -#define OPUS_PROJECTION_GET_DEMIXING_MATRIX(x,y) OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST, x, __opus_check_int(y) - - -/**@}*/ - -/** Opus projection encoder state. - * This contains the complete state of a projection Opus encoder. - * It is position independent and can be freely copied. - * @see opus_projection_ambisonics_encoder_create - */ -typedef struct OpusProjectionEncoder OpusProjectionEncoder; - - -/** Opus projection decoder state. - * This contains the complete state of a projection Opus decoder. - * It is position independent and can be freely copied. - * @see opus_projection_decoder_create - * @see opus_projection_decoder_init - */ -typedef struct OpusProjectionDecoder OpusProjectionDecoder; - - -/**\name Projection encoder functions */ -/**@{*/ - -/** Gets the size of an OpusProjectionEncoder structure. - * @param channels int: The total number of input channels to encode. - * This must be no more than 255. - * @param mapping_family int: The mapping family to use for selecting - * the appropriate projection. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_ambisonics_encoder_get_size( - int channels, - int mapping_family -); - - -/** Allocates and initializes a projection encoder state. - * Call opus_projection_encoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param mapping_family int: The mapping family to use for selecting - * the appropriate projection. - * @param[out] streams int *: The total number of streams that will - * be encoded from the input. - * @param[out] coupled_streams int *: Number of coupled (2 channel) - * streams that will be encoded from the input. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionEncoder *opus_projection_ambisonics_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - int application, - int *error -) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5); - - -/** Initialize a previously allocated projection encoder state. - * The memory pointed to by \a st must be at least the size returned by - * opus_projection_ambisonics_encoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_projection_ambisonics_encoder_create - * @see opus_projection_ambisonics_encoder_get_size - * @param st OpusProjectionEncoder*: Projection encoder state to initialize. - * @param Fs opus_int32: Sampling rate of the input signal (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels in the input signal. - * This must be at most 255. - * It may be greater than the number of - * coded channels (streams + - * coupled_streams). - * @param streams int: The total number of streams to encode from the - * input. - * This must be no more than the number of channels. - * @param coupled_streams int: Number of coupled (2 channel) streams - * to encode. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * encoded channels (streams + - * coupled_streams) must be no - * more than the number of input channels. - * @param application int: The target encoder application. - * This must be one of the following: - *
- *
#OPUS_APPLICATION_VOIP
- *
Process signal for improved speech intelligibility.
- *
#OPUS_APPLICATION_AUDIO
- *
Favor faithfulness to the original input.
- *
#OPUS_APPLICATION_RESTRICTED_LOWDELAY
- *
Configure the minimum possible coding delay by disabling certain modes - * of operation.
- *
- * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_projection_ambisonics_encoder_init( - OpusProjectionEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - int application -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6); - - -/** Encodes a projection Opus frame. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param[in] pcm const opus_int16*: The input signal as interleaved - * samples. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode( - OpusProjectionEncoder *st, - const opus_int16 *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - - -/** Encodes a projection Opus frame from floating point input. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param[in] pcm const float*: The input signal as interleaved - * samples with a normal range of - * +/-1.0. - * Samples with a range beyond +/-1.0 - * are supported but will be clipped by - * decoders using the integer API and - * should only be used if it is known - * that the far end supports extended - * dynamic range. - * This must contain - * frame_size*channels - * samples. - * @param frame_size int: Number of samples per channel in the input - * signal. - * This must be an Opus frame size for the - * encoder's sampling rate. - * For example, at 48 kHz the permitted values - * are 120, 240, 480, 960, 1920, and 2880. - * Passing in a duration of less than 10 ms - * (480 samples at 48 kHz) will prevent the - * encoder from using the LPC or hybrid modes. - * @param[out] data unsigned char*: Output payload. - * This must contain storage for at - * least \a max_data_bytes. - * @param [in] max_data_bytes opus_int32: Size of the allocated - * memory for the output - * payload. This may be - * used to impose an upper limit on - * the instant bitrate, but should - * not be used as the only bitrate - * control. Use #OPUS_SET_BITRATE to - * control the bitrate. - * @returns The length of the encoded packet (in bytes) on success or a - * negative error code (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode_float( - OpusProjectionEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); - - -/** Frees an OpusProjectionEncoder allocated by - * opus_projection_ambisonics_encoder_create(). - * @param st OpusProjectionEncoder*: Projection encoder state to be freed. - */ -OPUS_EXPORT void opus_projection_encoder_destroy(OpusProjectionEncoder *st); - - -/** Perform a CTL function on a projection Opus encoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusProjectionEncoder*: Projection encoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_encoderctls, @ref opus_multistream_ctls, or - * @ref opus_projection_ctls - * @see opus_genericctls - * @see opus_encoderctls - * @see opus_multistream_ctls - * @see opus_projection_ctls - */ -OPUS_EXPORT int opus_projection_encoder_ctl(OpusProjectionEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); - - -/**@}*/ - -/**\name Projection decoder functions */ -/**@{*/ - -/** Gets the size of an OpusProjectionDecoder structure. - * @param channels int: The total number of output channels. - * This must be no more than 255. - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @returns The size in bytes on success, or a negative error code - * (see @ref opus_errorcodes) on error. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_decoder_get_size( - int channels, - int streams, - int coupled_streams -); - - -/** Allocates and initializes a projection decoder state. - * Call opus_projection_decoder_destroy() to release - * this object when finished. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] demixing_matrix const unsigned char[demixing_matrix_size]: Demixing matrix - * that mapping from coded channels to output channels, - * as described in @ref opus_projection and - * @ref opus_projection_ctls. - * @param demixing_matrix_size opus_int32: The size in bytes of the - * demixing matrix, as - * described in @ref - * opus_projection_ctls. - * @param[out] error int *: Returns #OPUS_OK on success, or an error - * code (see @ref opus_errorcodes) on - * failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionDecoder *opus_projection_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - unsigned char *demixing_matrix, - opus_int32 demixing_matrix_size, - int *error -) OPUS_ARG_NONNULL(5); - - -/** Intialize a previously allocated projection decoder state object. - * The memory pointed to by \a st must be at least the size returned by - * opus_projection_decoder_get_size(). - * This is intended for applications which use their own allocator instead of - * malloc. - * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. - * @see opus_projection_decoder_create - * @see opus_projection_deocder_get_size - * @param st OpusProjectionDecoder*: Projection encoder state to initialize. - * @param Fs opus_int32: Sampling rate to decode at (in Hz). - * This must be one of 8000, 12000, 16000, - * 24000, or 48000. - * @param channels int: Number of channels to output. - * This must be at most 255. - * It may be different from the number of coded - * channels (streams + - * coupled_streams). - * @param streams int: The total number of streams coded in the - * input. - * This must be no more than 255. - * @param coupled_streams int: Number of streams to decode as coupled - * (2 channel) streams. - * This must be no larger than the total - * number of streams. - * Additionally, The total number of - * coded channels (streams + - * coupled_streams) must be no - * more than 255. - * @param[in] demixing_matrix const unsigned char[demixing_matrix_size]: Demixing matrix - * that mapping from coded channels to output channels, - * as described in @ref opus_projection and - * @ref opus_projection_ctls. - * @param demixing_matrix_size opus_int32: The size in bytes of the - * demixing matrix, as - * described in @ref - * opus_projection_ctls. - * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) - * on failure. - */ -OPUS_EXPORT int opus_projection_decoder_init( - OpusProjectionDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - unsigned char *demixing_matrix, - opus_int32 demixing_matrix_size -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); - - -/** Decode a projection Opus packet. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode( - OpusProjectionDecoder *st, - const unsigned char *data, - opus_int32 len, - opus_int16 *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - - -/** Decode a projection Opus packet with floating point output. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param[in] data const unsigned char*: Input payload. - * Use a NULL - * pointer to indicate packet - * loss. - * @param len opus_int32: Number of bytes in payload. - * @param[out] pcm opus_int16*: Output signal, with interleaved - * samples. - * This must contain room for - * frame_size*channels - * samples. - * @param frame_size int: The number of samples per channel of - * available space in \a pcm. - * If this is less than the maximum packet duration - * (120 ms; 5760 for 48kHz), this function will not be capable - * of decoding some packets. In the case of PLC (data==NULL) - * or FEC (decode_fec=1), then frame_size needs to be exactly - * the duration of audio that is missing, otherwise the - * decoder will not be in the optimal state to decode the - * next incoming packet. For the PLC and FEC cases, frame_size - * must be a multiple of 2.5 ms. - * @param decode_fec int: Flag (0 or 1) to request that any in-band - * forward error correction data be decoded. - * If no such data is available, the frame is - * decoded as if it were lost. - * @returns Number of samples decoded on success or a negative error code - * (see @ref opus_errorcodes) on failure. - */ -OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode_float( - OpusProjectionDecoder *st, - const unsigned char *data, - opus_int32 len, - float *pcm, - int frame_size, - int decode_fec -) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); - - -/** Perform a CTL function on a projection Opus decoder. - * - * Generally the request and subsequent arguments are generated by a - * convenience macro. - * @param st OpusProjectionDecoder*: Projection decoder state. - * @param request This and all remaining parameters should be replaced by one - * of the convenience macros in @ref opus_genericctls, - * @ref opus_decoderctls, @ref opus_multistream_ctls, or - * @ref opus_projection_ctls. - * @see opus_genericctls - * @see opus_decoderctls - * @see opus_multistream_ctls - * @see opus_projection_ctls - */ -OPUS_EXPORT int opus_projection_decoder_ctl(OpusProjectionDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); - - -/** Frees an OpusProjectionDecoder allocated by - * opus_projection_decoder_create(). - * @param st OpusProjectionDecoder: Projection decoder state to be freed. - */ -OPUS_EXPORT void opus_projection_decoder_destroy(OpusProjectionDecoder *st); - - -/**@}*/ - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* OPUS_PROJECTION_H */ diff --git a/submodules/ffmpeg/Sources/opus/include/opus/opus_types.h b/submodules/ffmpeg/Sources/opus/include/opus/opus_types.h deleted file mode 100644 index 7cf675580f..0000000000 --- a/submodules/ffmpeg/Sources/opus/include/opus/opus_types.h +++ /dev/null @@ -1,166 +0,0 @@ -/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */ -/* Modified by Jean-Marc Valin */ -/* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/* opus_types.h based on ogg_types.h from libogg */ - -/** - @file opus_types.h - @brief Opus reference implementation types -*/ -#ifndef OPUS_TYPES_H -#define OPUS_TYPES_H - -#define opus_int int /* used for counters etc; at least 16 bits */ -#define opus_int64 long long -#define opus_int8 signed char - -#define opus_uint unsigned int /* used for counters etc; at least 16 bits */ -#define opus_uint64 unsigned long long -#define opus_uint8 unsigned char - -/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */ -#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) -#include -# undef opus_int64 -# undef opus_int8 -# undef opus_uint64 -# undef opus_uint8 - typedef int8_t opus_int8; - typedef uint8_t opus_uint8; - typedef int16_t opus_int16; - typedef uint16_t opus_uint16; - typedef int32_t opus_int32; - typedef uint32_t opus_uint32; - typedef int64_t opus_int64; - typedef uint64_t opus_uint64; -#elif defined(_WIN32) - -# if defined(__CYGWIN__) -# include <_G_config.h> - typedef _G_int32_t opus_int32; - typedef _G_uint32_t opus_uint32; - typedef _G_int16 opus_int16; - typedef _G_uint16 opus_uint16; -# elif defined(__MINGW32__) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; -# elif defined(__MWERKS__) - typedef int opus_int32; - typedef unsigned int opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; -# else - /* MSVC/Borland */ - typedef __int32 opus_int32; - typedef unsigned __int32 opus_uint32; - typedef __int16 opus_int16; - typedef unsigned __int16 opus_uint16; -# endif - -#elif defined(__MACOS__) - -# include - typedef SInt16 opus_int16; - typedef UInt16 opus_uint16; - typedef SInt32 opus_int32; - typedef UInt32 opus_uint32; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include - typedef int16_t opus_int16; - typedef u_int16_t opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined(__BEOS__) - - /* Be */ -# include - typedef int16 opus_int16; - typedef u_int16 opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(R5900) - - /* PS2 EE */ - typedef int opus_int32; - typedef unsigned opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short opus_int16; - typedef unsigned short opus_uint16; - typedef signed int opus_int32; - typedef unsigned int opus_uint32; - -#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef long opus_int32; - typedef unsigned long opus_uint32; - -#elif defined(CONFIG_TI_C6X) - - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#else - - /* Give up, take a reasonable guess */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; - -#endif - -#endif /* OPUS_TYPES_H */ diff --git a/submodules/ffmpeg/Sources/opus/lib/libopus.a b/submodules/ffmpeg/Sources/opus/lib/libopus.a deleted file mode 100644 index 01624b7a6c..0000000000 Binary files a/submodules/ffmpeg/Sources/opus/lib/libopus.a and /dev/null differ diff --git a/submodules/libphonenumber/BUCK b/submodules/libphonenumber/BUCK deleted file mode 100644 index 2bf07e7f10..0000000000 --- a/submodules/libphonenumber/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "libphonenumber", - srcs = glob([ - "Sources/*.m", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/lottie-ios/BUCK b/submodules/lottie-ios/BUCK deleted file mode 100644 index 18430670c3..0000000000 --- a/submodules/lottie-ios/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -private_headers = glob([ - "lottie-ios/**/*.h", -], exclude = [ - "lottie-ios/Classes/PublicHeaders/**/*.h", -]) - -static_library( - name = "Lottie", - srcs = glob([ - "lottie-ios/**/*.m", - ]), - headers = private_headers, - exported_headers = glob([ - "lottie-ios/Classes/PublicHeaders/**/*.h", - ]), - deps = [ - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/openssl/BUCK b/submodules/openssl/BUCK deleted file mode 100644 index 5d87cd095d..0000000000 --- a/submodules/openssl/BUCK +++ /dev/null @@ -1,179 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "gen_header_targets") - -openssl_headers = [ - "aes.h", - "asn1.h", - "asn1_mac.h", - "asn1err.h", - "asn1t.h", - "async.h", - "asyncerr.h", - "bio.h", - "bioerr.h", - "blowfish.h", - "bn.h", - "bnerr.h", - "buffer.h", - "buffererr.h", - "camellia.h", - "cast.h", - "cmac.h", - "cms.h", - "cmserr.h", - "comp.h", - "comperr.h", - "conf.h", - "conf_api.h", - "conferr.h", - "crypto.h", - "cryptoerr.h", - "ct.h", - "cterr.h", - "des.h", - "dh.h", - "dherr.h", - "dsa.h", - "dsaerr.h", - "dtls1.h", - "e_os2.h", - "ebcdic.h", - "ec.h", - "ecdh.h", - "ecdsa.h", - "ecerr.h", - "engine.h", - "engineerr.h", - "err.h", - "evp.h", - "evperr.h", - "hmac.h", - "idea.h", - "kdf.h", - "kdferr.h", - "lhash.h", - "md2.h", - "md4.h", - "md5.h", - "mdc2.h", - "modes.h", - "obj_mac.h", - "objects.h", - "objectserr.h", - "ocsp.h", - "ocsperr.h", - "opensslconf.h", - "opensslv.h", - "ossl_typ.h", - "pem.h", - "pem2.h", - "pemerr.h", - "pkcs12.h", - "pkcs12err.h", - "pkcs7.h", - "pkcs7err.h", - "rand.h", - "rand_drbg.h", - "randerr.h", - "rc2.h", - "rc4.h", - "rc5.h", - "ripemd.h", - "rsa.h", - "rsaerr.h", - "safestack.h", - "seed.h", - "sha.h", - "srp.h", - "srtp.h", - "ssl.h", - "ssl2.h", - "ssl3.h", - "sslerr.h", - "stack.h", - "store.h", - "storeerr.h", - "symhacks.h", - "tls1.h", - "ts.h", - "tserr.h", - "txt_db.h", - "ui.h", - "uierr.h", - "whrlpool.h", - "x509.h", - "x509_vfy.h", - "x509err.h", - "x509v3.h", - "x509v3err.h", -] - -openssl_header_paths = ["openssl/" + header for header in openssl_headers] - -archs = ["arm64", "armv7", "x86_64"] - -rules = [ - genrule( - name = "openssl_build_" + arch, - srcs = glob([ - "build-openssl-buck.sh", - "*.tar.gz", - "*.patch", - ]), - bash = "sh $SRCDIR/build-openssl-buck.sh $OUT $SRCDIR " + arch, - out = "openssl_" + arch, - visibility = [ - "//submodules/openssl:...", - ] - ) for arch in archs -] - -genrule( - name = "openssl_build_merged", - srcs = [ - "pack-openssl.sh", - ], - bash = "sh $SRCDIR/pack-openssl.sh $OUT $(location :openssl_build_arm64)/out/include " + - " ".join(["$(location :openssl_build_" + arch + ")/out/lib/libcrypto.a" for arch in archs]), - out = "openssl", - visibility = [ - "PUBLIC", - ] -) - -genrule( - name = "openssl_libssl_merged", - srcs = [ - "pack-libssl.sh", - ], - bash = "sh $SRCDIR/pack-libssl.sh $OUT $(location :openssl_build_arm64)/out/include " + - " ".join(["$(location :openssl_build_" + arch + ")/out/lib/libssl.a" for arch in archs]), - out = "libssl", - visibility = [ - "PUBLIC", - ] -) - - -openssl_header_targets = gen_header_targets(openssl_header_paths, "openssl_header_", "", "openssl_build_arm64", "out/include") - -apple_library( - name = "openssl", - visibility = [ - "PUBLIC", - ], - header_namespace = "openssl", - exported_headers = openssl_header_targets, - linker_flags = [ - "-L$(location :openssl_build_merged)/lib", - "-L$(location :openssl_libssl_merged)/lib", - "-lcrypto", - "-lssl", - ], - exported_linker_flags = [ - "-L$(location :openssl_build_merged)/lib", - "-L$(location :openssl_libssl_merged)/lib", - "-lcrypto", - "-lssl", - ], - deps = [":openssl_build_" + arch for arch in ["arm64"]], -) diff --git a/submodules/openssl/build-openssl-buck.sh b/submodules/openssl/build-openssl-buck.sh deleted file mode 100644 index f2b2c487c4..0000000000 --- a/submodules/openssl/build-openssl-buck.sh +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/bash - -OUT_DIR="$1" -SRC_DIR="$2" -ARCH="$3" - -if [ "$ARCH" != "arm64" ] && [ "$ARCH" != "armv7" ] && [ "$ARCH" != "x86_64" ]; then - echo "Invalid architecture $ARCH" - exit 1 -fi - -if [ -z "$OUT_DIR" ]; then - echo "Usage: sh build-openssl.sh OUT_DIR SRC_DIR ARCH" - exit 1 -fi - -if [ -z "$SRC_DIR" ]; then - echo "Usage: sh build-openssl.sh OUT_DIR SRC_DIR ARCH" - exit 1 -fi - -if [ ! -d "$SRC_DIR" ]; then - echo "$SRC_DIR does not exist" - exit 1 -fi - -mkdir -p "$OUT_DIR" - -TMP_DIR="$OUT_DIR/build" -rm -rf "$TMP_DIR" -mkdir -p "$TMP_DIR" - -CROSS_TOP_SIM="`xcode-select --print-path`/Platforms/iPhoneSimulator.platform/Developer" -CROSS_SDK_SIM="iPhoneSimulator.sdk" - -CROSS_TOP_IOS="`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer" -CROSS_SDK_IOS="iPhoneOS.sdk" - -SOURCE_DIR="$OUT_DIR/openssl-1.1.1d" -SOURCE_ARCHIVE="$SRC_DIR/openssl-1.1.1d.tar.gz" - -rm -rf "$SOURCE_DIR" - -tar -xzf "$SOURCE_ARCHIVE" --directory "$OUT_DIR" - -export CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/ - -function build_for () -{ - DIR="$(pwd)" - cd "$SOURCE_DIR" - - PLATFORM="$1" - ARCH="$2" - CROSS_TOP_ENV="CROSS_TOP_$3" - CROSS_SDK_ENV="CROSS_SDK_$3" - - make clean - - export CROSS_TOP="${!CROSS_TOP_ENV}" - export CROSS_SDK="${!CROSS_SDK_ENV}" - - MINIMAL_FLAGS=(\ - "no-afalgeng" \ - "no-aria" \ - "no-asan" \ - "no-async" \ - "no-autoalginit" \ - "no-autoerrinit" \ - "no-autoload-config" \ - "no-bf" \ - "no-blake2" \ - "no-buildtest-c++" \ - "no-camellia" \ - "no-capieng" \ - "no-cast" \ - "no-chacha" \ - "no-cmac" \ - "no-cms" \ - "no-comp" \ - "no-crypto-mdebug" \ - "no-crypto-mdebug-backtrace" \ - "no-ct" \ - "no-deprecated" \ - "no-des" \ - "no-devcryptoeng" \ - "no-dgram" \ - "no-dh" \ - "no-dsa" \ - "no-dtls" \ - "no-dynamic-engine" \ - "no-ec" \ - "no-ec2m" \ - "no-ecdh" \ - "no-ecdsa" \ - "no-ec_nistp_64_gcc_128" \ - "no-egd" \ - "no-engine" \ - "no-err" \ - "no-external-tests" \ - "no-filenames" \ - "no-fuzz-libfuzzer" \ - "no-fuzz-afl" \ - "no-gost" \ - "no-heartbeats" \ - "no-idea" \ - "no-makedepend" \ - "no-md2" \ - "no-md4" \ - "no-mdc2" \ - "no-msan" \ - "no-multiblock" \ - "no-nextprotoneg" \ - "no-pinshared" \ - "no-ocb" \ - "no-ocsp" \ - "no-pic" \ - "no-poly1305" \ - "no-posix-io" \ - "no-psk" \ - "no-rc2" \ - "no-rc4" \ - "no-rc5" \ - "no-rfc3779" \ - "no-rmd160" \ - "no-scrypt" \ - "no-sctp" \ - "no-shared" \ - "no-siphash" \ - "no-sm2" \ - "no-sm3" \ - "no-sm4" \ - "no-sock" \ - "no-srp" \ - "no-srtp" \ - "no-sse2" \ - "no-ssl" \ - "no-ssl-trace" \ - "no-static-engine" \ - "no-stdio" \ - "no-tests" \ - "no-tls" \ - "no-ts" \ - "no-ubsan" \ - "no-ui-console" \ - "no-unit-test" \ - "no-whirlpool" \ - "no-weak-ssl-ciphers" \ - "no-zlib" \ - "no-zlib-dynamic" \ - ) - - DEFAULT_FLAGS=(\ - "no-asm" \ - "no-ssl3" \ - "no-comp" \ - "no-hw" \ - "no-engine" \ - "no-async" \ - ) - - ADDITIONAL_FLAGS=$DEFAULT_FLAGS - - ./Configure $PLATFORM "-arch $ARCH" ${ADDITIONAL_FLAGS[@]} --prefix=${TMP_DIR}/${ARCH} || exit 1 - - make && make install_sw || exit 2 - unset CROSS_TOP - unset CROSS_SDK - - cd "$DIR" -} - -patch "$SOURCE_DIR/Configurations/10-main.conf" < patch-conf.patch || exit 1 - -if [ "$ARCH" == "x86_64" ]; then - build_for ios64sim-cross x86_64 SIM || exit 2 -elif [ "$ARCH" == "armv7" ]; then - build_for ios-cross armv7 IOS || exit 4 -elif [ "$ARCH" == "arm64" ]; then - build_for ios64-cross arm64 IOS || exit 5 -else - echo "Invalid architecture $ARCH" - exit 1 -fi - -cp -r "${TMP_DIR}/$ARCH/include" "${TMP_DIR}/" -patch -p3 "${TMP_DIR}/include/openssl/opensslconf.h" < patch-include.patch - -DFT_DIST_DIR="$OUT_DIR/out" -rm -rf "$DFT_DIST_DIR" -mkdir -p "$DFT_DIST_DIR" - -DIST_DIR="${DIST_DIR:-$DFT_DIST_DIR}" -mkdir -p "${DIST_DIR}" -cp -r "${TMP_DIR}/include" "${TMP_DIR}/$ARCH/lib" "${DIST_DIR}" \ No newline at end of file diff --git a/submodules/rlottie/BUCK b/submodules/rlottie/BUCK deleted file mode 100644 index 6a595b8462..0000000000 --- a/submodules/rlottie/BUCK +++ /dev/null @@ -1,35 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -public_headers = glob([ - "PublicHeaders/**/*.h", -]) - -static_library( - name = "RLottieBinding", - srcs = glob([ - "rlottie/src/**/*.cpp", - ], exclude = [ - "rlottie/src/vector/vdrawhelper_neon.cpp", - "rlottie/src/vector/stb/**/*", - ]) + [ - "LottieInstance.mm" - ], - compiler_flags = [ - "-Dpixman_region_selfcheck(x)=1", - "-DLOTTIE_DISABLE_ARM_NEON=1", - "-DLOTTIE_IMAGE_MODULE_DISABLED=1", - ], - headers = glob([ - "rlottie/src/**/*.h", - "rlottie/inc/**/*.h", - ], exclude = [ - "rlottie/src/lottie/rapidjson/msinttypes/**/*", - ]) + [ - "config.h", - ] + public_headers, - exported_headers = public_headers, - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - "$SDKROOT/System/Library/Frameworks/UIKit.framework", - ], -) diff --git a/submodules/sqlcipher/BUCK b/submodules/sqlcipher/BUCK deleted file mode 100644 index 8411d124e2..0000000000 --- a/submodules/sqlcipher/BUCK +++ /dev/null @@ -1,24 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -static_library( - name = "sqlcipher", - compiler_flags = [ - "-DDSQLITE_HAS_CODEC=1", - "-DSQLCIPHER_CRYPTO_CC=1", - "-DSQLITE_ENABLE_FTS5", - "-DSQLITE_DEFAULT_MEMSTATUS=0", - "-DNDEBUG", - ], - srcs = glob([ - "Sources/*.c", - ]), - headers = glob([ - "Sources/*.h", - ]), - exported_headers = glob([ - "PublicHeaders/**/*.h", - ]), - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) diff --git a/submodules/webp/.gitignore b/submodules/webp/.gitignore deleted file mode 100644 index 5b8859f00b..0000000000 --- a/submodules/webp/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -fastlane/README.md -fastlane/report.xml -fastlane/test_output/* -build/* -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.xcscmblueprint -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -.DS_Store -*.dSYM -*.dSYM.zip -*.ipa -*/xcuserdata/* -webp.xcodeproj/* diff --git a/submodules/webp/BUCK b/submodules/webp/BUCK deleted file mode 100644 index afd63155da..0000000000 --- a/submodules/webp/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "framework") - -genrule( - name = "WebP_lib_file", - srcs = [ - "lib/libwebp.a", - ], - bash = "mkdir -p $OUT; cp $SRCS $OUT/", - out = "WebP_libs", - visibility = ["PUBLIC"] -) - -apple_library( - name = "webp", - header_namespace = "webp", - exported_headers = { - "webp/encode.h": "include/webp/encode.h", - "webp/decode.h": "include/webp/decode.h", - "webp/types.h": "include/webp/types.h", - }, - exported_linker_flags = [ - "-lwebp", - "-L$(location :WebP_lib_file)", - ], - visibility = ["PUBLIC"], -) diff --git a/submodules/webp/BUILD b/submodules/webp/BUILD deleted file mode 100644 index 5c072543a8..0000000000 --- a/submodules/webp/BUILD +++ /dev/null @@ -1,25 +0,0 @@ - -cc_library( - name = "webp_lib", - srcs = [ - "lib/libwebp.a", - ], -) - -objc_library( - name = "webp", - module_name = "webp", - enable_modules = True, - hdrs = glob([ - "include/**/*.h", - ]), - includes = [ - "include", - ], - deps = [ - ":webp_lib", - ], - visibility = [ - "//visibility:public", - ] -) diff --git a/submodules/webp/include/webp/decode.h b/submodules/webp/include/webp/decode.h deleted file mode 100644 index b00d15b346..0000000000 --- a/submodules/webp/include/webp/decode.h +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// Main decoding functions for WebP images. -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_DECODE_H_ -#define WEBP_WEBP_DECODE_H_ - -#include "./types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define WEBP_DECODER_ABI_VERSION 0x0208 // MAJOR(8b) + MINOR(8b) - -// Note: forward declaring enumerations is not allowed in (strict) C and C++, -// the types are left here for reference. -// typedef enum VP8StatusCode VP8StatusCode; -// typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; -typedef struct WebPRGBABuffer WebPRGBABuffer; -typedef struct WebPYUVABuffer WebPYUVABuffer; -typedef struct WebPDecBuffer WebPDecBuffer; -typedef struct WebPIDecoder WebPIDecoder; -typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; -typedef struct WebPDecoderOptions WebPDecoderOptions; -typedef struct WebPDecoderConfig WebPDecoderConfig; - -// Return the decoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetDecoderVersion(void); - -// Retrieve basic header information: width, height. -// This function will also validate the header and return 0 in -// case of formatting error. -// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. -WEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Decodes WebP images pointed to by 'data' and returns RGBA samples, along -// with the dimensions in *width and *height. The ordering of samples in -// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). -// The returned pointer should be deleted calling WebPFree(). -// Returns NULL in case of error. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. -// If the bitstream contains transparency, it is ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size, - int* width, int* height); - -// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. -WEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size, - int* width, int* height); - - -// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer -// returned is the Y samples buffer. Upon return, *u and *v will point to -// the U and V chroma data. These U and V buffers need NOT be passed to -// WebPFree(), unlike the returned Y luma one. The dimension of the U and V -// planes are both (*width + 1) / 2 and (*height + 1)/ 2. -// Upon return, the Y buffer has a stride returned as '*stride', while U and V -// have a common stride returned as '*uv_stride'. -// Return NULL in case of error. -// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr -WEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size, - int* width, int* height, - uint8_t** u, uint8_t** v, - int* stride, int* uv_stride); - -// Releases memory returned by the WebPDecode*() functions above. -WEBP_EXTERN(void) WebPFree(void* ptr); - -// These five functions are variants of the above ones, that decode the image -// directly into a pre-allocated buffer 'output_buffer'. The maximum storage -// available in this buffer is indicated by 'output_buffer_size'. If this -// storage is not sufficient (or an error occurred), NULL is returned. -// Otherwise, output_buffer is returned, for convenience. -// The parameter 'output_stride' specifies the distance (in bytes) -// between scanlines. Hence, output_buffer_size is expected to be at least -// output_stride x picture-height. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeARGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// RGB and BGR variants. Here too the transparency information, if present, -// will be dropped and ignored. -WEBP_EXTERN(uint8_t*) WebPDecodeRGBInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); -WEBP_EXTERN(uint8_t*) WebPDecodeBGRInto( - const uint8_t* data, size_t data_size, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly -// into pre-allocated luma/chroma plane buffers. This function requires the -// strides to be passed: one for the luma plane and one for each of the -// chroma ones. The size of each plane buffer is passed as 'luma_size', -// 'u_size' and 'v_size' respectively. -// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred -// during decoding (or because some buffers were found to be too small). -WEBP_EXTERN(uint8_t*) WebPDecodeYUVInto( - const uint8_t* data, size_t data_size, - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -//------------------------------------------------------------------------------ -// Output colorspaces and buffer - -// Colorspaces -// Note: the naming describes the byte-ordering of packed samples in memory. -// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... -// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. -// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: -// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... -// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... -// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for -// these two modes: -// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... -// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... - -typedef enum WEBP_CSP_MODE { - MODE_RGB = 0, MODE_RGBA = 1, - MODE_BGR = 2, MODE_BGRA = 3, - MODE_ARGB = 4, MODE_RGBA_4444 = 5, - MODE_RGB_565 = 6, - // RGB-premultiplied transparent modes (alpha value is preserved) - MODE_rgbA = 7, - MODE_bgrA = 8, - MODE_Argb = 9, - MODE_rgbA_4444 = 10, - // YUV modes must come after RGB ones. - MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 - MODE_LAST = 13 -} WEBP_CSP_MODE; - -// Some useful macros: -static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { - return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || - mode == MODE_rgbA_4444); -} - -static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { - return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || - mode == MODE_RGBA_4444 || mode == MODE_YUVA || - WebPIsPremultipliedMode(mode)); -} - -static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { - return (mode < MODE_YUV); -} - -//------------------------------------------------------------------------------ -// WebPDecBuffer: Generic structure for describing the output sample buffer. - -struct WebPRGBABuffer { // view as RGBA - uint8_t* rgba; // pointer to RGBA samples - int stride; // stride in bytes from one scanline to the next. - size_t size; // total size of the *rgba buffer. -}; - -struct WebPYUVABuffer { // view as YUVA - uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples - int y_stride; // luma stride - int u_stride, v_stride; // chroma strides - int a_stride; // alpha stride - size_t y_size; // luma plane size - size_t u_size, v_size; // chroma planes size - size_t a_size; // alpha-plane size -}; - -// Output buffer -struct WebPDecBuffer { - WEBP_CSP_MODE colorspace; // Colorspace. - int width, height; // Dimensions. - int is_external_memory; // If non-zero, 'internal_memory' pointer is not - // used. If value is '2' or more, the external - // memory is considered 'slow' and multiple - // read/write will be avoided. - union { - WebPRGBABuffer RGBA; - WebPYUVABuffer YUVA; - } u; // Nameless union of buffer parameters. - uint32_t pad[4]; // padding for later use - - uint8_t* private_memory; // Internally allocated memory (only when - // is_external_memory is 0). Should not be used - // externally, but accessed via the buffer union. -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int); - -// Initialize the structure as empty. Must be called before any other use. -// Returns false in case of version mismatch -static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { - return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); -} - -// Free any memory associated with the buffer. Must always be called last. -// Note: doesn't free the 'buffer' structure itself. -WEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer); - -//------------------------------------------------------------------------------ -// Enumeration of the status codes - -typedef enum VP8StatusCode { - VP8_STATUS_OK = 0, - VP8_STATUS_OUT_OF_MEMORY, - VP8_STATUS_INVALID_PARAM, - VP8_STATUS_BITSTREAM_ERROR, - VP8_STATUS_UNSUPPORTED_FEATURE, - VP8_STATUS_SUSPENDED, - VP8_STATUS_USER_ABORT, - VP8_STATUS_NOT_ENOUGH_DATA -} VP8StatusCode; - -//------------------------------------------------------------------------------ -// Incremental decoding -// -// This API allows streamlined decoding of partial data. -// Picture can be incrementally decoded as data become available thanks to the -// WebPIDecoder object. This object can be left in a SUSPENDED state if the -// picture is only partially decoded, pending additional input. -// Code example: -// -// WebPInitDecBuffer(&buffer); -// buffer.colorspace = mode; -// ... -// WebPIDecoder* idec = WebPINewDecoder(&buffer); -// while (has_more_data) { -// // ... (get additional data) -// status = WebPIAppend(idec, new_data, new_data_size); -// if (status != VP8_STATUS_SUSPENDED || -// break; -// } -// -// // The above call decodes the current available buffer. -// // Part of the image can now be refreshed by calling to -// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. -// } -// WebPIDelete(idec); - -// Creates a new incremental decoder with the supplied buffer parameter. -// This output_buffer can be passed NULL, in which case a default output buffer -// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' -// is kept, which means that the lifespan of 'output_buffer' must be larger than -// that of the returned WebPIDecoder object. -// The supplied 'output_buffer' content MUST NOT be changed between calls to -// WebPIAppend() or WebPIUpdate() unless 'output_buffer.is_external_memory' is -// not set to 0. In such a case, it is allowed to modify the pointers, size and -// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain -// within valid bounds. -// All other fields of WebPDecBuffer MUST remain constant between calls. -// Returns NULL if the allocation failed. -WEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer); - -// This function allocates and initializes an incremental-decoder object, which -// will output the RGB/A samples specified by 'csp' into a preallocated -// buffer 'output_buffer'. The size of this buffer is at least -// 'output_buffer_size' and the stride (distance in bytes between two scanlines) -// is specified by 'output_stride'. -// Additionally, output_buffer can be passed NULL in which case the output -// buffer will be allocated automatically when the decoding starts. The -// colorspace 'csp' is taken into account for allocating this buffer. All other -// parameters are ignored. -// Returns NULL if the allocation failed, or if some parameters are invalid. -WEBP_EXTERN(WebPIDecoder*) WebPINewRGB( - WEBP_CSP_MODE csp, - uint8_t* output_buffer, size_t output_buffer_size, int output_stride); - -// This function allocates and initializes an incremental-decoder object, which -// will output the raw luma/chroma samples into a preallocated planes if -// supplied. The luma plane is specified by its pointer 'luma', its size -// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane -// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v -// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer -// can be pass NULL in case one is not interested in the transparency plane. -// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. -// In this case, the output buffer will be automatically allocated (using -// MODE_YUVA) when decoding starts. All parameters are then ignored. -// Returns NULL if the allocation failed or if a parameter is invalid. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUVA( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride, - uint8_t* a, size_t a_size, int a_stride); - -// Deprecated version of the above, without the alpha plane. -// Kept for backward compatibility. -WEBP_EXTERN(WebPIDecoder*) WebPINewYUV( - uint8_t* luma, size_t luma_size, int luma_stride, - uint8_t* u, size_t u_size, int u_stride, - uint8_t* v, size_t v_size, int v_stride); - -// Deletes the WebPIDecoder object and associated memory. Must always be called -// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. -WEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec); - -// Copies and decodes the next available data. Returns VP8_STATUS_OK when -// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more -// data is expected. Returns error in other cases. -WEBP_EXTERN(VP8StatusCode) WebPIAppend( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// A variant of the above function to be used when data buffer contains -// partial data from the beginning. In this case data buffer is not copied -// to the internal memory. -// Note that the value of the 'data' pointer can change between calls to -// WebPIUpdate, for instance when the data buffer is resized to fit larger data. -WEBP_EXTERN(VP8StatusCode) WebPIUpdate( - WebPIDecoder* idec, const uint8_t* data, size_t data_size); - -// Returns the RGB/A image decoded so far. Returns NULL if output params -// are not initialized yet. The RGB/A output type corresponds to the colorspace -// specified during call to WebPINewDecoder() or WebPINewRGB(). -// *last_y is the index of last decoded row in raster scan order. Some pointers -// (*last_y, *width etc.) can be NULL if corresponding information is not -// needed. -WEBP_EXTERN(uint8_t*) WebPIDecGetRGB( - const WebPIDecoder* idec, int* last_y, - int* width, int* height, int* stride); - -// Same as above function to get a YUVA image. Returns pointer to the luma -// plane or NULL in case of error. If there is no alpha information -// the alpha pointer '*a' will be returned NULL. -WEBP_EXTERN(uint8_t*) WebPIDecGetYUVA( - const WebPIDecoder* idec, int* last_y, - uint8_t** u, uint8_t** v, uint8_t** a, - int* width, int* height, int* stride, int* uv_stride, int* a_stride); - -// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the -// alpha information (if present). Kept for backward compatibility. -static WEBP_INLINE uint8_t* WebPIDecGetYUV( - const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, - int* width, int* height, int* stride, int* uv_stride) { - return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, - stride, uv_stride, NULL); -} - -// Generic call to retrieve information about the displayable area. -// If non NULL, the left/right/width/height pointers are filled with the visible -// rectangular area so far. -// Returns NULL in case the incremental decoder object is in an invalid state. -// Otherwise returns the pointer to the internal representation. This structure -// is read-only, tied to WebPIDecoder's lifespan and should not be modified. -WEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea( - const WebPIDecoder* idec, int* left, int* top, int* width, int* height); - -//------------------------------------------------------------------------------ -// Advanced decoding parametrization -// -// Code sample for using the advanced decoding API -/* - // A) Init a configuration object - WebPDecoderConfig config; - CHECK(WebPInitDecoderConfig(&config)); - - // B) optional: retrieve the bitstream's features. - CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); - - // C) Adjust 'config', if needed - config.no_fancy_upsampling = 1; - config.output.colorspace = MODE_BGRA; - // etc. - - // Note that you can also make config.output point to an externally - // supplied memory buffer, provided it's big enough to store the decoded - // picture. Otherwise, config.output will just be used to allocate memory - // and store the decoded picture. - - // D) Decode! - CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); - - // E) Decoded image is now in config.output (and config.output.u.RGBA) - - // F) Reclaim memory allocated in config's object. It's safe to call - // this function even if the memory is external and wasn't allocated - // by WebPDecode(). - WebPFreeDecBuffer(&config.output); -*/ - -// Features gathered from the bitstream -struct WebPBitstreamFeatures { - int width; // Width in pixels, as read from the bitstream. - int height; // Height in pixels, as read from the bitstream. - int has_alpha; // True if the bitstream contains an alpha channel. - int has_animation; // True if the bitstream is an animation. - int format; // 0 = undefined (/mixed), 1 = lossy, 2 = lossless - - uint32_t pad[5]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal( - const uint8_t*, size_t, WebPBitstreamFeatures*, int); - -// Retrieve features from the bitstream. The *features structure is filled -// with information gathered from the bitstream. -// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns -// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the -// features from headers. Returns error in other cases. -static WEBP_INLINE VP8StatusCode WebPGetFeatures( - const uint8_t* data, size_t data_size, - WebPBitstreamFeatures* features) { - return WebPGetFeaturesInternal(data, data_size, features, - WEBP_DECODER_ABI_VERSION); -} - -// Decoding options -struct WebPDecoderOptions { - int bypass_filtering; // if true, skip the in-loop filtering - int no_fancy_upsampling; // if true, use faster pointwise upsampler - int use_cropping; // if true, cropping is applied _first_ - int crop_left, crop_top; // top-left position for cropping. - // Will be snapped to even values. - int crop_width, crop_height; // dimension of the cropping area - int use_scaling; // if true, scaling is applied _afterward_ - int scaled_width, scaled_height; // final resolution - int use_threads; // if true, use multi-threaded decoding - int dithering_strength; // dithering strength (0=Off, 100=full) - int flip; // flip output vertically - int alpha_dithering_strength; // alpha dithering strength in [0..100] - - uint32_t pad[5]; // padding for later use -}; - -// Main object storing the configuration for advanced decoding. -struct WebPDecoderConfig { - WebPBitstreamFeatures input; // Immutable bitstream features (optional) - WebPDecBuffer output; // Output buffer (can point to external mem) - WebPDecoderOptions options; // Decoding options -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); - -// Initialize the configuration as empty. This function must always be -// called first, unless WebPGetFeatures() is to be called. -// Returns false in case of mismatched version. -static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { - return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); -} - -// Instantiate a new incremental decoder object with the requested -// configuration. The bitstream can be passed using 'data' and 'data_size' -// parameter, in which case the features will be parsed and stored into -// config->input. Otherwise, 'data' can be NULL and no parsing will occur. -// Note that 'config' can be NULL too, in which case a default configuration -// is used. -// The return WebPIDecoder object must always be deleted calling WebPIDelete(). -// Returns NULL in case of error (and config->status will then reflect -// the error condition). -WEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -// Non-incremental version. This version decodes the full data at once, taking -// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK -// if the decoding was successful). -WEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size, - WebPDecoderConfig* config); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* WEBP_WEBP_DECODE_H_ */ diff --git a/submodules/webp/include/webp/encode.h b/submodules/webp/include/webp/encode.h deleted file mode 100644 index 9291b7195c..0000000000 --- a/submodules/webp/include/webp/encode.h +++ /dev/null @@ -1,527 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// WebP encoder: main interface -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_ENCODE_H_ -#define WEBP_WEBP_ENCODE_H_ - -#include "./types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define WEBP_ENCODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) - -// Note: forward declaring enumerations is not allowed in (strict) C and C++, -// the types are left here for reference. -// typedef enum WebPImageHint WebPImageHint; -// typedef enum WebPEncCSP WebPEncCSP; -// typedef enum WebPPreset WebPPreset; -// typedef enum WebPEncodingError WebPEncodingError; -typedef struct WebPConfig WebPConfig; -typedef struct WebPPicture WebPPicture; // main structure for I/O -typedef struct WebPAuxStats WebPAuxStats; -typedef struct WebPMemoryWriter WebPMemoryWriter; - -// Return the encoder's version number, packed in hexadecimal using 8bits for -// each of major/minor/revision. E.g: v2.5.7 is 0x020507. -WEBP_EXTERN(int) WebPGetEncoderVersion(void); - -//------------------------------------------------------------------------------ -// One-stop-shop call! No questions asked: - -// Returns the size of the compressed data (pointed to by *output), or 0 if -// an error occurred. The compressed data must be released by the caller -// using the call 'WebPFree(*output)'. -// These functions compress using the lossy format, and the quality_factor -// can go from 0 (smaller output, lower quality) to 100 (best quality, -// larger output). -WEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba, - int width, int height, int stride, - float quality_factor, uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra, - int width, int height, int stride, - float quality_factor, uint8_t** output); - -// These functions are the equivalent of the above, but compressing in a -// lossless manner. Files are usually larger than lossy format, but will -// not suffer any compression loss. -WEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba, - int width, int height, int stride, - uint8_t** output); -WEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra, - int width, int height, int stride, - uint8_t** output); - -// Releases memory returned by the WebPEncode*() functions above. -WEBP_EXTERN(void) WebPFree(void* ptr); - -//------------------------------------------------------------------------------ -// Coding parameters - -// Image characteristics hint for the underlying encoder. -typedef enum WebPImageHint { - WEBP_HINT_DEFAULT = 0, // default preset. - WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot - WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting - WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). - WEBP_HINT_LAST -} WebPImageHint; - -// Compression parameters. -struct WebPConfig { - int lossless; // Lossless encoding (0=lossy(default), 1=lossless). - float quality; // between 0 (smallest file) and 100 (biggest) - int method; // quality/speed trade-off (0=fast, 6=slower-better) - - WebPImageHint image_hint; // Hint for image type (lossless only for now). - - // Parameters related to lossy compression only: - int target_size; // if non-zero, set the desired target size in bytes. - // Takes precedence over the 'compression' parameter. - float target_PSNR; // if non-zero, specifies the minimal distortion to - // try to achieve. Takes precedence over target_size. - int segments; // maximum number of segments to use, in [1..4] - int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. - int filter_strength; // range: [0 = off .. 100 = strongest] - int filter_sharpness; // range: [0 = off .. 7 = least sharp] - int filter_type; // filtering type: 0 = simple, 1 = strong (only used - // if filter_strength > 0 or autofilter > 0) - int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] - int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, - // 1 = compressed with WebP lossless). Default is 1. - int alpha_filtering; // Predictive filtering method for alpha plane. - // 0: none, 1: fast, 2: best. Default if 1. - int alpha_quality; // Between 0 (smallest size) and 100 (lossless). - // Default is 100. - int pass; // number of entropy-analysis passes (in [1..10]). - - int show_compressed; // if true, export the compressed picture back. - // In-loop filtering is not applied. - int preprocessing; // preprocessing filter: - // 0=none, 1=segment-smooth, 2=pseudo-random dithering - int partitions; // log2(number of token partitions) in [0..3]. Default - // is set to 0 for easier progressive decoding. - int partition_limit; // quality degradation allowed to fit the 512k limit - // on prediction modes coding (0: no degradation, - // 100: maximum possible degradation). - int emulate_jpeg_size; // If true, compression parameters will be remapped - // to better match the expected output size from - // JPEG compression. Generally, the output size will - // be similar but the degradation will be lower. - int thread_level; // If non-zero, try and use multi-threaded encoding. - int low_memory; // If set, reduce memory usage (but increase CPU use). - - int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off - // (default)]. - int exact; // if non-zero, preserve the exact RGB values under - // transparent area. Otherwise, discard this invisible - // RGB information for better compression. The default - // value is 0. - -#ifdef WEBP_EXPERIMENTAL_FEATURES - int delta_palettization; - uint32_t pad[2]; // padding for later use -#else - uint32_t pad[3]; // padding for later use -#endif // WEBP_EXPERIMENTAL_FEATURES -}; - -// Enumerate some predefined settings for WebPConfig, depending on the type -// of source picture. These presets are used when calling WebPConfigPreset(). -typedef enum WebPPreset { - WEBP_PRESET_DEFAULT = 0, // default preset. - WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot - WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting - WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details - WEBP_PRESET_ICON, // small-sized colorful images - WEBP_PRESET_TEXT // text-like -} WebPPreset; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); - -// Should always be called, to initialize a fresh WebPConfig structure before -// modification. Returns false in case of version mismatch. WebPConfigInit() -// must have succeeded before using the 'config' object. -// Note that the default values are lossless=0 and quality=75. -static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { - return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, - WEBP_ENCODER_ABI_VERSION); -} - -// This function will initialize the configuration according to a predefined -// set of parameters (referred to by 'preset') and a given quality factor. -// This function can be called as a replacement to WebPConfigInit(). Will -// return false in case of error. -static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, - WebPPreset preset, float quality) { - return WebPConfigInitInternal(config, preset, quality, - WEBP_ENCODER_ABI_VERSION); -} - -// Activate the lossless compression mode with the desired efficiency level -// between 0 (fastest, lowest compression) and 9 (slower, best compression). -// A good default level is '6', providing a fair tradeoff between compression -// speed and final compressed size. -// This function will overwrite several fields from config: 'method', 'quality' -// and 'lossless'. Returns false in case of parameter error. -WEBP_EXTERN(int) WebPConfigLosslessPreset(WebPConfig* config, int level); - -// Returns true if 'config' is non-NULL and all configuration parameters are -// within their valid ranges. -WEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config); - -//------------------------------------------------------------------------------ -// Input / Output -// Structure for storing auxiliary statistics (mostly for lossy encoding). - -struct WebPAuxStats { - int coded_size; // final size - - float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha - int block_count[3]; // number of intra4/intra16/skipped macroblocks - int header_bytes[2]; // approximate number of bytes spent for header - // and mode-partition #0 - int residual_bytes[3][4]; // approximate number of bytes spent for - // DC/AC/uv coefficients for each (0..3) segments. - int segment_size[4]; // number of macroblocks in each segments - int segment_quant[4]; // quantizer values for each segments - int segment_level[4]; // filtering strength for each segments [0..63] - - int alpha_data_size; // size of the transparency data - int layer_data_size; // size of the enhancement layer data - - // lossless encoder statistics - uint32_t lossless_features; // bit0:predictor bit1:cross-color transform - // bit2:subtract-green bit3:color indexing - int histogram_bits; // number of precision bits of histogram - int transform_bits; // precision bits for transform - int cache_bits; // number of bits for color cache lookup - int palette_size; // number of color in palette, if used - int lossless_size; // final lossless size - int lossless_hdr_size; // lossless header (transform, huffman etc) size - int lossless_data_size; // lossless image data size - - uint32_t pad[2]; // padding for later use -}; - -// Signature for output function. Should return true if writing was successful. -// data/data_size is the segment of data to write, and 'picture' is for -// reference (and so one can make use of picture->custom_ptr). -typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using -// the following WebPMemoryWriter object (to be set as a custom_ptr). -struct WebPMemoryWriter { - uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). - size_t size; // final size - size_t max_size; // total capacity - uint32_t pad[1]; // padding for later use -}; - -// The following must be called first before any use. -WEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer); - -// The following must be called to deallocate writer->mem memory. The 'writer' -// object itself is not deallocated. -WEBP_EXTERN(void) WebPMemoryWriterClear(WebPMemoryWriter* writer); -// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon -// completion, writer.mem and writer.size will hold the coded data. -// writer.mem must be freed by calling WebPMemoryWriterClear. -WEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size, - const WebPPicture* picture); - -// Progress hook, called from time to time to report progress. It can return -// false to request an abort of the encoding process, or true otherwise if -// everything is OK. -typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); - -// Color spaces. -typedef enum WebPEncCSP { - // chroma sampling - WEBP_YUV420 = 0, // 4:2:0 - WEBP_YUV420A = 4, // alpha channel variant - WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors - WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present -} WebPEncCSP; - -// Encoding error conditions. -typedef enum WebPEncodingError { - VP8_ENC_OK = 0, - VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects - VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits - VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL - VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid - VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height - VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k - VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M - VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes - VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G - VP8_ENC_ERROR_USER_ABORT, // abort request by user - VP8_ENC_ERROR_LAST // list terminator. always last. -} WebPEncodingError; - -// maximum width/height allowed (inclusive), in pixels -#define WEBP_MAX_DIMENSION 16383 - -// Main exchange structure (input samples, output bytes, statistics) -struct WebPPicture { - // INPUT - ////////////// - // Main flag for encoder selecting between ARGB or YUV input. - // It is recommended to use ARGB input (*argb, argb_stride) for lossless - // compression, and YUV input (*y, *u, *v, etc.) for lossy compression - // since these are the respective native colorspace for these formats. - int use_argb; - - // YUV input (mostly used for input to lossy compression) - WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). - int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) - uint8_t *y, *u, *v; // pointers to luma/chroma planes. - int y_stride, uv_stride; // luma/chroma strides. - uint8_t* a; // pointer to the alpha plane - int a_stride; // stride of the alpha plane - uint32_t pad1[2]; // padding for later use - - // ARGB input (mostly used for input to lossless compression) - uint32_t* argb; // Pointer to argb (32 bit) plane. - int argb_stride; // This is stride in pixels units, not bytes. - uint32_t pad2[3]; // padding for later use - - // OUTPUT - /////////////// - // Byte-emission hook, to store compressed bytes as they are ready. - WebPWriterFunction writer; // can be NULL - void* custom_ptr; // can be used by the writer. - - // map for extra information (only for lossy compression mode) - int extra_info_type; // 1: intra type, 2: segment, 3: quant - // 4: intra-16 prediction mode, - // 5: chroma prediction mode, - // 6: bit cost, 7: distortion - uint8_t* extra_info; // if not NULL, points to an array of size - // ((width + 15) / 16) * ((height + 15) / 16) that - // will be filled with a macroblock map, depending - // on extra_info_type. - - // STATS AND REPORTS - /////////////////////////// - // Pointer to side statistics (updated only if not NULL) - WebPAuxStats* stats; - - // Error code for the latest error encountered during encoding - WebPEncodingError error_code; - - // If not NULL, report progress during encoding. - WebPProgressHook progress_hook; - - void* user_data; // this field is free to be set to any value and - // used during callbacks (like progress-report e.g.). - - uint32_t pad3[3]; // padding for later use - - // Unused for now - uint8_t *pad4, *pad5; - uint32_t pad6[8]; // padding for later use - - // PRIVATE FIELDS - //////////////////// - void* memory_; // row chunk of memory for yuva planes - void* memory_argb_; // and for argb too. - void* pad7[2]; // padding for later use -}; - -// Internal, version-checked, entry point -WEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int); - -// Should always be called, to initialize the structure. Returns false in case -// of version mismatch. WebPPictureInit() must have succeeded before using the -// 'picture' object. -// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. -static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { - return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); -} - -//------------------------------------------------------------------------------ -// WebPPicture utils - -// Convenience allocation / deallocation based on picture->width/height: -// Allocate y/u/v buffers as per colorspace/width/height specification. -// Note! This function will free the previous buffer if needed. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture); - -// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). -// Note that this function does _not_ free the memory used by the 'picture' -// object itself. -// Besides memory (which is reclaimed) all other fields of 'picture' are -// preserved. -WEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture); - -// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst -// will fully own the copied pixels (this is not a view). The 'dst' picture need -// not be initialized as its content is overwritten. -// Returns false in case of memory allocation error. -WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); - -// Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results -// are in dB, stored in result[] in the Y/U/V/Alpha/All or B/G/R/A/All order. -// Returns false in case of error (src and ref don't have same dimension, ...) -// Warning: this function is rather CPU-intensive. -WEBP_EXTERN(int) WebPPictureDistortion( - const WebPPicture* src, const WebPPicture* ref, - int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM - float result[5]); - -// self-crops a picture to the rectangle defined by top/left/width/height. -// Returns false in case of memory allocation error, or if the rectangle is -// outside of the source picture. -// The rectangle for the view is defined by the top-left corner pixel -// coordinates (left, top) as well as its width and height. This rectangle -// must be fully be comprised inside the 'src' source picture. If the source -// picture uses the YUV420 colorspace, the top and left coordinates will be -// snapped to even values. -WEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture, - int left, int top, int width, int height); - -// Extracts a view from 'src' picture into 'dst'. The rectangle for the view -// is defined by the top-left corner pixel coordinates (left, top) as well -// as its width and height. This rectangle must be fully be comprised inside -// the 'src' source picture. If the source picture uses the YUV420 colorspace, -// the top and left coordinates will be snapped to even values. -// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed -// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, -// the original dimension will be lost). Picture 'dst' need not be initialized -// with WebPPictureInit() if it is different from 'src', since its content will -// be overwritten. -// Returns false in case of memory allocation error or invalid parameters. -WEBP_EXTERN(int) WebPPictureView(const WebPPicture* src, - int left, int top, int width, int height, - WebPPicture* dst); - -// Returns true if the 'picture' is actually a view and therefore does -// not own the memory for pixels. -WEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture); - -// Rescale a picture to new dimension width x height. -// If either 'width' or 'height' (but not both) is 0 the corresponding -// dimension will be calculated preserving the aspect ratio. -// No gamma correction is applied. -// Returns false in case of error (invalid parameter or insufficient memory). -WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height); - -// Colorspace conversion function to import RGB samples. -// Previous buffer will be free'd, if any. -// *rgb buffer should have a size of at least height * rgb_stride. -// Returns false in case of memory error. -WEBP_EXTERN(int) WebPPictureImportRGB( - WebPPicture* picture, const uint8_t* rgb, int rgb_stride); -// Same, but for RGBA buffer. -WEBP_EXTERN(int) WebPPictureImportRGBA( - WebPPicture* picture, const uint8_t* rgba, int rgba_stride); -// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format -// input buffer ignoring the alpha channel. Avoids needing to copy the data -// to a temporary 24-bit RGB buffer to import the RGB only. -WEBP_EXTERN(int) WebPPictureImportRGBX( - WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); - -// Variants of the above, but taking BGR(A|X) input. -WEBP_EXTERN(int) WebPPictureImportBGR( - WebPPicture* picture, const uint8_t* bgr, int bgr_stride); -WEBP_EXTERN(int) WebPPictureImportBGRA( - WebPPicture* picture, const uint8_t* bgra, int bgra_stride); -WEBP_EXTERN(int) WebPPictureImportBGRX( - WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); - -// Converts picture->argb data to the YUV420A format. The 'colorspace' -// parameter is deprecated and should be equal to WEBP_YUV420. -// Upon return, picture->use_argb is set to false. The presence of real -// non-opaque transparent values is detected, and 'colorspace' will be -// adjusted accordingly. Note that this method is lossy. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture, - WebPEncCSP /*colorspace = WEBP_YUV420*/); - -// Same as WebPPictureARGBToYUVA(), but the conversion is done using -// pseudo-random dithering with a strength 'dithering' between -// 0.0 (no dithering) and 1.0 (maximum dithering). This is useful -// for photographic picture. -WEBP_EXTERN(int) WebPPictureARGBToYUVADithered( - WebPPicture* picture, WebPEncCSP colorspace, float dithering); - -// Performs 'smart' RGBA->YUVA420 downsampling and colorspace conversion. -// Downsampling is handled with extra care in case of color clipping. This -// method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better -// YUV representation. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureSmartARGBToYUVA(WebPPicture* picture); - -// Converts picture->yuv to picture->argb and sets picture->use_argb to true. -// The input format must be YUV_420 or YUV_420A. -// Note that the use of this method is discouraged if one has access to the -// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the -// conversion from YUV420 to ARGB incurs a small loss too. -// Returns false in case of error. -WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); - -// Helper function: given a width x height plane of RGBA or YUV(A) samples -// clean-up the YUV or RGB samples under fully transparent area, to help -// compressibility (no guarantee, though). -WEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture); - -// Scan the picture 'picture' for the presence of non fully opaque alpha values. -// Returns true in such case. Otherwise returns false (indicating that the -// alpha plane can be ignored altogether e.g.). -WEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture); - -// Remove the transparency information (if present) by blending the color with -// the background color 'background_rgb' (specified as 24bit RGB triplet). -// After this call, all alpha values are reset to 0xff. -WEBP_EXTERN(void) WebPBlendAlpha(WebPPicture* pic, uint32_t background_rgb); - -//------------------------------------------------------------------------------ -// Main call - -// Main encoding call, after config and picture have been initialized. -// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), -// and the 'config' object must be a valid one. -// Returns false in case of error, true otherwise. -// In case of error, picture->error_code is updated accordingly. -// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending -// on the value of 'picture->use_argb'. It is highly recommended to use -// the former for lossy encoding, and the latter for lossless encoding -// (when config.lossless is true). Automatic conversion from one format to -// another is provided but they both incur some loss. -WEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture); - -//------------------------------------------------------------------------------ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* WEBP_WEBP_ENCODE_H_ */ diff --git a/submodules/webp/include/webp/types.h b/submodules/webp/include/webp/types.h deleted file mode 100644 index 98fff35a11..0000000000 --- a/submodules/webp/include/webp/types.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// Common types -// -// Author: Skal (pascal.massimino@gmail.com) - -#ifndef WEBP_WEBP_TYPES_H_ -#define WEBP_WEBP_TYPES_H_ - -#include // for size_t - -#ifndef _MSC_VER -#include -#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) -#define WEBP_INLINE inline -#else -#define WEBP_INLINE -#endif -#else -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; -typedef long long int int64_t; -#define WEBP_INLINE __forceinline -#endif /* _MSC_VER */ - -#ifndef WEBP_EXTERN -// This explicitly marks library functions and allows for changing the -// signature for e.g., Windows DLL builds. -# if defined(__GNUC__) && __GNUC__ >= 4 -# define WEBP_EXTERN(type) extern __attribute__ ((visibility ("default"))) type -# else -# define WEBP_EXTERN(type) extern type -# endif /* __GNUC__ >= 4 */ -#endif /* WEBP_EXTERN */ - -// Macro to check ABI compatibility (same major revision number) -#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) - -#endif /* WEBP_WEBP_TYPES_H_ */ diff --git a/submodules/webp/lib/libwebp.a b/submodules/webp/lib/libwebp.a deleted file mode 100644 index f88dde2571..0000000000 Binary files a/submodules/webp/lib/libwebp.a and /dev/null differ diff --git a/third-party/BUCK b/third-party/BUCK deleted file mode 100644 index c2e30f374b..0000000000 --- a/third-party/BUCK +++ /dev/null @@ -1,8 +0,0 @@ - -filegroup( - name = "depot_tools_sources", - srcs = glob([ - "depot_tools/**/*" - ]), - visibility = ["PUBLIC"], -) diff --git a/third-party/boringssl/BUILD b/third-party/boringssl/BUILD index 1e52c36eb2..be357e69ca 100644 --- a/third-party/boringssl/BUILD +++ b/third-party/boringssl/BUILD @@ -61,15 +61,15 @@ posix_copts = [ boringssl_copts = select({ "@build_bazel_rules_apple//apple:ios_armv7": posix_copts, "@build_bazel_rules_apple//apple:ios_arm64": posix_copts, + "//build-system:ios_sim_arm64": posix_copts, "@build_bazel_rules_apple//apple:ios_x86_64": posix_copts, - "//conditions:default": ["-DOPENSSL_NO_ASM"], }) crypto_sources_asm = select({ "@build_bazel_rules_apple//apple:ios_armv7": crypto_sources_ios_arm, "@build_bazel_rules_apple//apple:ios_arm64": crypto_sources_ios_aarch64, + "//build-system:ios_sim_arm64": crypto_sources_ios_aarch64, "@build_bazel_rules_apple//apple:ios_x86_64": crypto_sources_mac_x86_64, - "//conditions:default": [], }) # For C targets only (not C++), compile with C11 support. @@ -83,8 +83,8 @@ posix_copts_c11 = [ boringssl_copts_c11 = boringssl_copts + select({ "@build_bazel_rules_apple//apple:ios_armv7": posix_copts_c11, "@build_bazel_rules_apple//apple:ios_arm64": posix_copts_c11, + "//build-system:ios_sim_arm64": posix_copts_c11, "@build_bazel_rules_apple//apple:ios_x86_64": posix_copts_c11, - "//conditions:default": [], }) # For C++ targets only (not C), compile with C++11 support. @@ -96,8 +96,8 @@ posix_copts_cxx = [ boringssl_copts_cxx = boringssl_copts + select({ "@build_bazel_rules_apple//apple:ios_armv7": posix_copts_cxx, "@build_bazel_rules_apple//apple:ios_arm64": posix_copts_cxx, + "//build-system:ios_sim_arm64": posix_copts_cxx, "@build_bazel_rules_apple//apple:ios_x86_64": posix_copts_cxx, - "//conditions:default": [], }) cc_library( @@ -109,8 +109,8 @@ cc_library( linkopts = select({ "@build_bazel_rules_apple//apple:ios_armv7": [], "@build_bazel_rules_apple//apple:ios_arm64": [], + "//build-system:ios_sim_arm64": [], "@build_bazel_rules_apple//apple:ios_x86_64": [], - "//conditions:default": ["-lpthread"], }), linkstatic = 1, visibility = ["//visibility:public"], diff --git a/third-party/depot_tools b/third-party/depot_tools deleted file mode 160000 index ae7f4c5111..0000000000 --- a/third-party/depot_tools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ae7f4c51114152e95cf1e9b6d2f0a4936fb7c5d6 diff --git a/third-party/libvpx/0001-Add-support-for-arm64-iphonesimulator-gcc.patch b/third-party/libvpx/0001-Add-support-for-arm64-iphonesimulator-gcc.patch new file mode 100644 index 0000000000..cdce38a140 --- /dev/null +++ b/third-party/libvpx/0001-Add-support-for-arm64-iphonesimulator-gcc.patch @@ -0,0 +1,132 @@ +From 654c44d26bd86efec4019990beac67900231f868 Mon Sep 17 00:00:00 2001 +From: Ali <> +Date: Wed, 16 Dec 2020 17:11:29 +0400 +Subject: [PATCH] Add support for arm64-iphonesimulator-gcc + +--- + build/make/configure.sh | 73 ++++++++++++++++++++++++++++++++++++++++- + configure | 3 +- + 2 files changed, 74 insertions(+), 2 deletions(-) + +diff --git a/build/make/configure.sh b/build/make/configure.sh +index 206b54f77..1c113e51d 100644 +--- a/build/make/configure.sh ++++ b/build/make/configure.sh +@@ -845,6 +845,14 @@ process_common_toolchain() { + # Handle darwin variants. Newer SDKs allow targeting older + # platforms, so use the newest one available. + case ${toolchain} in ++ arm64-iphonesimulator*) ++ add_cflags "-miphonesimulator-version-min=${IOS_VERSION_MIN}" ++ iphonesimulator_sdk_dir="$(show_darwin_sdk_path iphonesimulator)" ++ if [ -d "${iphonesimulator_sdk_dir}" ]; then ++ add_cflags "-isysroot ${iphonesimulator_sdk_dir}" ++ add_ldflags "-isysroot ${iphonesimulator_sdk_dir}" ++ fi ++ ;; + arm*-darwin*) + add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}" + iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)" +@@ -934,7 +942,7 @@ process_common_toolchain() { + + # Process ARM architecture variants + case ${toolchain} in +- arm*) ++ arm*|arm64-iphonesimulator-gcc) + # on arm, isa versions are supersets + case ${tgt_isa} in + arm64|armv8) +@@ -1144,6 +1152,69 @@ EOF + asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl" + ;; + ++ iphonesimulator*) ++ if ! enabled external_build; then ++ XCRUN_FIND="xcrun --sdk iphonesimulator --find" ++ CXX="$(${XCRUN_FIND} clang++)" ++ CC="$(${XCRUN_FIND} clang)" ++ AR="$(${XCRUN_FIND} ar)" ++ AS="$(${XCRUN_FIND} as)" ++ STRIP="$(${XCRUN_FIND} strip)" ++ NM="$(${XCRUN_FIND} nm)" ++ RANLIB="$(${XCRUN_FIND} ranlib)" ++ AS_SFX=.S ++ LD="${CXX:-$(${XCRUN_FIND} ld)}" ++ ++ # ASFLAGS is written here instead of using check_add_asflags ++ # because we need to overwrite all of ASFLAGS and purge the ++ # options that were put in above ++ ASFLAGS="-arch ${tgt_isa} -g" ++ ++ add_cflags -arch ${tgt_isa} ++ add_ldflags -arch ${tgt_isa} ++ ++ add_cflags --target=arm64-apple-ios7.0-simulator ++ add_ldflags --target=arm64-apple-ios7.0-simulator ++ ++ alt_libc="$(show_darwin_sdk_path iphonesimulator)" ++ if [ -d "${alt_libc}" ]; then ++ add_cflags -isysroot ${alt_libc} ++ fi ++ ++ if [ "${LD}" = "${CXX}" ]; then ++ add_ldflags -miphonesimulator-version-min="${IOS_VERSION_MIN}" ++ else ++ add_ldflags -ios_version_min "${IOS_VERSION_MIN}" ++ fi ++ ++ for d in lib usr/lib usr/lib/system; do ++ try_dir="${alt_libc}/${d}" ++ [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}" ++ done ++ ++ case ${tgt_isa} in ++ armv7|armv7s|armv8|arm64) ++ if enabled neon && ! check_xcode_minimum_version; then ++ soft_disable neon ++ log_echo " neon disabled: upgrade Xcode (need v6.3+)." ++ if enabled neon_asm; then ++ soft_disable neon_asm ++ log_echo " neon_asm disabled: upgrade Xcode (need v6.3+)." ++ fi ++ fi ++ ;; ++ esac ++ ++ if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then ++ check_add_cflags -fembed-bitcode ++ check_add_asflags -fembed-bitcode ++ check_add_ldflags -fembed-bitcode ++ fi ++ fi ++ ++ asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl" ++ ;; ++ + linux*) + enable_feature linux + if enabled rvct; then +diff --git a/configure b/configure +index 32272ce36..826769948 100755 +--- a/configure ++++ b/configure +@@ -99,6 +99,7 @@ EOF + # alphabetically by architecture, generic-gnu last. + all_platforms="${all_platforms} arm64-android-gcc" + all_platforms="${all_platforms} arm64-darwin-gcc" ++all_platforms="${all_platforms} arm64-iphonesimulator-gcc" + all_platforms="${all_platforms} arm64-linux-gcc" + all_platforms="${all_platforms} arm64-win64-gcc" + all_platforms="${all_platforms} arm64-win64-vs15" +@@ -733,7 +734,7 @@ process_toolchain() { + soft_enable libyuv + # GTestLog must be modified to use Android logging utilities. + ;; +- *-darwin-*) ++ *-darwin-*|arm64-iphonesimulator-*) + check_add_cxxflags -std=c++11 + # iOS/ARM builds do not work with gtest. This does not match + # x86 targets. +-- +2.24.3 (Apple Git-128) + diff --git a/third-party/libvpx/BUILD b/third-party/libvpx/BUILD index 62533a718d..b1c435b166 100644 --- a/third-party/libvpx/BUILD +++ b/third-party/libvpx/BUILD @@ -28,6 +28,7 @@ genrule( name = "libvpx_build", srcs = [ "build-libvpx-bazel.sh", + "0001-Add-support-for-arm64-iphonesimulator-gcc.patch", ":libvpx_sources", ], cmd_bash = @@ -40,6 +41,9 @@ genrule( elif [ "$(TARGET_CPU)" == "ios_arm64" ]; then BUILD_ARCH="arm64" PLATFORM_HEADER_DIR="arm64-darwin-gcc" + elif [ "$(TARGET_CPU)" == "ios_sim_arm64" ]; then + BUILD_ARCH="sim_arm64" + PLATFORM_HEADER_DIR="arm64-iphonesimulator-gcc" elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then BUILD_ARCH="x86_64" PLATFORM_HEADER_DIR="x86_64-iphonesimulator-gcc" @@ -52,14 +56,19 @@ genrule( mkdir -p "$$BUILD_DIR" cp $(location :build-libvpx-bazel.sh) "$$BUILD_DIR/" + cp $(location :0001-Add-support-for-arm64-iphonesimulator-gcc.patch) "$$BUILD_DIR/" SOURCE_PATH="third-party/libvpx/libvpx" cp -R "$$SOURCE_PATH" "$$BUILD_DIR/" + pushd "$$BUILD_DIR/libvpx" + patch -p1 < ../0001-Add-support-for-arm64-iphonesimulator-gcc.patch + popd + mkdir -p "$$BUILD_DIR/Public/libvpx" - arch -x86_64 sh $$BUILD_DIR/build-libvpx-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/libvpx" "$$BUILD_DIR" + sh $$BUILD_DIR/build-libvpx-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/libvpx" "$$BUILD_DIR" """ + "\n".join([ "cp -f \"$$BUILD_DIR/VPX.framework/Headers/vpx/{}\" \"$(location Public/vpx/{})\"".format(header, header) for header in headers diff --git a/third-party/libvpx/build-libvpx-bazel.sh b/third-party/libvpx/build-libvpx-bazel.sh index 885f2a2ead..a2ac3011d2 100755 --- a/third-party/libvpx/build-libvpx-bazel.sh +++ b/third-party/libvpx/build-libvpx-bazel.sh @@ -34,6 +34,8 @@ if [ "$ARCH" = "armv7" ]; then TARGETS="armv7-darwin-gcc" elif [ "$ARCH" = "arm64" ]; then TARGETS="arm64-darwin-gcc" +elif [ "$ARCH" = "sim_arm64" ]; then + TARGETS="arm64-iphonesimulator-gcc" elif [ "$ARCH" = "x86_64" ]; then TARGETS="x86_64-iphonesimulator-gcc" else @@ -58,9 +60,9 @@ build_target() { cd "${target}" eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \ - ${devnull} + export DIST_DIR - eval make dist ${devnull} + eval make dist cd "${old_pwd}" } diff --git a/third-party/mozjpeg/BUCK b/third-party/mozjpeg/BUCK deleted file mode 100644 index 379603ce42..0000000000 --- a/third-party/mozjpeg/BUCK +++ /dev/null @@ -1,108 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library", "gen_header_targets", "merge_maps") - -headers = [ - "mozjpeg/turbojpeg.h", - "mozjpeg/jpeglib.h", - "mozjpeg/jmorecfg.h", - "mozjpeg/jconfig.h", -] - -libs = [ - "jpeg", - "turbojpeg" -] - -genrule( - name = "libmozjpeg_build", - srcs = glob([ - "mozjpeg/**/*", - ], exclude = ["mozjpeg/**/.*"]) + [ - "build-mozjpeg-buck.sh", - ], - bash = - """ - set -ex - - mkdir -p "$OUT" - mkdir -p "$OUT/Public/mozjpeg" - mkdir -p "$OUT/Public/lib" - - CMAKE_DIR="$(location //third-party/cmake:cmake)/cmake-3.16.0" - - BUILD_ARCH="arm64" - - BUILD_DIR="$OUT/$BUILD_ARCH" - rm -rf "$BUILD_DIR" - mkdir -p "$BUILD_DIR" - - cp "$SRCDIR/build-mozjpeg-buck.sh" "$BUILD_DIR/" - - cp -R "$SRCDIR/mozjpeg" "$BUILD_DIR/" - - mkdir -p "$BUILD_DIR/Public/mozjpeg" - - PATH="$PATH:$CMAKE_DIR/bin" sh $BUILD_DIR/build-mozjpeg-buck.sh $BUILD_ARCH "$BUILD_DIR/mozjpeg" "$BUILD_DIR" - - cp $BUILD_DIR/mozjpeg/turbojpeg.h "$OUT/Public/mozjpeg/" - cp $BUILD_DIR/mozjpeg/jpeglib.h "$OUT/Public/mozjpeg/" - cp $BUILD_DIR/mozjpeg/jmorecfg.h "$OUT/Public/mozjpeg/" - cp $BUILD_DIR/build/jconfig.h "$OUT/Public/mozjpeg/" - - BUILD_ARCH="armv7" - - BUILD_DIR="$OUT/$BUILD_ARCH" - rm -rf "$BUILD_DIR" - mkdir -p "$BUILD_DIR" - - cp "$SRCDIR/build-mozjpeg-buck.sh" "$BUILD_DIR/" - - cp -R "$SRCDIR/mozjpeg" "$BUILD_DIR/" - - mkdir -p "$BUILD_DIR/Public/mozjpeg" - - PATH="$PATH:$CMAKE_DIR/bin" sh $BUILD_DIR/build-mozjpeg-buck.sh $BUILD_ARCH "$BUILD_DIR/mozjpeg" "$BUILD_DIR" - - lipo -create $OUT/arm64/build/libjpeg.a $OUT/armv7/build/libjpeg.a -output $OUT/Public/lib/libjpeg.a - lipo -create $OUT/arm64/build/libturbojpeg.a $OUT/armv7/build/libturbojpeg.a -output $OUT/Public/lib/libturbojpeg.a - """, - out = "libmozjpeg", - visibility = [ - "PUBLIC", - ] -) - -mozjpeg_header_targets = gen_header_targets(headers, "libmozjpeg_header_", "", "libmozjpeg_build", "Public") - -apple_library( - name = "mozjpeg_lib", - exported_headers = mozjpeg_header_targets, - visibility = [ - "//third-party/mozjpeg:mozjpeg" - ], - header_namespace = "mozjpeg", - linker_flags = [ - "-L$(location :libmozjpeg_build)/Public/lib", - "-ljpeg", - "-lturbojpeg", - ], - exported_linker_flags = [ - "-L$(location :libmozjpeg_build)/Public/lib", - "-ljpeg", - "-lturbojpeg", - ], - deps = [ - ":libmozjpeg_build", - ], -) - -static_library( - name = "mozjpeg", - exported_headers = mozjpeg_header_targets, - deps = [ - ":libmozjpeg_build", - ":mozjpeg_lib", - ], - frameworks = [ - "$SDKROOT/System/Library/Frameworks/Foundation.framework", - ], -) \ No newline at end of file diff --git a/third-party/mozjpeg/BUILD b/third-party/mozjpeg/BUILD index 94e7865ec6..ce7752f959 100644 --- a/third-party/mozjpeg/BUILD +++ b/third-party/mozjpeg/BUILD @@ -32,6 +32,8 @@ genrule( BUILD_ARCH="armv7" elif [ "$(TARGET_CPU)" == "ios_arm64" ]; then BUILD_ARCH="arm64" + elif [ "$(TARGET_CPU)" == "ios_sim_arm64" ]; then + BUILD_ARCH="sim_arm64" elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then BUILD_ARCH="x86_64" else @@ -55,7 +57,7 @@ genrule( mkdir -p "$$BUILD_DIR/Public/mozjpeg" - PATH="$$PATH:$$CMAKE_DIR/cmake-3.18.4-Darwin-x86_64/CMake.app/Contents/bin" arch -x86_64 sh $$BUILD_DIR/build-mozjpeg-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/mozjpeg" "$$BUILD_DIR" + PATH="$$PATH:$$CMAKE_DIR/cmake-3.19.2-macos-universal/CMake.app/Contents/bin" sh $$BUILD_DIR/build-mozjpeg-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/mozjpeg" "$$BUILD_DIR" """ + "\n".join([ "cp -f \"$$BUILD_DIR/mozjpeg/{}\" \"$(location Public/mozjpeg/{})\"".format(header, header) for header in headers diff --git a/third-party/mozjpeg/build-mozjpeg-bazel.sh b/third-party/mozjpeg/build-mozjpeg-bazel.sh index 8b31692546..3b73ba8564 100755 --- a/third-party/mozjpeg/build-mozjpeg-bazel.sh +++ b/third-party/mozjpeg/build-mozjpeg-bazel.sh @@ -38,6 +38,22 @@ elif [ "$ARCH" = "arm64" ]; then echo "set(CMAKE_SYSTEM_PROCESSOR aarch64)" >> toolchain.cmake echo "set(CMAKE_C_COMPILER $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)" >> toolchain.cmake + cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} -DPNG_SUPPORTED=FALSE -DENABLE_SHARED=FALSE -DWITH_JPEG8=1 -DBUILD=10000 ../mozjpeg + make +elif [ "$ARCH" = "sim_arm64" ]; then + IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform" + IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk) + export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios9.0-simulator -miphonesimulator-version-min=9.0 -funwind-tables" + + cd "$BUILD_DIR" + mkdir build + cd build + + touch toolchain.cmake + echo "set(CMAKE_SYSTEM_NAME Darwin)" >> toolchain.cmake + echo "set(CMAKE_SYSTEM_PROCESSOR aarch64)" >> toolchain.cmake + echo "set(CMAKE_C_COMPILER $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)" >> toolchain.cmake + cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} -DPNG_SUPPORTED=FALSE -DENABLE_SHARED=FALSE -DWITH_JPEG8=1 -DBUILD=10000 ../mozjpeg make elif [ "$ARCH" = "x86_64" ]; then diff --git a/third-party/mozjpeg/build-mozjpeg-buck.sh b/third-party/mozjpeg/build-mozjpeg-buck.sh deleted file mode 100755 index 94a9966479..0000000000 --- a/third-party/mozjpeg/build-mozjpeg-buck.sh +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/sh - -set -e - -ARCH="$1" - -SOURCE_DIR="$2" -BUILD_DIR=$(echo "$(cd "$(dirname "$3")"; pwd -P)/$(basename "$3")") - -if [ "$ARCH" = "armv7" ]; then - IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform" - IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk) - export CFLAGS="-mfloat-abi=softfp -arch armv7 -miphoneos-version-min=9.0" - export ASMFLAGS="-no-integrated-as" - - cd "$BUILD_DIR" - mkdir build - cd build - - touch toolchain.cmake - echo "set(CMAKE_SYSTEM_NAME Darwin)" >> toolchain.cmake - echo "set(CMAKE_SYSTEM_PROCESSOR arm)" >> toolchain.cmake - echo "set(CMAKE_C_COMPILER $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)" >> toolchain.cmake - - cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} -DPNG_SUPPORTED=FALSE -DENABLE_SHARED=FALSE -DWITH_JPEG8=1 ../mozjpeg - make -elif [ "$ARCH" = "arm64" ]; then - IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform" - IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk) - export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=9.0 -funwind-tables" - - cd "$BUILD_DIR" - mkdir build - cd build - - touch toolchain.cmake - echo "set(CMAKE_SYSTEM_NAME Darwin)" >> toolchain.cmake - echo "set(CMAKE_SYSTEM_PROCESSOR aarch64)" >> toolchain.cmake - echo "set(CMAKE_C_COMPILER $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)" >> toolchain.cmake - - cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} -DPNG_SUPPORTED=FALSE -DENABLE_SHARED=FALSE -DWITH_JPEG8=1 ../mozjpeg - make -elif [ "$ARCH" = "x86_64" ]; then - IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform" - IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk) - export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=9.0 -funwind-tables" - - cd "$BUILD_DIR" - mkdir build - cd build - - touch toolchain.cmake - echo "set(CMAKE_SYSTEM_NAME Darwin)" >> toolchain.cmake - echo "set(CMAKE_SYSTEM_PROCESSOR AMD64)" >> toolchain.cmake - echo "set(CMAKE_C_COMPILER $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang)" >> toolchain.cmake - - cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_OSX_SYSROOT=${IOS_SYSROOT[0]} -DPNG_SUPPORTED=FALSE -DENABLE_SHARED=FALSE -DWITH_JPEG8=1 ../mozjpeg - make -else - echo "Unsupported architecture $ARCH" - exit 1 -fi diff --git a/third-party/opus/BUILD b/third-party/opus/BUILD new file mode 100644 index 0000000000..6869dd01de --- /dev/null +++ b/third-party/opus/BUILD @@ -0,0 +1,81 @@ + +headers = [ + "opus.h", + "opus_defines.h", + "opus_multistream.h", + "opus_projection.h", + "opus_types.h", +] + +libs = [ + "opus", +] + +genrule( + name = "opus_build", + srcs = [ + "build-opus-bazel.sh", + "opus-1.3.1.tar.gz", + ], + cmd_bash = + """ + set -ex + + if [ "$(TARGET_CPU)" == "ios_armv7" ]; then + BUILD_ARCH="armv7" + elif [ "$(TARGET_CPU)" == "ios_arm64" ]; then + BUILD_ARCH="arm64" + elif [ "$(TARGET_CPU)" == "ios_sim_arm64" ]; then + BUILD_ARCH="sim_arm64" + elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then + BUILD_ARCH="x86_64" + else + echo "Unsupported architecture $(TARGET_CPU)" + fi + + BUILD_DIR="$(RULEDIR)/build_$${BUILD_ARCH}" + rm -rf "$$BUILD_DIR" + mkdir -p "$$BUILD_DIR" + + cp $(location :build-opus-bazel.sh) "$$BUILD_DIR/" + cp $(location :opus-1.3.1.tar.gz) "$$BUILD_DIR/" + + mkdir -p "$$BUILD_DIR/Public/opus" + + sh $$BUILD_DIR/build-opus-bazel.sh $$BUILD_ARCH "$$BUILD_DIR" opus-1.3.1.tar.gz + """ + + "\n".join([ + "cp -f \"$$BUILD_DIR/built/include/opus/{}\" \"$(location Public/opus/{})\"".format(header, header) for header in headers + ]) + + "\n" + + "\n".join([ + "cp -f \"$$BUILD_DIR/built/lib/lib{}.a\" \"$(location Public/opus/lib/lib{}.a)\"".format(lib, lib) for lib in libs + ]), + outs = ["Public/opus/" + x for x in headers] + + ["Public/opus/lib/lib{}.a".format(x) for x in libs], + visibility = [ + "//visibility:public", + ] +) + +cc_library( + name = "opus_lib", + srcs = [":Public/opus/lib/lib" + x + ".a" for x in libs], +) + +objc_library( + name = "opus", + module_name = "opus", + enable_modules = True, + hdrs = [":Public/opus/" + x for x in headers], + includes = [ + "Public", + "Public/opus", + ], + deps = [ + ":opus_lib", + ], + visibility = [ + "//visibility:public", + ], +) diff --git a/third-party/opus/build-opus-bazel.sh b/third-party/opus/build-opus-bazel.sh new file mode 100755 index 0000000000..e78dd815af --- /dev/null +++ b/third-party/opus/build-opus-bazel.sh @@ -0,0 +1,55 @@ +#! /bin/sh + +set -ex + +ARCH="$1" +BUILD_DIR=$(echo "$(cd "$(dirname "$2")"; pwd -P)/$(basename "$2")") +SOURCE_CODE_ARCHIVE="$3" + +MINIOSVERSION="9.0" + +OPT_CFLAGS="-Os -g" +OPT_LDFLAGS="" +OPT_CONFIG_ARGS="" + +DEVELOPER=`xcode-select -print-path` + +OUTPUTDIR="$BUILD_DIR/Public" + +# where we will keep our sources and build from. +SRCDIR="${BUILD_DIR}/src" +mkdir -p $SRCDIR +# where we will store intermediary builds +INTERDIR="${BUILD_DIR}/built" +mkdir -p $INTERDIR + +######################################## + +tar zxf "$BUILD_DIR/$SOURCE_CODE_ARCHIVE" -C $SRCDIR +cd "${SRCDIR}/opus-"* + +if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ]; then + PLATFORM="iphonesimulator" + EXTRA_CFLAGS="-arch ${ARCH}" + EXTRA_CONFIG="--host=x86_64-apple-darwin" +elif [ "${ARCH}" == "sim_arm64" ]; then + PLATFORM="iphonesimulator" + EXTRA_CFLAGS="-arch arm64 --target=arm64-apple-ios$MINIOSVERSION-simulator" + EXTRA_CONFIG="--host=arm-apple-darwin20" +else + PLATFORM="iphoneos" + EXTRA_CFLAGS="-arch ${ARCH}" + EXTRA_CONFIG="--host=arm-apple-darwin" +fi + +SDK_PATH="$(xcrun --sdk $PLATFORM --show-sdk-path 2>/dev/null)" + +mkdir -p "${INTERDIR}" + +./configure --enable-float-approx --disable-shared --enable-static --with-pic --disable-extra-programs --disable-doc ${EXTRA_CONFIG} \ + --prefix="${INTERDIR}" \ + LDFLAGS="$LDFLAGS ${OPT_LDFLAGS} -fPIE -miphoneos-version-min=${MINIOSVERSION} -L${OUTPUTDIR}/lib" \ + CFLAGS="$CFLAGS ${EXTRA_CFLAGS} ${OPT_CFLAGS} -fPIE -miphoneos-version-min=${MINIOSVERSION} -I${OUTPUTDIR}/include -isysroot ${SDK_PATH}" \ + +make -j +make install diff --git a/third-party/opus/opus-1.3.1.tar.gz b/third-party/opus/opus-1.3.1.tar.gz new file mode 100644 index 0000000000..1119371fc2 Binary files /dev/null and b/third-party/opus/opus-1.3.1.tar.gz differ diff --git a/third-party/webp/BUILD b/third-party/webp/BUILD new file mode 100644 index 0000000000..7d991c7246 --- /dev/null +++ b/third-party/webp/BUILD @@ -0,0 +1,81 @@ + +headers = [ + "decode.h", + "encode.h", + "types.h", + #"demux.h", + #"mux_types.h", +] + +libs = [ + "webp", +] + +genrule( + name = "webp_build", + srcs = [ + "build-webp-bazel.sh", + "libwebp-1.1.0.tar.gz", + ], + cmd_bash = + """ + set -ex + + if [ "$(TARGET_CPU)" == "ios_armv7" ]; then + BUILD_ARCH="armv7" + elif [ "$(TARGET_CPU)" == "ios_arm64" ]; then + BUILD_ARCH="arm64" + elif [ "$(TARGET_CPU)" == "ios_sim_arm64" ]; then + BUILD_ARCH="sim_arm64" + elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then + BUILD_ARCH="x86_64" + else + echo "Unsupported architecture $(TARGET_CPU)" + fi + + BUILD_DIR="$(RULEDIR)/build_$${BUILD_ARCH}" + rm -rf "$$BUILD_DIR" + mkdir -p "$$BUILD_DIR" + + cp $(location :build-webp-bazel.sh) "$$BUILD_DIR/" + cp $(location :libwebp-1.1.0.tar.gz) "$$BUILD_DIR/" + + mkdir -p "$$BUILD_DIR/Public/webp" + + sh $$BUILD_DIR/build-webp-bazel.sh $$BUILD_ARCH "$$BUILD_DIR" libwebp-1.1.0.tar.gz + """ + + "\n".join([ + "cp -f \"$$BUILD_DIR/src/libwebp-1.1.0/build-output/include/webp/{}\" \"$(location Public/webp/{})\"".format(header, header) for header in headers + ]) + + "\n" + + "\n".join([ + "cp -f \"$$BUILD_DIR/src/libwebp-1.1.0/build-output/lib/lib{}.a\" \"$(location Public/webp/lib/lib{}.a)\"".format(lib, lib) for lib in libs + ]), + outs = ["Public/webp/" + x for x in headers] + + ["Public/webp/lib/lib{}.a".format(x) for x in libs], + visibility = [ + "//visibility:public", + ] +) + +cc_library( + name = "webp_lib", + srcs = [":Public/webp/lib/lib" + x + ".a" for x in libs], +) + +objc_library( + name = "webp", + module_name = "webp", + enable_modules = True, + hdrs = [":Public/webp/" + x for x in headers], + includes = [ + "Public", + "Public/webp", + ], + deps = [ + ":webp_lib", + ], + visibility = [ + "//visibility:public", + ], +) diff --git a/third-party/webp/build-webp-bazel.sh b/third-party/webp/build-webp-bazel.sh new file mode 100755 index 0000000000..c199cba8f1 --- /dev/null +++ b/third-party/webp/build-webp-bazel.sh @@ -0,0 +1,56 @@ +#! /bin/sh + +set -ex + +ARCH="$1" +BUILD_DIR=$(echo "$(cd "$(dirname "$2")"; pwd -P)/$(basename "$2")") +SOURCE_CODE_ARCHIVE="$3" + +MINIOSVERSION="9.0" + +OPT_CFLAGS="-Os -g" +OPT_LDFLAGS="" +OPT_CONFIG_ARGS="" + +DEVELOPER=`xcode-select -print-path` + +OUTPUTDIR="$BUILD_DIR/Public" + +SRCDIR="${BUILD_DIR}/src" +mkdir -p $SRCDIR + +tar zxf "$BUILD_DIR/$SOURCE_CODE_ARCHIVE" -C $SRCDIR +cd "${SRCDIR}/libwebp-"* +PREFIX="$(pwd)/build-output" + +if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ]; then + PLATFORM="iphonesimulator" + EXTRA_CFLAGS="-arch ${ARCH}" + EXTRA_CONFIG="--host=x86_64-apple-darwin" +elif [ "${ARCH}" == "sim_arm64" ]; then + PLATFORM="iphonesimulator" + EXTRA_CFLAGS="-arch arm64 --target=arm64-apple-ios$MINIOSVERSION-simulator" + EXTRA_CONFIG="--host=arm-apple-darwin20" +else + PLATFORM="iphoneos" + EXTRA_CFLAGS="-arch ${ARCH}" + EXTRA_CONFIG="--host=arm-apple-darwin" +fi + +SDKROOT="$(xcrun --sdk $PLATFORM --show-sdk-path 2>/dev/null)" + +DEVROOT="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain" + +CFLAGS="-pipe -isysroot ${SDKROOT} -O3 -DNDEBUG $EXTRA_CFLAGS" +CFLAGS+=" -miphoneos-version-min=9.0" + +PATH="${DEVROOT}/usr/bin:${PATH}" ./configure \ + ${EXTRA_CONFIG} \ + --prefix=${PREFIX} \ + --build=$(./config.guess) \ + --disable-shared --enable-static \ + --disable-libwebpdecoder --enable-swap-16bit-csp \ + CFLAGS="${CFLAGS}" + +make V=0 +make install diff --git a/third-party/webp/libwebp-1.1.0.tar.gz b/third-party/webp/libwebp-1.1.0.tar.gz new file mode 100644 index 0000000000..63885d3d53 Binary files /dev/null and b/third-party/webp/libwebp-1.1.0.tar.gz differ diff --git a/third-party/webrtc/BUCK b/third-party/webrtc/BUCK deleted file mode 100644 index 6762598ed0..0000000000 --- a/third-party/webrtc/BUCK +++ /dev/null @@ -1,84 +0,0 @@ -load("//Config:buck_rule_macros.bzl", "static_library") - -webrtc_lib_flags = [ - "-lframework_objc_static" -] - -genrule( - name = "webrtc_build", - srcs = [ - "build-webrtc-buck.sh", - "webrtc-ios", - ], - bash = -""" - set -x - echo "SRCDIR=$SRCDIR" - - BUILD_ARCH=arm64 - - BUILD_DIR_ARM64="$SRCDIR/$BUILD_ARCH" - - BUILD_DIR="$BUILD_DIR_ARM64" - rm -rf "$BUILD_DIR" - mkdir -p "$BUILD_DIR" - - mkdir -p "$BUILD_DIR/webrtc-ios" - cp -R "$SRCDIR/webrtc-ios/src" "$BUILD_DIR/webrtc-ios/src" - - DEPOT_TOOLS_PATH="$(location //third-party:depot_tools_sources)" - - rm -rf "$BUILD_DIR/depot_tools" - cp -R "$DEPOT_TOOLS_PATH" "$BUILD_DIR/" - - rm -rf "$BUILD_DIR/openssl" - cp -R "$(location //submodules/openssl:openssl_build_merged)" "$BUILD_DIR/openssl/" - cp -R "$(location //submodules/openssl:openssl_libssl_merged)" "$BUILD_DIR/libssl/" - - sh $SRCDIR/build-webrtc-buck.sh "$BUILD_DIR" $BUILD_ARCH - - BUILD_ARCH=arm - - BUILD_DIR_ARMV7="$SRCDIR/$BUILD_ARCH" - - BUILD_DIR="$BUILD_DIR_ARMV7" - - rm -rf "$BUILD_DIR" - mkdir -p "$BUILD_DIR" - - mkdir -p "$BUILD_DIR/webrtc-ios" - cp -R "$SRCDIR/webrtc-ios/src" "$BUILD_DIR/webrtc-ios/src" - - DEPOT_TOOLS_PATH="$(location //third-party:depot_tools_sources)" - - rm -rf "$BUILD_DIR/depot_tools" - cp -R "$DEPOT_TOOLS_PATH" "$BUILD_DIR/" - - rm -rf "$BUILD_DIR/openssl" - cp -R "$(location //submodules/openssl:openssl_build_merged)" "$BUILD_DIR/openssl/" - cp -R "$(location //submodules/openssl:openssl_libssl_merged)" "$BUILD_DIR/libssl/" - - sh $SRCDIR/build-webrtc-buck.sh "$BUILD_DIR" $BUILD_ARCH - - mkdir -p "$OUT" - lipo -create "$BUILD_DIR_ARMV7/webrtc-ios/src/out/ios/obj/sdk/libframework_objc_static.a" "$BUILD_DIR_ARM64/webrtc-ios/src/out/ios_64/obj/sdk/libframework_objc_static.a" -output "$OUT/libframework_objc_static.a" -""", - out = "libwebrtc", - visibility = ["PUBLIC"] -) - -apple_library( - name = "webrtc_lib", - visibility = [ - "PUBLIC", - ], - linker_flags = [ - "-L$(location :webrtc_build)", - ] + webrtc_lib_flags, - exported_linker_flags = [ - "-L$(location :webrtc_build)", - ] + webrtc_lib_flags, - deps = [ - ":webrtc_build" - ], -) diff --git a/third-party/webrtc/BUILD b/third-party/webrtc/BUILD index 12e1afaeb5..ea6c4ecadd 100644 --- a/third-party/webrtc/BUILD +++ b/third-party/webrtc/BUILD @@ -1766,6 +1766,7 @@ x86_specific_sources = ["webrtc-ios/src/" + path for path in [ arch_specific_sources = select({ "@build_bazel_rules_apple//apple:ios_armv7": common_arm_specific_sources + armv7_specific_sources, "@build_bazel_rules_apple//apple:ios_arm64": common_arm_specific_sources + arm64_specific_sources, + "//build-system:ios_sim_arm64": common_arm_specific_sources + arm64_specific_sources, "@build_bazel_rules_apple//apple:ios_x86_64": x86_specific_sources, }) @@ -1795,6 +1796,7 @@ x86_64_specific_flags = [ arch_specific_cflags = select({ "@build_bazel_rules_apple//apple:ios_armv7": common_flags + arm_specific_flags, "@build_bazel_rules_apple//apple:ios_arm64": common_flags + arm64_specific_flags, + "//build-system:ios_sim_arm64": common_flags + arm64_specific_flags, "@build_bazel_rules_apple//apple:ios_x86_64": common_flags + x86_64_specific_flags, }) @@ -2134,7 +2136,7 @@ objc_library( deps = [ "//third-party/boringssl:crypto", "//third-party/boringssl:ssl", - "//submodules/Opus:opus", + "//third-party/opus:opus", ":usrsctp", ":libsrtp", ":libevent", @@ -2176,7 +2178,7 @@ objc_library( deps = [ "//third-party/boringssl:crypto", "//third-party/boringssl:ssl", - "//submodules/Opus:opus", + "//third-party/opus:opus", ":usrsctp", ":libsrtp", ":libevent", diff --git a/third-party/webrtc/build-webrtc-buck.sh b/third-party/webrtc/build-webrtc-buck.sh deleted file mode 100755 index f1c895666d..0000000000 --- a/third-party/webrtc/build-webrtc-buck.sh +++ /dev/null @@ -1,33 +0,0 @@ -#/bin/sh - -set -x -set -e - -BUILD_DIR="$1" -ARCH="$2" - -echo "BUILD_DIR=$BUILD_DIR" -echo "ARCH=$ARCH" - -export PATH="$PATH:$BUILD_DIR/depot_tools_sources/depot_tools" - -rm -rf "$BUILD_DIR/webrtc-ios/src/openssl" -cp -R "$BUILD_DIR/openssl" "$BUILD_DIR/webrtc-ios/src/" -cp -R "$BUILD_DIR/libssl" "$BUILD_DIR/webrtc-ios/src/" - -pushd "$BUILD_DIR/webrtc-ios/src" - -mv openssl/lib/libcrypto.a openssl/ -mv libssl/lib/libssl.a openssl/ - -OUT_DIR="ios" -if [ "$ARCH" == "arm64" ]; then - OUT_DIR="ios_64" -elif [ "$ARCH" == "x64" ]; then - OUT_DIR="ios_sim" -fi - -buildtools/mac/gn gen out/$OUT_DIR --args="use_xcode_clang=true "" target_cpu=\"$ARCH\""' target_os="ios" is_debug=false is_component_build=false rtc_include_tests=false use_rtti=true rtc_use_x11=false use_custom_libcxx=false use_custom_libcxx_for_host=false rtc_build_ssl=false rtc_build_examples=false rtc_build_tools=false ios_deployment_target="9.0" ios_enable_code_signing=false is_unsafe_developer_build=false rtc_enable_protobuf=false rtc_include_builtin_video_codecs=true rtc_build_libvpx=true rtc_libvpx_build_vp9=true rtc_use_gtk=false rtc_use_metal_rendering=true' -ninja -C out/$OUT_DIR framework_objc_static - -popd diff --git a/third-party/webrtc/webrtc-ios b/third-party/webrtc/webrtc-ios index 982b3456d0..15ce8b1b99 160000 --- a/third-party/webrtc/webrtc-ios +++ b/third-party/webrtc/webrtc-ios @@ -1 +1 @@ -Subproject commit 982b3456d0b18369f36e2b1e1438f40235a12eae +Subproject commit 15ce8b1b99dce2d1404f21f9e974f564bdbf4165 diff --git a/third-party/yasm/BUCK b/third-party/yasm/BUCK deleted file mode 100644 index eade17fbf2..0000000000 --- a/third-party/yasm/BUCK +++ /dev/null @@ -1,24 +0,0 @@ - -genrule( - name = "yasm", - srcs = [ - "yasm-1.3.0.tar.gz", - ], - bash = -""" - core_count="`sysctl -n hw.logicalcpu`" - mkdir -p "$OUT" - tar -xzf "$SRCDIR/yasm-1.3.0.tar.gz" --directory "$OUT" - pushd "$OUT/yasm-1.3.0" - mkdir build - cd build - export PATH=\"$PATH:$(location //third-party/cmake:cmake)/cmake-3.16.0/bin\" - cmake .. -DYASM_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - make -j $core_count - popd -""", - out = "yasm", - visibility = [ - "PUBLIC", - ] -) diff --git a/third-party/yasm/BUILD b/third-party/yasm/BUILD index 1970b6b67c..3d1ee6a815 100644 --- a/third-party/yasm/BUILD +++ b/third-party/yasm/BUILD @@ -23,8 +23,8 @@ set -x pushd "$$BUILD_DIR/yasm-1.3.0" mkdir build cd build - PATH="$$PATH:$$CMAKE_DIR/cmake-3.18.4-Darwin-x86_64/CMake.app/Contents/bin" arch -x86_64 cmake .. -DYASM_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF - arch -x86_64 make -j $$core_count + PATH="$$PATH:$$CMAKE_DIR/cmake-3.19.2-macos-universal/CMake.app/Contents/bin" cmake .. -DYASM_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + make -j $$core_count popd tar -cf "$(location yasm.tar)" -C "$$BUILD_DIR/yasm-1.3.0/build" . diff --git a/tools/buck-build/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch b/tools/buck-build/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch deleted file mode 100644 index fe6ee40c41..0000000000 --- a/tools/buck-build/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch +++ /dev/null @@ -1,157 +0,0 @@ -diff --git a/.gitignore b/.gitignore -index 78ce658b9a..30c0369ab7 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -3,6 +3,7 @@ - - # IntelliJ build - /intellij-out/ -+/.idea/ - - # Buck - /buck-out -diff --git a/.idea/modules.xml b/.idea/modules.xml -deleted file mode 100644 -index 7ff823b554..0000000000 ---- a/.idea/modules.xml -+++ /dev/null -@@ -1,16 +0,0 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -\ No newline at end of file -diff --git a/src/com/facebook/buck/apple/AppleBundle.java b/src/com/facebook/buck/apple/AppleBundle.java -index d895ab9a79..ad42beb302 100644 ---- a/src/com/facebook/buck/apple/AppleBundle.java -+++ b/src/com/facebook/buck/apple/AppleBundle.java -@@ -992,7 +992,11 @@ public class AppleBundle extends AbstractBuildRuleWithDeclaredAndExtraDeps - keys.put("DTPlatformName", new NSString(platform.getName())); - keys.put("DTPlatformVersion", new NSString(sdkVersion)); - keys.put("DTSDKName", new NSString(sdkName + sdkVersion)); -- keys.put("MinimumOSVersion", new NSString(minOSVersion)); -+ if (infoPlistSubstitutions.containsKey("MinimumOSVersion")) { -+ keys.put("MinimumOSVersion", new NSString(infoPlistSubstitutions.get("MinimumOSVersion"))); -+ } else { -+ keys.put("MinimumOSVersion", new NSString(minOSVersion)); -+ } - if (platformBuildVersion.isPresent()) { - keys.put("DTPlatformBuild", new NSString(platformBuildVersion.get())); - keys.put("DTSDKBuild", new NSString(platformBuildVersion.get())); -@@ -1185,9 +1189,10 @@ public class AppleBundle extends AbstractBuildRuleWithDeclaredAndExtraDeps - - // .framework bundles will be code-signed when they're copied into the containing bundle. - private boolean needCodeSign() { -- return binary.isPresent() -+ return false; -+ /*return binary.isPresent() - && ApplePlatform.needsCodeSign(platform.getName()) -- && !extension.equals(FRAMEWORK_EXTENSION); -+ && !extension.equals(FRAMEWORK_EXTENSION);*/ - } - - @Override -diff --git a/src/com/facebook/buck/apple/MultiarchFileInfos.java b/src/com/facebook/buck/apple/MultiarchFileInfos.java -index c078b2e134..030f9fc289 100644 ---- a/src/com/facebook/buck/apple/MultiarchFileInfos.java -+++ b/src/com/facebook/buck/apple/MultiarchFileInfos.java -@@ -177,7 +177,12 @@ public class MultiarchFileInfos { - cxxBuckConfig.shouldCacheLinks(), - BuildTargetPaths.getGenPath( - projectFilesystem, buildTarget, multiarchOutputPathFormat)); -- graphBuilder.addToIndex(multiarchFile); -+ Optional existingRule2 = graphBuilder.getRuleOptional(multiarchFile.getBuildTarget()); -+ if (existingRule2.isPresent()) { -+ return existingRule2.get(); -+ } else { -+ graphBuilder.addToIndex(multiarchFile); -+ } - return multiarchFile; - } else { - return new NoopBuildRule(buildTarget, projectFilesystem); -diff --git a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java -index 8db968b982..b10f793d8e 100644 ---- a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java -+++ b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java -@@ -825,6 +825,7 @@ public class ProjectGenerator { - Optional.of(xcodeDescriptions.getXCodeDescriptions())); - if (bundleRequiresRemovalOfAllTransitiveFrameworks(targetNode)) { - copiedRules = rulesWithoutFrameworkBundles(copiedRules); -+ copiedRules = rulesWithoutDylibs(copiedRules); - } else if (bundleRequiresAllTransitiveFrameworks(binaryNode, bundleLoaderNode)) { - copiedRules = - ImmutableSet.>builder() -@@ -954,6 +955,22 @@ public class ProjectGenerator { - .toImmutableList(); - } - -+ private ImmutableList> rulesWithoutDylibs( -+ Iterable> copiedRules) { -+ return RichStream.from(copiedRules) -+ .filter( -+ input -> -+ TargetNodes.castArg(input, AppleLibraryDescriptionArg.class) -+ .map(argTargetNode -> { -+ if (argTargetNode.getBuildTarget().getFlavors().contains(CxxDescriptionEnhancer.SHARED_FLAVOR)) { -+ return false; -+ } -+ return true; -+ }) -+ .orElse(true)) -+ .toImmutableList(); -+ } -+ - private ImmutableList> rulesWithoutBundleLoader( - Iterable> copiedRules, TargetNode bundleLoader) { - return RichStream.from(copiedRules).filter(x -> !bundleLoader.equals(x)).toImmutableList(); -@@ -2316,8 +2333,9 @@ public class ProjectGenerator { - .transform( - bundleExtension -> { - switch (bundleExtension) { -- case APP: - case APPEX: -+ return false; -+ case APP: - case PLUGIN: - case BUNDLE: - case XCTEST: -@@ -2515,7 +2533,7 @@ public class ProjectGenerator { - - librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift/$PLATFORM_NAME"); - if (options.shouldLinkSystemSwift()) { -- librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift-5.0/$PLATFORM_NAME"); -+ //librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift-5.0/$PLATFORM_NAME"); - } - } - -@@ -3444,7 +3462,7 @@ public class ProjectGenerator { - - PBXFileReference fileReference = getLibraryFileReference(targetNode); - PBXBuildFile buildFile = new PBXBuildFile(fileReference); -- if (fileReference.getExplicitFileType().equals(Optional.of("wrapper.framework"))) { -+ if (fileReference.getExplicitFileType().equals(Optional.of("wrapper.framework")) || fileReference.getExplicitFileType().equals(Optional.of("compiled.mach-o.dylib"))) { - UnflavoredBuildTargetView buildTarget = - targetNode.getBuildTarget().getUnflavoredBuildTarget(); - if (frameworkTargets.contains(buildTarget)) { -@@ -4696,6 +4714,9 @@ public class ProjectGenerator { - - private static boolean bundleRequiresRemovalOfAllTransitiveFrameworks( - TargetNode targetNode) { -+ if (targetNode.getConstructorArg().getXcodeProductType().equals(Optional.of("com.apple.product-type.app-extension"))) { -+ return true; -+ } - return isFrameworkBundle(targetNode.getConstructorArg()); - } - diff --git a/tools/buck-build/prepare_buck_source.sh b/tools/buck-build/prepare_buck_source.sh deleted file mode 100644 index 1b8db8da32..0000000000 --- a/tools/buck-build/prepare_buck_source.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -set -x -set -e - -target_directory="$1" - -if [ -z "$target_directory" ]; then - echo "Usage: sh prepare_buck_source.sh path/to/target/directory" - exit 1 -fi - -mkdir -p "$target_directory" - -jdk_archive_name="jdk.tar.gz" -jdk_archive_path="$target_directory/$jdk_archive_name" -jdk_unpacked_path="$target_directory/jdk8u232-b09" -jdk_url="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u232b09.tar.gz" - -if [ ! -f "$jdk_archive_path" ]; then - echo "Fetching JDK 8" - curl "$jdk_url" -L -o "$target_directory/jdk.tar.gz" -fi - -if [ ! -d "$jdk_unpacked_path" ]; then - echo "Unpacking JDK 8" - pushd "$target_directory" - tar -xf "$jdk_archive_name" - popd -fi - -patch_file="$(ls *.patch | head -1)" -patch_path="$(pwd)/$patch_file" - -if [ -z "$patch_file" ]; then - echo "There should be a patch-COMMIT_SHA.patch in the current directory" - exit 1 -fi - -commit_sha="$(echo "$patch_file" | sed -e 's/buck-//g' | sed -e 's/\.patch//g')" - -echo "Fetching commit $commit_sha" - -dir="$(pwd)" -cd "$target_directory" - -if [ ! -d "buck" ]; then - git clone "https://github.com/facebook/buck.git" -fi - -cd "buck" - -git reset --hard -git reset --hard "$commit_sha" - -git apply --check "$patch_path" -git apply "$patch_path" - -PATH="$PATH:$jdk_unpacked_path/Contents/Home/bin" ant -PATH="$PATH:$jdk_unpacked_path/Contents/Home/bin" ./bin/buck build --show-output buck - -cd "$dir" diff --git a/tools/defs.bzl b/tools/defs.bzl deleted file mode 100644 index ad459ba6dc..0000000000 --- a/tools/defs.bzl +++ /dev/null @@ -1,13 +0,0 @@ -XCODE_BINARY_CONFIG = { - 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', - 'SDKROOT': 'iphoneos', - 'GCC_OPTIMIZATION_LEVEL': '0', - 'SWIFT_OPTIMIZATION_LEVEL': '-Onone', - 'SWIFT_WHOLE_MODULE_OPTIMIZATION': 'NO', - 'ONLY_ACTIVE_ARCH': 'YES', - 'LD_RUNPATH_SEARCH_PATHS': '@executable_path/Frameworks', -} - -XCODE_STATIC_LIBRARY_CONFIG = { - 'SKIP_INSTALL': 'YES', -} diff --git a/tools/targets.bzl b/tools/targets.bzl deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tools/utils.bzl b/tools/utils.bzl deleted file mode 100644 index f443f03983..0000000000 --- a/tools/utils.bzl +++ /dev/null @@ -1,103 +0,0 @@ -OTHER_LINKER_FLAGS_KEY = 'OTHER_LDFLAGS' - -def config_with_updated_linker_flags(config, other_linker_flags, config_key=OTHER_LINKER_FLAGS_KEY): - new_config = { } - config_key_found = False - for key in config: - if key == config_key: - new_config[key] = config[key] + (" %s" % other_linker_flags) - config_key_found = True - else: - new_config[key] = config[key] - - if config_key_found == False: - # If `config` does not currently contain `config_key`, add it. Inherit for good measure. - new_config[config_key] = '$(inherited) ' + other_linker_flags - - return new_config - - -def xcode_configs(config): - return { - "Debug": config, - "Profile": config, - "Release": config, - } - -def merge_maps(dicts): - result = dict() - for d in dicts: - for key in d: - if key in result and result[key] != d[key]: - fail( - "Conflicting files in file search paths. " + - "\"%s\" maps to both \"%s\" and \"%s\"." % - (key, result[key], d[key]), - ) - result.update(d) - return result - - -def basename(p): - return p.rpartition("/")[-1] - - -def glob_map(glob_results): - result = dict() - for path in glob_results: - file_name = basename(path) - if file_name in result: - fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_name, result[file_name], path)) - result[file_name] = path - return result - - -def glob_sub_map(prefix, glob_specs): - result = dict() - for path in native.glob(glob_specs): - if not path.startswith(prefix): - fail('\"%s\" does not start with \"%s\"' % (path, prefix)) - file_key = path[len(prefix):] - if file_key in result: - fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_key, result[file_key], path)) - result[file_key] = path - return result - - -def gen_header_targets(header_paths, prefix, flavor, source_rule, source_path): - result = dict() - for header_path in header_paths: - name = prefix + header_path.replace('/', '_sub_') - native.genrule( - name = name + flavor, - cmd = 'cp $(location :' + source_rule + ')/' + source_path + '/' + header_path + ' $OUT', - out = name, - ) - result[header_path] = ':' + name + flavor - return result - - -def lib_basename(name): - result = name - if result.startswith('lib'): - result = result[3:] - if result.endswith('.a'): - result = result[:-2] - return result - - -def combined_config(dicts): - result = dict() - for d in dicts: - result.update(d) - return result - - -valid_build_variants = ['project', 'release'] - -def get_build_variant(): - build_variant = native.read_config('build', 'variant', '') - if build_variant not in valid_build_variants: - fail('build_variant should be one of %s' % valid_build_variants) - return build_variant -