Browse Source

add android + +

邓博 7 years ago
parent
commit
bbdb520db1

+ 27
- 0
android/build.gradle View File

@@ -0,0 +1,27 @@
1
+apply plugin: 'com.android.library'
2
+
3
+android {
4
+    compileSdkVersion 23
5
+    buildToolsVersion "23.0.1"
6
+
7
+    defaultConfig {
8
+        minSdkVersion 16
9
+        targetSdkVersion 22
10
+        versionCode 1
11
+        versionName "1.0"
12
+
13
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14
+
15
+    }
16
+    buildTypes {
17
+        release {
18
+            minifyEnabled false
19
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20
+        }
21
+    }
22
+}
23
+
24
+dependencies {
25
+    compile "com.facebook.react:react-native:+"
26
+    compile fileTree(dir: 'libs', include: ['*.jar'])
27
+}

+ 141
- 0
android/react-native-agora.iml View File

@@ -0,0 +1,141 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module external.linked.project.id=":react-native-agora" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3
+  <component name="FacetManager">
4
+    <facet type="android-gradle" name="Android-Gradle">
5
+      <configuration>
6
+        <option name="GRADLE_PROJECT_PATH" value=":react-native-agora" />
7
+      </configuration>
8
+    </facet>
9
+    <facet type="android" name="Android">
10
+      <configuration>
11
+        <option name="SELECTED_BUILD_VARIANT" value="debug" />
12
+        <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
13
+        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
14
+        <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
15
+        <afterSyncTasks>
16
+          <task>generateDebugSources</task>
17
+        </afterSyncTasks>
18
+        <option name="ALLOW_USER_CONFIGURATION" value="false" />
19
+        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
20
+        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
21
+        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
22
+        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
23
+        <option name="LIBRARY_PROJECT" value="true" />
24
+      </configuration>
25
+    </facet>
26
+  </component>
27
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
28
+    <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
29
+    <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
30
+    <exclude-output />
31
+    <content url="file://$MODULE_DIR$">
32
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
33
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
34
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
35
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
36
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
37
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
38
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
39
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
40
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
41
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
42
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
43
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
44
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
45
+      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
46
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
47
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
48
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
49
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
50
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
51
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
52
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
53
+      <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
54
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
55
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
56
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
57
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
58
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
59
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
60
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
61
+      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
62
+      <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
63
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
64
+      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
65
+      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
66
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
67
+      <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
68
+      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
69
+      <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
70
+      <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
71
+      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
72
+      <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
73
+      <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
74
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
75
+      <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
76
+      <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
77
+      <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
78
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
79
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
80
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
81
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
82
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
83
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
84
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
85
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
86
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
87
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
88
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
89
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
90
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
91
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/jars" />
92
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
93
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fbui.textlayoutbuilder/textlayoutbuilder/1.0.0/jars" />
94
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/drawee/1.0.1/jars" />
95
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/fbcore/1.0.1/jars" />
96
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/fresco/1.0.1/jars" />
97
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/imagepipeline-base/1.0.1/jars" />
98
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/imagepipeline-okhttp3/1.0.1/jars" />
99
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/imagepipeline/1.0.1/jars" />
100
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.react/react-native/0.44.3/jars" />
101
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.soloader/soloader/0.1.0/jars" />
102
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/org.webkit/android-jsc/r174650/jars" />
103
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
104
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
105
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
106
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
107
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
108
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
109
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
110
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
111
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
112
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
113
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/typedefs.txt" />
114
+      <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
115
+      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
116
+    </content>
117
+    <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
118
+    <orderEntry type="sourceFolder" forTests="false" />
119
+    <orderEntry type="library" exported="" name="okio-1.9.0" level="project" />
120
+    <orderEntry type="library" exported="" name="imagepipeline-base-1.0.1" level="project" />
121
+    <orderEntry type="library" exported="" name="textlayoutbuilder-1.0.0" level="project" />
122
+    <orderEntry type="library" exported="" name="imagepipeline-1.0.1" level="project" />
123
+    <orderEntry type="library" exported="" name="soloader-0.1.0" level="project" />
124
+    <orderEntry type="library" exported="" name="javax.inject-1" level="project" />
125
+    <orderEntry type="library" exported="" name="jsr305-3.0.0" level="project" />
126
+    <orderEntry type="library" exported="" name="bolts-tasks-1.4.0" level="project" />
127
+    <orderEntry type="library" exported="" name="drawee-1.0.1" level="project" />
128
+    <orderEntry type="library" exported="" name="fbcore-1.0.1" level="project" />
129
+    <orderEntry type="library" exported="" name="okhttp-urlconnection-3.4.1" level="project" />
130
+    <orderEntry type="library" exported="" name="okhttp-ws-3.4.1" level="project" />
131
+    <orderEntry type="library" exported="" name="android-jsc-r174650" level="project" />
132
+    <orderEntry type="library" exported="" name="okhttp-3.4.1" level="project" />
133
+    <orderEntry type="library" exported="" name="staticlayout-proxy-1.0" level="project" />
134
+    <orderEntry type="library" exported="" name="react-native-0.44.3" level="project" />
135
+    <orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
136
+    <orderEntry type="library" exported="" name="imagepipeline-okhttp3-1.0.1" level="project" />
137
+    <orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
138
+    <orderEntry type="library" exported="" name="fresco-1.0.1" level="project" />
139
+    <orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
140
+  </component>
141
+</module>

+ 8
- 0
android/src/main/AndroidManifest.xml View File

@@ -0,0 +1,8 @@
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.syan.agora">
2
+
3
+    <application android:allowBackup="true" android:label="@string/app_name"
4
+        android:supportsRtl="true">
5
+
6
+    </application>
7
+
8
+</manifest>

+ 26
- 0
android/src/main/java/com/syan/agora/AgoraModule.java View File

@@ -0,0 +1,26 @@
1
+package com.syan.agora;
2
+
3
+import android.util.Log;
4
+
5
+import com.facebook.react.bridge.ReactApplicationContext;
6
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
7
+import com.facebook.react.bridge.ReactMethod;
8
+import com.facebook.react.bridge.ReadableMap;
9
+
10
+public class AgoraModule extends ReactContextBaseJavaModule {
11
+
12
+    public AgoraModule(ReactApplicationContext context) {
13
+        super(context);
14
+    }
15
+
16
+    @Override
17
+    public String getName() {
18
+        return "RCTAgora";
19
+    }
20
+
21
+    @ReactMethod
22
+    public void loadAgoraKit(ReadableMap options) {
23
+        Log.i("Agora", options.toString());
24
+    }
25
+
26
+}

+ 29
- 0
android/src/main/java/com/syan/agora/AgoraPackage.java View File

@@ -0,0 +1,29 @@
1
+package com.syan.agora;
2
+
3
+import com.facebook.react.ReactPackage;
4
+import com.facebook.react.bridge.JavaScriptModule;
5
+import com.facebook.react.bridge.NativeModule;
6
+import com.facebook.react.bridge.ReactApplicationContext;
7
+import com.facebook.react.uimanager.ViewManager;
8
+
9
+import java.util.Arrays;
10
+import java.util.Collections;
11
+import java.util.List;
12
+
13
+public class AgoraPackage implements ReactPackage {
14
+    @Override
15
+    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
+        return Arrays.asList(new NativeModule[]{
17
+            new AgoraModule(reactContext),
18
+        });
19
+    }
20
+
21
+    public List<Class<? extends JavaScriptModule>> createJSModules() {
22
+        return Collections.emptyList();
23
+    }
24
+
25
+    @Override
26
+    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
27
+        return Collections.emptyList();
28
+    }
29
+}

+ 3
- 0
android/src/main/res/values/strings.xml View File

@@ -0,0 +1,3 @@
1
+<resources>
2
+    <string name="app_name">react-native-agora</string>
3
+</resources>

+ 286
- 0
ios/RCTAgora.xcodeproj/project.pbxproj View File

@@ -0,0 +1,286 @@
1
+// !$*UTF8*$!
2
+{
3
+	archiveVersion = 1;
4
+	classes = {
5
+	};
6
+	objectVersion = 46;
7
+	objects = {
8
+
9
+/* Begin PBXBuildFile section */
10
+		23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */ = {isa = PBXBuildFile; fileRef = 23AF28201EEFECD800D771AB /* RCTAgora.m */; };
11
+		23AF28221EEFECD800D771AB /* RCTAgora.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23AF281F1EEFECD800D771AB /* RCTAgora.h */; };
12
+/* End PBXBuildFile section */
13
+
14
+/* Begin PBXCopyFilesBuildPhase section */
15
+		23AF281A1EEFECD800D771AB /* CopyFiles */ = {
16
+			isa = PBXCopyFilesBuildPhase;
17
+			buildActionMask = 2147483647;
18
+			dstPath = "include/$(PRODUCT_NAME)";
19
+			dstSubfolderSpec = 16;
20
+			files = (
21
+				23AF28221EEFECD800D771AB /* RCTAgora.h in CopyFiles */,
22
+			);
23
+			runOnlyForDeploymentPostprocessing = 0;
24
+		};
25
+/* End PBXCopyFilesBuildPhase section */
26
+
27
+/* Begin PBXFileReference section */
28
+		23ACF47C1EF0CF9500801BC7 /* libs */ = {isa = PBXFileReference; lastKnownFileType = folder; path = libs; sourceTree = "<group>"; };
29
+		23AF281C1EEFECD800D771AB /* libRCTAgora.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAgora.a; sourceTree = BUILT_PRODUCTS_DIR; };
30
+		23AF281F1EEFECD800D771AB /* RCTAgora.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTAgora.h; sourceTree = "<group>"; };
31
+		23AF28201EEFECD800D771AB /* RCTAgora.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTAgora.m; sourceTree = "<group>"; };
32
+/* End PBXFileReference section */
33
+
34
+/* Begin PBXFrameworksBuildPhase section */
35
+		23AF28191EEFECD800D771AB /* Frameworks */ = {
36
+			isa = PBXFrameworksBuildPhase;
37
+			buildActionMask = 2147483647;
38
+			files = (
39
+			);
40
+			runOnlyForDeploymentPostprocessing = 0;
41
+		};
42
+/* End PBXFrameworksBuildPhase section */
43
+
44
+/* Begin PBXGroup section */
45
+		23AF28131EEFECD800D771AB = {
46
+			isa = PBXGroup;
47
+			children = (
48
+				23AF281E1EEFECD800D771AB /* RCTAgora */,
49
+				23AF281D1EEFECD800D771AB /* Products */,
50
+			);
51
+			sourceTree = "<group>";
52
+		};
53
+		23AF281D1EEFECD800D771AB /* Products */ = {
54
+			isa = PBXGroup;
55
+			children = (
56
+				23AF281C1EEFECD800D771AB /* libRCTAgora.a */,
57
+			);
58
+			name = Products;
59
+			sourceTree = "<group>";
60
+		};
61
+		23AF281E1EEFECD800D771AB /* RCTAgora */ = {
62
+			isa = PBXGroup;
63
+			children = (
64
+				23ACF47C1EF0CF9500801BC7 /* libs */,
65
+				23AF281F1EEFECD800D771AB /* RCTAgora.h */,
66
+				23AF28201EEFECD800D771AB /* RCTAgora.m */,
67
+			);
68
+			path = RCTAgora;
69
+			sourceTree = "<group>";
70
+		};
71
+/* End PBXGroup section */
72
+
73
+/* Begin PBXNativeTarget section */
74
+		23AF281B1EEFECD800D771AB /* RCTAgora */ = {
75
+			isa = PBXNativeTarget;
76
+			buildConfigurationList = 23AF28251EEFECD800D771AB /* Build configuration list for PBXNativeTarget "RCTAgora" */;
77
+			buildPhases = (
78
+				23AF28181EEFECD800D771AB /* Sources */,
79
+				23AF28191EEFECD800D771AB /* Frameworks */,
80
+				23AF281A1EEFECD800D771AB /* CopyFiles */,
81
+			);
82
+			buildRules = (
83
+			);
84
+			dependencies = (
85
+			);
86
+			name = RCTAgora;
87
+			productName = RCTAgora;
88
+			productReference = 23AF281C1EEFECD800D771AB /* libRCTAgora.a */;
89
+			productType = "com.apple.product-type.library.static";
90
+		};
91
+/* End PBXNativeTarget section */
92
+
93
+/* Begin PBXProject section */
94
+		23AF28141EEFECD800D771AB /* Project object */ = {
95
+			isa = PBXProject;
96
+			attributes = {
97
+				LastUpgradeCheck = 0830;
98
+				ORGANIZATIONNAME = Syan;
99
+				TargetAttributes = {
100
+					23AF281B1EEFECD800D771AB = {
101
+						CreatedOnToolsVersion = 8.3.2;
102
+						DevelopmentTeam = 342K4Q49RK;
103
+						ProvisioningStyle = Automatic;
104
+					};
105
+				};
106
+			};
107
+			buildConfigurationList = 23AF28171EEFECD800D771AB /* Build configuration list for PBXProject "RCTAgora" */;
108
+			compatibilityVersion = "Xcode 3.2";
109
+			developmentRegion = English;
110
+			hasScannedForEncodings = 0;
111
+			knownRegions = (
112
+				en,
113
+			);
114
+			mainGroup = 23AF28131EEFECD800D771AB;
115
+			productRefGroup = 23AF281D1EEFECD800D771AB /* Products */;
116
+			projectDirPath = "";
117
+			projectRoot = "";
118
+			targets = (
119
+				23AF281B1EEFECD800D771AB /* RCTAgora */,
120
+			);
121
+		};
122
+/* End PBXProject section */
123
+
124
+/* Begin PBXSourcesBuildPhase section */
125
+		23AF28181EEFECD800D771AB /* Sources */ = {
126
+			isa = PBXSourcesBuildPhase;
127
+			buildActionMask = 2147483647;
128
+			files = (
129
+				23AF28211EEFECD800D771AB /* RCTAgora.m in Sources */,
130
+			);
131
+			runOnlyForDeploymentPostprocessing = 0;
132
+		};
133
+/* End PBXSourcesBuildPhase section */
134
+
135
+/* Begin XCBuildConfiguration section */
136
+		23AF28231EEFECD800D771AB /* Debug */ = {
137
+			isa = XCBuildConfiguration;
138
+			buildSettings = {
139
+				ALWAYS_SEARCH_USER_PATHS = NO;
140
+				CLANG_ANALYZER_NONNULL = YES;
141
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
142
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
143
+				CLANG_CXX_LIBRARY = "libc++";
144
+				CLANG_ENABLE_MODULES = YES;
145
+				CLANG_ENABLE_OBJC_ARC = YES;
146
+				CLANG_WARN_BOOL_CONVERSION = YES;
147
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
148
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
149
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
150
+				CLANG_WARN_EMPTY_BODY = YES;
151
+				CLANG_WARN_ENUM_CONVERSION = YES;
152
+				CLANG_WARN_INFINITE_RECURSION = YES;
153
+				CLANG_WARN_INT_CONVERSION = YES;
154
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
155
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
156
+				CLANG_WARN_UNREACHABLE_CODE = YES;
157
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
158
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
159
+				COPY_PHASE_STRIP = NO;
160
+				DEBUG_INFORMATION_FORMAT = dwarf;
161
+				ENABLE_BITCODE = YES;
162
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
163
+				ENABLE_TESTABILITY = YES;
164
+				GCC_C_LANGUAGE_STANDARD = gnu99;
165
+				GCC_DYNAMIC_NO_PIC = NO;
166
+				GCC_NO_COMMON_BLOCKS = YES;
167
+				GCC_OPTIMIZATION_LEVEL = 0;
168
+				GCC_PREPROCESSOR_DEFINITIONS = (
169
+					"DEBUG=1",
170
+					"$(inherited)",
171
+				);
172
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
173
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
174
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
175
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
176
+				GCC_WARN_UNUSED_FUNCTION = YES;
177
+				GCC_WARN_UNUSED_VARIABLE = YES;
178
+				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
179
+				MTL_ENABLE_DEBUG_INFO = YES;
180
+				ONLY_ACTIVE_ARCH = YES;
181
+				SDKROOT = iphoneos;
182
+			};
183
+			name = Debug;
184
+		};
185
+		23AF28241EEFECD800D771AB /* Release */ = {
186
+			isa = XCBuildConfiguration;
187
+			buildSettings = {
188
+				ALWAYS_SEARCH_USER_PATHS = NO;
189
+				CLANG_ANALYZER_NONNULL = YES;
190
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
191
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
192
+				CLANG_CXX_LIBRARY = "libc++";
193
+				CLANG_ENABLE_MODULES = YES;
194
+				CLANG_ENABLE_OBJC_ARC = YES;
195
+				CLANG_WARN_BOOL_CONVERSION = YES;
196
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
197
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
198
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
199
+				CLANG_WARN_EMPTY_BODY = YES;
200
+				CLANG_WARN_ENUM_CONVERSION = YES;
201
+				CLANG_WARN_INFINITE_RECURSION = YES;
202
+				CLANG_WARN_INT_CONVERSION = YES;
203
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
204
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
205
+				CLANG_WARN_UNREACHABLE_CODE = YES;
206
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
207
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
208
+				COPY_PHASE_STRIP = NO;
209
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
210
+				ENABLE_BITCODE = YES;
211
+				ENABLE_NS_ASSERTIONS = NO;
212
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
213
+				GCC_C_LANGUAGE_STANDARD = gnu99;
214
+				GCC_NO_COMMON_BLOCKS = YES;
215
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
216
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
217
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
218
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
219
+				GCC_WARN_UNUSED_FUNCTION = YES;
220
+				GCC_WARN_UNUSED_VARIABLE = YES;
221
+				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
222
+				MTL_ENABLE_DEBUG_INFO = NO;
223
+				SDKROOT = iphoneos;
224
+				VALIDATE_PRODUCT = YES;
225
+			};
226
+			name = Release;
227
+		};
228
+		23AF28261EEFECD800D771AB /* Debug */ = {
229
+			isa = XCBuildConfiguration;
230
+			buildSettings = {
231
+				DEVELOPMENT_TEAM = 342K4Q49RK;
232
+				ENABLE_BITCODE = YES;
233
+				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/RCTAgora/libs\"";
234
+				HEADER_SEARCH_PATHS = (
235
+					"\"$(SRCROOT)/../../react-native/React\"/**",
236
+					"\"$(SRCROOT)/../../react-native/Libraries\"/**",
237
+				);
238
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
239
+				OTHER_LDFLAGS = "-ObjC";
240
+				PRODUCT_NAME = "$(TARGET_NAME)";
241
+				SKIP_INSTALL = YES;
242
+			};
243
+			name = Debug;
244
+		};
245
+		23AF28271EEFECD800D771AB /* Release */ = {
246
+			isa = XCBuildConfiguration;
247
+			buildSettings = {
248
+				DEVELOPMENT_TEAM = 342K4Q49RK;
249
+				ENABLE_BITCODE = YES;
250
+				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/RCTAgora/libs\"";
251
+				HEADER_SEARCH_PATHS = (
252
+					"\"$(SRCROOT)/../../react-native/React\"/**",
253
+					"\"$(SRCROOT)/../../react-native/Libraries\"/**",
254
+				);
255
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
256
+				OTHER_LDFLAGS = "-ObjC";
257
+				PRODUCT_NAME = "$(TARGET_NAME)";
258
+				SKIP_INSTALL = YES;
259
+			};
260
+			name = Release;
261
+		};
262
+/* End XCBuildConfiguration section */
263
+
264
+/* Begin XCConfigurationList section */
265
+		23AF28171EEFECD800D771AB /* Build configuration list for PBXProject "RCTAgora" */ = {
266
+			isa = XCConfigurationList;
267
+			buildConfigurations = (
268
+				23AF28231EEFECD800D771AB /* Debug */,
269
+				23AF28241EEFECD800D771AB /* Release */,
270
+			);
271
+			defaultConfigurationIsVisible = 0;
272
+			defaultConfigurationName = Release;
273
+		};
274
+		23AF28251EEFECD800D771AB /* Build configuration list for PBXNativeTarget "RCTAgora" */ = {
275
+			isa = XCConfigurationList;
276
+			buildConfigurations = (
277
+				23AF28261EEFECD800D771AB /* Debug */,
278
+				23AF28271EEFECD800D771AB /* Release */,
279
+			);
280
+			defaultConfigurationIsVisible = 0;
281
+			defaultConfigurationName = Release;
282
+		};
283
+/* End XCConfigurationList section */
284
+	};
285
+	rootObject = 23AF28141EEFECD800D771AB /* Project object */;
286
+}

+ 7
- 0
ios/RCTAgora.xcodeproj/project.xcworkspace/contents.xcworkspacedata View File

@@ -0,0 +1,7 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Workspace
3
+   version = "1.0">
4
+   <FileRef
5
+      location = "self:RCTAgora.xcodeproj">
6
+   </FileRef>
7
+</Workspace>

BIN
ios/RCTAgora.xcodeproj/project.xcworkspace/xcuserdata/DB.xcuserdatad/UserInterfaceState.xcuserstate View File


+ 80
- 0
ios/RCTAgora.xcodeproj/xcuserdata/DB.xcuserdatad/xcschemes/RCTAgora.xcscheme View File

@@ -0,0 +1,80 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "0830"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
8
+      <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "23AF281B1EEFECD800D771AB"
18
+               BuildableName = "libRCTAgora.a"
19
+               BlueprintName = "RCTAgora"
20
+               ReferencedContainer = "container:RCTAgora.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+      </Testables>
32
+      <AdditionalOptions>
33
+      </AdditionalOptions>
34
+   </TestAction>
35
+   <LaunchAction
36
+      buildConfiguration = "Debug"
37
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
38
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39
+      launchStyle = "0"
40
+      useCustomWorkingDirectory = "NO"
41
+      ignoresPersistentStateOnLaunch = "NO"
42
+      debugDocumentVersioning = "YES"
43
+      debugServiceExtension = "internal"
44
+      allowLocationSimulation = "YES">
45
+      <MacroExpansion>
46
+         <BuildableReference
47
+            BuildableIdentifier = "primary"
48
+            BlueprintIdentifier = "23AF281B1EEFECD800D771AB"
49
+            BuildableName = "libRCTAgora.a"
50
+            BlueprintName = "RCTAgora"
51
+            ReferencedContainer = "container:RCTAgora.xcodeproj">
52
+         </BuildableReference>
53
+      </MacroExpansion>
54
+      <AdditionalOptions>
55
+      </AdditionalOptions>
56
+   </LaunchAction>
57
+   <ProfileAction
58
+      buildConfiguration = "Release"
59
+      shouldUseLaunchSchemeArgsEnv = "YES"
60
+      savedToolIdentifier = ""
61
+      useCustomWorkingDirectory = "NO"
62
+      debugDocumentVersioning = "YES">
63
+      <MacroExpansion>
64
+         <BuildableReference
65
+            BuildableIdentifier = "primary"
66
+            BlueprintIdentifier = "23AF281B1EEFECD800D771AB"
67
+            BuildableName = "libRCTAgora.a"
68
+            BlueprintName = "RCTAgora"
69
+            ReferencedContainer = "container:RCTAgora.xcodeproj">
70
+         </BuildableReference>
71
+      </MacroExpansion>
72
+   </ProfileAction>
73
+   <AnalyzeAction
74
+      buildConfiguration = "Debug">
75
+   </AnalyzeAction>
76
+   <ArchiveAction
77
+      buildConfiguration = "Release"
78
+      revealArchiveInOrganizer = "YES">
79
+   </ArchiveAction>
80
+</Scheme>

+ 22
- 0
ios/RCTAgora.xcodeproj/xcuserdata/DB.xcuserdatad/xcschemes/xcschememanagement.plist View File

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>SchemeUserState</key>
6
+	<dict>
7
+		<key>RCTAgora.xcscheme</key>
8
+		<dict>
9
+			<key>orderHint</key>
10
+			<integer>0</integer>
11
+		</dict>
12
+	</dict>
13
+	<key>SuppressBuildableAutocreation</key>
14
+	<dict>
15
+		<key>23AF281B1EEFECD800D771AB</key>
16
+		<dict>
17
+			<key>primary</key>
18
+			<true/>
19
+		</dict>
20
+	</dict>
21
+</dict>
22
+</plist>

+ 16
- 0
ios/RCTAgora/RCTAgora.h View File

@@ -0,0 +1,16 @@
1
+//
2
+//  RCTAgora.h
3
+//  RCTAgora
4
+//
5
+//  Created by 邓博 on 2017/6/13.
6
+//  Copyright © 2017年 Syan. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import <UIKit/UIKit.h>
11
+#import <React/RCTBridgeModule.h>
12
+#import <AgoraRtcEngineKit/AgoraRtcEngineKit.h>
13
+
14
+@interface RCTAgora : NSObject<RCTBridgeModule, AgoraRtcEngineDelegate>
15
+
16
+@end

+ 99
- 0
ios/RCTAgora/RCTAgora.m View File

@@ -0,0 +1,99 @@
1
+//
2
+//  RCTAgora.m
3
+//  RCTAgora
4
+//
5
+//  Created by 邓博 on 2017/6/13.
6
+//  Copyright © 2017年 Syan. All rights reserved.
7
+//
8
+
9
+#import "RCTAgora.h"
10
+#import <React/RCTEventDispatcher.h>
11
+#import <React/RCTBridge.h>
12
+#import <React/RCTUIManager.h>
13
+#import <React/RCTView.h>
14
+
15
+@interface RCTAgora ()
16
+@property (strong, nonatomic) AgoraRtcEngineKit *rtcEngine;
17
+
18
+@end
19
+
20
+@implementation RCTAgora
21
+
22
+RCT_EXPORT_MODULE();
23
+
24
+@synthesize bridge = _bridge;
25
+
26
+- (void)dealloc
27
+{
28
+    //销毁引擎实例
29
+    [AgoraRtcEngineKit destroy];
30
+}
31
+
32
+//导出常量
33
+- (NSDictionary *)constantsToExport {
34
+    return @{};
35
+}
36
+
37
+/**
38
+ *  初始化AgoraKit
39
+ *
40
+ *  @param appid
41
+ *  @param channelProfile  设置频道模式
42
+ *  @param videoProfile    视频模式
43
+ *  @param clientRole      创建角色
44
+ *  @param channelName     频道名称
45
+ *  @param info            附加字段
46
+ *  @param reactTag        绑定view的tag
47
+ *  @return 0 when executed successfully. return negative value if failed.
48
+ */
49
+RCT_EXPORT_METHOD(loadAgoraKit:(NSDictionary *)options)
50
+{
51
+    
52
+    self.rtcEngine = [AgoraRtcEngineKit sharedEngineWithAppId:options[@"appid"] delegate:self];
53
+    
54
+    //频道模式
55
+    [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
56
+    //启用双流模式
57
+    [self.rtcEngine enableDualStreamMode:YES];
58
+    [self.rtcEngine enableVideo];
59
+    [self.rtcEngine setVideoProfile:[options[@"videoProfile"] integerValue]swapWidthAndHeight:YES];
60
+    [self.rtcEngine setClientRole:[options[@"clientRole"] integerValue] withKey:nil];
61
+    
62
+    //开启预览
63
+    [self.rtcEngine startPreview];
64
+    
65
+    [self.rtcEngine joinChannelByKey:nil channelName:options[@"channelName"] info:options[@"info"] uid:0 joinSuccess:^(NSString *channel, NSUInteger uid, NSInteger elapsed) {
66
+        
67
+        //绑定本地视图
68
+        AgoraRtcVideoCanvas *canvas = [[AgoraRtcVideoCanvas alloc] init];
69
+        canvas.uid = uid;
70
+        canvas.view = [self.bridge.uiManager viewForReactTag:options[@"reactTag"]];
71
+        canvas.renderMode = AgoraRtc_Render_Hidden;
72
+        [self.rtcEngine setupLocalVideo:canvas];
73
+        
74
+    }];
75
+    
76
+    //Agora Native SDK 与 Agora Web SDK 间的互通
77
+    [self.rtcEngine enableWebSdkInteroperability:YES];
78
+    
79
+}
80
+
81
+- (void)rtcEngine:(AgoraRtcEngineKit *)engine didOccurError:(AgoraRtcErrorCode)errorCode{
82
+    
83
+}
84
+
85
+- (dispatch_queue_t)methodQueue
86
+{
87
+    return dispatch_get_main_queue();
88
+}
89
+
90
+RCT_EXPORT_METHOD(getViewWithTag:(nonnull NSNumber *)reactTag)
91
+{
92
+    
93
+    UIView *view = [self.bridge.uiManager viewForReactTag:reactTag];
94
+    NSLog(@"%@",view);
95
+    
96
+}
97
+
98
+@end
99
+

BIN
ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework/AgoraRtcCryptoLoader View File


+ 13
- 0
ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework/Headers/AgoraRtcCryptoLoader.h View File

@@ -0,0 +1,13 @@
1
+//
2
+//  AgoraRtcCryptoLoader.h
3
+//  AgoraRtcCryptoLoader
4
+//
5
+//  Created by junhao wang on 1/5/17.
6
+//  Copyright © 2017 Agora. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface AgoraRtcCryptoLoader : NSObject
12
+
13
+@end

BIN
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/AgoraRtcEngineKit View File


+ 1333
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/AgoraRtcEngineKit.h
File diff suppressed because it is too large
View File


+ 175
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraMediaEngine.h View File

@@ -0,0 +1,175 @@
1
+#ifndef AGORA_MEDIA_ENGINE_H
2
+#define AGORA_MEDIA_ENGINE_H
3
+#if defined _WIN32 || defined __CYGWIN__
4
+typedef __int64 int64_t;
5
+typedef unsigned __int64 uint64_t;
6
+#else
7
+#include <stdint.h>
8
+#endif
9
+
10
+namespace agora
11
+{
12
+namespace media
13
+{
14
+
15
+class IAudioFrameObserver
16
+{
17
+public:
18
+  enum AUDIO_FRAME_TYPE {
19
+    FRAME_TYPE_PCM16 = 0,  //PCM 16bit little endian
20
+  };
21
+  struct AudioFrame {
22
+    AUDIO_FRAME_TYPE type;
23
+    int samples;  //number of samples in this frame
24
+    int bytesPerSample;  //number of bytes per sample: 2 for PCM16
25
+    int channels;  //number of channels (data are interleaved if stereo)
26
+    int samplesPerSec;  //sampling rate
27
+    void* buffer;  //data buffer
28
+    int64_t renderTimeMs;
29
+  };
30
+public:
31
+  virtual bool onRecordAudioFrame(AudioFrame& audioFrame) = 0;
32
+  virtual bool onPlaybackAudioFrame(AudioFrame& audioFrame) = 0;
33
+  virtual bool onMixedAudioFrame(AudioFrame& audioFrame) = 0;
34
+  virtual bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, AudioFrame& audioFrame) = 0;
35
+};
36
+
37
+class IVideoFrameObserver
38
+{
39
+public:
40
+  enum VIDEO_FRAME_TYPE {
41
+    FRAME_TYPE_YUV420 = 0,  //YUV 420 format
42
+  };
43
+  struct VideoFrame {
44
+    VIDEO_FRAME_TYPE type;
45
+    int width;  //width of video frame
46
+    int height;  //height of video frame
47
+    int yStride;  //stride of Y data buffer
48
+    int uStride;  //stride of U data buffer
49
+    int vStride;  //stride of V data buffer
50
+    void* yBuffer;  //Y data buffer
51
+    void* uBuffer;  //U data buffer
52
+    void* vBuffer;  //V data buffer
53
+    int rotation; // rotation of this frame (0, 90, 180, 270)
54
+    int64_t renderTimeMs;
55
+  };
56
+public:
57
+  virtual bool onCaptureVideoFrame(VideoFrame& videoFrame) = 0;
58
+  virtual bool onRenderVideoFrame(unsigned int uid, VideoFrame& videoFrame) = 0;
59
+};
60
+
61
+class IVideoFrame
62
+{
63
+public:
64
+  enum PLANE_TYPE {
65
+    Y_PLANE = 0,
66
+    U_PLANE = 1,
67
+    V_PLANE = 2,
68
+    NUM_OF_PLANES = 3
69
+  };
70
+  enum VIDEO_TYPE {
71
+    VIDEO_TYPE_UNKNOWN = 0,
72
+    VIDEO_TYPE_I420 = 1,
73
+    VIDEO_TYPE_IYUV = 2,
74
+    VIDEO_TYPE_RGB24 = 3,
75
+    VIDEO_TYPE_ABGR = 4,
76
+    VIDEO_TYPE_ARGB = 5,
77
+    VIDEO_TYPE_ARGB4444 = 6,
78
+    VIDEO_TYPE_RGB565 = 7,
79
+    VIDEO_TYPE_ARGB1555 = 8,
80
+    VIDEO_TYPE_YUY2 = 9,
81
+    VIDEO_TYPE_YV12 = 10,
82
+    VIDEO_TYPE_UYVY = 11,
83
+    VIDEO_TYPE_MJPG = 12,
84
+    VIDEO_TYPE_NV21 = 13,
85
+    VIDEO_TYPE_NV12 = 14,
86
+    VIDEO_TYPE_BGRA = 15,
87
+    VIDEO_TYPE_RGBA = 16,
88
+  };
89
+  virtual void release() = 0;
90
+  virtual const unsigned char* buffer(PLANE_TYPE type) const = 0;
91
+
92
+  // Copy frame: If required size is bigger than allocated one, new buffers of
93
+  // adequate size will be allocated.
94
+  // Return value: 0 on success ,-1 on error.
95
+  virtual int copyFrame(IVideoFrame** dest_frame) const = 0;
96
+
97
+  // Convert frame
98
+  // Input:
99
+  //   - src_frame        : Reference to a source frame.
100
+  //   - dst_video_type   : Type of output video.
101
+  //   - dst_sample_size  : Required only for the parsing of MJPG.
102
+  //   - dst_frame        : Pointer to a destination frame.
103
+  // Return value: 0 if OK, < 0 otherwise.
104
+  // It is assumed that source and destination have equal height.
105
+  virtual int convertFrame(VIDEO_TYPE dst_video_type, int dst_sample_size, unsigned char* dst_frame) const = 0;
106
+
107
+  // Get allocated size per plane.
108
+  virtual int allocated_size(PLANE_TYPE type) const = 0;
109
+
110
+  // Get allocated stride per plane.
111
+  virtual int stride(PLANE_TYPE type) const = 0;
112
+
113
+  // Get frame width.
114
+  virtual int width() const = 0;
115
+
116
+  // Get frame height.
117
+  virtual int height() const = 0;
118
+
119
+  // Get frame timestamp (90kHz).
120
+  virtual unsigned int timestamp() const = 0;
121
+
122
+  // Get render time in milliseconds.
123
+  virtual int64_t render_time_ms() const = 0;
124
+
125
+  // Return true if underlying plane buffers are of zero size, false if not.
126
+  virtual bool IsZeroSize() const = 0;
127
+};
128
+
129
+class IExternalVideoRenderCallback
130
+{
131
+public:
132
+  virtual void onViewSizeChanged(int width, int height) = 0;
133
+  virtual void onViewDestroyed() = 0;
134
+};
135
+
136
+struct ExternalVideoRenerContext
137
+{
138
+  IExternalVideoRenderCallback* renderCallback;
139
+  void* view;
140
+  int renderMode;
141
+  int zOrder;
142
+  float left;
143
+  float top;
144
+  float right;
145
+  float bottom;
146
+};
147
+
148
+class IExternalVideoRender
149
+{
150
+public:
151
+  virtual void release() = 0;
152
+  virtual int initialize() = 0;
153
+  virtual int deliverFrame(const IVideoFrame& videoFrame, int rotation, bool mirrored) = 0;
154
+};
155
+
156
+class IExternalVideoRenderFactory
157
+{
158
+public:
159
+  virtual IExternalVideoRender* createRenderInstance(const ExternalVideoRenerContext& context) = 0;
160
+};
161
+
162
+class IMediaEngine
163
+{
164
+public:
165
+  virtual void release() = 0;
166
+  virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
167
+  virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
168
+  virtual int registerVideoRenderFactory(IExternalVideoRenderFactory* factory) = 0;
169
+};
170
+
171
+} //media
172
+
173
+} //agora
174
+
175
+#endif //AGORA_MEDIA_ENGINE_H

+ 1964
- 0
ios/RCTAgora/libs/AgoraRtcEngineKit.framework/Headers/IAgoraRtcEngine.h
File diff suppressed because it is too large
View File


BIN
ios/RCTAgora/libs/libcrypto.a View File