Commit 2b238fe0 by zhangyunjie

OffcnLiveSDKiOS

parent 726b9d76
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; };
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
A95923162484B533007F5131 /* iOSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A95923142484B533007F5131 /* iOSViewController.m */; };
A95923172484B533007F5131 /* iOSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A95923152484B533007F5131 /* iOSAppDelegate.m */; };
A95923192484B53F007F5131 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A95923182484B53E007F5131 /* Main.storyboard */; };
B8933FFBD1D391986A823AB0 /* Pods_OffcnLiveSDKiOS_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A89BE439C54D2FF6CA0FDAEC /* Pods_OffcnLiveSDKiOS_Example.framework */; };
E031BC5A6D1684C7FC29ACF1 /* Pods_OffcnLiveSDKiOS_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54CBC425CF8AC01BB87AC75D /* Pods_OffcnLiveSDKiOS_Tests.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6003F582195388D10070C39A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 6003F589195388D20070C39A;
remoteInfo = OffcnLiveSDKiOS;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
54CBC425CF8AC01BB87AC75D /* Pods_OffcnLiveSDKiOS_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OffcnLiveSDKiOS_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58A195388D20070C39A /* OffcnLiveSDKiOS_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OffcnLiveSDKiOS_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6003F595195388D20070C39A /* OffcnLiveSDKiOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OffcnLiveSDKiOS-Info.plist"; sourceTree = "<group>"; };
6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6003F59B195388D20070C39A /* OffcnLiveSDKiOS-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OffcnLiveSDKiOS-Prefix.pch"; sourceTree = "<group>"; };
6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
6003F5AE195388D20070C39A /* OffcnLiveSDKiOS_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OffcnLiveSDKiOS_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = "<group>"; };
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
6EAC98A55AAEFAF603A14625 /* Pods-OffcnLiveSDKiOS_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnLiveSDKiOS_Tests.debug.xcconfig"; path = "Target Support Files/Pods-OffcnLiveSDKiOS_Tests/Pods-OffcnLiveSDKiOS_Tests.debug.xcconfig"; sourceTree = "<group>"; };
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9308FE854EF37D64DB162235 /* OffcnLiveSDKiOS.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = OffcnLiveSDKiOS.podspec; path = ../OffcnLiveSDKiOS.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
93D1E234B11F13A8A49A11EB /* Pods-OffcnLiveSDKiOS_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnLiveSDKiOS_Example.debug.xcconfig"; path = "Target Support Files/Pods-OffcnLiveSDKiOS_Example/Pods-OffcnLiveSDKiOS_Example.debug.xcconfig"; sourceTree = "<group>"; };
A89BE439C54D2FF6CA0FDAEC /* Pods_OffcnLiveSDKiOS_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OffcnLiveSDKiOS_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A95923122484B533007F5131 /* iOSViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iOSViewController.h; sourceTree = "<group>"; };
A95923132484B533007F5131 /* iOSAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iOSAppDelegate.h; sourceTree = "<group>"; };
A95923142484B533007F5131 /* iOSViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iOSViewController.m; sourceTree = "<group>"; };
A95923152484B533007F5131 /* iOSAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iOSAppDelegate.m; sourceTree = "<group>"; };
A95923182484B53E007F5131 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
AFC96D71A6DE5FB0323431E5 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
C18804E184EECC2EC345535B /* Pods-OffcnLiveSDKiOS_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnLiveSDKiOS_Tests.release.xcconfig"; path = "Target Support Files/Pods-OffcnLiveSDKiOS_Tests/Pods-OffcnLiveSDKiOS_Tests.release.xcconfig"; sourceTree = "<group>"; };
D6184155640B8A41D8A765B9 /* Pods-OffcnLiveSDKiOS_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnLiveSDKiOS_Example.release.xcconfig"; path = "Target Support Files/Pods-OffcnLiveSDKiOS_Example/Pods-OffcnLiveSDKiOS_Example.release.xcconfig"; sourceTree = "<group>"; };
F0B887005F39F74244FC7781 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6003F587195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
B8933FFBD1D391986A823AB0 /* Pods_OffcnLiveSDKiOS_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AB195388D20070C39A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
E031BC5A6D1684C7FC29ACF1 /* Pods_OffcnLiveSDKiOS_Tests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6003F581195388D10070C39A = {
isa = PBXGroup;
children = (
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */,
6003F593195388D20070C39A /* Example for OffcnLiveSDKiOS */,
6003F5B5195388D20070C39A /* Tests */,
6003F58C195388D20070C39A /* Frameworks */,
6003F58B195388D20070C39A /* Products */,
D4EA30AF0159DE4FF9F831C0 /* Pods */,
);
sourceTree = "<group>";
};
6003F58B195388D20070C39A /* Products */ = {
isa = PBXGroup;
children = (
6003F58A195388D20070C39A /* OffcnLiveSDKiOS_Example.app */,
6003F5AE195388D20070C39A /* OffcnLiveSDKiOS_Tests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
6003F58C195388D20070C39A /* Frameworks */ = {
isa = PBXGroup;
children = (
6003F58D195388D20070C39A /* Foundation.framework */,
6003F58F195388D20070C39A /* CoreGraphics.framework */,
6003F591195388D20070C39A /* UIKit.framework */,
6003F5AF195388D20070C39A /* XCTest.framework */,
A89BE439C54D2FF6CA0FDAEC /* Pods_OffcnLiveSDKiOS_Example.framework */,
54CBC425CF8AC01BB87AC75D /* Pods_OffcnLiveSDKiOS_Tests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
6003F593195388D20070C39A /* Example for OffcnLiveSDKiOS */ = {
isa = PBXGroup;
children = (
A95923132484B533007F5131 /* iOSAppDelegate.h */,
A95923152484B533007F5131 /* iOSAppDelegate.m */,
A95923122484B533007F5131 /* iOSViewController.h */,
A95923142484B533007F5131 /* iOSViewController.m */,
A95923182484B53E007F5131 /* Main.storyboard */,
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */,
);
name = "Example for OffcnLiveSDKiOS";
path = OffcnLiveSDKiOS;
sourceTree = "<group>";
};
6003F594195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F595195388D20070C39A /* OffcnLiveSDKiOS-Info.plist */,
6003F596195388D20070C39A /* InfoPlist.strings */,
6003F599195388D20070C39A /* main.m */,
6003F59B195388D20070C39A /* OffcnLiveSDKiOS-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
6003F5B5195388D20070C39A /* Tests */ = {
isa = PBXGroup;
children = (
6003F5BB195388D20070C39A /* Tests.m */,
6003F5B6195388D20070C39A /* Supporting Files */,
);
path = Tests;
sourceTree = "<group>";
};
6003F5B6195388D20070C39A /* Supporting Files */ = {
isa = PBXGroup;
children = (
6003F5B7195388D20070C39A /* Tests-Info.plist */,
6003F5B8195388D20070C39A /* InfoPlist.strings */,
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = {
isa = PBXGroup;
children = (
9308FE854EF37D64DB162235 /* OffcnLiveSDKiOS.podspec */,
AFC96D71A6DE5FB0323431E5 /* README.md */,
F0B887005F39F74244FC7781 /* LICENSE */,
);
name = "Podspec Metadata";
sourceTree = "<group>";
};
D4EA30AF0159DE4FF9F831C0 /* Pods */ = {
isa = PBXGroup;
children = (
93D1E234B11F13A8A49A11EB /* Pods-OffcnLiveSDKiOS_Example.debug.xcconfig */,
D6184155640B8A41D8A765B9 /* Pods-OffcnLiveSDKiOS_Example.release.xcconfig */,
6EAC98A55AAEFAF603A14625 /* Pods-OffcnLiveSDKiOS_Tests.debug.xcconfig */,
C18804E184EECC2EC345535B /* Pods-OffcnLiveSDKiOS_Tests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6003F589195388D20070C39A /* OffcnLiveSDKiOS_Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "OffcnLiveSDKiOS_Example" */;
buildPhases = (
63C0D152835E129D58E98946 /* [CP] Check Pods Manifest.lock */,
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
7BAB7FB541976ECD1B7325BF /* [CP] Embed Pods Frameworks */,
1FB127552B85C46DCA4C2EAA /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = OffcnLiveSDKiOS_Example;
productName = OffcnLiveSDKiOS;
productReference = 6003F58A195388D20070C39A /* OffcnLiveSDKiOS_Example.app */;
productType = "com.apple.product-type.application";
};
6003F5AD195388D20070C39A /* OffcnLiveSDKiOS_Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "OffcnLiveSDKiOS_Tests" */;
buildPhases = (
D38BB11B7A3D4118D290BDDF /* [CP] Check Pods Manifest.lock */,
6003F5AA195388D20070C39A /* Sources */,
6003F5AB195388D20070C39A /* Frameworks */,
6003F5AC195388D20070C39A /* Resources */,
);
buildRules = (
);
dependencies = (
6003F5B4195388D20070C39A /* PBXTargetDependency */,
);
name = OffcnLiveSDKiOS_Tests;
productName = OffcnLiveSDKiOSTests;
productReference = 6003F5AE195388D20070C39A /* OffcnLiveSDKiOS_Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6003F582195388D10070C39A /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = OFFCN;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "zhangyunjie  ";
TargetAttributes = {
6003F589195388D20070C39A = {
DevelopmentTeam = LA78A3696S;
ProvisioningStyle = Manual;
};
6003F5AD195388D20070C39A = {
TestTargetID = 6003F589195388D20070C39A;
};
};
};
buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "OffcnLiveSDKiOS" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 6003F581195388D10070C39A;
productRefGroup = 6003F58B195388D20070C39A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6003F589195388D20070C39A /* OffcnLiveSDKiOS_Example */,
6003F5AD195388D20070C39A /* OffcnLiveSDKiOS_Tests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
6003F588195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
A95923192484B53F007F5131 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AC195388D20070C39A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
1FB127552B85C46DCA4C2EAA /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-OffcnLiveSDKiOS_Example/Pods-OffcnLiveSDKiOS_Example-resources.sh",
"${PODS_ROOT}/../../OffcnLiveSDKiOS/Resources/OffcnLiveSDK.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/OffcnLiveSDK.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-OffcnLiveSDKiOS_Example/Pods-OffcnLiveSDKiOS_Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
63C0D152835E129D58E98946 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-OffcnLiveSDKiOS_Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
7BAB7FB541976ECD1B7325BF /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-OffcnLiveSDKiOS_Example/Pods-OffcnLiveSDKiOS_Example-frameworks.sh",
"${PODS_ROOT}/../../OffcnLiveSDKiOS/Frameworks/ZGIJKMediaFramework.framework",
"${PODS_ROOT}/../../OffcnLiveSDKiOS/Frameworks/WebRTC.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZGIJKMediaFramework.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-OffcnLiveSDKiOS_Example/Pods-OffcnLiveSDKiOS_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
D38BB11B7A3D4118D290BDDF /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-OffcnLiveSDKiOS_Tests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
6003F586195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A95923162484B533007F5131 /* iOSViewController.m in Sources */,
A95923172484B533007F5131 /* iOSAppDelegate.m in Sources */,
6003F59A195388D20070C39A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
6003F5AA195388D20070C39A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6003F5BC195388D20070C39A /* Tests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
6003F5B4195388D20070C39A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 6003F589195388D20070C39A /* OffcnLiveSDKiOS_Example */;
targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
6003F596195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F597195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
6003F5B8195388D20070C39A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
6003F5B9195388D20070C39A /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
71719F9E1E33DC2100824A3D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
6003F5BD195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
6003F5BE195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
6003F5C0195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 93D1E234B11F13A8A49A11EB /* Pods-OffcnLiveSDKiOS_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = LA78A3696S;
ENABLE_BITCODE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OffcnLiveSDKiOS/OffcnLiveSDKiOS-Prefix.pch";
INFOPLIST_FILE = "OffcnLiveSDKiOS/OffcnLiveSDKiOS-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MODULE_NAME = ExampleApp;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.questions;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = WXQuestionDev;
SWIFT_VERSION = 4.0;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
6003F5C1195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D6184155640B8A41D8A765B9 /* Pods-OffcnLiveSDKiOS_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = LA78A3696S;
ENABLE_BITCODE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "OffcnLiveSDKiOS/OffcnLiveSDKiOS-Prefix.pch";
INFOPLIST_FILE = "OffcnLiveSDKiOS/OffcnLiveSDKiOS-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.questions;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = WXQuestionDev;
SWIFT_VERSION = 4.0;
WRAPPER_EXTENSION = app;
};
name = Release;
};
6003F5C3195388D20070C39A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 6EAC98A55AAEFAF603A14625 /* Pods-OffcnLiveSDKiOS_Tests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OffcnLiveSDKiOS_Example.app/OffcnLiveSDKiOS_Example";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
6003F5C4195388D20070C39A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C18804E184EECC2EC345535B /* Pods-OffcnLiveSDKiOS_Tests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
FRAMEWORK_SEARCH_PATHS = (
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "Tests/Tests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OffcnLiveSDKiOS_Example.app/OffcnLiveSDKiOS_Example";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6003F585195388D10070C39A /* Build configuration list for PBXProject "OffcnLiveSDKiOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5BD195388D20070C39A /* Debug */,
6003F5BE195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "OffcnLiveSDKiOS_Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C0195388D20070C39A /* Debug */,
6003F5C1195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "OffcnLiveSDKiOS_Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6003F5C3195388D20070C39A /* Debug */,
6003F5C4195388D20070C39A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 6003F582195388D10070C39A /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "OffcnLiveSDKiOS_Example.app"
BlueprintName = "OffcnLiveSDKiOS_Example"
ReferencedContainer = "container:OffcnLiveSDKiOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F5AD195388D20070C39A"
BuildableName = "OffcnLiveSDKiOS_Tests.xctest"
BlueprintName = "OffcnLiveSDKiOS_Tests"
ReferencedContainer = "container:OffcnLiveSDKiOS.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "OffcnLiveSDKiOS_Example.app"
BlueprintName = "OffcnLiveSDKiOS_Example"
ReferencedContainer = "container:OffcnLiveSDKiOS.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "OffcnLiveSDKiOS_Example.app"
BlueprintName = "OffcnLiveSDKiOS_Example"
ReferencedContainer = "container:OffcnLiveSDKiOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6003F589195388D20070C39A"
BuildableName = "OffcnLiveSDKiOS_Example.app"
BlueprintName = "OffcnLiveSDKiOS_Example"
ReferencedContainer = "container:OffcnLiveSDKiOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--iOS View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="iOSViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="a21-3W-10n"/>
<viewControllerLayoutGuide type="bottom" id="ItS-Q1-ANW"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入房间口令" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="BUe-hm-JG9">
<rect key="frame" x="15" y="140" width="345" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="XIo-Ka-KqC"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入昵称" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="GT0-B9-RQ5">
<rect key="frame" x="15" y="30" width="345" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="5ga-Si-2Sb"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入uuid" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="60L-bR-OE1">
<rect key="frame" x="15" y="250" width="345" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="2TV-Zs-xuV"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RZ3-2O-Iin">
<rect key="frame" x="77.5" y="370" width="100" height="100"/>
<color key="backgroundColor" red="0.44563790509203638" green="1" blue="0.34767431509271307" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="PJW-8R-CEu"/>
<constraint firstAttribute="width" constant="100" id="Z7O-aI-WiM"/>
</constraints>
<state key="normal" title="直播"/>
<connections>
<action selector="enterRoomAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="L4a-ZS-hvF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pjv-b2-iPq">
<rect key="frame" x="197.5" y="370" width="100" height="100"/>
<color key="backgroundColor" red="0.0" green="0.99143940210000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="GPS-KO-pVF"/>
<constraint firstAttribute="height" constant="100" id="de2-4k-CRZ"/>
</constraints>
<state key="normal" title="回放"/>
<connections>
<action selector="playBackAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="VFm-PL-SgQ"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="RZ3-2O-Iin" firstAttribute="top" secondItem="60L-bR-OE1" secondAttribute="bottom" constant="20" id="3ea-wb-sTD"/>
<constraint firstItem="pjv-b2-iPq" firstAttribute="top" secondItem="60L-bR-OE1" secondAttribute="bottom" constant="20" id="3j3-ay-UaE"/>
<constraint firstItem="GT0-B9-RQ5" firstAttribute="centerX" secondItem="RZ3-2O-Iin" secondAttribute="centerX" constant="60" id="7GD-La-6d4"/>
<constraint firstItem="pjv-b2-iPq" firstAttribute="centerX" secondItem="60L-bR-OE1" secondAttribute="centerX" constant="60" id="FEQ-5I-0Oc"/>
<constraint firstItem="GT0-B9-RQ5" firstAttribute="top" secondItem="a21-3W-10n" secondAttribute="bottom" constant="10" id="GLd-jV-3Ij"/>
<constraint firstItem="60L-bR-OE1" firstAttribute="leading" secondItem="GT0-B9-RQ5" secondAttribute="leading" id="RIJ-u9-xod"/>
<constraint firstItem="GT0-B9-RQ5" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="Vdm-B9-tfL"/>
<constraint firstItem="60L-bR-OE1" firstAttribute="trailing" secondItem="GT0-B9-RQ5" secondAttribute="trailing" id="Zfl-lV-7Ty"/>
<constraint firstAttribute="trailing" secondItem="GT0-B9-RQ5" secondAttribute="trailing" constant="15" id="dgb-T9-FSc"/>
<constraint firstItem="BUe-hm-JG9" firstAttribute="trailing" secondItem="GT0-B9-RQ5" secondAttribute="trailing" id="gyC-Ke-gYg"/>
<constraint firstItem="60L-bR-OE1" firstAttribute="top" secondItem="BUe-hm-JG9" secondAttribute="bottom" constant="10" id="jNK-5a-7bm"/>
<constraint firstItem="BUe-hm-JG9" firstAttribute="leading" secondItem="GT0-B9-RQ5" secondAttribute="leading" id="m0d-Wn-2gU"/>
<constraint firstItem="BUe-hm-JG9" firstAttribute="top" secondItem="GT0-B9-RQ5" secondAttribute="bottom" constant="10" id="yKB-k6-ZZC"/>
</constraints>
</view>
<connections>
<outlet property="enterRoomBtn" destination="RZ3-2O-Iin" id="gCx-HH-LcF"/>
<outlet property="koulingTextField" destination="BUe-hm-JG9" id="Ndw-n1-ZxC"/>
<outlet property="nameTextField" destination="GT0-B9-RQ5" id="yCI-kd-Z2y"/>
<outlet property="playBackBtn" destination="pjv-b2-iPq" id="qcv-Mp-bLO"/>
<outlet property="uuidTextField" destination="60L-bR-OE1" id="dWh-Fl-MSs"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
@import UIKit;
@import Foundation;
#endif
/* Localized versions of Info.plist keys */
//
// iOSAppDelegate.h
// OffcnLiveSDK
//
// Created by zhangyunjie on 07/26/2018.
// Copyright (c) 2018 zhangyunjie. All rights reserved.
//
@import UIKit;
@interface iOSAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
//
// iOSAppDelegate.m
// OffcnLiveSDK
//
// Created by zhangyunjie on 07/26/2018.
// Copyright (c) 2018 zhangyunjie. All rights reserved.
//
#import "iOSAppDelegate.h"
#import "iOSViewController.h"
#import "OffcnLiveSDK.h"
@implementation iOSAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
UINavigationController *mainVC = [[UINavigationController alloc] initWithRootViewController:[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateInitialViewController]];
mainVC.navigationBar.translucent = NO;
self.window.rootViewController = mainVC;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
//中公直播使用测试环境设置为YES,正式环境设置为NO或者去掉这个配置
[OffcnLiveSDK defaultService].isTest = YES;
//上传用户观看视频进度统计数据
[[OffcnLiveSDK defaultService] startNotifierUseRealReachability];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if([OffcnLiveSDK defaultService].isFull){
return UIInterfaceOrientationMaskAllButUpsideDown;
}
return UIInterfaceOrientationMaskPortrait;
}
@end
//
// iOSViewController.h
// OffcnLiveSDK
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface iOSViewController : UIViewController
@end
//
// iOSViewController.m
// OffcnLiveSDK
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
//
#import "iOSViewController.h"
#import "OffcnLiveSDK.h"
@interface iOSViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;
@property (weak, nonatomic) IBOutlet UITextField *koulingTextField;
@property (weak, nonatomic) IBOutlet UITextField *uuidTextField;
@property (weak, nonatomic) IBOutlet UIButton *enterRoomBtn;
@property (weak, nonatomic) IBOutlet UIButton *playBackBtn;
@end
@implementation iOSViewController
#pragma mark - 直播事件
- (IBAction)enterRoomAction:(UIButton *)sender {
[self.view endEditing:YES];
[[OffcnLiveSDK defaultService] authWithNavigationController:self.navigationController VideoType:OffcnVideoTypeBigClassLive jumpMode:OffcnJumpModePush nickname:self.nameTextField.text password:self.koulingTextField.text uuid:self.uuidTextField.text hook:@"123" documentPath:@"123" extensionDic:[NSDictionary dictionaryWithObject:@"123" forKey:@"123"] playbackSeekTime:0];
//更换某个控件颜色
// NSString *colorStr = @"#ff895f";
// [OffcnLiveSDK defaultService].tabNormalColor(colorStr).tabSelectedColor(colorStr).chatBgColor(colorStr).chatNicknameColor(@"#ffffff").inputBgColor(colorStr).roomInfoBgColor(colorStr).roomInfoTitleColor(colorStr).roomOnlineNumColor(colorStr).wbTitleColor(colorStr).liveLabelBgColor(@"#ffffff").liveLabelTitleColor(colorStr);
}
#pragma mark - 回放视频事件
- (IBAction)playBackAction:(UIButton *)sender {
[[OffcnLiveSDK defaultService] authWithNavigationController:self.navigationController VideoType:OffcnVideoTypeBigClassPlayback jumpMode:OffcnJumpModePush nickname:self.nameTextField.text password:self.koulingTextField.text uuid:self.uuidTextField.text hook:@"123" documentPath:@"123" extensionDic:[NSDictionary dictionaryWithObject:@"123" forKey:@"123"] playbackSeekTime:0];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.nameTextField.text = @"杜拉拉";
self.koulingTextField.text = @"nv7jjqr1wsy";
self.uuidTextField.text = [NSString stringWithFormat:@"%d",arc4random_uniform(1000000)];
self.nameTextField.delegate = self;
self.koulingTextField.delegate = self;
self.uuidTextField.delegate = self;
[self.nameTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[self.koulingTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[self.uuidTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
if (self.nameTextField.text.length && self.koulingTextField.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn.enabled = YES;
self.playBackBtn.enabled = YES;
}else{
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
}
}
#pragma mark - UITextField代理
-(void)textFieldDidChange:(UITextField *)textField{
if (self.nameTextField.text.length && self.koulingTextField.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn.enabled = YES;
self.playBackBtn.enabled = YES;
}else{
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
}
}
- (BOOL)textFieldShouldClear:(UITextField *)textField{
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
return YES;
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// main.m
// OffcnLiveSDKiOS
//
// Created by zhangyunjie   on 06/01/2020.
// Copyright (c) 2020 zhangyunjie  . All rights reserved.
//
@import UIKit;
#import "iOSAppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([iOSAppDelegate class]));
}
}
use_frameworks!
platform :ios, '8.0'
target 'OffcnLiveSDKiOS_Example' do
pod 'OffcnLiveSDKiOS', :path => '../'
target 'OffcnLiveSDKiOS_Tests' do
inherit! :search_paths
end
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
// The contents of this file are implicitly included at the beginning of every test case source file.
#ifdef __OBJC__
#endif
//
// OffcnLiveSDKiOSTests.m
// OffcnLiveSDKiOSTests
//
// Created by zhangyunjie   on 06/01/2020.
// Copyright (c) 2020 zhangyunjie  . All rights reserved.
//
@import XCTest;
@interface Tests : XCTestCase
@end
@implementation Tests
- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
@end
/* Localized versions of Info.plist keys */
Copyright (c) 2020 zhangyunjie   <zhangyunjie@offcn.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
#
# Be sure to run `pod lib lint OffcnLiveSDKiOS.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'OffcnLiveSDKiOS'
s.version = '2.5.2.1'
s.summary = 'OffcnLiveSDKiOS.'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://gitlab.eoffcn.com/video/iOSLiveSDK.git'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'zhangyunjie' => 'zhangyunjie@offcn.com' }
s.source = { :git => 'https://gitlab.eoffcn.com/video/iOSLiveSDK.git', :tag => s.version.to_s }
s.requires_arc = true
s.ios.deployment_target = '9.0'
s.source_files = 'OffcnLiveSDKiOS/Classes/*.h'
s.public_header_files = 'OffcnLiveSDKiOS/Classes/*.h'
#vendored_frameworks: 第三方framework
s.vendored_frameworks = ['OffcnLiveSDKiOS/Frameworks/ZGIJKMediaFramework.framework','OffcnLiveSDKiOS/Frameworks/WebRTC.framework']
#frameworks: 该pod依赖的系统framework
s.frameworks = 'CFNetwork', 'CoreFoundation', 'CoreData', 'Foundation', 'AudioToolbox', 'AVFoundation', 'CoreGraphics', 'CoreMedia', 'CoreVideo', 'MediaPlayer', 'MobileCoreServices', 'OpenGLES', 'QuartzCore', 'UIKit', 'VideoToolbox'
s.vendored_libraries = ['OffcnLiveSDKiOS/Libraries/libOffcnLiveSDK.a']
#libraries: 该pod依赖的系统library
s.libraries = 'c++','bz2','z','xml2','sqlite3','xml2'
s.resource = 'OffcnLiveSDKiOS/Resources/*.bundle'
s.user_target_xcconfig = {'OTHER_LDFLAGS' => '-ObjC'}
#dependency : 该pod依赖的pod
end
//
// OffcnDownloadManager.h
// OffcnLiveSDK
//
// Created by vockey on 2019/1/22.
// Copyright © 2019年 中公教育. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, OffcnDownloadState) {
OffcnDownloadStateResume = 0,//开始下载或继续下载
OffcnDownloadStateSuspended,//暂停
OffcnDownloadStateClean,//清除当前的视频
OffcnDownloadStateAllClean,//清除所有的视频
OffcnDownloadStateWaiting,//等待
OffcnDownloadStateProgress,//进度//进行中
OffcnDownloadStateCompleted,//下载完成
OffcnDownloadStateFailed,//下载失败
};
typedef NS_ENUM(NSInteger, OffcnReachabilityStatus) {
OffcnRealStatusUnknown = -1,
OffcnRealStatusNotReachable = 0,
OffcnRealStatusViaWWAN = 1,
OffcnRealStatusViaWiFi = 2
};
@interface OffcnDownloadManagerModel : NSObject
//沙盒所有视频所在路径
@property (nonatomic, copy) NSString *documentPath;
//沙盒每个下载视频路径
@property (nonatomic, copy) NSString *itemPath;
//沙盒每个下载视频m3u8文件路径
@property (nonatomic, copy) NSString *itemM3U8Path;
//沙盒每个下载视频聊天数据库地址
@property (nonatomic, copy) NSString *itemSqlitePath;
//沙盒每个下载视频公告数据库地址
@property (nonatomic, copy) NSString *itemGongGaoSqlitePath;
//口令
@property (nonatomic, copy) NSString *password;
//房间名称
@property (nonatomic, copy) NSString *room_name;
//流地址ts全地址
@property (nonatomic, copy) NSString *flowUrlStr;
//流地址ts序号地址
@property (nonatomic, copy) NSString *flowUrlPartStr;
//接口返回聊天数据库地址
@property (nonatomic, copy) NSString *sqlite;
//接口返回公告数据库地址
@property (nonatomic, copy) NSString *timeAnnounce;
//下载最后的ts片角标
@property (nonatomic, assign) NSInteger index;
//总ts片数据
@property (nonatomic, strong) NSArray *listArr;
//进度
@property (nonatomic, assign) float progress;
//沙盒每个下载完成的视频的本地占用大小
@property (nonatomic, copy) NSString *itemFileSize;
//任务
//@property (nonatomic, strong) NSURLSessionDownloadTask *downloadTask;
//下载状态
@property (nonatomic, assign) OffcnDownloadState downloadState;
//extensionDic 拓展字段
@property (nonatomic, strong) NSDictionary *extensionDic;
//关于鉴权的回调地址
@property (nonatomic, copy) NSString *hook;
//某一个ts片下载失败
@property (nonatomic, assign) NSInteger tsFailedIndex;
@end
@class OffcnDownloadManager;
//下载进度OffcnDownloadStateProgress,完成OffcnDownloadStateCompleted,失败OffcnDownloadStateFailed,暂停OffcnDownloadStateSuspended回调
typedef void(^stateCallBack)(NSString *password,OffcnDownloadState state,OffcnDownloadManager *downloadManager);
//网络监测
typedef void(^reachabilityStatusCallBack)(OffcnReachabilityStatus status);
//下载聊天数据库状态
typedef void(^downloadChatDatabaseCallBack)(BOOL isSuccess, NSError *error);
//下载公告数据库状态
typedef void(^downloadGongGaoDatabaseCallBack)(BOOL isSuccess, NSError *error);
@interface OffcnDownloadManager : NSObject
//队列集合
@property (nonatomic, strong) NSMutableDictionary *blockOperationDic;
//任务集合
@property (nonatomic, strong) NSMutableDictionary *downloadTaskDic;
//沙盒所有视频所在路径
@property (nonatomic, copy) NSString *documentPath;
//实时下载数据
@property (nonatomic, strong) NSMutableDictionary *modelDic;
//下载进度OffcnDownloadStateProgress,完成OffcnDownloadStateCompleted,失败OffcnDownloadStateFailed,暂停OffcnDownloadStateSuspended回调
@property (nonatomic, copy) stateCallBack downloadStateCallBack;
//网络监测到使用手机流量提醒回调
@property (nonatomic, copy) reachabilityStatusCallBack reachabilitystatusCallBack;
//下载聊天数据库状态
@property (nonatomic, copy) downloadChatDatabaseCallBack downloadchatDatabaseCallBack;
//下载公告数据库状态
@property (nonatomic, copy) downloadGongGaoDatabaseCallBack downloadgonggaoDatabaseCallBack;
/**
创建单例
@return 单例
*/
+ (instancetype)sharedInstance;
@property (nonatomic, assign) NSInteger maxOperationCount;
/**
下载
@param password 不同课程的学生口令
@param hook 根据自己需求区分(直播,回放,下载)的鉴权(OffcnDownloadStateResume开始下载或继续下载时传入),非必填
@param documentPath 需要下载的沙盒路径
@param downloadState 操作事件枚举
@param extensionDic 根据自己需求的拓展字段,非必填
*/
- (void)downloadDataWithPassword:(NSString *)password hook:(NSString *)hook documentPath:(NSString *)documentPath downloadState:(OffcnDownloadState)downloadState extensionDic:(NSDictionary *)extensionDic;
/**
在线看回放只下载聊天数据库
@param model model
*/
- (void)downloadChatDatabaseWithModel:(OffcnDownloadManagerModel *)model;
/**
在线看回放只下载公告数据库
@param model model
*/
- (void)downloadGonghGaoDatabaseWithModel:(OffcnDownloadManagerModel *)model;
@end
//
// OffcnLiveSDK.h
// OffcnLiveSDK
//
// Created by vockey on 2018/10/16.
// Copyright © 2018年 中公教育. All rights reserved.
//
#import <UIKit/UIKit.h>
//#import "OffcnShareWindow.h"
static const NSString *OffcnLiveSDKVersion = @"2.5.2.1";
typedef NS_ENUM(NSUInteger, OffcnVideoType) {
OffcnVideoTypeBigClassLive = 1, //大班课直播
OffcnVideoTypeBigClassPlayback, //大班课回放
OffcnVideoTypeSmallClassLive, //小班课直播
OffcnVideoTypeSmallClassPlayback, //小班课回放
};
typedef NS_ENUM(NSUInteger, OffcnJumpMode) {
OffcnJumpModePush = 0,
OffcnJumpModePresent,
};
/**
回放观看进度回调
@param password 课程口令
@param recentlyWatchValue 最近观看的秒数
@param maxWatchValue 最大观看的进度(最大观看的秒数/总时长秒数所得值)
@param totalValue 总时长秒数
*/
typedef void(^playbackCallBack)(NSString *password, NSInteger recentlyWatchValue, CGFloat maxWatchValue, NSInteger totalValue);
@interface OffcnLiveSDK : NSObject
/**
创建直播单例服务
@return 返回单例对象
*/
+ (OffcnLiveSDK *)defaultService;
/**
共享窗口
*/
//@property (nonatomic,strong) OffcnShareWindow *shareWindow;
/**
是否支持全屏
*/
@property (nonatomic, assign) BOOL isFull;
@property (nonatomic, assign) OffcnVideoType videoType;
/**
是否选用测试环境
*/
@property (nonatomic, assign) BOOL isTest;
//回放观看进度回调
@property (nonatomic, copy) playbackCallBack offcnPlaybackCallBack;
/**
使用RealReachability监听网络状态上传用户观看进度统计数据
*/
-(void)startNotifierUseRealReachability;
/**
登录授权
@param navigationController 导航控制器
@param videoType 观看模式是:大班课直播/大班课回放/小班课直播(注:小班课目前只传OffcnVideoTypeSmallClassLive)
@param jumpMode 跳转方式:Push/Present(注:小班课只传OffcnJumpModePresent)
@param nickname 昵称
@param password 不同课程的学生口令
@param uuid 用户唯一标识码
@param hook 根据自己需求区分(直播,回放,下载)的鉴权,非必填
@param documentPath 沙盒所有视频所在路径
@param extensionDic 根据自己需求的拓展字段,非必填
@param seekTime 回放开始的时间,单位:秒,默认从0秒开始,根据需求是否从上次观看记录的位置开始播放,如果没有上次观看记录的位置请传0
*/
-(void)authWithNavigationController:(UINavigationController *)navigationController
VideoType:(OffcnVideoType)videoType
jumpMode:(OffcnJumpMode)jumpMode
nickname:(NSString *)nickname
password:(NSString *)password
uuid:(NSString *)uuid
hook:(NSString *)hook
documentPath:(NSString *)documentPath
extensionDic:(NSDictionary *)extensionDic
playbackSeekTime:(NSTimeInterval)seekTime;
-(void)authWithNavigationController:(UINavigationController *)navigationController
VideoType:(OffcnVideoType)videoType
jumpMode:(OffcnJumpMode)jumpMode
nickname:(NSString *)nickname
password:(NSString *)password
uuid:(NSString *)uuid
hook:(NSString *)hook
documentPath:(NSString *)documentPath
extensionDic:(NSDictionary *)extensionDic;
/**
* resignKeyWindow,并还原到上一次的keyWindow
*/
//- (void)recoverLastKeyWindow;
/**
tab(聊天,提问板,资料)普通颜色
*/
-(OffcnLiveSDK *(^)(NSString *))tabNormalColor;
/**
tab(聊天,提问板,资料)选中颜色
*/
-(OffcnLiveSDK *(^)(NSString *))tabSelectedColor;
/**
聊天区域背景色(默认灰色)
*/
-(OffcnLiveSDK *(^)(NSString *))chatBgColor;
/**
聊天区域用户名颜色
*/
-(OffcnLiveSDK *(^)(NSString *))chatNicknameColor;
/**
发送窗背景色(默认白色)
*/
-(OffcnLiveSDK *(^)(NSString *))inputBgColor;
/**
房间标题区域背景色(默认白色)
*/
-(OffcnLiveSDK *(^)(NSString *))roomInfoBgColor;
/**
房间标题文字颜色
*/
-(OffcnLiveSDK *(^)(NSString *))roomInfoTitleColor;
/**
在线人数颜色
*/
-(OffcnLiveSDK *(^)(NSString *))roomOnlineNumColor;
/**
公众号、微博、QQ群文字颜色
*/
-(OffcnLiveSDK *(^)(NSString *))wbTitleColor;
/**
“直播”标签的背景色
*/
-(OffcnLiveSDK *(^)(NSString *))liveLabelBgColor;
/**
“直播”标签的字体颜色
*/
-(OffcnLiveSDK *(^)(NSString *))liveLabelTitleColor;
@end
/*
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kRTCAudioSessionErrorDomain;
/** Method that requires lock was called without lock. */
extern NSInteger const kRTCAudioSessionErrorLockRequired;
/** Unknown configuration error occurred. */
extern NSInteger const kRTCAudioSessionErrorConfiguration;
@class RTCAudioSession;
@class RTCAudioSessionConfiguration;
// Surfaces AVAudioSession events. WebRTC will listen directly for notifications
// from AVAudioSession and handle them before calling these delegate methods,
// at which point applications can perform additional processing if required.
RTC_OBJC_EXPORT
@protocol RTCAudioSessionDelegate <NSObject>
@optional
/** Called on a system notification thread when AVAudioSession starts an
* interruption event.
*/
- (void)audioSessionDidBeginInterruption:(RTCAudioSession *)session;
/** Called on a system notification thread when AVAudioSession ends an
* interruption event.
*/
- (void)audioSessionDidEndInterruption:(RTCAudioSession *)session
shouldResumeSession:(BOOL)shouldResumeSession;
/** Called on a system notification thread when AVAudioSession changes the
* route.
*/
- (void)audioSessionDidChangeRoute:(RTCAudioSession *)session
reason:(AVAudioSessionRouteChangeReason)reason
previousRoute:(AVAudioSessionRouteDescription *)previousRoute;
/** Called on a system notification thread when AVAudioSession media server
* terminates.
*/
- (void)audioSessionMediaServerTerminated:(RTCAudioSession *)session;
/** Called on a system notification thread when AVAudioSession media server
* restarts.
*/
- (void)audioSessionMediaServerReset:(RTCAudioSession *)session;
// TODO(tkchin): Maybe handle SilenceSecondaryAudioHintNotification.
- (void)audioSession:(RTCAudioSession *)session didChangeCanPlayOrRecord:(BOOL)canPlayOrRecord;
/** Called on a WebRTC thread when the audio device is notified to begin
* playback or recording.
*/
- (void)audioSessionDidStartPlayOrRecord:(RTCAudioSession *)session;
/** Called on a WebRTC thread when the audio device is notified to stop
* playback or recording.
*/
- (void)audioSessionDidStopPlayOrRecord:(RTCAudioSession *)session;
/** Called when the AVAudioSession output volume value changes. */
- (void)audioSession:(RTCAudioSession *)audioSession didChangeOutputVolume:(float)outputVolume;
/** Called when the audio device detects a playout glitch. The argument is the
* number of glitches detected so far in the current audio playout session.
*/
- (void)audioSession:(RTCAudioSession *)audioSession
didDetectPlayoutGlitch:(int64_t)totalNumberOfGlitches;
/** Called when the audio session is about to change the active state.
*/
- (void)audioSession:(RTCAudioSession *)audioSession willSetActive:(BOOL)active;
/** Called after the audio session sucessfully changed the active state.
*/
- (void)audioSession:(RTCAudioSession *)audioSession didSetActive:(BOOL)active;
/** Called after the audio session failed to change the active state.
*/
- (void)audioSession:(RTCAudioSession *)audioSession
failedToSetActive:(BOOL)active
error:(NSError *)error;
@end
/** This is a protocol used to inform RTCAudioSession when the audio session
* activation state has changed outside of RTCAudioSession. The current known use
* case of this is when CallKit activates the audio session for the application
*/
RTC_OBJC_EXPORT
@protocol RTCAudioSessionActivationDelegate <NSObject>
/** Called when the audio session is activated outside of the app by iOS. */
- (void)audioSessionDidActivate:(AVAudioSession *)session;
/** Called when the audio session is deactivated outside of the app by iOS. */
- (void)audioSessionDidDeactivate:(AVAudioSession *)session;
@end
/** Proxy class for AVAudioSession that adds a locking mechanism similar to
* AVCaptureDevice. This is used to that interleaving configurations between
* WebRTC and the application layer are avoided.
*
* RTCAudioSession also coordinates activation so that the audio session is
* activated only once. See |setActive:error:|.
*/
RTC_OBJC_EXPORT
@interface RTCAudioSession : NSObject <RTCAudioSessionActivationDelegate>
/** Convenience property to access the AVAudioSession singleton. Callers should
* not call setters on AVAudioSession directly, but other method invocations
* are fine.
*/
@property(nonatomic, readonly) AVAudioSession *session;
/** Our best guess at whether the session is active based on results of calls to
* AVAudioSession.
*/
@property(nonatomic, readonly) BOOL isActive;
/** Whether RTCAudioSession is currently locked for configuration. */
@property(nonatomic, readonly) BOOL isLocked;
/** If YES, WebRTC will not initialize the audio unit automatically when an
* audio track is ready for playout or recording. Instead, applications should
* call setIsAudioEnabled. If NO, WebRTC will initialize the audio unit
* as soon as an audio track is ready for playout or recording.
*/
@property(nonatomic, assign) BOOL useManualAudio;
/** This property is only effective if useManualAudio is YES.
* Represents permission for WebRTC to initialize the VoIP audio unit.
* When set to NO, if the VoIP audio unit used by WebRTC is active, it will be
* stopped and uninitialized. This will stop incoming and outgoing audio.
* When set to YES, WebRTC will initialize and start the audio unit when it is
* needed (e.g. due to establishing an audio connection).
* This property was introduced to work around an issue where if an AVPlayer is
* playing audio while the VoIP audio unit is initialized, its audio would be
* either cut off completely or played at a reduced volume. By preventing
* the audio unit from being initialized until after the audio has completed,
* we are able to prevent the abrupt cutoff.
*/
@property(nonatomic, assign) BOOL isAudioEnabled;
// Proxy properties.
@property(readonly) NSString *category;
@property(readonly) AVAudioSessionCategoryOptions categoryOptions;
@property(readonly) NSString *mode;
@property(readonly) BOOL secondaryAudioShouldBeSilencedHint;
@property(readonly) AVAudioSessionRouteDescription *currentRoute;
@property(readonly) NSInteger maximumInputNumberOfChannels;
@property(readonly) NSInteger maximumOutputNumberOfChannels;
@property(readonly) float inputGain;
@property(readonly) BOOL inputGainSettable;
@property(readonly) BOOL inputAvailable;
@property(readonly, nullable) NSArray<AVAudioSessionDataSourceDescription *> *inputDataSources;
@property(readonly, nullable) AVAudioSessionDataSourceDescription *inputDataSource;
@property(readonly, nullable) NSArray<AVAudioSessionDataSourceDescription *> *outputDataSources;
@property(readonly, nullable) AVAudioSessionDataSourceDescription *outputDataSource;
@property(readonly) double sampleRate;
@property(readonly) double preferredSampleRate;
@property(readonly) NSInteger inputNumberOfChannels;
@property(readonly) NSInteger outputNumberOfChannels;
@property(readonly) float outputVolume;
@property(readonly) NSTimeInterval inputLatency;
@property(readonly) NSTimeInterval outputLatency;
@property(readonly) NSTimeInterval IOBufferDuration;
@property(readonly) NSTimeInterval preferredIOBufferDuration;
/** Default constructor. */
+ (instancetype)sharedInstance;
- (instancetype)init NS_UNAVAILABLE;
/** Adds a delegate, which is held weakly. */
- (void)addDelegate:(id<RTCAudioSessionDelegate>)delegate;
/** Removes an added delegate. */
- (void)removeDelegate:(id<RTCAudioSessionDelegate>)delegate;
/** Request exclusive access to the audio session for configuration. This call
* will block if the lock is held by another object.
*/
- (void)lockForConfiguration;
/** Relinquishes exclusive access to the audio session. */
- (void)unlockForConfiguration;
/** If |active|, activates the audio session if it isn't already active.
* Successful calls must be balanced with a setActive:NO when activation is no
* longer required. If not |active|, deactivates the audio session if one is
* active and this is the last balanced call. When deactivating, the
* AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation option is passed to
* AVAudioSession.
*/
- (BOOL)setActive:(BOOL)active error:(NSError **)outError;
// The following methods are proxies for the associated methods on
// AVAudioSession. |lockForConfiguration| must be called before using them
// otherwise they will fail with kRTCAudioSessionErrorLockRequired.
- (BOOL)setCategory:(NSString *)category
withOptions:(AVAudioSessionCategoryOptions)options
error:(NSError **)outError;
- (BOOL)setMode:(NSString *)mode error:(NSError **)outError;
- (BOOL)setInputGain:(float)gain error:(NSError **)outError;
- (BOOL)setPreferredSampleRate:(double)sampleRate error:(NSError **)outError;
- (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError **)outError;
- (BOOL)setPreferredInputNumberOfChannels:(NSInteger)count error:(NSError **)outError;
- (BOOL)setPreferredOutputNumberOfChannels:(NSInteger)count error:(NSError **)outError;
- (BOOL)overrideOutputAudioPort:(AVAudioSessionPortOverride)portOverride error:(NSError **)outError;
- (BOOL)setPreferredInput:(AVAudioSessionPortDescription *)inPort error:(NSError **)outError;
- (BOOL)setInputDataSource:(AVAudioSessionDataSourceDescription *)dataSource
error:(NSError **)outError;
- (BOOL)setOutputDataSource:(AVAudioSessionDataSourceDescription *)dataSource
error:(NSError **)outError;
@end
@interface RTCAudioSession (Configuration)
/** Applies the configuration to the current session. Attempts to set all
* properties even if previous ones fail. Only the last error will be
* returned.
* |lockForConfiguration| must be called first.
*/
- (BOOL)setConfiguration:(RTCAudioSessionConfiguration *)configuration error:(NSError **)outError;
/** Convenience method that calls both setConfiguration and setActive.
* |lockForConfiguration| must be called first.
*/
- (BOOL)setConfiguration:(RTCAudioSessionConfiguration *)configuration
active:(BOOL)active
error:(NSError **)outError;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_EXTERN const int kRTCAudioSessionPreferredNumberOfChannels;
RTC_EXTERN const double kRTCAudioSessionHighPerformanceSampleRate;
RTC_EXTERN const double kRTCAudioSessionLowComplexitySampleRate;
RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration;
RTC_EXTERN const double kRTCAudioSessionLowComplexityIOBufferDuration;
// Struct to hold configuration values.
RTC_OBJC_EXPORT
@interface RTCAudioSessionConfiguration : NSObject
@property(nonatomic, strong) NSString *category;
@property(nonatomic, assign) AVAudioSessionCategoryOptions categoryOptions;
@property(nonatomic, strong) NSString *mode;
@property(nonatomic, assign) double sampleRate;
@property(nonatomic, assign) NSTimeInterval ioBufferDuration;
@property(nonatomic, assign) NSInteger inputNumberOfChannels;
@property(nonatomic, assign) NSInteger outputNumberOfChannels;
/** Initializes configuration to defaults. */
- (instancetype)init NS_DESIGNATED_INITIALIZER;
/** Returns the current configuration of the audio session. */
+ (instancetype)currentConfiguration;
/** Returns the configuration that WebRTC needs. */
+ (instancetype)webRTCConfiguration;
/** Provide a way to override the default configuration. */
+ (void)setWebRTCConfiguration:(RTCAudioSessionConfiguration *)configuration;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import "RTCMacros.h"
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol RTCAudioSinkDelegate <NSObject>
@optional
- (void)onVolume:(NSString*)handleID sinkVolume:(unsigned short)volume;
@end
@interface RTCAudioSink : NSObject
//@property (readwrite, nonatomic) unsigned short sinkVolume;
-(void)setVolume:(unsigned short)volume;
@property(nonatomic, weak) id<RTCAudioSinkDelegate> delegate;
@property (readwrite, nonatomic) NSString* handleID;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCMediaSource.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCAudioSource : RTCMediaSource
- (instancetype)init NS_UNAVAILABLE;
// Sets the volume for the RTCMediaSource. |volume| is a gain value in the range
// [0, 10].
// Temporary fix to be able to modify volume of remote audio tracks.
// TODO(kthelgason): Property stays here temporarily until a proper volume-api
// is available on the surface exposed by webrtc.
@property(nonatomic, assign) double volume;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import "RTCMacros.h"
#import "RTCMediaStreamTrack.h"
#import "RTCAudioSink.h"
NS_ASSUME_NONNULL_BEGIN
@class RTCAudioSource;
@class RTCAudioSink;
RTC_OBJC_EXPORT
@interface RTCAudioTrack : RTCMediaStreamTrack
- (instancetype)init NS_UNAVAILABLE;
/** The audio source for this audio track. */
@property(nonatomic, readonly) RTCAudioSource *source;
- (void)addAudioSink:(RTCAudioSink*) audioSink;
- (void)removeAudioSink;
- (void)setVolume:(double)volume;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCMacros.h"
#import "RTCVideoFrameBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** RTCVideoFrameBuffer containing a CVPixelBufferRef */
RTC_OBJC_EXPORT
@interface RTCCVPixelBuffer : NSObject <RTCVideoFrameBuffer>
@property(nonatomic, readonly) CVPixelBufferRef pixelBuffer;
@property(nonatomic, readonly) int cropX;
@property(nonatomic, readonly) int cropY;
@property(nonatomic, readonly) int cropWidth;
@property(nonatomic, readonly) int cropHeight;
+ (NSSet<NSNumber *> *)supportedPixelFormats;
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer;
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
adaptedWidth:(int)adaptedWidth
adaptedHeight:(int)adaptedHeight
cropWidth:(int)cropWidth
cropHeight:(int)cropHeight
cropX:(int)cropX
cropY:(int)cropY;
- (BOOL)requiresCropping;
- (BOOL)requiresScalingToWidth:(int)width height:(int)height;
- (int)bufferSizeForCroppingAndScalingToWidth:(int)width height:(int)height;
/** The minimum size of the |tmpBuffer| must be the number of bytes returned from the
* bufferSizeForCroppingAndScalingToWidth:height: method.
* If that size is 0, the |tmpBuffer| may be nil.
*/
- (BOOL)cropAndScaleTo:(CVPixelBufferRef)outputPixelBuffer
withTempBuffer:(nullable uint8_t *)tmpBuffer;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCLogging.h"
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
// This class intercepts WebRTC logs and forwards them to a registered block.
// This class is not threadsafe.
RTC_OBJC_EXPORT
@interface RTCCallbackLogger : NSObject
// The severity level to capture. The default is kRTCLoggingSeverityInfo.
@property(nonatomic, assign) RTCLoggingSeverity severity;
// The callback will be called on the same thread that does the logging, so
// if the logging callback can be slow it may be a good idea to implement
// dispatching to some other queue.
- (void)start:(nullable void (^)(NSString*))callback;
- (void)stop;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "RTCMacros.h"
@class AVCaptureSession;
/** RTCCameraPreviewView is a view that renders local video from an
* AVCaptureSession.
*/
RTC_OBJC_EXPORT
@interface RTCCameraPreviewView : UIView
/** The capture session being rendered in the view. Capture session
* is assigned to AVCaptureVideoPreviewLayer async in the same
* queue that the AVCaptureSession is started/stopped.
*/
@property(nonatomic, strong) AVCaptureSession* captureSession;
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoCapturer.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
// Camera capture that implements RTCVideoCapturer. Delivers frames to a RTCVideoCapturerDelegate
// (usually RTCVideoSource).
NS_EXTENSION_UNAVAILABLE_IOS("Camera not available in app extensions.")
@protocol RtcCameraDelegate <NSObject>
- (void)onCaptureError;
@end
@interface RTCCameraVideoCapturer : RTCVideoCapturer
// Capture session that is used for capturing. Valid from initialization to dealloc.
@property(readonly, nonatomic) AVCaptureSession *captureSession;
@property(nonatomic, weak) id<RtcCameraDelegate> cameraDelegate;
// Returns list of available capture devices that support video capture.
+ (NSArray<AVCaptureDevice *> *)captureDevices;
// Returns list of formats that are supported by this class for this device.
+ (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:(AVCaptureDevice *)device;
// Returns the most efficient supported output pixel format for this capturer.
- (FourCharCode)preferredOutputPixelFormat;
// Starts the capture session asynchronously and notifies callback on completion.
// The device will capture video in the format given in the `format` parameter. If the pixel format
// in `format` is supported by the WebRTC pipeline, the same pixel format will be used for the
// output. Otherwise, the format returned by `preferredOutputPixelFormat` will be used.
- (void)startCaptureWithDevice:(AVCaptureDevice *)device
format:(AVCaptureDeviceFormat *)format
fps:(NSInteger)fps
completionHandler:(nullable void (^)(NSError *))completionHandler;
// Stops the capture session asynchronously and notifies callback on completion.
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler;
// Starts the capture session asynchronously.
- (void)startCaptureWithDevice:(AVCaptureDevice *)device
format:(AVCaptureDeviceFormat *)format
fps:(NSInteger)fps;
// Stops the capture session asynchronously.
- (void)stopCapture;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCCertificate : NSObject <NSCopying>
/** Private key in PEM. */
@property(nonatomic, readonly, copy) NSString *private_key;
/** Public key in an x509 cert encoded in PEM. */
@property(nonatomic, readonly, copy) NSString *certificate;
/**
* Initialize an RTCCertificate with PEM strings for private_key and certificate.
*/
- (instancetype)initWithPrivateKey:(NSString *)private_key
certificate:(NSString *)certificate NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
/** Generate a new certificate for 're' use.
*
* Optional dictionary of parameters. Defaults to KeyType ECDSA if none are
* provided.
* - name: "ECDSA" or "RSASSA-PKCS1-v1_5"
*/
+ (nullable RTCCertificate *)generateCertificateWithParams:(NSDictionary *)params;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** Implement this protocol to pass codec specific info from the encoder.
* Corresponds to webrtc::CodecSpecificInfo.
*/
RTC_OBJC_EXPORT
@protocol RTCCodecSpecificInfo <NSObject>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCCodecSpecificInfo.h"
#import "RTCMacros.h"
/** Class for H264 specific config. */
typedef NS_ENUM(NSUInteger, RTCH264PacketizationMode) {
RTCH264PacketizationModeNonInterleaved = 0, // Mode 1 - STAP-A, FU-A is allowed
RTCH264PacketizationModeSingleNalUnit // Mode 0 - only single NALU allowed
};
RTC_OBJC_EXPORT
@interface RTCCodecSpecificInfoH264 : NSObject <RTCCodecSpecificInfo>
@property(nonatomic, assign) RTCH264PacketizationMode packetizationMode;
@end
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCCertificate.h"
#import "RTCCryptoOptions.h"
#import "RTCMacros.h"
@class RTCIceServer;
@class RTCIntervalRange;
/**
* Represents the ice transport policy. This exposes the same states in C++,
* which include one more state than what exists in the W3C spec.
*/
typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) {
RTCIceTransportPolicyNone,
RTCIceTransportPolicyRelay,
RTCIceTransportPolicyNoHost,
RTCIceTransportPolicyAll
};
/** Represents the bundle policy. */
typedef NS_ENUM(NSInteger, RTCBundlePolicy) {
RTCBundlePolicyBalanced,
RTCBundlePolicyMaxCompat,
RTCBundlePolicyMaxBundle
};
/** Represents the rtcp mux policy. */
typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) { RTCRtcpMuxPolicyNegotiate, RTCRtcpMuxPolicyRequire };
/** Represents the tcp candidate policy. */
typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
RTCTcpCandidatePolicyEnabled,
RTCTcpCandidatePolicyDisabled
};
/** Represents the candidate network policy. */
typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) {
RTCCandidateNetworkPolicyAll,
RTCCandidateNetworkPolicyLowCost
};
/** Represents the continual gathering policy. */
typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
RTCContinualGatheringPolicyGatherOnce,
RTCContinualGatheringPolicyGatherContinually
};
/** Represents the encryption key type. */
typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
RTCEncryptionKeyTypeRSA,
RTCEncryptionKeyTypeECDSA,
};
/** Represents the chosen SDP semantics for the RTCPeerConnection. */
typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
RTCSdpSemanticsPlanB,
RTCSdpSemanticsUnifiedPlan,
};
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCConfiguration : NSObject
/** An array of Ice Servers available to be used by ICE. */
@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
/** An RTCCertificate for 're' use. */
@property(nonatomic, nullable) RTCCertificate *certificate;
/** Which candidates the ICE agent is allowed to use. The W3C calls it
* |iceTransportPolicy|, while in C++ it is called |type|. */
@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;
/** The media-bundling policy to use when gathering ICE candidates. */
@property(nonatomic, assign) RTCBundlePolicy bundlePolicy;
/** The rtcp-mux policy to use when gathering ICE candidates. */
@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
@property(nonatomic, assign) RTCContinualGatheringPolicy continualGatheringPolicy;
/** By default, the PeerConnection will use a limited number of IPv6 network
* interfaces, in order to avoid too many ICE candidate pairs being created
* and delaying ICE completion.
*
* Can be set to INT_MAX to effectively disable the limit.
*/
@property(nonatomic, assign) int maxIPv6Networks;
/** Exclude link-local network interfaces
* from considertaion for gathering ICE candidates.
* Defaults to NO.
*/
@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
@property(nonatomic, assign) int audioJitterBufferMaxPackets;
@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
@property(nonatomic, assign) int iceConnectionReceivingTimeout;
@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
/** Key type used to generate SSL identity. Default is ECDSA. */
@property(nonatomic, assign) RTCEncryptionKeyType keyType;
/** ICE candidate pool size as defined in JSEP. Default is 0. */
@property(nonatomic, assign) int iceCandidatePoolSize;
/** Prune turn ports on the same network to the same turn server.
* Default is NO.
*/
@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
/** If set to YES, this means the ICE transport should presume TURN-to-TURN
* candidate pairs will succeed, even before a binding response is received.
*/
@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
/** If set to non-nil, controls the minimal interval between consecutive ICE
* check packets.
*/
@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
/** ICE Periodic Regathering
* If set, WebRTC will periodically create and propose candidates without
* starting a new ICE generation. The regathering happens continuously with
* interval specified in milliseconds by the uniform distribution [a, b].
*/
@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
/** Configure the SDP semantics used by this PeerConnection. Note that the
* WebRTC 1.0 specification requires UnifiedPlan semantics. The
* RTCRtpTransceiver API is only available with UnifiedPlan semantics.
*
* PlanB will cause RTCPeerConnection to create offers and answers with at
* most one audio and one video m= section with multiple RTCRtpSenders and
* RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
* will also cause RTCPeerConnection to ignore all but the first m= section of
* the same media type.
*
* UnifiedPlan will cause RTCPeerConnection to create offers and answers with
* multiple m= sections where each m= section maps to one RTCRtpSender and one
* RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
* will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
* that form a Plan B stream.
*
* For users who wish to send multiple audio/video streams and need to stay
* interoperable with legacy WebRTC implementations or use legacy APIs,
* specify PlanB.
*
* For all other users, specify UnifiedPlan.
*/
@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
/** Actively reset the SRTP parameters when the DTLS transports underneath are
* changed after offer/answer negotiation. This is only intended to be a
* workaround for crbug.com/835958
*/
@property(nonatomic, assign) BOOL activeResetSrtpParams;
/**
* If MediaTransportFactory is provided in PeerConnectionFactory, this flag informs PeerConnection
* that it should use the MediaTransportInterface.
*/
@property(nonatomic, assign) BOOL useMediaTransport;
/**
* Defines advanced optional cryptographic settings related to SRTP and
* frame encryption for native WebRTC. Setting this will overwrite any
* options set through the PeerConnectionFactory (which is deprecated).
*/
@property(nonatomic, nullable) RTCCryptoOptions *cryptoOptions;
- (instancetype)init;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Objective-C bindings for webrtc::CryptoOptions. This API had to be flattened
* as Objective-C doesn't support nested structures.
*/
RTC_OBJC_EXPORT
@interface RTCCryptoOptions : NSObject
/**
* Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used
* if both sides enable it
*/
@property(nonatomic, assign) BOOL srtpEnableGcmCryptoSuites;
/**
* If set to true, the (potentially insecure) crypto cipher
* SRTP_AES128_CM_SHA1_32 will be included in the list of supported ciphers
* during negotiation. It will only be used if both peers support it and no
* other ciphers get preferred.
*/
@property(nonatomic, assign) BOOL srtpEnableAes128Sha1_32CryptoCipher;
/**
* If set to true, encrypted RTP header extensions as defined in RFC 6904
* will be negotiated. They will only be used if both peers support them.
*/
@property(nonatomic, assign) BOOL srtpEnableEncryptedRtpHeaderExtensions;
/**
* If set all RtpSenders must have an FrameEncryptor attached to them before
* they are allowed to send packets. All RtpReceivers must have a
* FrameDecryptor attached to them before they are able to receive packets.
*/
@property(nonatomic, assign) BOOL sframeRequireFrameEncryption;
/**
* Initializes CryptoOptions with all possible options set explicitly. This
* is done when converting from a native RTCConfiguration.crypto_options.
*/
- (instancetype)initWithSrtpEnableGcmCryptoSuites:(BOOL)srtpEnableGcmCryptoSuites
srtpEnableAes128Sha1_32CryptoCipher:(BOOL)srtpEnableAes128Sha1_32CryptoCipher
srtpEnableEncryptedRtpHeaderExtensions:(BOOL)srtpEnableEncryptedRtpHeaderExtensions
sframeRequireFrameEncryption:(BOOL)sframeRequireFrameEncryption
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AvailabilityMacros.h>
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCDataBuffer : NSObject
/** NSData representation of the underlying buffer. */
@property(nonatomic, readonly) NSData *data;
/** Indicates whether |data| contains UTF-8 or binary data. */
@property(nonatomic, readonly) BOOL isBinary;
- (instancetype)init NS_UNAVAILABLE;
/**
* Initialize an RTCDataBuffer from NSData. |isBinary| indicates whether |data|
* contains UTF-8 or binary data.
*/
- (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary;
@end
@class RTCDataChannel;
RTC_OBJC_EXPORT
@protocol RTCDataChannelDelegate <NSObject>
/** The data channel state changed. */
- (void)dataChannelDidChangeState:(RTCDataChannel *)dataChannel;
/** The data channel successfully received a data buffer. */
- (void)dataChannel:(RTCDataChannel *)dataChannel
didReceiveMessageWithBuffer:(RTCDataBuffer *)buffer;
@optional
/** The data channel's |bufferedAmount| changed. */
- (void)dataChannel:(RTCDataChannel *)dataChannel didChangeBufferedAmount:(uint64_t)amount;
@end
/** Represents the state of the data channel. */
typedef NS_ENUM(NSInteger, RTCDataChannelState) {
RTCDataChannelStateConnecting,
RTCDataChannelStateOpen,
RTCDataChannelStateClosing,
RTCDataChannelStateClosed,
};
RTC_OBJC_EXPORT
@interface RTCDataChannel : NSObject
/**
* A label that can be used to distinguish this data channel from other data
* channel objects.
*/
@property(nonatomic, readonly) NSString *label;
/** Whether the data channel can send messages in unreliable mode. */
@property(nonatomic, readonly) BOOL isReliable DEPRECATED_ATTRIBUTE;
/** Returns whether this data channel is ordered or not. */
@property(nonatomic, readonly) BOOL isOrdered;
/** Deprecated. Use maxPacketLifeTime. */
@property(nonatomic, readonly) NSUInteger maxRetransmitTime DEPRECATED_ATTRIBUTE;
/**
* The length of the time window (in milliseconds) during which transmissions
* and retransmissions may occur in unreliable mode.
*/
@property(nonatomic, readonly) uint16_t maxPacketLifeTime;
/**
* The maximum number of retransmissions that are attempted in unreliable mode.
*/
@property(nonatomic, readonly) uint16_t maxRetransmits;
/**
* The name of the sub-protocol used with this data channel, if any. Otherwise
* this returns an empty string.
*/
@property(nonatomic, readonly) NSString *protocol;
/**
* Returns whether this data channel was negotiated by the application or not.
*/
@property(nonatomic, readonly) BOOL isNegotiated;
/** Deprecated. Use channelId. */
@property(nonatomic, readonly) NSInteger streamId DEPRECATED_ATTRIBUTE;
/** The identifier for this data channel. */
@property(nonatomic, readonly) int channelId;
/** The state of the data channel. */
@property(nonatomic, readonly) RTCDataChannelState readyState;
/**
* The number of bytes of application data that have been queued using
* |sendData:| but that have not yet been transmitted to the network.
*/
@property(nonatomic, readonly) uint64_t bufferedAmount;
/** The delegate for this data channel. */
@property(nonatomic, weak) id<RTCDataChannelDelegate> delegate;
- (instancetype)init NS_UNAVAILABLE;
/** Closes the data channel. */
- (void)close;
/** Attempt to send |data| on this data channel's underlying data transport. */
- (BOOL)sendData:(RTCDataBuffer *)data;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AvailabilityMacros.h>
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCDataChannelConfiguration : NSObject
/** Set to YES if ordered delivery is required. */
@property(nonatomic, assign) BOOL isOrdered;
/** Deprecated. Use maxPacketLifeTime. */
@property(nonatomic, assign) NSInteger maxRetransmitTimeMs DEPRECATED_ATTRIBUTE;
/**
* Max period in milliseconds in which retransmissions will be sent. After this
* time, no more retransmissions will be sent. -1 if unset.
*/
@property(nonatomic, assign) int maxPacketLifeTime;
/** The max number of retransmissions. -1 if unset. */
@property(nonatomic, assign) int maxRetransmits;
/** Set to YES if the channel has been externally negotiated and we do not send
* an in-band signalling in the form of an "open" message.
*/
@property(nonatomic, assign) BOOL isNegotiated;
/** Deprecated. Use channelId. */
@property(nonatomic, assign) int streamId DEPRECATED_ATTRIBUTE;
/** The id of the data channel. */
@property(nonatomic, assign) int channelId;
/** Set by the application and opaque to the WebRTC implementation. */
@property(nonatomic) NSString* protocol;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoDecoderFactory.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, H264DecoderType) {
DECODER_VIDEOTOOLBOX,
DECODER_FFMPEG
};
/** This decoder factory include support for all codecs bundled with WebRTC. If using custom
* codecs, create custom implementations of RTCVideoEncoderFactory and RTCVideoDecoderFactory.
*/
RTC_OBJC_EXPORT
@interface RTCDefaultVideoDecoderFactory : NSObject <RTCVideoDecoderFactory>
@property(readwrite, nonatomic) H264DecoderType decoderType;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoEncoderFactory.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, H264EncoderType) {
ENCODER_VIDEOTOOLBOX,
ENCODER_OPENH264
};
/** This encoder factory include support for all codecs bundled with WebRTC. If using custom
* codecs, create custom implementations of RTCVideoEncoderFactory and RTCVideoDecoderFactory.
*/
RTC_OBJC_EXPORT
@interface RTCDefaultVideoEncoderFactory : NSObject <RTCVideoEncoderFactory>
@property(nonatomic, retain) RTCVideoCodecInfo *preferredCodec;
@property(readwrite, nonatomic) H264EncoderType encoderType;
+ (NSArray<RTCVideoCodecInfo *> *)supportedCodecs;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
typedef NS_ENUM(NSInteger, RTCDispatcherQueueType) {
// Main dispatcher queue.
RTCDispatcherTypeMain,
// Used for starting/stopping AVCaptureSession, and assigning
// capture session to AVCaptureVideoPreviewLayer.
RTCDispatcherTypeCaptureSession,
// Used for operations on AVAudioSession.
RTCDispatcherTypeAudioSession,
};
/** Dispatcher that asynchronously dispatches blocks to a specific
* shared dispatch queue.
*/
RTC_OBJC_EXPORT
@interface RTCDispatcher : NSObject
- (instancetype)init NS_UNAVAILABLE;
/** Dispatch the block asynchronously on the queue for dispatchType.
* @param dispatchType The queue type to dispatch on.
* @param block The block to dispatch asynchronously.
*/
+ (void)dispatchAsyncOnType:(RTCDispatcherQueueType)dispatchType block:(dispatch_block_t)block;
/** Returns YES if run on queue for the dispatchType otherwise NO.
* Useful for asserting that a method is run on a correct queue.
*/
+ (BOOL)isOnQueueForType:(RTCDispatcherQueueType)dispatchType;
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@protocol RTCDtmfSender <NSObject>
/**
* Returns true if this RTCDtmfSender is capable of sending DTMF. Otherwise
* returns false. To be able to send DTMF, the associated RTCRtpSender must be
* able to send packets, and a "telephone-event" codec must be negotiated.
*/
@property(nonatomic, readonly) BOOL canInsertDtmf;
/**
* Queues a task that sends the DTMF tones. The tones parameter is treated
* as a series of characters. The characters 0 through 9, A through D, #, and *
* generate the associated DTMF tones. The characters a to d are equivalent
* to A to D. The character ',' indicates a delay of 2 seconds before
* processing the next character in the tones parameter.
*
* Unrecognized characters are ignored.
*
* @param duration The parameter indicates the duration to use for each
* character passed in the tones parameter. The duration cannot be more
* than 6000 or less than 70 ms.
*
* @param interToneGap The parameter indicates the gap between tones.
* This parameter must be at least 50 ms but should be as short as
* possible.
*
* If InsertDtmf is called on the same object while an existing task for this
* object to generate DTMF is still running, the previous task is canceled.
* Returns true on success and false on failure.
*/
- (BOOL)insertDtmf:(nonnull NSString *)tones
duration:(NSTimeInterval)duration
interToneGap:(NSTimeInterval)interToneGap;
/** The tones remaining to be played out */
- (nonnull NSString *)remainingTones;
/**
* The current tone duration value. This value will be the value last set via the
* insertDtmf method, or the default value of 100 ms if insertDtmf was never called.
*/
- (NSTimeInterval)duration;
/**
* The current value of the between-tone gap. This value will be the value last set
* via the insertDtmf() method, or the default value of 50 ms if insertDtmf() was never
* called.
*/
- (NSTimeInterval)interToneGap;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "RTCMacros.h"
#import "RTCVideoRenderer.h"
#import "RTCVideoViewShading.h"
NS_ASSUME_NONNULL_BEGIN
@class RTCEAGLVideoView;
/**
* RTCEAGLVideoView is an RTCVideoRenderer which renders video frames in its
* bounds using OpenGLES 2.0 or OpenGLES 3.0.
*/
RTC_OBJC_EXPORT
NS_EXTENSION_UNAVAILABLE_IOS("Rendering not available in app extensions.")
@interface RTCEAGLVideoView : UIView <RTCVideoRenderer>
@property(nonatomic, weak) id<RTCVideoViewDelegate> delegate;
@property (readwrite, nonatomic) NSString *handleId;
@property (readwrite, nonatomic) RenderMode renderMode;
@property (readwrite, nonatomic) int frameRate;
- (instancetype)initWithFrame:(CGRect)frame
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)aDecoder
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoFrame.h"
NS_ASSUME_NONNULL_BEGIN
/** Represents an encoded frame's type. */
typedef NS_ENUM(NSUInteger, RTCFrameType) {
RTCFrameTypeEmptyFrame = 0,
RTCFrameTypeAudioFrameSpeech = 1,
RTCFrameTypeAudioFrameCN = 2,
RTCFrameTypeVideoFrameKey = 3,
RTCFrameTypeVideoFrameDelta = 4,
};
typedef NS_ENUM(NSUInteger, RTCVideoContentType) {
RTCVideoContentTypeUnspecified,
RTCVideoContentTypeScreenshare,
};
/** Represents an encoded frame. Corresponds to webrtc::EncodedImage. */
RTC_OBJC_EXPORT
@interface RTCEncodedImage : NSObject
@property(nonatomic, strong) NSData *buffer;
@property(nonatomic, assign) int32_t encodedWidth;
@property(nonatomic, assign) int32_t encodedHeight;
@property(nonatomic, assign) uint32_t timeStamp;
@property(nonatomic, assign) int64_t captureTimeMs;
@property(nonatomic, assign) int64_t ntpTimeMs;
@property(nonatomic, assign) uint8_t flags;
@property(nonatomic, assign) int64_t encodeStartMs;
@property(nonatomic, assign) int64_t encodeFinishMs;
@property(nonatomic, assign) RTCFrameType frameType;
@property(nonatomic, assign) RTCVideoRotation rotation;
@property(nonatomic, assign) BOOL completeFrame;
@property(nonatomic, strong) NSNumber *qp;
@property(nonatomic, assign) RTCVideoContentType contentType;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
/** The only valid value for the following if set is kRTCFieldTrialEnabledValue. */
RTC_EXTERN NSString * const kRTCFieldTrialAudioSendSideBweKey;
RTC_EXTERN NSString * const kRTCFieldTrialAudioSendSideBweForVideoKey;
RTC_EXTERN NSString * const kRTCFieldTrialAudioForceNoTWCCKey;
RTC_EXTERN NSString * const kRTCFieldTrialAudioForceABWENoTWCCKey;
RTC_EXTERN NSString * const kRTCFieldTrialSendSideBweWithOverheadKey;
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03AdvertisedKey;
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03Key;
RTC_EXTERN NSString * const kRTCFieldTrialImprovedBitrateEstimateKey;
RTC_EXTERN NSString * const kRTCFieldTrialH264HighProfileKey;
RTC_EXTERN NSString * const kRTCFieldTrialMinimizeResamplingOnMobileKey;
/** The valid value for field trials above. */
RTC_EXTERN NSString * const kRTCFieldTrialEnabledValue;
/** Use a string returned by RTCFieldTrialMedianSlopeFilterValue as the value. */
RTC_EXTERN NSString * const kRTCFieldTrialMedianSlopeFilterKey;
RTC_EXTERN NSString *RTCFieldTrialMedianSlopeFilterValue(
size_t windowSize, double thresholdGain);
/** Use a string returned by RTCFieldTrialTrendlineFilterValue as the value. */
RTC_EXTERN NSString * const kRTCFieldTrialTrendlineFilterKey;
/** Returns a valid value for kRTCFieldTrialTrendlineFilterKey. */
RTC_EXTERN NSString *RTCFieldTrialTrendlineFilterValue(
size_t windowSize, double smoothingCoeff, double thresholdGain);
/** Initialize field trials using a dictionary mapping field trial keys to their
* values. See above for valid keys and values. Must be called before any other
* call into WebRTC. See: webrtc/system_wrappers/include/field_trial.h
*/
RTC_EXTERN void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials);
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) {
RTCFileLoggerSeverityVerbose,
RTCFileLoggerSeverityInfo,
RTCFileLoggerSeverityWarning,
RTCFileLoggerSeverityError
};
typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) {
RTCFileLoggerTypeCall,
RTCFileLoggerTypeApp,
};
NS_ASSUME_NONNULL_BEGIN
// This class intercepts WebRTC logs and saves them to a file. The file size
// will not exceed the given maximum bytesize. When the maximum bytesize is
// reached, logs are rotated according to the rotationType specified.
// For kRTCFileLoggerTypeCall, logs from the beginning and the end
// are preserved while the middle section is overwritten instead.
// For kRTCFileLoggerTypeApp, the oldest log is overwritten.
// This class is not threadsafe.
RTC_OBJC_EXPORT
@interface RTCFileLogger : NSObject
// The severity level to capture. The default is kRTCFileLoggerSeverityInfo.
@property(nonatomic, assign) RTCFileLoggerSeverity severity;
// The rotation type for this file logger. The default is
// kRTCFileLoggerTypeCall.
@property(nonatomic, readonly) RTCFileLoggerRotationType rotationType;
// Disables buffering disk writes. Should be set before |start|. Buffering
// is enabled by default for performance.
@property(nonatomic, assign) BOOL shouldDisableBuffering;
// Default constructor provides default settings for dir path, file size and
// rotation type.
- (instancetype)init;
// Create file logger with default rotation type.
- (instancetype)initWithDirPath:(NSString *)dirPath maxFileSize:(NSUInteger)maxFileSize;
- (instancetype)initWithDirPath:(NSString *)dirPath
maxFileSize:(NSUInteger)maxFileSize
rotationType:(RTCFileLoggerRotationType)rotationType NS_DESIGNATED_INITIALIZER;
// Starts writing WebRTC logs to disk if not already started. Overwrites any
// existing file(s).
- (void)start;
// Stops writing WebRTC logs to disk. This method is also called on dealloc.
- (void)stop;
// Returns the current contents of the logs, or nil if start has been called
// without a stop.
- (nullable NSData *)logData;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCVideoCapturer.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Error passing block.
*/
typedef void (^RTCFileVideoCapturerErrorBlock)(NSError *error);
/**
* Captures buffers from bundled video file.
*
* See @c RTCVideoCapturer for more info on capturers.
*/
RTC_OBJC_EXPORT
NS_CLASS_AVAILABLE_IOS(10)
@interface RTCFileVideoCapturer : RTCVideoCapturer
/**
* Starts asynchronous capture of frames from video file.
*
* Capturing is not started if error occurs. Underlying error will be
* relayed in the errorBlock if one is provided.
* Successfully captured video frames will be passed to the delegate.
*
* @param nameOfFile The name of the bundled video file to be read.
* @errorBlock block to be executed upon error.
*/
- (void)startCapturingFromFileNamed:(NSString *)nameOfFile
onError:(__nullable RTCFileVideoCapturerErrorBlock)errorBlock;
/**
* Immediately stops capture.
*/
- (void)stopCapture;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
RTC_OBJC_EXPORT extern NSString *const kRTCVideoCodecH264Name;
RTC_OBJC_EXPORT extern NSString *const kRTCLevel31ConstrainedHigh;
RTC_OBJC_EXPORT extern NSString *const kRTCLevel31ConstrainedBaseline;
RTC_OBJC_EXPORT extern NSString *const kRTCMaxSupportedH264ProfileLevelConstrainedHigh;
RTC_OBJC_EXPORT extern NSString *const kRTCMaxSupportedH264ProfileLevelConstrainedBaseline;
/** H264 Profiles and levels. */
typedef NS_ENUM(NSUInteger, RTCH264Profile) {
RTCH264ProfileConstrainedBaseline,
RTCH264ProfileBaseline,
RTCH264ProfileMain,
RTCH264ProfileConstrainedHigh,
RTCH264ProfileHigh,
};
typedef NS_ENUM(NSUInteger, RTCH264Level) {
RTCH264Level1_b = 0,
RTCH264Level1 = 10,
RTCH264Level1_1 = 11,
RTCH264Level1_2 = 12,
RTCH264Level1_3 = 13,
RTCH264Level2 = 20,
RTCH264Level2_1 = 21,
RTCH264Level2_2 = 22,
RTCH264Level3 = 30,
RTCH264Level3_1 = 31,
RTCH264Level3_2 = 32,
RTCH264Level4 = 40,
RTCH264Level4_1 = 41,
RTCH264Level4_2 = 42,
RTCH264Level5 = 50,
RTCH264Level5_1 = 51,
RTCH264Level5_2 = 52
};
RTC_OBJC_EXPORT
@interface RTCH264ProfileLevelId : NSObject
@property(nonatomic, readonly) RTCH264Profile profile;
@property(nonatomic, readonly) RTCH264Level level;
@property(nonatomic, readonly) NSString *hexString;
- (instancetype)initWithHexString:(NSString *)hexString;
- (instancetype)initWithProfile:(RTCH264Profile)profile level:(RTCH264Level)level;
@end
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCYUVPlanarBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Protocol for RTCYUVPlanarBuffers containing I420 data */
RTC_OBJC_EXPORT
@protocol RTCI420Buffer <RTCYUVPlanarBuffer>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCIceCandidate : NSObject
/**
* If present, the identifier of the "media stream identification" for the media
* component this candidate is associated with.
*/
@property(nonatomic, readonly, nullable) NSString *sdpMid;
/**
* The index (starting at zero) of the media description this candidate is
* associated with in the SDP.
*/
@property(nonatomic, readonly) int sdpMLineIndex;
/** The SDP string for this candidate. */
@property(nonatomic, readonly) NSString *sdp;
/** The URL of the ICE server which this candidate is gathered from. */
@property(nonatomic, readonly, nullable) NSString *serverUrl;
- (instancetype)init NS_UNAVAILABLE;
/**
* Initialize an RTCIceCandidate from SDP.
*/
- (instancetype)initWithSdp:(NSString *)sdp
sdpMLineIndex:(int)sdpMLineIndex
sdpMid:(nullable NSString *)sdpMid NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
typedef NS_ENUM(NSUInteger, RTCTlsCertPolicy) {
RTCTlsCertPolicySecure,
RTCTlsCertPolicyInsecureNoCheck
};
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCIceServer : NSObject
/** URI(s) for this server represented as NSStrings. */
@property(nonatomic, readonly) NSArray<NSString *> *urlStrings;
/** Username to use if this RTCIceServer object is a TURN server. */
@property(nonatomic, readonly, nullable) NSString *username;
/** Credential to use if this RTCIceServer object is a TURN server. */
@property(nonatomic, readonly, nullable) NSString *credential;
/**
* TLS certificate policy to use if this RTCIceServer object is a TURN server.
*/
@property(nonatomic, readonly) RTCTlsCertPolicy tlsCertPolicy;
/**
If the URIs in |urls| only contain IP addresses, this field can be used
to indicate the hostname, which may be necessary for TLS (using the SNI
extension). If |urls| itself contains the hostname, this isn't necessary.
*/
@property(nonatomic, readonly, nullable) NSString *hostname;
/** List of protocols to be used in the TLS ALPN extension. */
@property(nonatomic, readonly) NSArray<NSString *> *tlsAlpnProtocols;
/**
List elliptic curves to be used in the TLS elliptic curves extension.
Only curve names supported by OpenSSL should be used (eg. "P-256","X25519").
*/
@property(nonatomic, readonly) NSArray<NSString *> *tlsEllipticCurves;
- (nonnull instancetype)init NS_UNAVAILABLE;
/** Convenience initializer for a server with no authentication (e.g. STUN). */
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, and credentialType.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, and TLS cert policy.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, TLS cert policy and hostname.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
hostname:(nullable NSString *)hostname;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, TLS cert policy, hostname and ALPN protocols.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
hostname:(nullable NSString *)hostname
tlsAlpnProtocols:(NSArray<NSString *> *)tlsAlpnProtocols;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, TLS cert policy, hostname, ALPN protocols and
* elliptic curves.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
hostname:(nullable NSString *)hostname
tlsAlpnProtocols:(nullable NSArray<NSString *> *)tlsAlpnProtocols
tlsEllipticCurves:(nullable NSArray<NSString *> *)tlsEllipticCurves
NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface RTCIntervalRange : NSObject
@property(nonatomic, readonly) NSInteger min;
@property(nonatomic, readonly) NSInteger max;
- (instancetype)init;
- (instancetype)initWithMin:(NSInteger)min max:(NSInteger)max NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** This does not currently conform to the spec. */
RTC_OBJC_EXPORT
@interface RTCLegacyStatsReport : NSObject
/** Time since 1970-01-01T00:00:00Z in milliseconds. */
@property(nonatomic, readonly) CFTimeInterval timestamp;
/** The type of stats held by this object. */
@property(nonatomic, readonly) NSString *type;
/** The identifier for this object. */
@property(nonatomic, readonly) NSString *reportId;
/** A dictionary holding the actual stats. */
@property(nonatomic, readonly) NSDictionary<NSString *, NSString *> *values;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
// Subset of rtc::LoggingSeverity.
typedef NS_ENUM(NSInteger, RTCLoggingSeverity) {
RTCLoggingSeverityVerbose,
RTCLoggingSeverityInfo,
RTCLoggingSeverityWarning,
RTCLoggingSeverityError,
RTCLoggingSeverityNone,
};
// Wrapper for C++ RTC_LOG(sev) macros.
// Logs the log string to the webrtc logstream for the given severity.
RTC_EXTERN void RTCLogEx(RTCLoggingSeverity severity, NSString* log_string);
// Wrapper for rtc::LogMessage::LogToDebug.
// Sets the minimum severity to be logged to console.
RTC_EXTERN void RTCSetMinDebugLogLevel(RTCLoggingSeverity severity);
// Returns the filename with the path prefix removed.
RTC_EXTERN NSString* RTCFileName(const char* filePath);
// Some convenience macros.
#define RTCLogString(format, ...) \
[NSString stringWithFormat:@"(%@:%d %s): " format, RTCFileName(__FILE__), \
__LINE__, __FUNCTION__, ##__VA_ARGS__]
#define RTCLogFormat(severity, format, ...) \
do { \
NSString* log_string = RTCLogString(format, ##__VA_ARGS__); \
RTCLogEx(severity, log_string); \
} while (false)
#define RTCLogVerbose(format, ...) \
RTCLogFormat(RTCLoggingSeverityVerbose, format, ##__VA_ARGS__)
#define RTCLogInfo(format, ...) \
RTCLogFormat(RTCLoggingSeverityInfo, format, ##__VA_ARGS__)
#define RTCLogWarning(format, ...) \
RTCLogFormat(RTCLoggingSeverityWarning, format, ##__VA_ARGS__)
#define RTCLogError(format, ...) \
RTCLogFormat(RTCLoggingSeverityError, format, ##__VA_ARGS__)
#if !defined(NDEBUG)
#define RTCLogDebug(format, ...) RTCLogInfo(format, ##__VA_ARGS__)
#else
#define RTCLogDebug(format, ...) \
do { \
} while (false)
#endif
#define RTCLog(format, ...) RTCLogInfo(format, ##__VA_ARGS__)
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoFrame.h"
#import "RTCVideoRenderer.h"
NS_ASSUME_NONNULL_BEGIN
/**
* RTCMTLVideoView is thin wrapper around MTKView.
*
* It has id<RTCVideoRenderer> property that renders video frames in the view's
* bounds using Metal.
* NOTE: always check if metal is available on the running device via
* RTC_SUPPORTS_METAL macro before initializing this class.
*/
NS_CLASS_AVAILABLE_IOS(9)
RTC_OBJC_EXPORT
@interface RTCMTLVideoView : UIView<RTCVideoRenderer>
@property(nonatomic, weak) id<RTCVideoViewDelegate> delegate;
@property(nonatomic) UIViewContentMode videoContentMode;
/** @abstract Enables/disables rendering.
*/
@property(nonatomic, getter=isEnabled) BOOL enabled;
/** @abstract Wrapped RTCVideoRotation, or nil.
*/
@property(nonatomic, nullable) NSValue* rotationOverride;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#ifndef SDK_OBJC_BASE_RTCMACROS_H_
#define SDK_OBJC_BASE_RTCMACROS_H_
#define RTC_OBJC_EXPORT __attribute__((visibility("default")))
#if defined(__cplusplus)
#define RTC_EXTERN extern "C" RTC_OBJC_EXPORT
#else
#define RTC_EXTERN extern RTC_OBJC_EXPORT
#endif
#ifdef __OBJC__
#define RTC_FWD_DECL_OBJC_CLASS(classname) @class classname
#else
#define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname
#endif
#endif // SDK_OBJC_BASE_RTCMACROS_H_
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** Constraint keys for media sources. */
RTC_EXTERN NSString *const kRTCMediaConstraintsMinAspectRatio;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxAspectRatio;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxWidth;
RTC_EXTERN NSString *const kRTCMediaConstraintsMinWidth;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxHeight;
RTC_EXTERN NSString *const kRTCMediaConstraintsMinHeight;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxFrameRate;
RTC_EXTERN NSString *const kRTCMediaConstraintsMinFrameRate;
/** The value for this key should be a base64 encoded string containing
* the data from the serialized configuration proto.
*/
RTC_EXTERN NSString *const kRTCMediaConstraintsAudioNetworkAdaptorConfig;
/** Constraint keys for generating offers and answers. */
RTC_EXTERN NSString *const kRTCMediaConstraintsIceRestart;
RTC_EXTERN NSString *const kRTCMediaConstraintsOfferToReceiveAudio;
RTC_EXTERN NSString *const kRTCMediaConstraintsOfferToReceiveVideo;
RTC_EXTERN NSString *const kRTCMediaConstraintsVoiceActivityDetection;
/** Constraint values for Boolean parameters. */
RTC_EXTERN NSString *const kRTCMediaConstraintsValueTrue;
RTC_EXTERN NSString *const kRTCMediaConstraintsValueFalse;
RTC_OBJC_EXPORT
@interface RTCMediaConstraints : NSObject
- (instancetype)init NS_UNAVAILABLE;
/** Initialize with mandatory and/or optional constraints. */
- (instancetype)
initWithMandatoryConstraints:(nullable NSDictionary<NSString *, NSString *> *)mandatory
optionalConstraints:(nullable NSDictionary<NSString *, NSString *> *)optional
NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
typedef NS_ENUM(NSInteger, RTCSourceState) {
RTCSourceStateInitializing,
RTCSourceStateLive,
RTCSourceStateEnded,
RTCSourceStateMuted,
};
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCMediaSource : NSObject
/** The current state of the RTCMediaSource. */
@property(nonatomic, readonly) RTCSourceState state;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@class RTCAudioTrack;
@class RTCPeerConnectionFactory;
@class RTCVideoTrack;
RTC_OBJC_EXPORT
@interface RTCMediaStream : NSObject
/** The audio tracks in this stream. */
@property(nonatomic, strong, readonly) NSArray<RTCAudioTrack *> *audioTracks;
/** The video tracks in this stream. */
@property(nonatomic, strong, readonly) NSArray<RTCVideoTrack *> *videoTracks;
/** An identifier for this media stream. */
@property(nonatomic, readonly) NSString *streamId;
- (instancetype)init NS_UNAVAILABLE;
/** Adds the given audio track to this media stream. */
- (void)addAudioTrack:(RTCAudioTrack *)audioTrack;
/** Adds the given video track to this media stream. */
- (void)addVideoTrack:(RTCVideoTrack *)videoTrack;
/** Removes the given audio track to this media stream. */
- (void)removeAudioTrack:(RTCAudioTrack *)audioTrack;
/** Removes the given video track to this media stream. */
- (void)removeVideoTrack:(RTCVideoTrack *)videoTrack;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
/**
* Represents the state of the track. This exposes the same states in C++.
*/
typedef NS_ENUM(NSInteger, RTCMediaStreamTrackState) {
RTCMediaStreamTrackStateLive,
RTCMediaStreamTrackStateEnded
};
NS_ASSUME_NONNULL_BEGIN
RTC_EXTERN NSString *const kRTCMediaStreamTrackKindAudio;
RTC_EXTERN NSString *const kRTCMediaStreamTrackKindVideo;
RTC_OBJC_EXPORT
@interface RTCMediaStreamTrack : NSObject
/**
* The kind of track. For example, "audio" if this track represents an audio
* track and "video" if this track represents a video track.
*/
@property(nonatomic, readonly) NSString *kind;
/** An identifier string. */
@property(nonatomic, readonly) NSString *trackId;
/** The enabled state of the track. */
@property(nonatomic, assign) BOOL isEnabled;
/** The state of the track. */
@property(nonatomic, readonly) RTCMediaStreamTrackState readyState;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCMetricsSampleInfo.h"
/**
* Enables gathering of metrics (which can be fetched with
* RTCGetAndResetMetrics). Must be called before any other call into WebRTC.
*/
RTC_EXTERN void RTCEnableMetrics(void);
/** Gets and clears native histograms. */
RTC_EXTERN NSArray<RTCMetricsSampleInfo*>* RTCGetAndResetMetrics(void);
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCMetricsSampleInfo : NSObject
/**
* Example of RTCMetricsSampleInfo:
* name: "WebRTC.Video.InputFramesPerSecond"
* min: 1
* max: 100
* bucketCount: 50
* samples: [29]:2 [30]:1
*/
/** The name of the histogram. */
@property(nonatomic, readonly) NSString *name;
/** The minimum bucket value. */
@property(nonatomic, readonly) int min;
/** The maximum bucket value. */
@property(nonatomic, readonly) int max;
/** The number of buckets. */
@property(nonatomic, readonly) int bucketCount;
/** A dictionary holding the samples <value, # of events>. */
@property(nonatomic, readonly) NSDictionary<NSNumber *, NSNumber *> *samples;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCI420Buffer.h"
#import "RTCMutableYUVPlanarBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Extension of the I420 buffer with mutable data access */
RTC_OBJC_EXPORT
@protocol RTCMutableI420Buffer <RTCI420Buffer, RTCMutableYUVPlanarBuffer>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCYUVPlanarBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Extension of the YUV planar data buffer with mutable data access */
RTC_OBJC_EXPORT
@protocol RTCMutableYUVPlanarBuffer <RTCYUVPlanarBuffer>
@property(nonatomic, readonly) uint8_t *mutableDataY;
@property(nonatomic, readonly) uint8_t *mutableDataU;
@property(nonatomic, readonly) uint8_t *mutableDataV;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCI420Buffer.h"
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** RTCI420Buffer implements the RTCI420Buffer protocol */
RTC_OBJC_EXPORT
@interface RTCI420Buffer : NSObject<RTCI420Buffer>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCMacros.h"
#import "RTCMutableI420Buffer.h"
#import "RTCNativeI420Buffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Mutable version of RTCI420Buffer */
RTC_OBJC_EXPORT
@interface RTCMutableI420Buffer : RTCI420Buffer<RTCMutableI420Buffer>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
@class RTCConfiguration;
@class RTCDataChannel;
@class RTCDataChannelConfiguration;
@class RTCIceCandidate;
@class RTCMediaConstraints;
@class RTCMediaStream;
@class RTCMediaStreamTrack;
@class RTCPeerConnectionFactory;
@class RTCRtpReceiver;
@class RTCRtpSender;
@class RTCRtpTransceiver;
@class RTCRtpTransceiverInit;
@class RTCSessionDescription;
@class RTCLegacyStatsReport;
typedef NS_ENUM(NSInteger, RTCRtpMediaType);
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kRTCPeerConnectionErrorDomain;
extern int const kRTCSessionDescriptionErrorCode;
/** Represents the signaling state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCSignalingState) {
RTCSignalingStateStable,
RTCSignalingStateHaveLocalOffer,
RTCSignalingStateHaveLocalPrAnswer,
RTCSignalingStateHaveRemoteOffer,
RTCSignalingStateHaveRemotePrAnswer,
// Not an actual state, represents the total number of states.
RTCSignalingStateClosed,
};
/** Represents the ice connection state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCIceConnectionState) {
RTCIceConnectionStateNew,
RTCIceConnectionStateChecking,
RTCIceConnectionStateConnected,
RTCIceConnectionStateCompleted,
RTCIceConnectionStateFailed,
RTCIceConnectionStateDisconnected,
RTCIceConnectionStateClosed,
RTCIceConnectionStateCount,
};
/** Represents the ice gathering state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCIceGatheringState) {
RTCIceGatheringStateNew,
RTCIceGatheringStateGathering,
RTCIceGatheringStateComplete,
};
/** Represents the stats output level. */
typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
RTCStatsOutputLevelStandard,
RTCStatsOutputLevelDebug,
};
@interface RTCMediaStats : NSObject
@property (readwrite, nonatomic) NSUInteger audio_bitrate;
@property (readwrite, nonatomic) NSUInteger video_bitrate;
@property (readwrite, nonatomic) NSUInteger video_framerate;
@end
@class RTCPeerConnection;
RTC_OBJC_EXPORT
@protocol RTCPeerConnectionDelegate <NSObject>
/** Called when the SignalingState changed. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didChangeSignalingState:(RTCSignalingState)stateChanged;
/** Called when media is received on a new stream from remote peer. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection didAddStream:(RTCMediaStream *)stream;
/** Called when a remote peer closes a stream.
* This is not called when RTCSdpSemanticsUnifiedPlan is specified.
*/
- (void)peerConnection:(RTCPeerConnection *)peerConnection didRemoveStream:(RTCMediaStream *)stream;
/** Called when negotiation is needed, for example ICE has restarted. */
- (void)peerConnectionShouldNegotiate:(RTCPeerConnection *)peerConnection;
/** Called any time the IceConnectionState changes. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didChangeIceConnectionState:(RTCIceConnectionState)newState;
/** Called any time the IceGatheringState changes. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didChangeIceGatheringState:(RTCIceGatheringState)newState;
/** New ice candidate has been found. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didGenerateIceCandidate:(RTCIceCandidate *)candidate;
/** Called when a group of local Ice candidates have been removed. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didRemoveIceCandidates:(NSArray<RTCIceCandidate *> *)candidates;
/** New data channel has been opened. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didOpenDataChannel:(RTCDataChannel *)dataChannel;
/** Called when signaling indicates a transceiver will be receiving media from
* the remote endpoint.
* This is only called with RTCSdpSemanticsUnifiedPlan specified.
*/
@optional
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didStartReceivingOnTransceiver:(RTCRtpTransceiver *)transceiver;
/** Called when a receiver and its track are created. */
@optional
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didAddReceiver:(RTCRtpReceiver *)rtpReceiver
streams:(NSArray<RTCMediaStream *> *)mediaStreams;
/** Called when the receiver and its track are removed. */
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didRemoveReceiver:(RTCRtpReceiver *)rtpReceiver;
@optional
- (void)peerConnection:(RTCPeerConnection *)peerConnection
didRTCStats:(RTCMediaStats *)stats;
@end
RTC_OBJC_EXPORT
@interface RTCPeerConnection : NSObject
/** The object that will be notifed about events such as state changes and
* streams being added or removed.
*/
@property(nonatomic, weak, nullable) id<RTCPeerConnectionDelegate> delegate;
/** This property is not available with RTCSdpSemanticsUnifiedPlan. Please use
* |senders| instead.
*/
@property(nonatomic, readonly) NSArray<RTCMediaStream *> *localStreams;
@property(nonatomic, readonly, nullable) RTCSessionDescription *localDescription;
@property(nonatomic, readonly, nullable) RTCSessionDescription *remoteDescription;
@property(nonatomic, readonly) RTCSignalingState signalingState;
@property(nonatomic, readonly) RTCIceConnectionState iceConnectionState;
@property(nonatomic, readonly) RTCIceGatheringState iceGatheringState;
@property(nonatomic, readonly, copy) RTCConfiguration *configuration;
/** Gets all RTCRtpSenders associated with this peer connection.
* Note: reading this property returns different instances of RTCRtpSender.
* Use isEqual: instead of == to compare RTCRtpSender instances.
*/
@property(nonatomic, readonly) NSArray<RTCRtpSender *> *senders;
/** Gets all RTCRtpReceivers associated with this peer connection.
* Note: reading this property returns different instances of RTCRtpReceiver.
* Use isEqual: instead of == to compare RTCRtpReceiver instances.
*/
@property(nonatomic, readonly) NSArray<RTCRtpReceiver *> *receivers;
/** Gets all RTCRtpTransceivers associated with this peer connection.
* Note: reading this property returns different instances of
* RTCRtpTransceiver. Use isEqual: instead of == to compare RTCRtpTransceiver
* instances.
* This is only available with RTCSdpSemanticsUnifiedPlan specified.
*/
@property(nonatomic, readonly) NSArray<RTCRtpTransceiver *> *transceivers;
- (instancetype)init NS_UNAVAILABLE;
/** Sets the PeerConnection's global configuration to |configuration|.
* Any changes to STUN/TURN servers or ICE candidate policy will affect the
* next gathering phase, and cause the next call to createOffer to generate
* new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies
* cannot be changed with this method.
*/
- (BOOL)setConfiguration:(RTCConfiguration *)configuration;
/** Terminate all media and close the transport. */
- (void)close;
/** Provide a remote candidate to the ICE Agent. */
- (void)addIceCandidate:(RTCIceCandidate *)candidate;
/** Remove a group of remote candidates from the ICE Agent. */
- (void)removeIceCandidates:(NSArray<RTCIceCandidate *> *)candidates;
/** Add a new media stream to be sent on this peer connection.
* This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use
* addTrack instead.
*/
- (void)addStream:(RTCMediaStream *)stream;
/** Remove the given media stream from this peer connection.
* This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use
* removeTrack instead.
*/
- (void)removeStream:(RTCMediaStream *)stream;
/** Add a new media stream track to be sent on this peer connection, and return
* the newly created RTCRtpSender. The RTCRtpSender will be associated with
* the streams specified in the |streamIds| list.
*
* Errors: If an error occurs, returns nil. An error can occur if:
* - A sender already exists for the track.
* - The peer connection is closed.
*/
- (RTCRtpSender *)addTrack:(RTCMediaStreamTrack *)track streamIds:(NSArray<NSString *> *)streamIds;
/** With PlanB semantics, removes an RTCRtpSender from this peer connection.
*
* With UnifiedPlan semantics, sets sender's track to null and removes the
* send component from the associated RTCRtpTransceiver's direction.
*
* Returns YES on success.
*/
- (BOOL)removeTrack:(RTCRtpSender *)sender;
/** addTransceiver creates a new RTCRtpTransceiver and adds it to the set of
* transceivers. Adding a transceiver will cause future calls to CreateOffer
* to add a media description for the corresponding transceiver.
*
* The initial value of |mid| in the returned transceiver is nil. Setting a
* new session description may change it to a non-nil value.
*
* https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver
*
* Optionally, an RtpTransceiverInit structure can be specified to configure
* the transceiver from construction. If not specified, the transceiver will
* default to having a direction of kSendRecv and not be part of any streams.
*
* These methods are only available when Unified Plan is enabled (see
* RTCConfiguration).
*/
/** Adds a transceiver with a sender set to transmit the given track. The kind
* of the transceiver (and sender/receiver) will be derived from the kind of
* the track.
*/
- (RTCRtpTransceiver *)addTransceiverWithTrack:(RTCMediaStreamTrack *)track;
- (RTCRtpTransceiver *)addTransceiverWithTrack:(RTCMediaStreamTrack *)track
init:(RTCRtpTransceiverInit *)init;
/** Adds a transceiver with the given kind. Can either be RTCRtpMediaTypeAudio
* or RTCRtpMediaTypeVideo.
*/
- (RTCRtpTransceiver *)addTransceiverOfType:(RTCRtpMediaType)mediaType;
- (RTCRtpTransceiver *)addTransceiverOfType:(RTCRtpMediaType)mediaType
init:(RTCRtpTransceiverInit *)init;
/** Generate an SDP offer. */
- (void)offerForConstraints:(RTCMediaConstraints *)constraints
completionHandler:(nullable void (^)(RTCSessionDescription *_Nullable sdp,
NSError *_Nullable error))completionHandler;
/** Generate an SDP answer. */
- (void)answerForConstraints:(RTCMediaConstraints *)constraints
completionHandler:(nullable void (^)(RTCSessionDescription *_Nullable sdp,
NSError *_Nullable error))completionHandler;
/** Apply the supplied RTCSessionDescription as the local description. */
- (void)setLocalDescription:(RTCSessionDescription *)sdp
completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler;
/** Apply the supplied RTCSessionDescription as the remote description. */
- (void)setRemoteDescription:(RTCSessionDescription *)sdp
completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler;
/** Limits the bandwidth allocated for all RTP streams sent by this
* PeerConnection. Nil parameters will be unchanged. Setting
* |currentBitrateBps| will force the available bitrate estimate to the given
* value. Returns YES if the parameters were successfully updated.
*/
- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
currentBitrateBps:(nullable NSNumber *)currentBitrateBps
maxBitrateBps:(nullable NSNumber *)maxBitrateBps;
/** Start or stop recording an Rtc EventLog. */
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
- (void)stopRtcEventLog;
- (int)GetNetFrameRate;
- (int)GetNetBitrate;
- (void)SetStats:(RTCMediaStats *)mediaStats;
- (void)GetStats;
@end
@interface RTCPeerConnection (Media)
/** Create an RTCRtpSender with the specified kind and media stream ID.
* See RTCMediaStreamTrack.h for available kinds.
* This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use
* addTransceiver instead.
*/
- (RTCRtpSender *)senderWithKind:(NSString *)kind streamId:(NSString *)streamId;
@end
@interface RTCPeerConnection (DataChannel)
/** Create a new data channel with the given label and configuration. */
- (nullable RTCDataChannel *)dataChannelForLabel:(NSString *)label
configuration:(RTCDataChannelConfiguration *)configuration;
@end
@interface RTCPeerConnection (Stats)
/** Gather stats for the given RTCMediaStreamTrack. If |mediaStreamTrack| is nil
* statistics are gathered for all tracks.
*/
- (void)statsForTrack:(nullable RTCMediaStreamTrack *)mediaStreamTrack
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
completionHandler:(nullable void (^)(NSArray<RTCLegacyStatsReport *> *stats))completionHandler;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@class RTCAudioSource;
@class RTCAudioTrack;
@class RTCConfiguration;
@class RTCMediaConstraints;
@class RTCMediaStream;
@class RTCPeerConnection;
@class RTCVideoSource;
@class RTCVideoTrack;
@class RTCPeerConnectionFactoryOptions;
@protocol RTCPeerConnectionDelegate;
@protocol RTCVideoDecoderFactory;
@protocol RTCVideoEncoderFactory;
RTC_OBJC_EXPORT
@interface RTCPeerConnectionFactory : NSObject
/* Initialize object with default H264 video encoder/decoder factories */
- (instancetype)init;
/* Initialize object with injectable video encoder/decoder factories */
- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory
decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory;
/** Initialize an RTCAudioSource with constraints. */
- (RTCAudioSource *)audioSourceWithConstraints:(nullable RTCMediaConstraints *)constraints;
/** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio source with no
* constraints.
*/
- (RTCAudioTrack *)audioTrackWithTrackId:(NSString *)trackId;
/** Initialize an RTCAudioTrack with a source and an id. */
- (RTCAudioTrack *)audioTrackWithSource:(RTCAudioSource *)source trackId:(NSString *)trackId;
/** Initialize a generic RTCVideoSource. The RTCVideoSource should be passed to a RTCVideoCapturer
* implementation, e.g. RTCCameraVideoCapturer, in order to produce frames.
*/
- (RTCVideoSource *)videoSource;
/** Initialize an RTCVideoTrack with a source and an id. */
- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source trackId:(NSString *)trackId;
/** Initialize an RTCMediaStream with an id. */
- (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId;
/** Initialize an RTCPeerConnection with a configuration, constraints, and
* delegate.
*/
- (RTCPeerConnection *)peerConnectionWithConfiguration:(RTCConfiguration *)configuration
constraints:(RTCMediaConstraints *)constraints
delegate:
(nullable id<RTCPeerConnectionDelegate>)delegate;
/** Set the options to be used for subsequently created RTCPeerConnections */
- (void)setOptions:(nonnull RTCPeerConnectionFactoryOptions *)options;
/** Start an AecDump recording. This API call will likely change in the future. */
- (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
/* Stop an active AecDump recording */
- (void)stopAecDump;
/* set audio recording ability*/
- (void)enableAudioRecording:(bool)bEnable;
/* get audio recording volume*/
- (int)getAudioRecordVolume;
/* set audio speak mute*/
- (void)speakMute:(bool)bMute;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCPeerConnectionFactoryOptions : NSObject
@property(nonatomic, assign) BOOL disableEncryption;
@property(nonatomic, assign) BOOL disableNetworkMonitor;
@property(nonatomic, assign) BOOL ignoreLoopbackNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreVPNNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreCellularNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreWiFiNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreEthernetNetworkAdapter;
@property(nonatomic, assign) BOOL enableAes128Sha1_32CryptoCipher;
@property(nonatomic, assign) BOOL enableGcmCryptoSuites;
@property(nonatomic, assign) BOOL requireFrameEncryption;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCRtcpParameters : NSObject
/** The Canonical Name used by RTCP. */
@property(nonatomic, readonly, copy) NSString *cname;
/** Whether reduced size RTCP is configured or compound RTCP. */
@property(nonatomic, assign) BOOL isReducedSize;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_EXTERN const NSString *const kRTCRtxCodecName;
RTC_EXTERN const NSString *const kRTCRedCodecName;
RTC_EXTERN const NSString *const kRTCUlpfecCodecName;
RTC_EXTERN const NSString *const kRTCFlexfecCodecName;
RTC_EXTERN const NSString *const kRTCOpusCodecName;
RTC_EXTERN const NSString *const kRTCIsacCodecName;
RTC_EXTERN const NSString *const kRTCL16CodecName;
RTC_EXTERN const NSString *const kRTCG722CodecName;
RTC_EXTERN const NSString *const kRTCIlbcCodecName;
RTC_EXTERN const NSString *const kRTCPcmuCodecName;
RTC_EXTERN const NSString *const kRTCPcmaCodecName;
RTC_EXTERN const NSString *const kRTCDtmfCodecName;
RTC_EXTERN const NSString *const kRTCComfortNoiseCodecName;
RTC_EXTERN const NSString *const kRTCVp8CodecName;
RTC_EXTERN const NSString *const kRTCVp9CodecName;
RTC_EXTERN const NSString *const kRTCH264CodecName;
/** Defined in http://w3c.github.io/webrtc-pc/#idl-def-RTCRtpCodecParameters */
RTC_OBJC_EXPORT
@interface RTCRtpCodecParameters : NSObject
/** The RTP payload type. */
@property(nonatomic, assign) int payloadType;
/**
* The codec MIME subtype. Valid types are listed in:
* http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2
*
* Several supported types are represented by the constants above.
*/
@property(nonatomic, readonly, nonnull) NSString *name;
/**
* The media type of this codec. Equivalent to MIME top-level type.
*
* Valid values are kRTCMediaStreamTrackKindAudio and
* kRTCMediaStreamTrackKindVideo.
*/
@property(nonatomic, readonly, nonnull) NSString *kind;
/** The codec clock rate expressed in Hertz. */
@property(nonatomic, readonly, nullable) NSNumber *clockRate;
/**
* The number of channels (mono=1, stereo=2).
* Set to null for video codecs.
**/
@property(nonatomic, readonly, nullable) NSNumber *numChannels;
/** The "format specific parameters" field from the "a=fmtp" line in the SDP */
@property(nonatomic, readonly, nonnull) NSDictionary *parameters;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCRtpEncodingParameters : NSObject
/** Controls whether the encoding is currently transmitted. */
@property(nonatomic, assign) BOOL isActive;
/** The maximum bitrate to use for the encoding, or nil if there is no
* limit.
*/
@property(nonatomic, copy, nullable) NSNumber *maxBitrateBps;
/** The minimum bitrate to use for the encoding, or nil if there is no
* limit.
*/
@property(nonatomic, copy, nullable) NSNumber *minBitrateBps;
/** The maximum framerate to use for the encoding, or nil if there is no
* limit.
*/
@property(nonatomic, copy, nullable) NSNumber *maxFramerate;
/** The requested number of temporal layers to use for the encoding, or nil
* if the default should be used.
*/
@property(nonatomic, copy, nullable) NSNumber *numTemporalLayers;
/** The SSRC being used by this encoding. */
@property(nonatomic, readonly, nullable) NSNumber *ssrc;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** Information for header. Corresponds to webrtc::RTPFragmentationHeader. */
RTC_OBJC_EXPORT
@interface RTCRtpFragmentationHeader : NSObject
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationOffset;
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationLength;
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationTimeDiff;
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationPlType;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCRtpHeaderExtension : NSObject
/** The URI of the RTP header extension, as defined in RFC5285. */
@property(nonatomic, readonly, copy) NSString *uri;
/** The value put in the RTP packet to identify the header extension. */
@property(nonatomic, readonly) int id;
/** Whether the header extension is encrypted or not. */
@property(nonatomic, readonly, getter=isEncrypted) BOOL encrypted;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCRtcpParameters.h"
#import "RTCRtpCodecParameters.h"
#import "RTCRtpEncodingParameters.h"
#import "RTCRtpHeaderExtension.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCRtpParameters : NSObject
/** A unique identifier for the last set of parameters applied. */
@property(nonatomic, copy) NSString *transactionId;
/** Parameters used for RTCP. */
@property(nonatomic, readonly, copy) RTCRtcpParameters *rtcp;
/** An array containing parameters for RTP header extensions. */
@property(nonatomic, readonly, copy) NSArray<RTCRtpHeaderExtension *> *headerExtensions;
/** The currently active encodings in the order of preference. */
@property(nonatomic, copy) NSArray<RTCRtpEncodingParameters *> *encodings;
/** The negotiated set of send codecs in order of preference. */
@property(nonatomic, copy) NSArray<RTCRtpCodecParameters *> *codecs;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCMediaStreamTrack.h"
#import "RTCRtpParameters.h"
NS_ASSUME_NONNULL_BEGIN
/** Represents the media type of the RtpReceiver. */
typedef NS_ENUM(NSInteger, RTCRtpMediaType) {
RTCRtpMediaTypeAudio,
RTCRtpMediaTypeVideo,
RTCRtpMediaTypeData,
};
@class RTCRtpReceiver;
RTC_OBJC_EXPORT
@protocol RTCRtpReceiverDelegate <NSObject>
/** Called when the first RTP packet is received.
*
* Note: Currently if there are multiple RtpReceivers of the same media type,
* they will all call OnFirstPacketReceived at once.
*
* For example, if we create three audio receivers, A/B/C, they will listen to
* the same signal from the underneath network layer. Whenever the first audio packet
* is received, the underneath signal will be fired. All the receivers A/B/C will be
* notified and the callback of the receiver's delegate will be called.
*
* The process is the same for video receivers.
*/
- (void)rtpReceiver:(RTCRtpReceiver *)rtpReceiver
didReceiveFirstPacketForMediaType:(RTCRtpMediaType)mediaType;
@end
RTC_OBJC_EXPORT
@protocol RTCRtpReceiver <NSObject>
/** A unique identifier for this receiver. */
@property(nonatomic, readonly) NSString *receiverId;
/** The currently active RTCRtpParameters, as defined in
* https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters.
*
* The WebRTC specification only defines RTCRtpParameters in terms of senders,
* but this API also applies them to receivers, similar to ORTC:
* http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*.
*/
@property(nonatomic, readonly) RTCRtpParameters *parameters;
/** The RTCMediaStreamTrack associated with the receiver.
* Note: reading this property returns a new instance of
* RTCMediaStreamTrack. Use isEqual: instead of == to compare
* RTCMediaStreamTrack instances.
*/
@property(nonatomic, readonly, nullable) RTCMediaStreamTrack *track;
/** The delegate for this RtpReceiver. */
@property(nonatomic, weak) id<RTCRtpReceiverDelegate> delegate;
@end
RTC_OBJC_EXPORT
@interface RTCRtpReceiver : NSObject <RTCRtpReceiver>
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCDtmfSender.h"
#import "RTCMacros.h"
#import "RTCMediaStreamTrack.h"
#import "RTCRtpParameters.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@protocol RTCRtpSender <NSObject>
/** A unique identifier for this sender. */
@property(nonatomic, readonly) NSString *senderId;
/** The currently active RTCRtpParameters, as defined in
* https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters.
*/
@property(nonatomic, copy) RTCRtpParameters *parameters;
/** The RTCMediaStreamTrack associated with the sender.
* Note: reading this property returns a new instance of
* RTCMediaStreamTrack. Use isEqual: instead of == to compare
* RTCMediaStreamTrack instances.
*/
@property(nonatomic, copy, nullable) RTCMediaStreamTrack *track;
/** The RTCDtmfSender accociated with the RTP sender. */
@property(nonatomic, readonly, nullable) id<RTCDtmfSender> dtmfSender;
@end
RTC_OBJC_EXPORT
@interface RTCRtpSender : NSObject <RTCRtpSender>
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCRtpReceiver.h"
#import "RTCRtpSender.h"
NS_ASSUME_NONNULL_BEGIN
/** https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverdirection */
typedef NS_ENUM(NSInteger, RTCRtpTransceiverDirection) {
RTCRtpTransceiverDirectionSendRecv,
RTCRtpTransceiverDirectionSendOnly,
RTCRtpTransceiverDirectionRecvOnly,
RTCRtpTransceiverDirectionInactive,
};
/** Structure for initializing an RTCRtpTransceiver in a call to
* RTCPeerConnection.addTransceiver.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverinit
*/
@interface RTCRtpTransceiverInit : NSObject
/** Direction of the RTCRtpTransceiver. See RTCRtpTransceiver.direction. */
@property(nonatomic) RTCRtpTransceiverDirection direction;
/** The added RTCRtpTransceiver will be added to these streams. */
@property(nonatomic) NSArray<NSString *> *streamIds;
/** TODO(bugs.webrtc.org/7600): Not implemented. */
@property(nonatomic) NSArray<RTCRtpEncodingParameters *> *sendEncodings;
@end
@class RTCRtpTransceiver;
/** The RTCRtpTransceiver maps to the RTCRtpTransceiver defined by the WebRTC
* specification. A transceiver represents a combination of an RTCRtpSender
* and an RTCRtpReceiver that share a common mid. As defined in JSEP, an
* RTCRtpTransceiver is said to be associated with a media description if its
* mid property is non-nil; otherwise, it is said to be disassociated.
* JSEP: https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24
*
* Note that RTCRtpTransceivers are only supported when using
* RTCPeerConnection with Unified Plan SDP.
*
* WebRTC specification for RTCRtpTransceiver, the JavaScript analog:
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver
*/
RTC_OBJC_EXPORT
@protocol RTCRtpTransceiver <NSObject>
/** Media type of the transceiver. The sender and receiver will also have this
* type.
*/
@property(nonatomic, readonly) RTCRtpMediaType mediaType;
/** The mid attribute is the mid negotiated and present in the local and
* remote descriptions. Before negotiation is complete, the mid value may be
* nil. After rollbacks, the value may change from a non-nil value to nil.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-mid
*/
@property(nonatomic, readonly) NSString *mid;
/** The sender attribute exposes the RTCRtpSender corresponding to the RTP
* media that may be sent with the transceiver's mid. The sender is always
* present, regardless of the direction of media.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-sender
*/
@property(nonatomic, readonly) RTCRtpSender *sender;
/** The receiver attribute exposes the RTCRtpReceiver corresponding to the RTP
* media that may be received with the transceiver's mid. The receiver is
* always present, regardless of the direction of media.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-receiver
*/
@property(nonatomic, readonly) RTCRtpReceiver *receiver;
/** The isStopped attribute indicates that the sender of this transceiver will
* no longer send, and that the receiver will no longer receive. It is true if
* either stop has been called or if setting the local or remote description
* has caused the RTCRtpTransceiver to be stopped.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stopped
*/
@property(nonatomic, readonly) BOOL isStopped;
/** The direction attribute indicates the preferred direction of this
* transceiver, which will be used in calls to createOffer and createAnswer.
* An update of directionality does not take effect immediately. Instead,
* future calls to createOffer and createAnswer mark the corresponding media
* descriptions as sendrecv, sendonly, recvonly, or inactive.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction
*/
@property(nonatomic) RTCRtpTransceiverDirection direction;
/** The currentDirection attribute indicates the current direction negotiated
* for this transceiver. If this transceiver has never been represented in an
* offer/answer exchange, or if the transceiver is stopped, the value is not
* present and this method returns NO.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-currentdirection
*/
- (BOOL)currentDirection:(RTCRtpTransceiverDirection *)currentDirectionOut;
/** The stop method irreversibly stops the RTCRtpTransceiver. The sender of
* this transceiver will no longer send, the receiver will no longer receive.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
*/
- (void)stop;
@end
RTC_OBJC_EXPORT
@interface RTCRtpTransceiver : NSObject <RTCRtpTransceiver>
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
/**
* Initialize and clean up the SSL library. Failure is fatal. These call the
* corresponding functions in webrtc/rtc_base/ssladapter.h.
*/
RTC_EXTERN BOOL RTCInitializeSSL(void);
RTC_EXTERN BOOL RTCCleanupSSL(void);
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
/**
* Represents the session description type. This exposes the same types that are
* in C++, which doesn't include the rollback type that is in the W3C spec.
*/
typedef NS_ENUM(NSInteger, RTCSdpType) {
RTCSdpTypeOffer,
RTCSdpTypePrAnswer,
RTCSdpTypeAnswer,
};
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCSessionDescription : NSObject
/** The type of session description. */
@property(nonatomic, readonly) RTCSdpType type;
/** The SDP string representation of this session description. */
@property(nonatomic, readonly) NSString *sdp;
- (instancetype)init NS_UNAVAILABLE;
/** Initialize a session description with a type and SDP string. */
- (instancetype)initWithType:(RTCSdpType)type sdp:(NSString *)sdp NS_DESIGNATED_INITIALIZER;
+ (NSString *)stringForType:(RTCSdpType)type;
+ (RTCSdpType)typeForString:(NSString *)string;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
RTC_EXTERN void RTCSetupInternalTracer(void);
/** Starts capture to specified file. Must be a valid writable path.
* Returns YES if capture starts.
*/
RTC_EXTERN BOOL RTCStartInternalCapture(NSString* filePath);
RTC_EXTERN void RTCStopInternalCapture(void);
RTC_EXTERN void RTCShutdownInternalTracer(void);
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import "RTCVideoFrame.h"
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@class RTCVideoCapturer;
RTC_OBJC_EXPORT
@protocol RTCVideoCapturerDelegate <NSObject>
- (void)capturer:(RTCVideoCapturer *)capturer didCaptureVideoFrame:(RTCVideoFrame *)frame;
@end
RTC_OBJC_EXPORT
@interface RTCVideoCapturer : NSObject
@property(nonatomic, weak) id<RTCVideoCapturerDelegate> delegate;
- (instancetype)initWithDelegate:(id<RTCVideoCapturerDelegate>)delegate;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
RTC_OBJC_EXPORT extern NSString* const kRTCVideoCodecVp8Name;
RTC_OBJC_EXPORT extern NSString* const kRTCVideoCodecVp9Name;
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** Holds information to identify a codec. Corresponds to webrtc::SdpVideoFormat. */
RTC_OBJC_EXPORT
@interface RTCVideoCodecInfo : NSObject <NSCoding>
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithName:(NSString *)name;
- (instancetype)initWithName:(NSString *)name
parameters:(nullable NSDictionary<NSString *, NSString *> *)parameters
NS_DESIGNATED_INITIALIZER;
- (BOOL)isEqualToCodecInfo:(RTCVideoCodecInfo *)info;
@property(nonatomic, readonly) NSString *name;
@property(nonatomic, readonly) NSDictionary<NSString *, NSString *> *parameters;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCCodecSpecificInfo.h"
#import "RTCEncodedImage.h"
#import "RTCMacros.h"
#import "RTCVideoEncoderSettings.h"
#import "RTCVideoFrame.h"
NS_ASSUME_NONNULL_BEGIN
/** Callback block for decoder. */
typedef void (^RTCVideoDecoderCallback)(RTCVideoFrame *frame);
/** Protocol for decoder implementations. */
RTC_OBJC_EXPORT
@protocol RTCVideoDecoder <NSObject>
- (void)setCallback:(RTCVideoDecoderCallback)callback;
- (NSInteger)startDecodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores
DEPRECATED_MSG_ATTRIBUTE("use startDecodeWithNumberOfCores: instead");
- (NSInteger)releaseDecoder;
- (NSInteger)decode:(RTCEncodedImage *)encodedImage
missingFrames:(BOOL)missingFrames
codecSpecificInfo:(nullable id<RTCCodecSpecificInfo>)info
renderTimeMs:(int64_t)renderTimeMs;
- (NSString *)implementationName;
// TODO(andersc): Make non-optional when `startDecodeWithSettings:numberOfCores:` is removed.
@optional
- (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoCodecInfo.h"
#import "RTCVideoDecoder.h"
NS_ASSUME_NONNULL_BEGIN
/** RTCVideoDecoderFactory is an Objective-C version of webrtc::VideoDecoderFactory. */
RTC_OBJC_EXPORT
@protocol RTCVideoDecoderFactory <NSObject>
- (nullable id<RTCVideoDecoder>)createDecoder:(RTCVideoCodecInfo *)info;
- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs; // TODO(andersc): "supportedFormats" instead?
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoDecoderFactory.h"
RTC_OBJC_EXPORT
@interface RTCVideoDecoderFactoryH264 : NSObject <RTCVideoDecoderFactory>
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoDecoder.h"
RTC_OBJC_EXPORT
@interface RTCVideoDecoderH264 : NSObject <RTCVideoDecoder>
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoDecoder.h"
RTC_OBJC_EXPORT
@interface RTCVideoDecoderVP8 : NSObject
/* This returns a VP8 decoder that can be returned from a RTCVideoDecoderFactory injected into
* RTCPeerConnectionFactory. Even though it implements the RTCVideoDecoder protocol, it can not be
* used independently from the RTCPeerConnectionFactory.
*/
+ (id<RTCVideoDecoder>)vp8Decoder;
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoDecoder.h"
RTC_OBJC_EXPORT
@interface RTCVideoDecoderVP9 : NSObject
/* This returns a VP9 decoder that can be returned from a RTCVideoDecoderFactory injected into
* RTCPeerConnectionFactory. Even though it implements the RTCVideoDecoder protocol, it can not be
* used independently from the RTCPeerConnectionFactory.
*/
+ (id<RTCVideoDecoder>)vp9Decoder;
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCCodecSpecificInfo.h"
#import "RTCEncodedImage.h"
#import "RTCMacros.h"
#import "RTCRtpFragmentationHeader.h"
#import "RTCVideoEncoderQpThresholds.h"
#import "RTCVideoEncoderSettings.h"
#import "RTCVideoFrame.h"
NS_ASSUME_NONNULL_BEGIN
/** Callback block for encoder. */
typedef BOOL (^RTCVideoEncoderCallback)(RTCEncodedImage *frame,
id<RTCCodecSpecificInfo> info,
RTCRtpFragmentationHeader *header);
/** Protocol for encoder implementations. */
RTC_OBJC_EXPORT
@protocol RTCVideoEncoder <NSObject>
- (void)setCallback:(RTCVideoEncoderCallback)callback;
- (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores;
- (NSInteger)releaseEncoder;
- (NSInteger)encode:(RTCVideoFrame *)frame
codecSpecificInfo:(nullable id<RTCCodecSpecificInfo>)info
frameTypes:(NSArray<NSNumber *> *)frameTypes;
- (int)setBitrate:(uint32_t)bitrateKbit framerate:(uint32_t)framerate;
- (NSString *)implementationName;
/** Returns QP scaling settings for encoder. The quality scaler adjusts the resolution in order to
* keep the QP from the encoded images within the given range. Returning nil from this function
* disables quality scaling. */
- (nullable RTCVideoEncoderQpThresholds *)scalingSettings;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoCodecInfo.h"
#import "RTCVideoEncoder.h"
NS_ASSUME_NONNULL_BEGIN
/** RTCVideoEncoderFactory is an Objective-C version of webrtc::VideoEncoderFactory. */
RTC_OBJC_EXPORT
@protocol RTCVideoEncoderFactory <NSObject>
- (nullable id<RTCVideoEncoder>)createEncoder:(RTCVideoCodecInfo *)info;
- (NSArray<RTCVideoCodecInfo *> *)supportedCodecs; // TODO(andersc): "supportedFormats" instead?
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoEncoderFactory.h"
RTC_OBJC_EXPORT
@interface RTCVideoEncoderFactoryH264 : NSObject <RTCVideoEncoderFactory>
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoCodecInfo.h"
#import "RTCVideoEncoder.h"
RTC_OBJC_EXPORT
@interface RTCVideoEncoderH264 : NSObject <RTCVideoEncoder>
- (instancetype)initWithCodecInfo:(RTCVideoCodecInfo *)codecInfo;
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** QP thresholds for encoder. Corresponds to webrtc::VideoEncoder::QpThresholds. */
RTC_OBJC_EXPORT
@interface RTCVideoEncoderQpThresholds : NSObject
- (instancetype)initWithThresholdsLow:(NSInteger)low high:(NSInteger)high;
@property(nonatomic, readonly) NSInteger low;
@property(nonatomic, readonly) NSInteger high;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, RTCVideoCodecMode) {
RTCVideoCodecModeRealtimeVideo,
RTCVideoCodecModeScreensharing,
};
/** Settings for encoder. Corresponds to webrtc::VideoCodec. */
RTC_OBJC_EXPORT
@interface RTCVideoEncoderSettings : NSObject
@property(nonatomic, strong) NSString *name;
@property(nonatomic, assign) unsigned short width;
@property(nonatomic, assign) unsigned short height;
@property(nonatomic, assign) unsigned int startBitrate; // kilobits/sec.
@property(nonatomic, assign) unsigned int maxBitrate;
@property(nonatomic, assign) unsigned int minBitrate;
@property(nonatomic, assign) unsigned int targetBitrate;
@property(nonatomic, assign) uint32_t maxFramerate;
@property(nonatomic, assign) unsigned int qpMax;
@property(nonatomic, assign) RTCVideoCodecMode mode;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoEncoder.h"
RTC_OBJC_EXPORT
@interface RTCVideoEncoderVP8 : NSObject
/* This returns a VP8 encoder that can be returned from a RTCVideoEncoderFactory injected into
* RTCPeerConnectionFactory. Even though it implements the RTCVideoEncoder protocol, it can not be
* used independently from the RTCPeerConnectionFactory.
*/
+ (id<RTCVideoEncoder>)vp8Encoder;
@end
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCVideoEncoder.h"
RTC_OBJC_EXPORT
@interface RTCVideoEncoderVP9 : NSObject
/* This returns a VP9 encoder that can be returned from a RTCVideoEncoderFactory injected into
* RTCPeerConnectionFactory. Even though it implements the RTCVideoEncoder protocol, it can not be
* used independently from the RTCPeerConnectionFactory.
*/
+ (id<RTCVideoEncoder>)vp9Encoder;
@end
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, RTCVideoRotation) {
RTCVideoRotation_0 = 0,
RTCVideoRotation_90 = 90,
RTCVideoRotation_180 = 180,
RTCVideoRotation_270 = 270,
};
@protocol RTCVideoFrameBuffer;
// RTCVideoFrame is an ObjectiveC version of webrtc::VideoFrame.
RTC_OBJC_EXPORT
@interface RTCVideoFrame : NSObject
/** Width without rotation applied. */
@property(nonatomic) int width;
/** Height without rotation applied. */
@property(nonatomic) int height;
@property(nonatomic, readonly) RTCVideoRotation rotation;
/** Timestamp in nanoseconds. */
@property(nonatomic, readonly) int64_t timeStampNs;
/** Timestamp 90 kHz. */
@property(nonatomic, assign) int32_t timeStamp;
@property(nonatomic, readonly) id<RTCVideoFrameBuffer> buffer;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype) new NS_UNAVAILABLE;
/** Initialize an RTCVideoFrame from a pixel buffer, rotation, and timestamp.
* Deprecated - initialize with a RTCCVPixelBuffer instead
*/
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
rotation:(RTCVideoRotation)rotation
timeStampNs:(int64_t)timeStampNs
DEPRECATED_MSG_ATTRIBUTE("use initWithBuffer instead");
/** Initialize an RTCVideoFrame from a pixel buffer combined with cropping and
* scaling. Cropping will be applied first on the pixel buffer, followed by
* scaling to the final resolution of scaledWidth x scaledHeight.
*/
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
scaledWidth:(int)scaledWidth
scaledHeight:(int)scaledHeight
cropWidth:(int)cropWidth
cropHeight:(int)cropHeight
cropX:(int)cropX
cropY:(int)cropY
rotation:(RTCVideoRotation)rotation
timeStampNs:(int64_t)timeStampNs
DEPRECATED_MSG_ATTRIBUTE("use initWithBuffer instead");
/** Initialize an RTCVideoFrame from a frame buffer, rotation, and timestamp.
*/
- (instancetype)initWithBuffer:(id<RTCVideoFrameBuffer>)frameBuffer
rotation:(RTCVideoRotation)rotation
timeStampNs:(int64_t)timeStampNs;
/** Return a frame that is guaranteed to be I420, i.e. it is possible to access
* the YUV data on it.
*/
- (RTCVideoFrame *)newI420VideoFrame;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@protocol RTCI420Buffer;
// RTCVideoFrameBuffer is an ObjectiveC version of webrtc::VideoFrameBuffer.
RTC_OBJC_EXPORT
@protocol RTCVideoFrameBuffer <NSObject>
@property(nonatomic, readonly) int width;
@property(nonatomic, readonly) int height;
- (id<RTCI420Buffer>)toI420;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#endif
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@class RTCVideoFrame;
typedef NS_ENUM(NSInteger, RenderMode) {
RENDER_FIT,
RENDER_FILL
};
RTC_OBJC_EXPORT
@protocol RTCVideoRenderer <NSObject>
/** The size of the frame. */
- (void)setSize:(CGSize)size;
/** The frame to be displayed. */
- (void)renderFrame:(nullable RTCVideoFrame *)frame;
@end
RTC_OBJC_EXPORT
@protocol RTCVideoViewDelegate
- (void)videoView:(id<RTCVideoRenderer>)videoView didChangeVideoSize:(CGSize)size;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCMediaSource.h"
#import "RTCVideoCapturer.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTCVideoSource : RTCMediaSource <RTCVideoCapturerDelegate>
- (instancetype)init NS_UNAVAILABLE;
/**
* Calling this function will cause frames to be scaled down to the
* requested resolution. Also, frames will be cropped to match the
* requested aspect ratio, and frames will be dropped to match the
* requested fps. The requested aspect ratio is orientation agnostic and
* will be adjusted to maintain the input orientation, so it doesn't
* matter if e.g. 1280x720 or 720x1280 is requested.
*/
- (void)adaptOutputFormatToWidth:(int)width height:(int)height fps:(int)fps;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import "RTCMediaStreamTrack.h"
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@protocol RTCVideoRenderer;
@class RTCPeerConnectionFactory;
@class RTCVideoSource;
RTC_OBJC_EXPORT
@interface RTCVideoTrack : RTCMediaStreamTrack
/** The video source for this video track. */
@property(nonatomic, readonly) RTCVideoSource *source;
- (instancetype)init NS_UNAVAILABLE;
/** Register a renderer that will render all frames received on this track. */
- (void)addRenderer:(id<RTCVideoRenderer>)renderer;
/** Deregister a renderer. */
- (void)removeRenderer:(id<RTCVideoRenderer>)renderer;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <Foundation/Foundation.h>
#import "RTCVideoFrame.h"
NS_ASSUME_NONNULL_BEGIN
/**
* RTCVideoViewShading provides a way for apps to customize the OpenGL(ES) shaders used in
* rendering for the RTCEAGLVideoView/RTCNSGLVideoView.
*/
RTC_OBJC_EXPORT
@protocol RTCVideoViewShading <NSObject>
/** Callback for I420 frames. Each plane is given as a texture. */
- (void)applyShadingForFrameWithWidth:(int)width
height:(int)height
rotation:(RTCVideoRotation)rotation
yPlane:(GLuint)yPlane
uPlane:(GLuint)uPlane
vPlane:(GLuint)vPlane;
/** Callback for NV12 frames. Each plane is given as a texture. */
- (void)applyShadingForFrameWithWidth:(int)width
height:(int)height
rotation:(RTCVideoRotation)rotation
yPlane:(GLuint)yPlane
uvPlane:(GLuint)uvPlane;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCMacros.h"
#import "RTCVideoFrameBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Protocol for RTCVideoFrameBuffers containing YUV planar data. */
RTC_OBJC_EXPORT
@protocol RTCYUVPlanarBuffer <RTCVideoFrameBuffer>
@property(nonatomic, readonly) int chromaWidth;
@property(nonatomic, readonly) int chromaHeight;
@property(nonatomic, readonly) const uint8_t *dataY;
@property(nonatomic, readonly) const uint8_t *dataU;
@property(nonatomic, readonly) const uint8_t *dataV;
@property(nonatomic, readonly) int strideY;
@property(nonatomic, readonly) int strideU;
@property(nonatomic, readonly) int strideV;
- (instancetype)initWithWidth:(int)width
height:(int)height
dataY:(const uint8_t *)dataY
dataU:(const uint8_t *)dataU
dataV:(const uint8_t *)dataV;
- (instancetype)initWithWidth:(int)width height:(int)height;
- (instancetype)initWithWidth:(int)width
height:(int)height
strideY:(int)strideY
strideU:(int)strideU
strideV:(int)strideV;
@end
NS_ASSUME_NONNULL_END
#import <Foundation/Foundation.h>
#import <WebRTC/WebRTC.h>
@interface RtcConnection : NSObject
@property (readwrite, nonatomic) NSString *handleId;
@property (readwrite, nonatomic) NSString *streamID;
@property (readwrite, nonatomic) ClientType clientType;
@property (readwrite, nonatomic) RTCPeerConnection *connection;
@property (readwrite, nonatomic) RTCVideoTrack *videoTrack;
@property (readwrite, nonatomic) RTCEAGLVideoView *videoView;
@property (readwrite, nonatomic) RTCAudioTrack *audioTrack;
@property (readwrite, nonatomic) NSString *receive_video;
@end
#import <Foundation/Foundation.h>
static const char *WebrtcVersion = "0.3.5";
#define StreamID_Camera @"camera"
#define StreamID_Window @"window"
//全字符串是否为空
#define KWebrtcStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str isEqual: @"null"] || [str isEqual: @"<null>"] || [str isEqual: @"nil"] || [str length] < 1 ? YES : NO )
//数组是否为空
#define KWebrtcArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)
//字典是否为空
#define KWebrtcDictIsEmpty(dict) (dict == nil || [dict isKindOfClass:[NSNull class]] || dict.allKeys.count == 0)
typedef NS_ENUM(NSInteger, ClientType) {
CLIENT_TEACHER,
CLIENT_STUDENT
};
typedef NS_ENUM(NSInteger, ClassMode) {
CLASS_BIG,
CLASS_SMALL
};
#import <Foundation/Foundation.h>
#import "WebRTC.h"
#import "RTCMacros.h"
static const char *ZGWebrtcVersion = "0.1.20";
@protocol RtcFactoryDelegate <NSObject>
- (void)onCreateView:(RTCEAGLVideoView*)view
streamID:(NSString*)streamID
clientType:(ClientType)clientType;
- (void)onCreateSdp:(NSString *)handleId
streamID:(NSString*)streamID
sdp:(RTCSessionDescription *)sdp;
- (void)onCreateCandidate:(NSString *)handleId streamID:(NSString*)streamID candidate:(RTCIceCandidate *)candidate;
- (void)onCreateSubscriber:(NSString *)handleId streamID:(NSString *)streamID;
@optional
- (void)onViewSizeChanged:(RTCEAGLVideoView *)videoView streamID:(NSString*)streamID didChangeVideoSize:(CGSize)size;
- (void)onVolumeChanged:(NSString*)handleID didChangeVolume:(unsigned short)volume;
- (void)onIceState:(RTCIceConnectionState)state handleId:(NSString *)handleId streamID:(NSString*)streamID clientType:(ClientType)clientType;
- (void)onOpenCameraFailed;
- (void)onSendStats:(RTCMediaStats *)stats;
- (void)onRecieveStats:(RTCMediaStats *)stats;
- (void)onLogOut:(NSString *)logInfo;
@end
@interface RtcFactory : NSObject <RTCPeerConnectionDelegate,RTCVideoViewDelegate,RTCAudioSinkDelegate,RtcCameraDelegate>
- (instancetype)init;
@property(nonatomic, weak) id<RtcFactoryDelegate> delegate;
@property(nonatomic, assign) BOOL smallClass;
/**
设置小班课
@param smallClass 是否为小班课
*/
- (void)setSmallClass:(BOOL)smallClass;
/**
是否推送视频
@param bVideo 视频推送开关
*/
- (void)setLocalVideoEnable:(BOOL)bVideo;
/**
设置所有流声音大小
@param volume 声音大小,范围(0-10)
*/
- (void)setVolume:(double)volume;
/**
是否推送音频
@param bAudio 音频推送开关
*/
- (void)setLocalAudioEnable:(BOOL)bAudio;
/**
静音设置🔇
@param bMute 是否静音
*/
- (void)speakMute:(BOOL)bMute;
/**
创建推流用户
@param handleId 推流用户ID
*/
- (void)setPublisher:(NSString *)handleId;
/**
推流用户设置服务器sdp
@param handleId 推流用户ID
@param jsep 远程服务器sdp信息
*/
- (void)setPublisherRemoteJsep:(NSString *)handleId dict:(NSDictionary *)jsep;
/**
订阅用户设置远程推流用户
@param handleId 远程用户ID
@param streamID 远程用户采集设备类型
@param clientType 用户角色类型:老师/学生
*/
- (void)setSubscriberHandleRemotePublisher: (NSString *)handleId streamID:(NSString*)streamID clientType:(ClientType)clientType;
/**
订阅用户设置远程sdp
@param handleId 远程用户的ID
@param streamID 远程用户采集设备类型
@param jsep 远程sdp
*/
- (void)setSubscriberHandleRemoteJsep: (NSString *)handleId streamID:(NSString*)streamID dict:(NSDictionary *)jsep;
/**
推流断开
@param handleId 拉取的连麦用户ID
@param streamID 流类型
*/
- (void)stopPull:(NSString *)handleId streamID:(NSString *)streamID;
/**
停止本地推流
*/
- (void)stopPublish;
/**
远程视频显示控制
@param handleId 当前连麦用户ID
@param bShow 是否显示视频
*/
- (void)showRemoteView:(NSString *)handleId showView:(BOOL)bShow;
/**
切换摄像头
*/
- (void)switchCamera;
/**
播放
*/
- (void)play;
/**
暂停
*/
- (void)pause;
/**
允许回调RTC状态信息
*/
- (void)enbleRTCStats;
/**
获取网络传输帧率,多个通道的平均帧率
@return 帧率
*/
- (int)GetNetFrameRate;
/**
获取网络传输码率
@return 码率(kbps)
*/
- (double)GetNetBitrate;
/**
设置本地推送码
@param minBitrateBps 最小码率(bps)
@param curBitrateBps 正常推送参考码率(bps)
@param maxBitrateBps 最大码率(bps)
*/
- (void)setNetBitrate:(NSNumber*)minBitrateBps curBitrate:(NSNumber*)curBitrateBps maxBitrate:(NSNumber*)maxBitrateBps;
/**
关闭连麦
*/
- (void)close;
@end
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, RTCDeviceType) {
RTCDeviceTypeUnknown,
RTCDeviceTypeIPhone1G,
RTCDeviceTypeIPhone3G,
RTCDeviceTypeIPhone3GS,
RTCDeviceTypeIPhone4,
RTCDeviceTypeIPhone4Verizon,
RTCDeviceTypeIPhone4S,
RTCDeviceTypeIPhone5GSM,
RTCDeviceTypeIPhone5GSM_CDMA,
RTCDeviceTypeIPhone5CGSM,
RTCDeviceTypeIPhone5CGSM_CDMA,
RTCDeviceTypeIPhone5SGSM,
RTCDeviceTypeIPhone5SGSM_CDMA,
RTCDeviceTypeIPhone6Plus,
RTCDeviceTypeIPhone6,
RTCDeviceTypeIPhone6S,
RTCDeviceTypeIPhone6SPlus,
RTCDeviceTypeIPhone7,
RTCDeviceTypeIPhone7Plus,
RTCDeviceTypeIPhoneSE,
RTCDeviceTypeIPhone8,
RTCDeviceTypeIPhone8Plus,
RTCDeviceTypeIPhoneX,
RTCDeviceTypeIPhoneXS,
RTCDeviceTypeIPhoneXSMax,
RTCDeviceTypeIPhoneXR,
RTCDeviceTypeIPodTouch1G,
RTCDeviceTypeIPodTouch2G,
RTCDeviceTypeIPodTouch3G,
RTCDeviceTypeIPodTouch4G,
RTCDeviceTypeIPodTouch5G,
RTCDeviceTypeIPodTouch6G,
RTCDeviceTypeIPad,
RTCDeviceTypeIPad2Wifi,
RTCDeviceTypeIPad2GSM,
RTCDeviceTypeIPad2CDMA,
RTCDeviceTypeIPad2Wifi2,
RTCDeviceTypeIPadMiniWifi,
RTCDeviceTypeIPadMiniGSM,
RTCDeviceTypeIPadMiniGSM_CDMA,
RTCDeviceTypeIPad3Wifi,
RTCDeviceTypeIPad3GSM_CDMA,
RTCDeviceTypeIPad3GSM,
RTCDeviceTypeIPad4Wifi,
RTCDeviceTypeIPad4GSM,
RTCDeviceTypeIPad4GSM_CDMA,
RTCDeviceTypeIPad5,
RTCDeviceTypeIPad6,
RTCDeviceTypeIPadAirWifi,
RTCDeviceTypeIPadAirCellular,
RTCDeviceTypeIPadAirWifiCellular,
RTCDeviceTypeIPadAir2,
RTCDeviceTypeIPadMini2GWifi,
RTCDeviceTypeIPadMini2GCellular,
RTCDeviceTypeIPadMini2GWifiCellular,
RTCDeviceTypeIPadMini3,
RTCDeviceTypeIPadMini4,
RTCDeviceTypeIPadPro9Inch,
RTCDeviceTypeIPadPro12Inch,
RTCDeviceTypeIPadPro12Inch2,
RTCDeviceTypeIPadPro10Inch,
RTCDeviceTypeSimulatori386,
RTCDeviceTypeSimulatorx86_64,
};
@interface UIDevice (RTCDevice)
+ (RTCDeviceType)deviceType;
+ (BOOL)isIOS11OrLater;
@end
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE 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.
*/
#import <WebRTC/RtcDefined.h>
#import <WebRTC/RTCCodecSpecificInfo.h>
#import <WebRTC/RTCEncodedImage.h>
#import <WebRTC/RTCI420Buffer.h>
#import <WebRTC/RTCLogging.h>
#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMutableI420Buffer.h>
#import <WebRTC/RTCMutableYUVPlanarBuffer.h>
#import <WebRTC/RTCRtpFragmentationHeader.h>
#import <WebRTC/RTCVideoCapturer.h>
#import <WebRTC/RTCVideoCodecInfo.h>
#import <WebRTC/RTCVideoDecoder.h>
#import <WebRTC/RTCVideoDecoderFactory.h>
#import <WebRTC/RTCVideoEncoder.h>
#import <WebRTC/RTCVideoEncoderFactory.h>
#import <WebRTC/RTCVideoEncoderQpThresholds.h>
#import <WebRTC/RTCVideoEncoderSettings.h>
#import <WebRTC/RTCVideoFrame.h>
#import <WebRTC/RTCVideoFrameBuffer.h>
#import <WebRTC/RTCVideoRenderer.h>
#import <WebRTC/RTCYUVPlanarBuffer.h>
#import <WebRTC/RTCAudioSession.h>
#import <WebRTC/RTCAudioSessionConfiguration.h>
#import <WebRTC/RTCCameraVideoCapturer.h>
#import <WebRTC/RTCFileVideoCapturer.h>
#import <WebRTC/RTCMTLVideoView.h>
#import <WebRTC/RTCEAGLVideoView.h>
#import <WebRTC/RTCVideoViewShading.h>
#import <WebRTC/RTCCodecSpecificInfoH264.h>
#import <WebRTC/RTCDefaultVideoDecoderFactory.h>
#import <WebRTC/RTCDefaultVideoEncoderFactory.h>
#import <WebRTC/RTCH264ProfileLevelId.h>
#import <WebRTC/RTCVideoDecoderFactoryH264.h>
#import <WebRTC/RTCVideoDecoderH264.h>
#import <WebRTC/RTCVideoEncoderFactoryH264.h>
#import <WebRTC/RTCVideoEncoderH264.h>
#import <WebRTC/RTCCVPixelBuffer.h>
#import <WebRTC/RTCCameraPreviewView.h>
#import <WebRTC/RTCDispatcher.h>
#import <WebRTC/UIDevice+RTCDevice.h>
#import <WebRTC/RTCAudioSink.h>
#import <WebRTC/RTCAudioSource.h>
#import <WebRTC/RTCAudioTrack.h>
#import <WebRTC/RTCConfiguration.h>
#import <WebRTC/RTCDataChannel.h>
#import <WebRTC/RTCDataChannelConfiguration.h>
#import <WebRTC/RTCFieldTrials.h>
#import <WebRTC/RTCIceCandidate.h>
#import <WebRTC/RTCIceServer.h>
#import <WebRTC/RTCIntervalRange.h>
#import <WebRTC/RTCLegacyStatsReport.h>
#import <WebRTC/RTCMediaConstraints.h>
#import <WebRTC/RTCMediaSource.h>
#import <WebRTC/RTCMediaStream.h>
#import <WebRTC/RTCMediaStreamTrack.h>
#import <WebRTC/RTCMetrics.h>
#import <WebRTC/RTCMetricsSampleInfo.h>
#import <WebRTC/RTCPeerConnection.h>
#import <WebRTC/RTCPeerConnectionFactory.h>
#import <WebRTC/RTCPeerConnectionFactoryOptions.h>
#import <WebRTC/RTCRtcpParameters.h>
#import <WebRTC/RTCRtpCodecParameters.h>
#import <WebRTC/RTCRtpEncodingParameters.h>
#import <WebRTC/RTCRtpHeaderExtension.h>
#import <WebRTC/RTCRtpParameters.h>
#import <WebRTC/RTCRtpReceiver.h>
#import <WebRTC/RTCRtpSender.h>
#import <WebRTC/RTCRtpTransceiver.h>
#import <WebRTC/RTCDtmfSender.h>
#import <WebRTC/RTCSSLAdapter.h>
#import <WebRTC/RTCSessionDescription.h>
#import <WebRTC/RTCTracing.h>
#import <WebRTC/RTCCertificate.h>
#import <WebRTC/RTCCryptoOptions.h>
#import <WebRTC/RTCVideoSource.h>
#import <WebRTC/RTCVideoTrack.h>
#import <WebRTC/RTCVideoCodecConstants.h>
#import <WebRTC/RTCVideoDecoderVP8.h>
#import <WebRTC/RTCVideoDecoderVP9.h>
#import <WebRTC/RTCVideoEncoderVP8.h>
#import <WebRTC/RTCVideoEncoderVP9.h>
#import <WebRTC/RTCNativeI420Buffer.h>
#import <WebRTC/RTCNativeMutableI420Buffer.h>
#import <WebRTC/RTCCallbackLogger.h>
#import <WebRTC/RTCFileLogger.h>
//#import <WebRTC/RTCChannel.h>
//#import <WebRTC/AresChannel.h>
//#import <WebRTC/JanusChannel.h>
//#import <WebRTC/RtcFactory.h>
framework module WebRTC {
umbrella header "WebRTC.h"
export *
module * { export * }
}
/*
* ZGIJKAVMoviePlayerController.h
*
* Copyright (c) 2014 Bilibili
* Copyright (c) 2014 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
File: AVPlayerDemoPlaybackViewController.h
Abstract: UIViewController managing a playback view, thumbnail view, and associated playback UI.
Version: 1.3
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
#import "ZGIJKMediaPlayback.h"
@interface ZGIJKAVMoviePlayerController : NSObject <ZGIJKMediaPlayback>
- (id)initWithContentURL:(NSURL *)aUrl;
- (id)initWithContentURLString:(NSString *)aUrl;
+ (id)getInstance:(NSString *)aUrl;
@end
/*
* Copyright (c) 2016 Bilibili
* Copyright (c) 2016 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <Foundation/Foundation.h>
@interface ZGIJKFFMonitor : NSObject
- (instancetype)init;
@property(nonatomic) NSDictionary *mediaMeta;
@property(nonatomic) NSDictionary *videoMeta;
@property(nonatomic) NSDictionary *audioMeta;
@property(nonatomic, readonly) int64_t duration; // milliseconds
@property(nonatomic, readonly) int64_t bitrate; // bit / sec
@property(nonatomic, readonly) float fps; // frame / sec
@property(nonatomic, readonly) int width; // width
@property(nonatomic, readonly) int height; // height
@property(nonatomic, readonly) NSString *vcodec; // video codec
@property(nonatomic, readonly) NSString *acodec; // audio codec
@property(nonatomic, readonly) int sampleRate;
@property(nonatomic, readonly) int64_t channelLayout;
@property(nonatomic) NSString *vdecoder;
@property(nonatomic) int tcpError;
@property(nonatomic) NSString *remoteIp;
@property(nonatomic) int httpError;
@property(nonatomic) NSString *httpUrl;
@property(nonatomic) NSString *httpHost;
@property(nonatomic) int httpCode;
@property(nonatomic) int64_t httpOpenTick;
@property(nonatomic) int64_t httpSeekTick;
@property(nonatomic) int httpOpenCount;
@property(nonatomic) int httpSeekCount;
@property(nonatomic) int64_t lastHttpOpenDuration;
@property(nonatomic) int64_t lastHttpSeekDuration;
@property(nonatomic) int64_t prepareStartTick;
@property(nonatomic) int64_t prepareDuration;
@property(nonatomic) int64_t firstVideoFrameLatency;
@property(nonatomic) int64_t lastPrerollStartTick;
@property(nonatomic) int64_t lastPrerollDuration;
@end
/*
* ZGIJKFFMoviePlayerController.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "ZGIJKMediaPlayback.h"
#import "ZGIJKFFMonitor.h"
#import "ZGIJKFFOptions.h"
// media meta
#define k_IJKM_KEY_FORMAT @"format"
#define k_IJKM_KEY_DURATION_US @"duration_us"
#define k_IJKM_KEY_START_US @"start_us"
#define k_IJKM_KEY_BITRATE @"bitrate"
// stream meta
#define k_IJKM_KEY_TYPE @"type"
#define k_IJKM_VAL_TYPE__VIDEO @"video"
#define k_IJKM_VAL_TYPE__AUDIO @"audio"
#define k_IJKM_VAL_TYPE__UNKNOWN @"unknown"
#define k_IJKM_KEY_CODEC_NAME @"codec_name"
#define k_IJKM_KEY_CODEC_PROFILE @"codec_profile"
#define k_IJKM_KEY_CODEC_LONG_NAME @"codec_long_name"
// stream: video
#define k_IJKM_KEY_WIDTH @"width"
#define k_IJKM_KEY_HEIGHT @"height"
#define k_IJKM_KEY_FPS_NUM @"fps_num"
#define k_IJKM_KEY_FPS_DEN @"fps_den"
#define k_IJKM_KEY_TBR_NUM @"tbr_num"
#define k_IJKM_KEY_TBR_DEN @"tbr_den"
#define k_IJKM_KEY_SAR_NUM @"sar_num"
#define k_IJKM_KEY_SAR_DEN @"sar_den"
// stream: audio
#define k_IJKM_KEY_SAMPLE_RATE @"sample_rate"
#define k_IJKM_KEY_CHANNEL_LAYOUT @"channel_layout"
#define kk_IJKM_KEY_STREAMS @"streams"
#define k_IJKM_TIMEINTERVAL 2.0
typedef enum IJKLogLevel {
k_IJK_LOG_UNKNOWN = 0,
k_IJK_LOG_DEFAULT = 1,
k_IJK_LOG_VERBOSE = 2,
k_IJK_LOG_DEBUG = 3,
k_IJK_LOG_INFO = 4,
k_IJK_LOG_WARN = 5,
k_IJK_LOG_ERROR = 6,
k_IJK_LOG_FATAL = 7,
k_IJK_LOG_SILENT = 8,
} IJKLogLevel;
@interface ZGIJKFFMoviePlayerController : NSObject <ZGIJKMediaPlayback>
- (id)initWithContentURL:(NSURL *)aUrl
withOptions:(ZGIJKFFOptions *)options;
- (id)initWithContentURLString:(NSString *)aUrlString
withOptions:(ZGIJKFFOptions *)options;
- (void)removeView;
- (int64_t)trafficStatistic;
- (float)dropFrameRate;
- (BOOL)isVideoToolboxOpen;
+ (void)setLogReport:(BOOL)preferLogReport;
+ (void)setLogLevel:(IJKLogLevel)logLevel;
+ (BOOL)checkIfFFmpegVersionMatch:(BOOL)showAlert;
+ (BOOL)checkIfPlayerVersionMatch:(BOOL)showAlert
version:(NSString *)version;
@property(nonatomic, readonly) CGFloat fpsInMeta;
@property(nonatomic, readonly) CGFloat fpsAtOutput;
@property(nonatomic) BOOL shouldShowHudView;
- (void)setOptionValue:(NSString *)value
forKey:(NSString *)key
ofCategory:(IJKFFOptionCategory)category;
- (void)setOptionIntValue:(int64_t)value
forKey:(NSString *)key
ofCategory:(IJKFFOptionCategory)category;
- (void)setFormatOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setCodecOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setSwsOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setPlayerOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setFormatOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (void)setCodecOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (void)setSwsOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (void)setPlayerOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (NSString*)getVideoCodecInfo;
- (NSString*)getAudioCodecInfo;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> segmentOpenDelegate;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> tcpOpenDelegate;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> httpOpenDelegate;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> liveOpenDelegate;
@property (nonatomic, retain) id<IJKMediaNativeInvokeDelegate> nativeInvokeDelegate;
- (void)didShutdown;
#pragma mark KVO properties
@property (nonatomic, readonly) ZGIJKFFMonitor *monitor;
@property (nonatomic, strong) NSThread *thread;
@property (nonatomic, strong) NSTimer *threadTimer;
@end
#define IJK_FF_IO_TYPE_READ (1)
void IJKFFIOStatDebugCallback(const char *url, int type, int bytes);
void IJKFFIOStatRegister(void (*cb)(const char *url, int type, int bytes));
void IJKFFIOStatCompleteDebugCallback(const char *url,
int64_t read_bytes, int64_t total_size,
int64_t elpased_time, int64_t total_duration);
void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
int64_t read_bytes, int64_t total_size,
int64_t elpased_time, int64_t total_duration));
/*
* ZGIJKFFOptions.h
*
* Copyright (c) 2013-2015 Bilibili
* Copyright (c) 2013-2015 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <Foundation/Foundation.h>
#import "ZGIJKMediaPlayback.h"
typedef enum IJKFFOptionCategory {
kIJKFFOptionCategoryFormat = 1,
kIJKFFOptionCategoryCodec = 2,
kIJKFFOptionCategorySws = 3,
kIJKFFOptionCategoryPlayer = 4,
kIJKFFOptionCategorySwr = 5,
} IJKFFOptionCategory;
// for codec option 'skip_loop_filter' and 'skip_frame'
typedef enum IJKAVDiscard {
/* We leave some space between them for extensions (drop some
* keyframes for intra-only or drop just some bidir frames). */
IJK_AVDISCARD_NONE =-16, ///< discard nothing
IJK_AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
IJK_AVDISCARD_NONREF = 8, ///< discard all non reference
IJK_AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
IJK_AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
IJK_AVDISCARD_ALL = 48, ///< discard all
} IJKAVDiscard;
struct IjkMediaPlayer;
@interface ZGIJKFFOptions : NSObject
+(ZGIJKFFOptions *)optionsByDefault:(PlayerMode)playerMode;
-(void)applyTo:(struct IjkMediaPlayer *)mediaPlayer;
- (void)setOptionValue:(NSString *)value
forKey:(NSString *)key
ofCategory:(IJKFFOptionCategory)category;
- (void)setOptionIntValue:(int64_t)value
forKey:(NSString *)key
ofCategory:(IJKFFOptionCategory)category;
-(void)setFormatOptionValue: (NSString *)value forKey:(NSString *)key;
-(void)setCodecOptionValue: (NSString *)value forKey:(NSString *)key;
-(void)setSwsOptionValue: (NSString *)value forKey:(NSString *)key;
-(void)setPlayerOptionValue: (NSString *)value forKey:(NSString *)key;
-(void)setFormatOptionIntValue: (int64_t)value forKey:(NSString *)key;
-(void)setCodecOptionIntValue: (int64_t)value forKey:(NSString *)key;
-(void)setSwsOptionIntValue: (int64_t)value forKey:(NSString *)key;
-(void)setPlayerOptionIntValue: (int64_t)value forKey:(NSString *)key;
@property(nonatomic) BOOL showHudView;
@end
/*
* ZGIJKKVOController.h
*
* Copyright (c) 2014 Bilibili
* Copyright (c) 2014 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <Foundation/Foundation.h>
@interface ZGIJKKVOController : NSObject
- (id)initWithTarget:(NSObject *)target;
- (void)safelyAddObserver:(NSObject *)observer
forKeyPath:(NSString *)keyPath
options:(NSKeyValueObservingOptions)options
context:(void *)context;
- (void)safelyRemoveObserver:(NSObject *)observer
forKeyPath:(NSString *)keyPath;
- (void)safelyRemoveAllObservers;
@end
/*
* ZGIJKMPMoviePlayerController.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "ZGIJKMediaPlayback.h"
#import <MediaPlayer/MediaPlayer.h>
@interface ZGIJKMPMoviePlayerController : MPMoviePlayerController <ZGIJKMediaPlayback>
- (id)initWithContentURL:(NSURL *)aUrl;
- (id)initWithContentURLString:(NSString *)aUrl;
@end
/*
* IJKMediaFramework.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <UIKit/UIKit.h>
//! Project version number for IJKMediaFramework.
FOUNDATION_EXPORT double IJKMediaFrameworkVersionNumber;
//! Project version string for IJKMediaFramework.
FOUNDATION_EXPORT const unsigned char IJKMediaFrameworkVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <IJKMediaFrameworkWithSSL/PublicHeader.h>
#import <ZGIJKMediaFramework/ZGIJKMediaPlayback.h>
#import <ZGIJKMediaFramework/ZGIJKMPMoviePlayerController.h>
#import <ZGIJKMediaFramework/ZGIJKFFOptions.h>
#import <ZGIJKMediaFramework/ZGIJKFFMoviePlayerController.h>
#import <ZGIJKMediaFramework/ZGIJKAVMoviePlayerController.h>
#import <ZGIJKMediaFramework/ZGIJKMediaModule.h>
#import <ZGIJKMediaFramework/ZGIJKMediaPlayer.h>
#import <ZGIJKMediaFramework/ZGIJKNotificationManager.h>
#import <ZGIJKMediaFramework/ZGIJKKVOController.h>
#import <ZGIJKMediaFramework/ZGMoviePlayer.h>
// backward compatible for old names
#define ZGIJKMediaPlaybackIsPreparedToPlayDidChangeNotification ZGIJKMPMediaPlaybackIsPreparedToPlayDidChangeNotification
#define ZGIJKMoviePlayerLoadStateDidChangeNotification ZGIJKMPMoviePlayerLoadStateDidChangeNotification
#define ZGIJKMoviePlayerPlaybackDidFinishNotification ZGIJKMPMoviePlayerPlaybackDidFinishNotification
#define ZGIJKMoviePlayerPlaybackDidFinishReasonUserInfoKey ZGIJKMPMoviePlayerPlaybackDidFinishReasonUserInfoKey
#define ZGIJKMoviePlayerPlaybackStateDidChangeNotification ZGIJKMPMoviePlayerPlaybackStateDidChangeNotification
#define ZGIJKMoviePlayerIsAirPlayVideoActiveDidChangeNotification ZGIJKMPMoviePlayerIsAirPlayVideoActiveDidChangeNotification
#define ZGIJKMoviePlayerVideoDecoderOpenNotification ZGIJKMPMoviePlayerVideoDecoderOpenNotification
#define ZGIJKMoviePlayerFirstVideoFrameRenderedNotification ZGIJKMPMoviePlayerFirstVideoFrameRenderedNotification
#define ZGIJKMoviePlayerFirstAudioFrameRenderedNotification ZGIJKMPMoviePlayerFirstAudioFrameRenderedNotification
#define ZGIJKMPMoviePlayerAccurateSeekCompleteNotification ZGIJKMPMoviePlayerAccurateSeekCompleteNotification
/*
* ZGIJKMediaModule.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <Foundation/Foundation.h>
@interface ZGIJKMediaModule : NSObject
+ (ZGIJKMediaModule *)sharedModule;
@property(atomic, getter=isAppIdleTimerDisabled) BOOL appIdleTimerDisabled;
@property(atomic, getter=isMediaModuleIdleTimerDisabled) BOOL mediaModuleIdleTimerDisabled;
@end
/*
* ZGIJKMediaPlayback.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, IJKMPMovieScalingMode) {
IJKMPMovieScalingModeNone, // No scaling
IJKMPMovieScalingModeAspectFit, // Uniform scale until one dimension fits
IJKMPMovieScalingModeAspectFill, // Uniform scale until the movie fills the visible bounds. One dimension may have clipped contents
IJKMPMovieScalingModeFill // Non-uniform scale. Both render dimensions will exactly match the visible bounds
};
typedef NS_ENUM(NSInteger, IJKMPMoviePlaybackState) {
IJKMPMoviePlaybackStateStopped,
IJKMPMoviePlaybackStatePlaying,
IJKMPMoviePlaybackStatePaused,
IJKMPMoviePlaybackStateInterrupted,
IJKMPMoviePlaybackStateSeekingForward,
IJKMPMoviePlaybackStateSeekingBackward
};
typedef NS_OPTIONS(NSUInteger, IJKMPMovieLoadState) {
IJKMPMovieLoadStateUnknown = 0,
IJKMPMovieLoadStatePlayable = 1 << 0,
IJKMPMovieLoadStatePlaythroughOK = 1 << 1, // Playback will be automatically started in this state when shouldAutoplay is YES
IJKMPMovieLoadStateStalled = 1 << 2, // Playback will be automatically paused in this state, if started
};
typedef NS_ENUM(NSInteger, IJKMPMovieFinishReason) {
IJKMPMovieFinishReasonPlaybackEnded,
IJKMPMovieFinishReasonPlaybackError,
IJKMPMovieFinishReasonUserExited
};
typedef NS_ENUM(NSInteger, IJKMPMoviePullState) {
IJKMPMoviePullStateFailed,
IJKMPMoviePullStateSuccessed
};
typedef NS_ENUM(NSInteger, IJKMPMovieWarningType) {
IJKMPMovieBufferEmptyWarning,
IJKMPMovieAVLostSynWarning,
IJKMPMovieNetworkDelayWarning
};
typedef NS_ENUM(NSInteger, IJKMPMovieRequestType) {
IJKMPMovieTypeLocal,
IJKMPMovieTypeNetwork
};
typedef NS_ENUM(NSInteger, IJKMPMovieProtocal) {
IJKMPMovieProtocalRTYMP,
IJKMPMovieProtocalHLS,
IJKMPMovieProtocalMP4 = 3
};
typedef NS_ENUM(NSInteger, IJKMPMovieCodecMode) {
IJKMPMovieUnknownCodec,
IJKMPMovieMediaCodec,
IJKMPMovieAVCodec
};
// -----------------------------------------------------------------------------
// Thumbnails
typedef NS_ENUM(NSInteger, IJKMPMovieTimeOption) {
IJKMPMovieTimeOptionNearestKeyFrame,
IJKMPMovieTimeOptionExact
};
typedef NS_ENUM(NSInteger, PlayerMode) {
PLAYER_MODE_LOCAL,
PLAYER_MODE_VOD,
PLAYER_MODE_LIVING,
PLAYER_MODE_P2P
};
@protocol ZGIJKMediaPlayback;
#pragma mark ZGIJKMediaPlayback
@protocol ZGIJKMediaPlayback <NSObject>
- (void)prepareToPlay;
- (void)play;
- (void)play_from:(NSTimeInterval)aSeekTime; //modify 2019-11-11
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;
- (void)shutdown;
- (void)setPauseInBackground:(BOOL)pause;
- (void)setScalingMode: (IJKMPMovieScalingMode) aScalingMode;
- (void)seek:(NSTimeInterval)aSeekTime;
- (NSString*)getVideoCodecInfo;
- (NSString*)getAudioCodecInfo;
- (void)bindPlayerToView:(UIView *)playerView;
- (void)removeView;
- (void)reset;
- (void)mute:(BOOL)mute;
- (void)resetVideoUrl:(NSString*)url;
@property(nonatomic) NSTimeInterval currentPlaybackTime;
@property(nonatomic, readonly) NSTimeInterval duration;
@property(nonatomic, readonly) NSTimeInterval playableDuration;
@property(nonatomic, readonly) NSInteger bufferingProgress;
@property(nonatomic, readonly) double networkBitrate;
@property(nonatomic, readonly) BOOL isPreparedToPlay;
@property(nonatomic, readonly) IJKMPMoviePlaybackState playbackState;
@property(nonatomic, readonly) IJKMPMovieLoadState loadState;
@property(nonatomic, readonly) int64_t numberOfBytesTransferred;
@property(nonatomic, readonly) CGSize naturalSize;
@property(nonatomic) IJKMPMovieScalingMode scalingMode;
@property(nonatomic) BOOL shouldAutoplay;
@property (nonatomic) BOOL allowsMediaAirPlay;
@property (nonatomic) BOOL isDanmakuMediaAirPlay;
@property (nonatomic, readonly) BOOL airPlayMediaActive;
@property (nonatomic) float playbackRate;
@property (nonatomic) float playbackVolume;
@property (nonatomic) PlayerMode playerMode;
- (UIImage *)thumbnailImageAtCurrentTime;
#pragma mark Notifications
#ifdef __cplusplus
#define IJK_EXTERN extern "C" __attribute__((visibility ("default")))
#else
#define IJK_EXTERN extern __attribute__((visibility ("default")))
#endif
// -----------------------------------------------------------------------------
// MPMediaPlayback.h
// Posted when the prepared state changes of an object conforming to the MPMediaPlayback protocol changes.
// This supersedes MPMoviePlayerContentPreloadDidFinishNotification.
IJK_EXTERN NSString *const ZGIJKMPMediaPlaybackIsPreparedToPlayDidChangeNotification;
// -----------------------------------------------------------------------------
// MPMoviePlayerController.h
// Movie Player Notifications
// Posted when the scaling mode changes.
IJK_EXTERN NSString* const ZGIJKMPMoviePlayerScalingModeDidChangeNotification;
// Posted when movie playback ends or a user exits playback.
IJK_EXTERN NSString* const ZGIJKMPMoviePlayerPlaybackDidFinishNotification;
IJK_EXTERN NSString* const ZGIJKMPMoviePlayerPlaybackDidFinishReasonUserInfoKey; // NSNumber (IJKMPMovieFinishReason)
// Posted when the playback state changes, either programatically or by the user.
IJK_EXTERN NSString* const ZGIJKMPMoviePlayerPlaybackStateDidChangeNotification;
// Posted when the network load state changes.
IJK_EXTERN NSString* const ZGIJKMPMoviePlayerLoadStateDidChangeNotification;
// Posted when the movie player begins or ends playing video via AirPlay.
IJK_EXTERN NSString* const ZGIJKMPMoviePlayerIsAirPlayVideoActiveDidChangeNotification;
// -----------------------------------------------------------------------------
// Movie Property Notifications
// Calling -prepareToPlay on the movie player will begin determining movie properties asynchronously.
// These notifications are posted when the associated movie property becomes available.
IJK_EXTERN NSString* const ZGIJKMPMovieNaturalSizeAvailableNotification;
// -----------------------------------------------------------------------------
// Extend Notifications
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerVideoDecoderOpenNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerFirstVideoFrameRenderedNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerFirstAudioFrameRenderedNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidSeekCompleteNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidSeekCompleteTargetKey;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidSeekCompleteErrorKey;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidAccurateSeekCompleteCurPos;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerAccurateSeekCompleteNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidKeyFrameNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidBufferEnoughNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidPullStreamStateNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidPullStreamStateUserInfoKey;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerDidKeyFrameNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerWarningNotification;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerWarningUserInfoKey;
IJK_EXTERN NSString *const ZGIJKMPMoviePlayerLoadTimeRanges;
@end
#pragma mark IJKMediaUrlOpenDelegate
// Must equal to the defination in ijkavformat/ijkavformat.h
typedef NS_ENUM(NSInteger, IJKMediaEvent) {
// Notify Events
IJKMediaEvent_WillHttpOpen = 1, // attr: url
IJKMediaEvent_DidHttpOpen = 2, // attr: url, error, http_code
IJKMediaEvent_WillHttpSeek = 3, // attr: url, offset
IJKMediaEvent_DidHttpSeek = 4, // attr: url, offset, error, http_code
// Control Message
IJKMediaCtrl_WillTcpOpen = 0x20001, // IJKMediaUrlOpenData: no args
IJKMediaCtrl_DidTcpOpen = 0x20002, // IJKMediaUrlOpenData: error, family, ip, port, fd
IJKMediaCtrl_WillHttpOpen = 0x20003, // IJKMediaUrlOpenData: url, segmentIndex, retryCounter
IJKMediaCtrl_WillLiveOpen = 0x20005, // IJKMediaUrlOpenData: url, retryCounter
IJKMediaCtrl_WillConcatSegmentOpen = 0x20007, // IJKMediaUrlOpenData: url, segmentIndex, retryCounter
};
#define IJKMediaEventAttrKey_url @"url"
#define IJKMediaEventAttrKey_host @"host"
#define IJKMediaEventAttrKey_error @"error"
#define IJKMediaEventAttrKey_time_of_event @"time_of_event"
#define IJKMediaEventAttrKey_http_code @"http_code"
#define IJKMediaEventAttrKey_offset @"offset"
// event of IJKMediaUrlOpenEvent_xxx
@interface IJKMediaUrlOpenData: NSObject
- (id)initWithUrl:(NSString *)url
event:(IJKMediaEvent)event
segmentIndex:(int)segmentIndex
retryCounter:(int)retryCounter;
@property(nonatomic, readonly) IJKMediaEvent event;
@property(nonatomic, readonly) int segmentIndex;
@property(nonatomic, readonly) int retryCounter;
@property(nonatomic, retain) NSString *url;
@property(nonatomic, assign) int fd;
@property(nonatomic, strong) NSString *msg;
@property(nonatomic) int error; // set a negative value to indicate an error has occured.
@property(nonatomic, getter=isHandled) BOOL handled; // auto set to YES if url changed
@property(nonatomic, getter=isUrlChanged) BOOL urlChanged; // auto set to YES by url changed
@end
@protocol IJKMediaUrlOpenDelegate <NSObject>
- (void)willOpenUrl:(IJKMediaUrlOpenData*) urlOpenData;
@end
@protocol IJKMediaNativeInvokeDelegate <NSObject>
- (int)invoke:(IJKMediaEvent)event attributes:(NSDictionary *)attributes;
@end
/*
* ZGIJKMediaPlayer.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "ZGIJKMediaPlayback.h"
#import "ZGIJKFFOptions.h"
#import "ZGIJKFFMoviePlayerController.h"
#import "ZGIJKAVMoviePlayerController.h"
#import "ZGIJKMediaModule.h"
/*
* IJKNotificationManager.h
*
* Copyright (c) 2016 Bilibili
* Copyright (c) 2016 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import <Foundation/Foundation.h>
@interface ZGIJKNotificationManager : NSObject
- (nullable instancetype)init;
- (void)addObserver:(nonnull id)observer
selector:(nonnull SEL)aSelector
name:(nullable NSString *)aName
object:(nullable id)anObject;
- (void)removeAllObservers:(nonnull id)observer;
@end
/*
* ZGMoviePlayer.h
*
* Copyright (c) 2017 HFLive
* Copyright (c) 2017 Zhang Xiaolin
*
* This file is part of hfPlayer.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "ZGIJKMediaPlayer.h"
static const char *ZGMediaPlayrVersion = "0.3.6";
#define ZGMEDIAPLAYER_BUFFER_TIMEOUT 60
#define ZGMEDIAPLAYER_CONNECT_TIMEOUT 30
#define ZGMEDIAPLAYER_SHOW_POSITION_TIME 0.5
#define ZG_CHANNEL_MONO 1
#define ZG_CHANNEL_STEREO 2
typedef NS_ENUM(NSInteger,PlayerState)
{
PLAYER_STATE_PREPARE,
PLAYER_STATE_PLAY,
PLAYER_STATE_BUFFEREMPTY,
PLAYER_STATE_BUFFERREADY,
PLAYER_STATE_LOADTIMEUPDATE,
PLAYER_STATE_KEYFRAME,
PLAYER_STATE_TIMEOUT,
PLAYER_STATE_COMPLETED,
PLAYER_STATE_ERROR
};
@protocol PlayerStateDelegate <NSObject>
@optional
-(void) onPlayerStateChanged:(PlayerState) playerState;
-(void) onCurrentPosition:(NSTimeInterval)curPos totalDuration:(NSTimeInterval)duration;
@end
@interface ZGMoviePlayer : NSObject
/*
* 播放器类型
* TYPE_UNKNOW_PLAYER 未知类型
* TYPE_FFMOIVE_PLAYER FFplayer播放器
* TYPE_AVMOIVE_PLAYER AVPlayer播放器
* TYPE_MPMOIVE_PLAYER MPMoviePlayer播放器,iOS9之后被弃用
*/
typedef enum ZGPlayerType {
TYPE_UNKNOW_PLAYER = 0,
TYPE_FFMOIVE_PLAYER = 1,
TYPE_AVMOIVE_PLAYER = 2,
TYPE_MPMOIVE_PLAYER = 3,
} ZGPlayerType;
@property(nonatomic, strong) NSURL* url; // 拉流地址
@property(nonatomic,weak) id<PlayerStateDelegate> delegate;
// 初始化播放器
- (id)init;
- (id)initWithServer:(NSString *)serverAddr;
// 设置本地服务地址
- (void)setServerAddr:(NSString *)serverAddr;
// 设置播放地址
- (BOOL)setContentURL:(NSURL *)aUrl;
// 重启
- (void)reset;
// 设置播放器渲染视图
- (void)setView:(UIView *)playerView;
// 移除播放器渲染视图
- (void)removeView;
// 启动播放准备工作
- (void)prepareToPlay;
// 播放
- (void)play;
// 暂停
- (void)pause;
// 停止
- (void)stop;
// 是否处于播放状态
- (BOOL)isPlaying;
// 关闭播放器
- (void)shutdown;
// 静音
- (void)mute:(BOOL)mute;
// 设置超时时间
- (void)setBufferTimeOut:(UInt64)bufferTimeOut;
// 设置填充模式
- (void)setScalingMode: (IJKMPMovieScalingMode) aScalingMode;
// 获取当前播放时间
- (NSTimeInterval)currentPlaybackTime;
// 获取播放时长
- (NSTimeInterval)duration;
// 获取已缓存的时间
- (NSTimeInterval)playableDuration;
// 跳转到指定时刻
- (void)seek:(NSTimeInterval)aSeekTime;
// 设置音量
- (void)setPlaybackVolume:(float)volume;
// 获取音量
- (float)playbackVolume;
// 设置进入后台是否暂停
- (void)setPauseInBackground:(BOOL)pause;
// 设置播放器类型(AVPlayer/IJKPlayer),要在setContentURL之前设置
- (void)setPlayerType:(ZGPlayerType)type;
//注意更改播放速度要在视频开始播放之后才会生效
- (void)setPlayRate:(float)fRate;
//播放地址更改
-(void)resetVideoUrl:(NSString *)url;
@end
framework module ZGIJKMediaFramework {
umbrella header "ZGIJKMediaFramework.h"
export *
module * { export * }
}
This folder contains some sample formatters that may be helpful.
Feel free to change them, extend them, or use them as the basis for your own custom formatter(s).
More information about creating your own custom formatters can be found on the wiki:
https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters
# OffcnLiveSDKiOS
[![CI Status](https://img.shields.io/travis/zhangyunjie/OffcnLiveSDKiOS.svg?style=flat)](https://travis-ci.org/zhangyunjie/OffcnLiveSDKiOS)
[![Version](https://img.shields.io/cocoapods/v/OffcnLiveSDKiOS.svg?style=flat)](https://cocoapods.org/pods/OffcnLiveSDKiOS)
[![License](https://img.shields.io/cocoapods/l/OffcnLiveSDKiOS.svg?style=flat)](https://cocoapods.org/pods/OffcnLiveSDKiOS)
[![Platform](https://img.shields.io/cocoapods/p/OffcnLiveSDKiOS.svg?style=flat)](https://cocoapods.org/pods/OffcnLiveSDKiOS)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
OffcnLiveSDKiOS is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'OffcnLiveSDKiOS'
```
## Author
zhangyunjie, zhangyunjie@offcn.com
## License
OffcnLiveSDKiOS is available under the MIT license. See the LICENSE file for more info.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment