agora-toolchain 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/package.json +2 -2
  2. package/presets/karma.conf.js +9 -2
  3. package/presets/postcss-plugin/px-to-vw/index.js +212 -0
  4. package/presets/postcss-plugin/px-to-vw/src/pixel-unit-regexp.js +14 -0
  5. package/presets/postcss-plugin/px-to-vw/src/prop-list-matcher.js +118 -0
  6. package/presets/postcss.config.js +16 -3
  7. package/presets/webpack.base.js +2 -1
  8. package/presets/webpack.dev.js +0 -1
  9. package/public/electron-native-libs/mac/FcrUISceneLauncher.node +0 -0
  10. package/public/electron-native-libs/win/FcrUISceneLauncher.node +0 -0
  11. package/scripts/bundle.js +9 -2
  12. package/scripts/pack-client-app.js +8 -1
  13. package/scripts/pack-client-sdk.js +10 -2
  14. package/scripts/test-karma-browser.js +1 -1
  15. package/scripts/test-karma-electron.js +1 -1
  16. package/tools/karma-options.js +8 -0
  17. package/tools/webpack-utils.js +13 -8
  18. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/FcrUIScene +0 -0
  19. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/Headers/FcrEnums.h +0 -40
  20. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/Headers/FcrError.h +0 -13
  21. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/Headers/FcrObjects.h +0 -76
  22. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/Headers/FcrUIPlatform.h +0 -87
  23. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/Headers/IFcrUISceneCreator.h +0 -29
  24. package/public/electron-native-libs/mac/FcrUIScene.framework/Versions/A/Resources/Info.plist +0 -48
  25. package/public/electron-native-libs/win/FcrUIScene.dll +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-toolchain",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "agora-tc-transpile": "./scripts/transpile.js",
@@ -73,4 +73,4 @@
73
73
  "mini-css-extract-plugin": "^2.9.1",
74
74
  "electron-builder": "^24.13.3"
75
75
  }
76
- }
76
+ }
@@ -1,12 +1,19 @@
1
1
  require('dotenv/config');
2
+ const opts = require('../tools/karma-options');
2
3
  const webpackConfig = require('./webpack.karma')();
3
4
  const path = require('path');
4
5
  const cwd = process.cwd();
5
6
 
7
+ const pattern = opts.file ?? '**/*.test.ts';
8
+
6
9
  const files =
7
10
  process.env.platform === 'browser'
8
- ? ['__test__/universal/**/*.test.ts', '__test__/browser/**/*.test.ts']
9
- : ['__test__/universal/**/*.test.ts', '__test__/electron/**/*.test.ts'];
11
+ ? pattern
12
+ ? [`__test__/${pattern}`]
13
+ : [`__test__/universal/**/*.test.ts`, `__test__/browser/**/*.test.ts`]
14
+ : pattern
15
+ ? [`__test__/${pattern}`]
16
+ : [`__test__/universal/**/*.test.ts`, `__test__/electron/**/*.test.ts`];
10
17
 
11
18
  const preprocessors =
12
19
  process.env.platform === 'browser'
@@ -0,0 +1,212 @@
1
+ 'use strict';
2
+ var postcss = require('postcss');
3
+ var objectAssign = require('object-assign');
4
+ var { createPropListMatcher } = require('./src/prop-list-matcher');
5
+ var { getUnitRegexp } = require('./src/pixel-unit-regexp');
6
+
7
+ var defaults = {
8
+ unitToConvert: 'px',
9
+ viewportWidth: 320,
10
+ viewportHeight: 568, // not now used; TODO: need for different units and math for different properties
11
+ unitPrecision: 5,
12
+ viewportUnit: 'vw',
13
+ fontViewportUnit: 'vw', // vmin is more suitable.
14
+ selectorBlackList: [],
15
+ propList: ['*'],
16
+ minPixelValue: 1,
17
+ mediaQuery: false,
18
+ replace: true,
19
+ landscape: false,
20
+ landscapeUnit: 'vw',
21
+ landscapeWidth: 568,
22
+ };
23
+
24
+ var ignoreNextComment = 'px-to-viewport-ignore-next';
25
+ var ignorePrevComment = 'px-to-viewport-ignore';
26
+
27
+ module.exports = postcss.plugin('postcss-px-to-viewport', function (options) {
28
+ var opts = objectAssign({}, defaults, options);
29
+ checkRegExpOrArray(opts, 'exclude');
30
+ checkRegExpOrArray(opts, 'include');
31
+
32
+ var pxRegex = getUnitRegexp(opts.unitToConvert);
33
+ var satisfyPropList = createPropListMatcher(opts.propList);
34
+ var landscapeRules = [];
35
+
36
+ return function (css, result) {
37
+ css.walkRules(function (rule) {
38
+ // Add exclude option to ignore some files like 'node_modules'
39
+ var file = rule.source && rule.source.input.file;
40
+
41
+ if (opts.include && file) {
42
+ if (Object.prototype.toString.call(opts.include) === '[object RegExp]') {
43
+ if (!opts.include.test(file)) return;
44
+ } else if (Object.prototype.toString.call(opts.include) === '[object Array]') {
45
+ var flag = false;
46
+ for (var i = 0; i < opts.include.length; i++) {
47
+ if (opts.include[i].test(file)) {
48
+ flag = true;
49
+ break;
50
+ }
51
+ }
52
+ if (!flag) return;
53
+ }
54
+ }
55
+
56
+ if (opts.exclude && file) {
57
+ if (Object.prototype.toString.call(opts.exclude) === '[object RegExp]') {
58
+ if (opts.exclude.test(file)) return;
59
+ } else if (Object.prototype.toString.call(opts.exclude) === '[object Array]') {
60
+ for (var i = 0; i < opts.exclude.length; i++) {
61
+ if (opts.exclude[i].test(file)) return;
62
+ }
63
+ }
64
+ }
65
+
66
+ if (blacklistedSelector(opts.selectorBlackList, rule.selector)) return;
67
+
68
+ if (opts.landscape && !rule.parent.params) {
69
+ var landscapeRule = rule.clone().removeAll();
70
+
71
+ rule.walkDecls(function (decl) {
72
+ if (decl.value.indexOf(opts.unitToConvert) === -1) return;
73
+ if (!satisfyPropList(decl.prop)) return;
74
+
75
+ landscapeRule.append(
76
+ decl.clone({
77
+ value: decl.value.replace(
78
+ pxRegex,
79
+ createPxReplace(opts, opts.landscapeUnit, opts.landscapeWidth),
80
+ ),
81
+ }),
82
+ );
83
+ });
84
+
85
+ if (landscapeRule.nodes.length > 0) {
86
+ landscapeRules.push(landscapeRule);
87
+ }
88
+ }
89
+
90
+ if (!validateParams(rule.parent.params, opts.mediaQuery)) return;
91
+
92
+ rule.walkDecls(function (decl, i) {
93
+ if (decl.value.indexOf(opts.unitToConvert) === -1) return;
94
+ if (!satisfyPropList(decl.prop)) return;
95
+
96
+ var prev = decl.prev();
97
+ // prev declaration is ignore conversion comment at same line
98
+ if (prev && prev.type === 'comment' && prev.text === ignoreNextComment) {
99
+ // remove comment
100
+ prev.remove();
101
+ return;
102
+ }
103
+ var next = decl.next();
104
+ // next declaration is ignore conversion comment at same line
105
+ if (next && next.type === 'comment' && next.text === ignorePrevComment) {
106
+ if (/\n/.test(next.raws.before)) {
107
+ result.warn(
108
+ 'Unexpected comment /* ' +
109
+ ignorePrevComment +
110
+ ' */ must be after declaration at same line.',
111
+ { node: next },
112
+ );
113
+ } else {
114
+ // remove comment
115
+ next.remove();
116
+ return;
117
+ }
118
+ }
119
+
120
+ var unit;
121
+ var size;
122
+ var params = rule.parent.params;
123
+
124
+ if (opts.landscape && params && params.indexOf('landscape') !== -1) {
125
+ unit = opts.landscapeUnit;
126
+ size = opts.landscapeWidth;
127
+ } else {
128
+ unit = getUnit(decl.prop, opts);
129
+ size = opts.viewportWidth;
130
+ }
131
+
132
+ var value = decl.value.replace(pxRegex, createPxReplace(opts, unit, size));
133
+
134
+ if (declarationExists(decl.parent, decl.prop, value)) return;
135
+
136
+ if (opts.replace) {
137
+ decl.value = value;
138
+ } else {
139
+ decl.parent.insertAfter(i, decl.clone({ value: value }));
140
+ }
141
+ });
142
+ });
143
+
144
+ if (landscapeRules.length > 0) {
145
+ var landscapeRoot = new postcss.AtRule({ params: '(orientation: landscape)', name: 'media' });
146
+
147
+ landscapeRules.forEach(function (rule) {
148
+ landscapeRoot.append(rule);
149
+ });
150
+ css.append(landscapeRoot);
151
+ }
152
+ };
153
+ });
154
+
155
+ function getUnit(prop, opts) {
156
+ return prop.indexOf('font') === -1 ? opts.viewportUnit : opts.fontViewportUnit;
157
+ }
158
+
159
+ function createPxReplace(opts, viewportUnit, viewportSize) {
160
+ return function (m, $1) {
161
+ if (!$1) return m;
162
+ var pixels = parseFloat($1);
163
+ if (pixels <= opts.minPixelValue) return m;
164
+ var parsedVal = toFixed((pixels / viewportSize) * 100, opts.unitPrecision);
165
+ return parsedVal === 0 ? '0' : parsedVal + viewportUnit;
166
+ };
167
+ }
168
+
169
+ function error(decl, message) {
170
+ throw decl.error(message, { plugin: 'postcss-px-to-viewport' });
171
+ }
172
+
173
+ function checkRegExpOrArray(options, optionName) {
174
+ var option = options[optionName];
175
+ if (!option) return;
176
+ if (Object.prototype.toString.call(option) === '[object RegExp]') return;
177
+ if (Object.prototype.toString.call(option) === '[object Array]') {
178
+ var bad = false;
179
+ for (var i = 0; i < option.length; i++) {
180
+ if (Object.prototype.toString.call(option[i]) !== '[object RegExp]') {
181
+ bad = true;
182
+ break;
183
+ }
184
+ }
185
+ if (!bad) return;
186
+ }
187
+ throw new Error('options.' + optionName + ' should be RegExp or Array of RegExp.');
188
+ }
189
+
190
+ function toFixed(number, precision) {
191
+ var multiplier = Math.pow(10, precision + 1),
192
+ wholeNumber = Math.floor(number * multiplier);
193
+ return (Math.round(wholeNumber / 10) * 10) / multiplier;
194
+ }
195
+
196
+ function blacklistedSelector(blacklist, selector) {
197
+ if (typeof selector !== 'string') return;
198
+ return blacklist.some(function (regex) {
199
+ if (typeof regex === 'string') return selector.indexOf(regex) !== -1;
200
+ return selector.match(regex);
201
+ });
202
+ }
203
+
204
+ function declarationExists(decls, prop, value) {
205
+ return decls.some(function (decl) {
206
+ return decl.prop === prop && decl.value === value;
207
+ });
208
+ }
209
+
210
+ function validateParams(params, mediaQuery) {
211
+ return !params || (params && mediaQuery);
212
+ }
@@ -0,0 +1,14 @@
1
+ // excluding regex trick: http://www.rexegg.com/regex-best-trick.html
2
+
3
+ // Not anything inside double quotes
4
+ // Not anything inside single quotes
5
+ // Not anything inside url()
6
+ // Any digit followed by px
7
+ // !singlequotes|!doublequotes|!url()|pixelunit
8
+ function getUnitRegexp(unit) {
9
+ return new RegExp('"[^"]+"|\'[^\']+\'|url\\([^\\)]+\\)|(\\d*\\.?\\d+)' + unit, 'g');
10
+ }
11
+
12
+ module.exports = {
13
+ getUnitRegexp,
14
+ };
@@ -0,0 +1,118 @@
1
+ var filterPropList = {
2
+ exact: function (list) {
3
+ return list.filter(function (m) {
4
+ return m.match(/^[^\*\!]+$/);
5
+ });
6
+ },
7
+ contain: function (list) {
8
+ return list
9
+ .filter(function (m) {
10
+ return m.match(/^\*.+\*$/);
11
+ })
12
+ .map(function (m) {
13
+ return m.substr(1, m.length - 2);
14
+ });
15
+ },
16
+ endWith: function (list) {
17
+ return list
18
+ .filter(function (m) {
19
+ return m.match(/^\*[^\*]+$/);
20
+ })
21
+ .map(function (m) {
22
+ return m.substr(1);
23
+ });
24
+ },
25
+ startWith: function (list) {
26
+ return list
27
+ .filter(function (m) {
28
+ return m.match(/^[^\*\!]+\*$/);
29
+ })
30
+ .map(function (m) {
31
+ return m.substr(0, m.length - 1);
32
+ });
33
+ },
34
+ notExact: function (list) {
35
+ return list
36
+ .filter(function (m) {
37
+ return m.match(/^\![^\*].*$/);
38
+ })
39
+ .map(function (m) {
40
+ return m.substr(1);
41
+ });
42
+ },
43
+ notContain: function (list) {
44
+ return list
45
+ .filter(function (m) {
46
+ return m.match(/^\!\*.+\*$/);
47
+ })
48
+ .map(function (m) {
49
+ return m.substr(2, m.length - 3);
50
+ });
51
+ },
52
+ notEndWith: function (list) {
53
+ return list
54
+ .filter(function (m) {
55
+ return m.match(/^\!\*[^\*]+$/);
56
+ })
57
+ .map(function (m) {
58
+ return m.substr(2);
59
+ });
60
+ },
61
+ notStartWith: function (list) {
62
+ return list
63
+ .filter(function (m) {
64
+ return m.match(/^\![^\*]+\*$/);
65
+ })
66
+ .map(function (m) {
67
+ return m.substr(1, m.length - 2);
68
+ });
69
+ },
70
+ };
71
+
72
+ function createPropListMatcher(propList) {
73
+ var hasWild = propList.indexOf('*') > -1;
74
+ var matchAll = hasWild && propList.length === 1;
75
+ var lists = {
76
+ exact: filterPropList.exact(propList),
77
+ contain: filterPropList.contain(propList),
78
+ startWith: filterPropList.startWith(propList),
79
+ endWith: filterPropList.endWith(propList),
80
+ notExact: filterPropList.notExact(propList),
81
+ notContain: filterPropList.notContain(propList),
82
+ notStartWith: filterPropList.notStartWith(propList),
83
+ notEndWith: filterPropList.notEndWith(propList),
84
+ };
85
+ return function (prop) {
86
+ if (matchAll) return true;
87
+ return (
88
+ (hasWild ||
89
+ lists.exact.indexOf(prop) > -1 ||
90
+ lists.contain.some(function (m) {
91
+ return prop.indexOf(m) > -1;
92
+ }) ||
93
+ lists.startWith.some(function (m) {
94
+ return prop.indexOf(m) === 0;
95
+ }) ||
96
+ lists.endWith.some(function (m) {
97
+ return prop.indexOf(m) === prop.length - m.length;
98
+ })) &&
99
+ !(
100
+ lists.notExact.indexOf(prop) > -1 ||
101
+ lists.notContain.some(function (m) {
102
+ return prop.indexOf(m) > -1;
103
+ }) ||
104
+ lists.notStartWith.some(function (m) {
105
+ return prop.indexOf(m) === 0;
106
+ }) ||
107
+ lists.notEndWith.some(function (m) {
108
+ return prop.indexOf(m) === prop.length - m.length;
109
+ })
110
+ )
111
+ );
112
+ };
113
+ }
114
+
115
+ module.exports = {
116
+ filterPropList,
117
+ createPropListMatcher,
118
+ };
@@ -1,5 +1,18 @@
1
- const autoprefixer = require("autoprefixer");
2
-
1
+ const autoprefixer = require('autoprefixer');
2
+ const postcssPxToViewport = require('./postcss-plugin/px-to-vw/index');
3
3
  module.exports = {
4
- plugins: [autoprefixer()],
4
+ plugins: [
5
+ autoprefixer(),
6
+ postcssPxToViewport({
7
+ viewportWidth: 375,
8
+ unitPrecision: 5,
9
+ viewportUnit: 'vw',
10
+ fontViewportUnit: 'vw',
11
+ exclude: [/\/node_modules\//i],
12
+ landscape: true, // 是否处理横屏情况
13
+ landscapeUnit: 'vw', // (String) 横屏时使用的单位
14
+ landscapeWidth: 812, // (Number) 横屏时使用的视口宽度
15
+ landscapeHeight: 375, // (Number) 横屏时使用的视口宽度
16
+ }),
17
+ ],
5
18
  };
@@ -34,8 +34,9 @@ module.exports = {
34
34
  'agora-foundation',
35
35
  'agora-ui-foundation',
36
36
  'agora-rte-sdk',
37
- 'agora-edu-core',
37
+ 'fcr-core',
38
38
  'fcr-ui-scene',
39
+ 'fcr-ui-scene-mobile',
39
40
  ]),
40
41
  },
41
42
  extensions: ['.ts', '.js', '.tsx'],
@@ -8,7 +8,6 @@ const { getCodeOfDeclaredVariables } = require('../tools/ast-utils');
8
8
  const baseConfig = require('./webpack.base');
9
9
  const { resolveCwd, resolveModule } = require('../tools/paths');
10
10
  const fs = require('fs');
11
-
12
11
  module.exports = createConfig = ({ entry, port = 3000, analyze }) => {
13
12
  const extractArray = (str = '') => {
14
13
  if (!str) {
package/scripts/bundle.js CHANGED
@@ -8,8 +8,15 @@ const webpackConfig = require(webpackProdPath)({ entry, analyze, out });
8
8
 
9
9
  Webpack(webpackConfig, (err, stats) => {
10
10
  // TODO: write error stack and stats to local disk, dont print log to the console
11
+
11
12
  if (err || stats.hasErrors()) {
12
- console.error('Stats', stats);
13
- console.error('Build failed', err);
13
+ console.error(`Build failed`);
14
+ if (err) {
15
+ console.error(`cause: ${err.cause}`);
16
+ console.error(`message: ${err.message}`);
17
+ console.error(`stack: ${err.stack}`);
18
+ }
19
+ console.error(`stats: ${stats.toString()}`);
20
+ process.exit(1);
14
21
  }
15
22
  });
@@ -78,7 +78,9 @@ const options = {
78
78
  to: 'assets/pretest.mp3',
79
79
  },
80
80
  ],
81
- files: cpp ? ['!**/node_modules/agora-electron-sdk/**/*'] : ['**/*'],
81
+ files: cpp
82
+ ? ['!**/node_modules/agora-electron-sdk/**/*', '!**/artifactory_deps/**/*']
83
+ : ['**/*', '!**/artifactory_deps/**/*'],
82
84
  // files: [
83
85
  // // 'node_modules//**/*',
84
86
  // {
@@ -114,6 +116,11 @@ const options = {
114
116
  NSMicrophoneUsageDescription: 'Fcr Meeting wants to acquire your microphone permission',
115
117
  NSCameraUsageDescription: 'Fcr Meeting wants to acquire your camera permission',
116
118
  NSScreenCaptureDescription: 'Fcr Meeting wants to acquire your screen capture permission',
119
+ 'com.apple.security.device.audio-input': true,
120
+ 'com.apple.security.cs.allow-jit': true,
121
+ 'com.apple.security.cs.allow-unsigned-executable-memory': true,
122
+ 'com.apple.security.cs.allow-dyld-environment-variables': true,
123
+ 'com.apple.security.device.camera': true,
117
124
  },
118
125
  },
119
126
  dmg: {
@@ -32,8 +32,10 @@ function copyDirSync(source, target) {
32
32
  }
33
33
  }
34
34
  }
35
-
36
- // copyDirSync(resolveBase('lib'), resolveCwd('dist'));
35
+ if (!fs.existsSync(resolveCwd('dist/assets'))) {
36
+ fs.mkdirSync(resolveCwd('dist/assets'));
37
+ }
38
+ fs.copyFileSync(resolveCwd('public/assets/loading.gif'), resolveCwd('dist/assets/loading.gif'));
37
39
 
38
40
  // Let's get that intellisense working
39
41
  /**
@@ -82,6 +84,7 @@ const options = {
82
84
  output: resolveCwd('release'),
83
85
  buildResources: resolveCwd('installer/resources'),
84
86
  },
87
+ files: ['!**/artifactory_deps/**/*'],
85
88
  // files: [
86
89
  // // 'node_modules//**/*',
87
90
  // {
@@ -94,6 +97,10 @@ const options = {
94
97
  from: resolveCwd('public/assets/pretest.mp3'),
95
98
  to: 'assets/pretest.mp3',
96
99
  },
100
+ {
101
+ from: resolveCwd('public/assets/loading.gif'),
102
+ to: 'assets/loading.gif',
103
+ },
97
104
  ],
98
105
  // extraFiles: [
99
106
  // {
@@ -120,6 +127,7 @@ const options = {
120
127
  NSMicrophoneUsageDescription: 'Fcr Meeting wants to acquire your microphone permission',
121
128
  NSCameraUsageDescription: 'Fcr Meeting wants to acquire your camera permission',
122
129
  NSScreenCaptureDescription: 'Fcr Meeting wants to acquire your screen capture permission',
130
+ LSUIElement: 1,
123
131
  },
124
132
  },
125
133
  dmg: {
@@ -7,7 +7,7 @@ const karmaPresetPath = path.join(presetsDir, 'karma.conf.js');
7
7
 
8
8
  process.env.platform = 'browser';
9
9
 
10
- spawn(require.resolve('.bin/karma'), ['start', karmaPresetPath], {
10
+ spawn(require.resolve('.bin/karma'), ['start', karmaPresetPath, ...process.argv], {
11
11
  stdio: 'inherit',
12
12
  }).on('exit', (code) => {
13
13
  if (code === 0) {
@@ -41,7 +41,7 @@ waitOn(
41
41
  },
42
42
  );
43
43
 
44
- spawn(require.resolve('.bin/karma'), ['start', karmaPresetPath], {
44
+ spawn(require.resolve('.bin/karma'), ['start', karmaPresetPath, ...process.argv], {
45
45
  stdio: 'inherit',
46
46
  }).on('exit', (code) => {
47
47
  if (code === 0) {
@@ -0,0 +1,8 @@
1
+ const { program } = require('commander');
2
+
3
+ const opts = program
4
+ .option('--file <file>', 'Specify an UT to run')
5
+ .parse(process.argv)
6
+ .opts();
7
+
8
+ module.exports = opts;
@@ -3,19 +3,24 @@ const { resolveModule } = require('./paths');
3
3
 
4
4
  const sourceAlias = (libs) => {
5
5
  return libs.reduce((prev, libName) => {
6
- const modulePath = resolveModule(libName);
6
+ try {
7
+ const modulePath = resolveModule(libName);
7
8
 
8
- const srcPath = `${modulePath}/src`;
9
+ const srcPath = `${modulePath}/src`;
9
10
 
10
- if (existsSync(srcPath)) {
11
- console.log(`source linker: ${libName} linked`);
11
+ if (existsSync(srcPath)) {
12
+ console.log(`source linker: ${libName} linked`);
12
13
 
13
- prev[`${libName}/lib`] = srcPath;
14
+ prev[`${libName}/lib`] = srcPath;
14
15
 
15
- prev[`${libName}`] = srcPath;
16
- }
16
+ prev[`${libName}`] = srcPath;
17
+ }
17
18
 
18
- return prev;
19
+ return prev;
20
+ } catch (e) {
21
+ console.log(`source linker: ${libName} not found`);
22
+ return prev;
23
+ }
19
24
  }, {});
20
25
  };
21
26
 
@@ -1,40 +0,0 @@
1
-
2
- #pragma once
3
-
4
- namespace agora {
5
- namespace Fcr {
6
-
7
- enum class Region {
8
- CN = 0,
9
- NA = 1,
10
- EU = 2,
11
- AP = 3,
12
- };
13
-
14
- enum class UserRole {
15
- host = 1,
16
- assistant = 2,
17
- participant = 3,
18
- audience = 4,
19
- observer = 5,
20
- };
21
-
22
- enum class StreamLatencyLevel {
23
- low = 1,
24
- ultraLow = 2,
25
- };
26
-
27
- enum class VideoOutputOrientationMode {
28
- adaptative = 0,
29
- fixedLandScape = 1,
30
- fixedPortrait = 2
31
- };
32
-
33
- enum class DegradationPreference {
34
- quality = 0,
35
- frameRate = 1,
36
- balanced = 2
37
- };
38
-
39
- } // namespace Fcr
40
- } // namespace agora
@@ -1,13 +0,0 @@
1
- #pragma once
2
-
3
- namespace agora {
4
- namespace Fcr {
5
- enum class ErrorCode {
6
- ok = 0,
7
- invalidParams = 1,
8
- alreadyLaunch = 2,
9
-
10
- error = 1000,
11
- };
12
- }
13
- } // namespace agora
@@ -1,76 +0,0 @@
1
- #pragma once
2
-
3
- #include "FcrEnums.h"
4
- #include "FcrUIPlatform.h"
5
- #include <stdint.h>
6
-
7
- namespace agora {
8
- namespace Fcr {
9
-
10
- struct VideoEncoderConfig {
11
- uint32_t width;
12
- uint32_t height;
13
- uint32_t frameRate;
14
- uint32_t bitRate;
15
- VideoOutputOrientationMode orientationMode;
16
- DegradationPreference degradationPreference;
17
- bool isMirror;
18
-
19
- VideoEncoderConfig(uint32_t width, uint32_t height, uint32_t frameRate,
20
- uint32_t bitRate,
21
- VideoOutputOrientationMode orientationMode,
22
- DegradationPreference degradationPreference,
23
- bool isMirror)
24
- : width(width), height(height), frameRate(frameRate), bitRate(bitRate),
25
- orientationMode(orientationMode),
26
- degradationPreference(degradationPreference), isMirror(isMirror) {}
27
- };
28
-
29
- struct DualVideoStreamConfig {
30
- VideoEncoderConfig highVideoEncoderConfig;
31
- VideoEncoderConfig lowVideoEncoderConfig;
32
- bool enableDualStreamMode;
33
-
34
- DualVideoStreamConfig(const VideoEncoderConfig &highVideoEncoderConfig,
35
- const VideoEncoderConfig &lowVideoEncoderConfig,
36
- bool enableDualStreamMode)
37
- : highVideoEncoderConfig(highVideoEncoderConfig),
38
- lowVideoEncoderConfig(lowVideoEncoderConfig),
39
- enableDualStreamMode(enableDualStreamMode) {}
40
- };
41
-
42
- struct UISceneConfig {
43
- const char *appId;
44
- const char *token;
45
- Region region;
46
-
47
- const char *roomId;
48
-
49
- const char *userId;
50
- const char *userName;
51
- UserRole userRole;
52
- // A json dictionary
53
- const char *userProperties;
54
-
55
- StreamLatencyLevel streamLatency;
56
- DualVideoStreamConfig dualCameraVideoStreamConfig;
57
- DualVideoStreamConfig dualScreenVideoStreamConfig;
58
- // A json dictionary
59
- const char *parameters;
60
-
61
- UISceneConfig(const char *appId, const char *token, Region region,
62
- const char *roomId, const char *userId, const char *userName,
63
- UserRole userRole, const char *userProperties,
64
- StreamLatencyLevel streamLatency,
65
- const DualVideoStreamConfig &dualCameraVideoStreamConfig,
66
- const DualVideoStreamConfig &dualScreenVideoStreamConfig,
67
- const char *parameters)
68
- : appId(appId), token(token), region(region), roomId(roomId),
69
- userId(userId), userName(userName), userRole(userRole),
70
- userProperties(userProperties), streamLatency(streamLatency),
71
- dualCameraVideoStreamConfig(dualCameraVideoStreamConfig),
72
- dualScreenVideoStreamConfig(dualScreenVideoStreamConfig),
73
- parameters(parameters) {}
74
- };
75
- } // namespace Fcr
76
- } // namespace agora
@@ -1,87 +0,0 @@
1
- #ifndef __FCRUI_PLATFORM_H__
2
- #define __FCRUI_PLATFORM_H__
3
-
4
- #include <stdint.h>
5
- #if defined(__APPLE__)
6
- #include <TargetConditionals.h>
7
- #endif
8
-
9
- #ifdef __cplusplus
10
- #define EXTERN_C extern "C"
11
- #define EXTERN_C_ENTER extern "C" {
12
- #define EXTERN_C_LEAVE }
13
- #else
14
- #define EXTERN_C
15
- #define EXTERN_C_ENTER
16
- #define EXTERN_C_LEAVE
17
- #endif
18
-
19
- #ifdef __GNUC__
20
- #define AGORA_GCC_VERSION_AT_LEAST(x, y) \
21
- (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
22
- #else
23
- #define AGORA_GCC_VERSION_AT_LEAST(x, y) 0
24
- #endif
25
-
26
- #if defined(_WIN32)
27
- #define FCRUI_CALL __cdecl
28
- #if defined(FCRUI_EXPORT)
29
- #define FCRUI_API EXTERN_C __declspec(dllexport)
30
- #define FCRUI_CPP_API __declspec(dllexport)
31
- #else
32
- #define FCRUI_API EXTERN_C __declspec(dllimport)
33
- #define FCRUI_CPP_API __declspec(dllimport)
34
- #endif
35
- #elif defined(__APPLE__)
36
- #if AGORA_GCC_VERSION_AT_LEAST(3, 3)
37
- #define FCRUI_API __attribute__((visibility("default"))) EXTERN_C
38
- #define FCRUI_CPP_API __attribute__((visibility("default")))
39
- #else
40
- #define FCRUI_API EXTERN_C
41
- #define FCRUI_CPP_API
42
- #endif
43
- #define FCRUI_CALL
44
- #elif defined(__ANDROID__) || defined(__linux__)
45
- #if AGORA_GCC_VERSION_AT_LEAST(3, 3)
46
- #define FCRUI_API EXTERN_C __attribute__((visibility("default")))
47
- #define FCRUI_CPP_API __attribute__((visibility("default")))
48
- #else
49
- #define FCRUI_API EXTERN_C
50
- #define FCRUI_CPP_API
51
- #endif
52
- #define FCRUI_CALL
53
- #else
54
- #define FCRUI_API EXTERN_C
55
- #define FCRUI_CPP_API
56
- #define FCRUI_CALL
57
- #endif
58
-
59
- #if AGORA_GCC_VERSION_AT_LEAST(3, 1)
60
- #define FCRUI_DEPRECATED __attribute__((deprecated))
61
- #elif defined(_MSC_VER)
62
- #define FCRUI_DEPRECATED
63
- #else
64
- #define FCRUI_DEPRECATED
65
- #endif
66
-
67
- #if defined(__GUNC__)
68
- #define COMPILER_IS_GCC
69
- #if defined(__MINGW32__) || defined(__MINGW64__)
70
- #define COMPILER_IS_MINGW
71
- #endif
72
- #if defined(__MSYS__)
73
- #define COMPILER_ON_MSYS
74
- #endif
75
- #if defined(__CYGWIN__) || defined(__CYGWIN32__)
76
- #define COMPILER_ON_CYGWIN
77
- #endif
78
- #if defined(__clang__)
79
- #define COMPILER_IS_CLANG
80
- #endif
81
- #elif defined(_MSC_VER)
82
- #define COMPILER_IS_MSVC
83
- #else
84
- #define COMPILER_IS_UNKNOWN
85
- #endif
86
-
87
- #endif
@@ -1,29 +0,0 @@
1
- #pragma once
2
-
3
- #include "FcrError.h"
4
- #include "FcrObjects.h"
5
- #include "FcrUIPlatform.h"
6
-
7
- namespace agora {
8
- namespace Fcr {
9
-
10
- class IUISceneCreatorObserver {
11
- public:
12
- FCRUI_CPP_API virtual void onLaunchSuccess() = 0;
13
- FCRUI_CPP_API virtual void onLaunchFailure(ErrorCode error) = 0;
14
- FCRUI_CPP_API virtual void onExited() = 0;
15
- FCRUI_CPP_API virtual void onReleaseCompelete() = 0;
16
- };
17
-
18
- class IUISceneCreator {
19
- public:
20
- FCRUI_CPP_API static IUISceneCreator *createCreator();
21
- FCRUI_CPP_API virtual ~IUISceneCreator() = default;
22
- FCRUI_CPP_API virtual ErrorCode launch(UISceneConfig config) = 0;
23
- FCRUI_CPP_API virtual void release() = 0;
24
-
25
- FCRUI_CPP_API virtual void registerObserver(IUISceneCreatorObserver *) = 0;
26
- FCRUI_CPP_API virtual void unRegisterObserver(IUISceneCreatorObserver *) = 0;
27
- };
28
- } // namespace Fcr
29
- } // namespace agora
@@ -1,48 +0,0 @@
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>BuildMachineOSBuild</key>
6
- <string>21G419</string>
7
- <key>CFBundleDevelopmentRegion</key>
8
- <string>English</string>
9
- <key>CFBundleExecutable</key>
10
- <string>FcrUIScene</string>
11
- <key>CFBundleIdentifier</key>
12
- <string>io.agora.fcruiscene</string>
13
- <key>CFBundleInfoDictionaryVersion</key>
14
- <string>6.0</string>
15
- <key>CFBundlePackageType</key>
16
- <string>FMWK</string>
17
- <key>CFBundleShortVersionString</key>
18
- <string>3.0.0</string>
19
- <key>CFBundleSignature</key>
20
- <string>????</string>
21
- <key>CFBundleSupportedPlatforms</key>
22
- <array>
23
- <string>MacOSX</string>
24
- </array>
25
- <key>CFBundleVersion</key>
26
- <string>3.0.0</string>
27
- <key>CSResourcesFileMapped</key>
28
- <true/>
29
- <key>DTCompiler</key>
30
- <string>com.apple.compilers.llvm.clang.1_0</string>
31
- <key>DTPlatformBuild</key>
32
- <string>13F100</string>
33
- <key>DTPlatformName</key>
34
- <string>macosx</string>
35
- <key>DTPlatformVersion</key>
36
- <string>12.3</string>
37
- <key>DTSDKBuild</key>
38
- <string>21E226</string>
39
- <key>DTSDKName</key>
40
- <string>macosx12.3</string>
41
- <key>DTXcode</key>
42
- <string>1341</string>
43
- <key>DTXcodeBuild</key>
44
- <string>13F100</string>
45
- <key>LSMinimumSystemVersion</key>
46
- <string>10.10</string>
47
- </dict>
48
- </plist>