Lita-Tako vor 4 Monaten
Ursprung
Commit
cdc1939a92
100 geänderte Dateien mit 26207 neuen und 37 gelöschten Zeilen
  1. 105 0
      queue-monitor/components/commonSelect.vue
  2. 290 0
      queue-monitor/components/u-action-sheet/my-action-sheet.vue
  3. 54 0
      queue-monitor/components/u-action-sheet/props.js
  4. 313 0
      queue-monitor/h5player.min.js
  5. 5 0
      queue-monitor/hybrid/html/.idea/.gitignore
  6. 12 0
      queue-monitor/hybrid/html/.idea/html.iml
  7. 8 0
      queue-monitor/hybrid/html/.idea/modules.xml
  8. 6 0
      queue-monitor/hybrid/html/.idea/vcs.xml
  9. 313 0
      queue-monitor/hybrid/html/h5player.min.js
  10. 2 0
      queue-monitor/hybrid/html/jquery-3.7.1.min.js
  11. 642 0
      queue-monitor/hybrid/html/playctrl1/DecodeWorker.js
  12. 1 0
      queue-monitor/hybrid/html/playctrl1/Decoder.js
  13. 642 0
      queue-monitor/hybrid/html/playctrl1simd/DecodeWorker.js
  14. 1 0
      queue-monitor/hybrid/html/playctrl1simd/Decoder.js
  15. 21 0
      queue-monitor/hybrid/html/playctrl2/Decoder.js
  16. BIN
      queue-monitor/hybrid/html/playctrl2/Decoder.wasm
  17. 1 0
      queue-monitor/hybrid/html/playctrl2/Decoder.worker.js
  18. 21 0
      queue-monitor/hybrid/html/playctrl3/Decoder.js
  19. BIN
      queue-monitor/hybrid/html/playctrl3/Decoder.wasm
  20. 1 0
      queue-monitor/hybrid/html/playctrl3/Decoder.worker.js
  21. 71 0
      queue-monitor/hybrid/html/player.html
  22. 21 0
      queue-monitor/hybrid/html/style.css
  23. 21 0
      queue-monitor/hybrid/html/talk/AudioInterCom.js
  24. BIN
      queue-monitor/hybrid/html/talk/AudioInterCom.wasm
  25. 21 0
      queue-monitor/hybrid/html/talkW/AudioInterCom.js
  26. BIN
      queue-monitor/hybrid/html/talkW/AudioInterCom.wasm
  27. 1 0
      queue-monitor/hybrid/html/talkW/AudioInterCom.worker.js
  28. 6525 0
      queue-monitor/hybrid/html/transform/libSystemTransform.js
  29. BIN
      queue-monitor/hybrid/html/transform/libSystemTransform.wasm
  30. 120 0
      queue-monitor/hybrid/html/transform/systemTransform-worker.js
  31. 78 0
      queue-monitor/hybrid/html/utils.js
  32. 10 0
      queue-monitor/hybrid/html/vconsole.min.js
  33. 7 0
      queue-monitor/pages.json
  34. 7 1
      queue-monitor/pages/home/home.vue
  35. 4 2
      queue-monitor/pages/index/index.vue
  36. 4 3
      queue-monitor/pages/monitor/monitor.vue
  37. 5 3
      queue-monitor/pages/registration/registration.vue
  38. 4 3
      queue-monitor/pages/reservation/reservation.vue
  39. 5 3
      queue-monitor/pages/schedule/schedule.vue
  40. 33 0
      queue-monitor/pages/video/video.vue
  41. BIN
      queue-monitor/unpackage/cache/apk/__UNI__FB8F249_cm.apk
  42. 1 1
      queue-monitor/unpackage/cache/apk/apkurl
  43. 1 1
      queue-monitor/unpackage/cache/apk/cmManifestCache.json
  44. 2 2
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/app-config-service.js
  45. 4 4
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/app-service.js
  46. 1 1
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/app-view.js
  47. 313 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/h5player.min.js
  48. 2 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/jquery-3.7.1.min.js
  49. 642 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1/DecodeWorker.js
  50. 1 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1/Decoder.js
  51. 642 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1simd/DecodeWorker.js
  52. 1 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1simd/Decoder.js
  53. 21 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl2/Decoder.js
  54. BIN
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl2/Decoder.wasm
  55. 1 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl2/Decoder.worker.js
  56. 21 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl3/Decoder.js
  57. BIN
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl3/Decoder.wasm
  58. 1 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl3/Decoder.worker.js
  59. 62 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/player.html
  60. 21 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talk/AudioInterCom.js
  61. BIN
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talk/AudioInterCom.wasm
  62. 21 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talkW/AudioInterCom.js
  63. BIN
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talkW/AudioInterCom.wasm
  64. 1 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talkW/AudioInterCom.worker.js
  65. 6525 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/transform/libSystemTransform.js
  66. BIN
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/transform/libSystemTransform.wasm
  67. 120 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/transform/systemTransform-worker.js
  68. 10 0
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/vconsole.min.js
  69. 1 1
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/manifest.json
  70. 1 1
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/view.css
  71. 1 1
      queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/view.umd.min.js
  72. 2 2
      queue-monitor/unpackage/dist/build/app-plus/app-config-service.js
  73. 4 4
      queue-monitor/unpackage/dist/build/app-plus/app-service.js
  74. 1 1
      queue-monitor/unpackage/dist/build/app-plus/app-view.js
  75. 313 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/h5player.min.js
  76. 2 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/jquery-3.7.1.min.js
  77. 642 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1/DecodeWorker.js
  78. 1 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1/Decoder.js
  79. 642 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1simd/DecodeWorker.js
  80. 1 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1simd/Decoder.js
  81. 21 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl2/Decoder.js
  82. BIN
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl2/Decoder.wasm
  83. 1 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl2/Decoder.worker.js
  84. 21 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl3/Decoder.js
  85. BIN
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl3/Decoder.wasm
  86. 1 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl3/Decoder.worker.js
  87. 62 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/player.html
  88. 21 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talk/AudioInterCom.js
  89. BIN
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talk/AudioInterCom.wasm
  90. 21 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talkW/AudioInterCom.js
  91. BIN
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talkW/AudioInterCom.wasm
  92. 1 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talkW/AudioInterCom.worker.js
  93. 6525 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/transform/libSystemTransform.js
  94. BIN
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/transform/libSystemTransform.wasm
  95. 120 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/transform/systemTransform-worker.js
  96. 10 0
      queue-monitor/unpackage/dist/build/app-plus/hybrid/html/vconsole.min.js
  97. 1 1
      queue-monitor/unpackage/dist/build/app-plus/manifest.json
  98. 1 1
      queue-monitor/unpackage/dist/build/app-plus/view.css
  99. 1 1
      queue-monitor/unpackage/dist/build/app-plus/view.umd.min.js
  100. 0 0
      queue-monitor/unpackage/dist/dev/app-plus/__uniappchooselocation.js

+ 105 - 0
queue-monitor/components/commonSelect.vue

@@ -0,0 +1,105 @@
1
+<template>
2
+	<view>
3
+		<u-input v-model="v" readonly placeholder="请选择">
4
+			<template v-if="!readonly" slot="suffix">
5
+				<u-button @tap="openSelect" text="点击选择" type="primary" size="small"></u-button>
6
+			</template>
7
+		</u-input>
8
+		<action-sheet :actions="options" title="请选择" :show="showSelector" @closeOnClickOverlay="showSelector = false"
9
+			@close="showSelector = false" @select="onSelect" />
10
+	</view>
11
+</template>
12
+
13
+<script>
14
+	import {
15
+		str,
16
+		clone
17
+	} from '@/utils/tools';
18
+	import * as allStatic from './options.js'
19
+	import actionSheet from './u-action-sheet/my-action-sheet.vue'
20
+	export default {
21
+		name: "commonSelect",
22
+		props: {
23
+			value: {
24
+				type: [String, Number],
25
+				required: false,
26
+				default: null,
27
+			},
28
+			data: {
29
+				type: [String, Array],
30
+				required: true
31
+			},
32
+			remote: {
33
+				type: Boolean,
34
+				required: false,
35
+				default: false,
36
+			},
37
+			readonly: {
38
+				type: Boolean,
39
+				required: false,
40
+				default: false,
41
+			}
42
+		},
43
+		components: {
44
+			// uInput
45
+			actionSheet
46
+		},
47
+		data() {
48
+			return {
49
+				v: str(this.value, null),
50
+				_name: this.getName(),
51
+				options: [],
52
+				showSelector: false,
53
+			};
54
+		},
55
+		watch: {
56
+			value(n, o) {
57
+				this._vlaue = str(n, null)
58
+			},
59
+			data: {
60
+				handler: function(n, o) {
61
+					this.initOptions()
62
+				},
63
+				immediate: true,
64
+			}
65
+		},
66
+		methods: {
67
+			getName() {
68
+				if (!this.v) {
69
+					return ''
70
+				}
71
+			},
72
+			openSelect() {
73
+				uni.hideKeyboard()
74
+				if (!this.readonly) {
75
+					this.showSelector = true
76
+				}
77
+			},
78
+			onSelect(n) {
79
+				this.v = n.name
80
+				console.log('select', arguments);
81
+			},
82
+			parseData(d) {
83
+				return {
84
+					name: d.text,
85
+					value: d.value,
86
+					raw: d,
87
+				}
88
+			},
89
+			initOptions() {
90
+				if (Array.isArray(this.data)) { // 本地数据
91
+					this.options = clone(this.data).map(this.parseData)
92
+					console.log(this.options);
93
+				} else if(this.remote){ // 字典数据
94
+
95
+				} else { // 静态数据
96
+					this.options = allStatic[this.data].map(this.parseData)
97
+				}
98
+			}
99
+		}
100
+	}
101
+</script>
102
+
103
+<style>
104
+
105
+</style>

+ 290 - 0
queue-monitor/components/u-action-sheet/my-action-sheet.vue

@@ -0,0 +1,290 @@
1
+
2
+<template>
3
+	<u-popup
4
+	    :show="show"
5
+	    mode="bottom"
6
+	    @close="closeHandler"
7
+	    :safeAreaInsetBottom="safeAreaInsetBottom"
8
+	    :round="round"
9
+	>
10
+	<scroll-view :scroll-y="true" :style="{'max-height': `${height}px`}">
11
+		<view class="u-action-sheet">
12
+			<view
13
+			    class="u-action-sheet__header"
14
+			    v-if="title"
15
+			>
16
+				<text class="u-action-sheet__header__title u-line-1">{{title}}</text>
17
+				<view
18
+				    class="u-action-sheet__header__icon-wrap"
19
+				    @tap.stop="cancel"
20
+				>
21
+					<u-icon
22
+					    name="close"
23
+					    size="17"
24
+					    color="#c8c9cc"
25
+					    bold
26
+					></u-icon>
27
+				</view>
28
+			</view>
29
+			<text
30
+			    class="u-action-sheet__description"
31
+				:style="[{
32
+					marginTop: `${title && description ? 0 : '18px'}`
33
+				}]"
34
+			    v-if="description"
35
+			>{{description}}</text>
36
+			<slot>
37
+				<u-line v-if="description"></u-line>
38
+				<view class="u-action-sheet__item-wrap">
39
+					<template v-for="(item, index) in actions">
40
+						<!-- #ifdef MP -->
41
+						<button
42
+						    :key="index"
43
+						    class="u-reset-button"
44
+						    :openType="item.openType"
45
+						    @getuserinfo="onGetUserInfo"
46
+						    @contact="onContact"
47
+						    @getphonenumber="onGetPhoneNumber"
48
+						    @error="onError"
49
+						    @launchapp="onLaunchApp"
50
+						    @opensetting="onOpenSetting"
51
+						    :lang="lang"
52
+						    :session-from="sessionFrom"
53
+						    :send-message-title="sendMessageTitle"
54
+						    :send-message-path="sendMessagePath"
55
+						    :send-message-img="sendMessageImg"
56
+						    :show-message-card="showMessageCard"
57
+						    :app-parameter="appParameter"
58
+						    @tap="selectHandler(index)"
59
+						    :hover-class="!item.disabled && !item.loading ? 'u-action-sheet--hover' : ''"
60
+						>
61
+							<!-- #endif -->
62
+							<view
63
+							    class="u-action-sheet__item-wrap__item"
64
+							    @tap.stop="selectHandler(index)"
65
+							    :hover-class="!item.disabled && !item.loading ? 'u-action-sheet--hover' : ''"
66
+							    :hover-stay-time="150"
67
+							>
68
+								<template v-if="!item.loading">
69
+									<text
70
+									    class="u-action-sheet__item-wrap__item__name"
71
+									    :style="[itemStyle(index)]"
72
+									>{{ item.name }}</text>
73
+									<text
74
+									    v-if="item.subname"
75
+									    class="u-action-sheet__item-wrap__item__subname"
76
+									>{{ item.subname }}</text>
77
+								</template>
78
+								<u-loading-icon
79
+								    v-else
80
+								    custom-class="van-action-sheet__loading"
81
+								    size="18"
82
+								    mode="circle"
83
+								/>
84
+							</view>
85
+							<!-- #ifdef MP -->
86
+						</button>
87
+						<!-- #endif -->
88
+						<u-line v-if="index !== actions.length - 1"></u-line>
89
+					</template>
90
+				</view>
91
+			</slot>
92
+			<u-gap
93
+			    bgColor="#eaeaec"
94
+			    height="6"
95
+			    v-if="cancelText"
96
+			></u-gap>
97
+			<view hover-class="u-action-sheet--hover">
98
+				<text
99
+				    @touchmove.stop.prevent
100
+				    :hover-stay-time="150"
101
+				    v-if="cancelText"
102
+				    class="u-action-sheet__cancel-text"
103
+				    @tap="cancel"
104
+				>{{cancelText}}</text>
105
+			</view>
106
+		</view>
107
+	</scroll-view>
108
+	</u-popup>
109
+</template>
110
+
111
+<script>
112
+	import openType from '@/uni_modules/uview-ui/libs/mixin/openType'
113
+	import button from '@/uni_modules/uview-ui/libs/mixin/button'
114
+	import props from './props.js';
115
+	/**
116
+	 * ActionSheet 操作菜单
117
+	 * @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。本组件功能类似于uni的uni.showActionSheetAPI,配置更加灵活,所有平台都表现一致。
118
+	 * @tutorial https://www.uviewui.com/components/actionSheet.html
119
+	 * 
120
+	 * @property {Boolean}			show				操作菜单是否展示 (默认 false )
121
+	 * @property {String}			title				操作菜单标题
122
+	 * @property {String}			description			选项上方的描述信息
123
+	 * @property {Array<Object>}	actions				按钮的文字数组,见官方文档示例
124
+	 * @property {String}			cancelText			取消按钮的提示文字,不为空时显示按钮
125
+	 * @property {Boolean}			closeOnClickAction	点击某个菜单项时是否关闭弹窗 (默认 true )
126
+	 * @property {Boolean}			safeAreaInsetBottom	处理底部安全区 (默认 true )
127
+	 * @property {String}			openType			小程序的打开方式 (contact | launchApp | getUserInfo | openSetting |getPhoneNumber |error )
128
+	 * @property {Boolean}			closeOnClickOverlay	点击遮罩是否允许关闭  (默认 true )
129
+	 * @property {Number|String}	round				圆角值,默认无圆角  (默认 0 )
130
+	 * @property {String}			lang				指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文
131
+	 * @property {String}			sessionFrom			会话来源,openType="contact"时有效
132
+	 * @property {String}			sendMessageTitle	会话内消息卡片标题,openType="contact"时有效
133
+	 * @property {String}			sendMessagePath		会话内消息卡片点击跳转小程序路径,openType="contact"时有效
134
+	 * @property {String}			sendMessageImg		会话内消息卡片图片,openType="contact"时有效
135
+	 * @property {Boolean}			showMessageCard		是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效 (默认 false )
136
+	 * @property {String}			appParameter		打开 APP 时,向 APP 传递的参数,openType=launchApp 时有效
137
+	 * 
138
+	 * @event {Function} select			点击ActionSheet列表项时触发 
139
+	 * @event {Function} close			点击取消按钮时触发
140
+	 * @event {Function} getuserinfo	用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,openType="getUserInfo"时有效
141
+	 * @event {Function} contact		客服消息回调,openType="contact"时有效
142
+	 * @event {Function} getphonenumber	获取用户手机号回调,openType="getPhoneNumber"时有效
143
+	 * @event {Function} error			当使用开放能力时,发生错误的回调,openType="error"时有效
144
+	 * @event {Function} launchapp		打开 APP 成功的回调,openType="launchApp"时有效
145
+	 * @event {Function} opensetting	在打开授权设置页后回调,openType="openSetting"时有效
146
+	 * @example <u-action-sheet :actions="list" :title="title" :show="show"></u-action-sheet>
147
+	 */
148
+	export default {
149
+		name: "my-action-sheet",
150
+		// 一些props参数和methods方法,通过mixin混入,因为其他文件也会用到
151
+		mixins: [openType, button, uni.$u.mixin, props],
152
+		data() {
153
+			return {
154
+				height: 0,
155
+			}
156
+		},
157
+		computed: {
158
+			// 操作项目的样式
159
+			itemStyle() {
160
+				return (index) => {
161
+					let style = {};
162
+					if (this.actions[index].color) style.color = this.actions[index].color
163
+					if (this.actions[index].fontSize) style.fontSize = uni.$u.addUnit(this.actions[index].fontSize)
164
+					// 选项被禁用的样式
165
+					if (this.actions[index].disabled) style.color = '#c0c4cc'
166
+					return style;
167
+				}
168
+			},
169
+		},
170
+		beforeMount() {
171
+			uni.onWindowResize(() => {
172
+				this.calHeight()
173
+			})
174
+			this.calHeight()
175
+		},
176
+		methods: {
177
+			calHeight() {
178
+				console.log(123);
179
+				this.height = uni.getWindowInfo().screenHeight * 0.6
180
+			},
181
+			closeHandler() {
182
+				// 允许点击遮罩关闭时,才发出close事件
183
+				if(this.closeOnClickOverlay) {
184
+					this.$emit('close')
185
+				}
186
+			},
187
+			// 点击取消按钮
188
+			cancel() {
189
+				this.$emit('close')
190
+			},
191
+			selectHandler(index) {
192
+				const item = this.actions[index]
193
+				if (item && !item.disabled && !item.loading) {
194
+					this.$emit('select', item)
195
+					if (this.closeOnClickAction) {
196
+						this.$emit('close')
197
+					}
198
+				}
199
+			},
200
+		}
201
+	}
202
+</script>
203
+
204
+<style lang="scss" scoped>
205
+	@import "@/uni_modules/uview-ui/libs/css/components.scss";
206
+	$u-action-sheet-reset-button-width:100% !default;
207
+	$u-action-sheet-title-font-size: 16px !default;
208
+	$u-action-sheet-title-padding: 12px 30px !default;
209
+	$u-action-sheet-title-color: $u-main-color !default;
210
+	$u-action-sheet-header-icon-wrap-right:15px !default;
211
+	$u-action-sheet-header-icon-wrap-top:15px !default;
212
+	$u-action-sheet-description-font-size:13px !default;
213
+	$u-action-sheet-description-color:14px !default;
214
+	$u-action-sheet-description-margin: 18px 15px !default;
215
+	$u-action-sheet-item-wrap-item-padding:15px !default;
216
+	$u-action-sheet-item-wrap-name-font-size:16px !default;
217
+	$u-action-sheet-item-wrap-subname-font-size:13px !default;
218
+	$u-action-sheet-item-wrap-subname-color: #c0c4cc !default;
219
+	$u-action-sheet-item-wrap-subname-margin-top:10px !default;
220
+	$u-action-sheet-cancel-text-font-size:16px !default;
221
+	$u-action-sheet-cancel-text-color:$u-content-color !default;
222
+	$u-action-sheet-cancel-text-font-size:15px !default;
223
+	$u-action-sheet-cancel-text-hover-background-color:rgb(242, 243, 245) !default;
224
+
225
+	.u-reset-button {
226
+		width: $u-action-sheet-reset-button-width;
227
+	}
228
+
229
+	.u-action-sheet {
230
+		text-align: center;
231
+		&__header {
232
+			position: relative;
233
+			padding: $u-action-sheet-title-padding;
234
+			&__title {
235
+				font-size: $u-action-sheet-title-font-size;
236
+				color: $u-action-sheet-title-color;
237
+				font-weight: bold;
238
+				text-align: center;
239
+			}
240
+
241
+			&__icon-wrap {
242
+				position: absolute;
243
+				right: $u-action-sheet-header-icon-wrap-right;
244
+				top: $u-action-sheet-header-icon-wrap-top;
245
+			}
246
+		}
247
+
248
+		&__description {
249
+			font-size: $u-action-sheet-description-font-size;
250
+			color: $u-tips-color;
251
+			margin: $u-action-sheet-description-margin;
252
+			text-align: center;
253
+		}
254
+
255
+		&__item-wrap {
256
+
257
+			&__item {
258
+				padding: $u-action-sheet-item-wrap-item-padding;
259
+				@include flex;
260
+				align-items: center;
261
+				justify-content: center;
262
+				flex-direction: column;
263
+
264
+				&__name {
265
+					font-size: $u-action-sheet-item-wrap-name-font-size;
266
+					color: $u-main-color;
267
+					text-align: center;
268
+				}
269
+
270
+				&__subname {
271
+					font-size: $u-action-sheet-item-wrap-subname-font-size;
272
+					color: $u-action-sheet-item-wrap-subname-color;
273
+					margin-top: $u-action-sheet-item-wrap-subname-margin-top;
274
+					text-align: center;
275
+				}
276
+			}
277
+		}
278
+
279
+		&__cancel-text {
280
+			font-size: $u-action-sheet-cancel-text-font-size;
281
+			color: $u-action-sheet-cancel-text-color;
282
+			text-align: center;
283
+			padding: $u-action-sheet-cancel-text-font-size;
284
+		}
285
+
286
+		&--hover {
287
+			background-color: $u-action-sheet-cancel-text-hover-background-color;
288
+		}
289
+	}
290
+</style>

+ 54 - 0
queue-monitor/components/u-action-sheet/props.js

@@ -0,0 +1,54 @@
1
+export default {
2
+    props: {
3
+        // 操作菜单是否展示 (默认false)
4
+        show: {
5
+            type: Boolean,
6
+            default: uni.$u.props.actionSheet.show
7
+        },
8
+        // 标题
9
+        title: {
10
+            type: String,
11
+            default: uni.$u.props.actionSheet.title
12
+        },
13
+        // 选项上方的描述信息
14
+        description: {
15
+            type: String,
16
+            default: uni.$u.props.actionSheet.description
17
+        },
18
+        // 数据
19
+        actions: {
20
+            type: Array,
21
+            default: uni.$u.props.actionSheet.actions
22
+        },
23
+        // 取消按钮的文字,不为空时显示按钮
24
+        cancelText: {
25
+            type: String,
26
+            default: uni.$u.props.actionSheet.cancelText
27
+        },
28
+        // 点击某个菜单项时是否关闭弹窗
29
+        closeOnClickAction: {
30
+            type: Boolean,
31
+            default: uni.$u.props.actionSheet.closeOnClickAction
32
+        },
33
+        // 处理底部安全区(默认true)
34
+        safeAreaInsetBottom: {
35
+            type: Boolean,
36
+            default: uni.$u.props.actionSheet.safeAreaInsetBottom
37
+        },
38
+        // 小程序的打开方式
39
+        openType: {
40
+            type: String,
41
+            default: uni.$u.props.actionSheet.openType
42
+        },
43
+        // 点击遮罩是否允许关闭 (默认true)
44
+        closeOnClickOverlay: {
45
+            type: Boolean,
46
+            default: uni.$u.props.actionSheet.closeOnClickOverlay
47
+        },
48
+        // 圆角值
49
+        round: {
50
+            type: [Boolean, String, Number],
51
+            default: uni.$u.props.actionSheet.round
52
+        }
53
+    }
54
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 313 - 0
queue-monitor/h5player.min.js


+ 5 - 0
queue-monitor/hybrid/html/.idea/.gitignore

@@ -0,0 +1,5 @@
1
+# Default ignored files
2
+/shelf/
3
+/workspace.xml
4
+# Editor-based HTTP Client requests
5
+/httpRequests/

+ 12 - 0
queue-monitor/hybrid/html/.idea/html.iml

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="WEB_MODULE" version="4">
3
+  <component name="NewModuleRootManager">
4
+    <content url="file://$MODULE_DIR$">
5
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+    </content>
9
+    <orderEntry type="inheritedJdk" />
10
+    <orderEntry type="sourceFolder" forTests="false" />
11
+  </component>
12
+</module>

+ 8 - 0
queue-monitor/hybrid/html/.idea/modules.xml

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/html.iml" filepath="$PROJECT_DIR$/.idea/html.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6 - 0
queue-monitor/hybrid/html/.idea/vcs.xml

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
5
+  </component>
6
+</project>

Datei-Diff unterdrückt, da er zu groß ist
+ 313 - 0
queue-monitor/hybrid/html/h5player.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 0
queue-monitor/hybrid/html/jquery-3.7.1.min.js


+ 642 - 0
queue-monitor/hybrid/html/playctrl1/DecodeWorker.js

@@ -0,0 +1,642 @@
1
+/**
2
+ * Created by wangweijie5 on 2016/12/5.
3
+ */
4
+(function (event) {
5
+    const AUDIO_TYPE = 0;	// 音频
6
+    const VIDEO_TYPE = 1;   // 视频
7
+    const PRIVT_TYPE = 2;  // 私有帧
8
+
9
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
10
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
11
+
12
+    const PLAYM4_OK = 1;
13
+    const PLAYM4_ORDER_ERROR = 2;
14
+    const PLAYM4_DECODE_ERROR = 44 	// 解码失败
15
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
16
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
17
+    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
18
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
19
+
20
+    importScripts('Decoder.js');
21
+    Module.addOnPostRun(function () {
22
+        postMessage({ 'function': "loaded" });
23
+    });
24
+
25
+    var iStreamMode = 0;  // 流模式
26
+
27
+    var bOpenMode = false;
28
+    var bOpenStream = false;
29
+
30
+    var funGetFrameData = null;
31
+    var funGetAudFrameData = null;
32
+
33
+    var bWorkerPrintLog = false;//worker层log开关
34
+
35
+    var g_nPort = -1;
36
+    var pInputData = null;
37
+    var inputBufferSize = 40960;
38
+
39
+    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
40
+        let port = nPort;
41
+        let user = pUser;
42
+        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
43
+        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
44
+        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
45
+        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
46
+        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
47
+        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
48
+        postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
49
+    }
50
+
51
+    onmessage = function (event) {
52
+        var eventData = event.data;
53
+        var res = 0;
54
+        switch (eventData.command) {
55
+            case "printLog":
56
+                let downloadFlag = eventData.data;
57
+                if (downloadFlag === true) {
58
+                    bWorkerPrintLog = true;
59
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
60
+                }
61
+                else {
62
+                    bWorkerPrintLog = false;
63
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
64
+                }
65
+
66
+                if (res !== PLAYM4_OK) {
67
+                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
68
+                    postMessage({ 'function': "printLog", 'errorCode': res });
69
+                }
70
+                break;
71
+            case "SetPlayPosition":
72
+                let nFrameNumOrTime = eventData.data;
73
+                let enPosType = eventData.type;
74
+                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
75
+                // if (res !== PLAYM4_OK)
76
+                // {
77
+                //     postMessage({'function': "SetPlayPosition", 'errorCode': res});
78
+                //     return;
79
+                // }
80
+                // //有没有buffer需要清除
81
+
82
+                break;
83
+            case "SetStreamOpenMode":
84
+                //获取端口号
85
+                g_nPort = Module._GetPort();
86
+                //设置流打开模式
87
+                iStreamMode = eventData.data;
88
+                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
89
+                if (res !== PLAYM4_OK) {
90
+                    postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
91
+                    return;
92
+                }
93
+                bOpenMode = true;
94
+                break;
95
+
96
+            case "OpenStream":
97
+                // 接收到的数据
98
+                var iHeadLen = eventData.dataSize;
99
+                var pHead = Module._malloc(iHeadLen + 4);
100
+                if (pHead === null) {
101
+                    return;
102
+                }
103
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
104
+                aHead.set(new Uint8Array(eventData.data));
105
+                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
106
+                postMessage({ 'function': "OpenStream", 'errorCode': res });
107
+                if (res !== PLAYM4_OK) {
108
+                    //释放内存
109
+                    Module._free(pHead);
110
+                    pHead = null;
111
+                    return;
112
+                }
113
+                bOpenStream = true;
114
+                break;
115
+            case "Play":
116
+                let resP = Module._Play(g_nPort);
117
+                if (resP !== PLAYM4_OK) {
118
+                    return;
119
+                }
120
+                break;
121
+            case "InputData":
122
+                // 接收到的数据
123
+                var iLen = eventData.dataSize;
124
+                if (iLen > 0) {
125
+                    if (pInputData == null || iLen > inputBufferSize) {
126
+                        if (pInputData != null) {
127
+                            Module._free(pInputData);
128
+                            pInputData = null;
129
+                        }
130
+                        if (iLen > inputBufferSize) {
131
+                            inputBufferSize = iLen;
132
+                        }
133
+
134
+                        pInputData = Module._malloc(inputBufferSize);
135
+                        if (pInputData === null) {
136
+                            return;
137
+                        }
138
+                    }
139
+
140
+                    var inputData = new Uint8Array(eventData.data);
141
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
142
+                    // aInputData.set(inputData);
143
+                    Module.writeArrayToMemory(inputData, pInputData);
144
+                    inputData = null;
145
+                    res = Module._InputData(g_nPort, pInputData, iLen);
146
+                    if (res !== PLAYM4_OK) {
147
+                        let errorCode = Module._GetLastError(g_nPort);
148
+                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
149
+                        postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
150
+                    }
151
+                    //Module._free(pInputData);
152
+                    //pInputData = null;
153
+                } else {
154
+                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
155
+                    if (sourceRemain == 0) {
156
+                        postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
157
+                        return;
158
+                    }
159
+                }
160
+
161
+                /////////////////////
162
+                // if (funGetFrameData === null) {
163
+                //     funGetFrameData = Module.cwrap('GetFrameData', 'number');
164
+                // }
165
+
166
+                while (bOpenMode && bOpenStream) {
167
+
168
+                    var ret = getFrameData();
169
+                    // 直到获取视频帧或数据不足为止
170
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret
171
+                    {
172
+                        break;
173
+                    }
174
+                }
175
+                break;
176
+
177
+            case "SetSecretKey":
178
+                var keyLen = eventData.nKeyLen;
179
+                var pKeyData = Module._malloc(keyLen);
180
+                if (pKeyData === null) {
181
+                    return;
182
+                }
183
+                var nKeySize = eventData.data.length
184
+                var bufData = stringToBytes(eventData.data);
185
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
186
+                let u8array = new Uint8Array(keyLen);
187
+                aKeyData.set(u8array, 0);
188
+                aKeyData.set(new Uint8Array(bufData));
189
+                aKeyData = null;
190
+                u8array = null;
191
+
192
+                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
193
+                if (res !== PLAYM4_OK) {
194
+                    postMessage({ 'function': "SetSecretKey", 'errorCode': res });
195
+                    Module._free(pKeyData);
196
+                    pKeyData = null;
197
+                    return;
198
+                }
199
+
200
+                Module._free(pKeyData);
201
+                pKeyData = null;
202
+                break;
203
+
204
+            case "GetBMP":
205
+                var nBMPWidth = eventData.width;
206
+                var nBMPHeight = eventData.height;
207
+                var pYUVData = eventData.data;
208
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
209
+                var oJpegCropRect = {
210
+                    left: eventData.left,
211
+                    top: eventData.top,
212
+                    right: eventData.right,
213
+                    bottom: eventData.bottom
214
+                };
215
+
216
+                var pDataYUV = Module._malloc(nYUVSize);
217
+                if (pDataYUV === null) {
218
+                    return;
219
+                }
220
+
221
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
222
+
223
+                // 分配BMP空间
224
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
225
+                var pBmpData = Module._malloc(nBmpSize);
226
+                var pBmpSize = Module._malloc(4);
227
+                if (pBmpData === null || pBmpSize === null) {
228
+                    Module._free(pDataYUV);
229
+                    pDataYUV = null;
230
+
231
+                    if (pBmpData != null) {
232
+                        Module._free(pBmpData);
233
+                        pBmpData = null;
234
+                    }
235
+
236
+                    if (pBmpSize != null) {
237
+                        Module._free(pBmpSize);
238
+                        pBmpSize = null;
239
+                    }
240
+                    return;
241
+                }
242
+
243
+                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
244
+                Module.setValue(pBmpSize, nBmpSize, "i32");
245
+                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
246
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
247
+                if (res !== PLAYM4_OK) {
248
+                    postMessage({ 'function': "GetBMP", 'errorCode': res });
249
+                    Module._free(pDataYUV);
250
+                    pDataYUV = null;
251
+                    Module._free(pBmpData);
252
+                    pBmpData = null;
253
+                    Module._free(pBmpSize);
254
+                    pBmpSize = null;
255
+                    return;
256
+                }
257
+
258
+                // 获取BMP图片大小
259
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
260
+
261
+                // 获取BMP图片数据
262
+                var aBmpData = new Uint8Array(nBmpDataSize);
263
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
264
+
265
+                postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
266
+                aBmpData = null;
267
+                if (pDataYUV != null) {
268
+                    Module._free(pDataYUV);
269
+                    pDataYUV = null;
270
+                }
271
+                if (pBmpData != null) {
272
+                    Module._free(pBmpData);
273
+                    pBmpData = null;
274
+                }
275
+                if (pBmpSize != null) {
276
+                    Module._free(pBmpSize);
277
+                    pBmpSize = null;
278
+                }
279
+                break;
280
+
281
+            case "GetJPEG":
282
+                var nJpegWidth = eventData.width;
283
+                var nJpegHeight = eventData.height;
284
+                var pYUVData1 = eventData.data;
285
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
286
+                var oJpegCropRect = {
287
+                    left: eventData.left,
288
+                    top: eventData.top,
289
+                    right: eventData.right,
290
+                    bottom: eventData.bottom
291
+                };
292
+
293
+                var pDataYUV1 = Module._malloc(nYUVSize1);
294
+                if (pDataYUV1 === null) {
295
+                    return;
296
+                }
297
+
298
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
299
+
300
+                // 分配JPEG空间
301
+                var pJpegData = Module._malloc(nYUVSize1);
302
+                var pJpegSize = Module._malloc(4);
303
+                if (pJpegData === null || pJpegSize === null) {
304
+                    if (pJpegData != null) {
305
+                        Module._free(pJpegData);
306
+                        pJpegData = null;
307
+                    }
308
+
309
+                    if (pJpegSize != null) {
310
+                        Module._free(pJpegSize);
311
+                        pJpegSize = null;
312
+                    }
313
+
314
+                    if (pDataYUV1 != null) {
315
+                        Module._free(pDataYUV1);
316
+                        pDataYUV1 = null;
317
+                    }
318
+                    return;
319
+                }
320
+
321
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
322
+
323
+                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
324
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
325
+                if (res !== PLAYM4_OK) {
326
+                    postMessage({ 'function': "GetJPEG", 'errorCode': res });
327
+                    if (pJpegData != null) {
328
+                        Module._free(pJpegData);
329
+                        pJpegData = null;
330
+                    }
331
+
332
+                    if (pJpegSize != null) {
333
+                        Module._free(pJpegSize);
334
+                        pJpegSize = null;
335
+                    }
336
+
337
+                    if (pDataYUV1 != null) {
338
+                        Module._free(pDataYUV1);
339
+                        pDataYUV1 = null;
340
+                    }
341
+                    return;
342
+                }
343
+
344
+                // 获取JPEG图片大小
345
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
346
+
347
+                // 获取JPEG图片数据
348
+                var aJpegData = new Uint8Array(nJpegSize);
349
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
350
+
351
+                postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
352
+
353
+                nJpegSize = null;
354
+                aJpegData = null;
355
+
356
+                if (pDataYUV1 != null) {
357
+                    Module._free(pDataYUV1);
358
+                    pDataYUV1 = null;
359
+                }
360
+                if (pJpegData != null) {
361
+                    Module._free(pJpegData);
362
+                    pJpegData = null;
363
+                }
364
+                if (pJpegSize != null) {
365
+                    Module._free(pJpegSize);
366
+                    pJpegSize = null;
367
+                }
368
+                break;
369
+
370
+            case "SetDecodeFrameType":
371
+                var nFrameType = eventData.data;
372
+                res = Module._SetDecodeFrameType(g_nPort, nFrameType);
373
+                if (res !== PLAYM4_OK) {
374
+                    postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
375
+                    return;
376
+                }
377
+                break;
378
+            case "CloseStream":
379
+                //stop
380
+                let resS = Module._Stop(g_nPort);
381
+                if (resS !== PLAYM4_OK) {
382
+                    postMessage({ 'function': "Stop", 'errorCode': res });
383
+                    return;
384
+                }
385
+                //closeStream
386
+                res = Module._CloseStream(g_nPort);
387
+                if (res !== PLAYM4_OK) {
388
+                    postMessage({ 'function': "CloseStream", 'errorCode': res });
389
+                    return;
390
+                }
391
+                //freePort
392
+                let resF = Module._FreePort(g_nPort);
393
+                if (resF !== PLAYM4_OK) {
394
+                    postMessage({ 'function': "FreePort", 'errorCode': res });
395
+                    return;
396
+                }
397
+                if (pInputData != null) {
398
+                    Module._free(pInputData);
399
+                    pInputData = null;
400
+                }
401
+                break;
402
+            case "PlaySound":
403
+                let resPS = Module._PlaySound(g_nPort);
404
+                if (resPS !== PLAYM4_OK) {
405
+                    console.log("PlaySound failed");
406
+                    return;
407
+                }
408
+                break;
409
+            case "StopSound":
410
+                let resSS = Module._StopSound();
411
+                if (resSS !== PLAYM4_OK) {
412
+                    console.log("StopSound failed");
413
+                    return;
414
+                }
415
+                break;
416
+            case "SetVolume":
417
+                let resSV = Module._SetVolume(g_nPort, eventData.volume);
418
+                if (resSV !== PLAYM4_OK) {
419
+                    console.log("Audio SetVolume failed");
420
+                    return;
421
+                }
422
+                break;
423
+            case "GetVolume":
424
+                let volume = Module._GetVolume();
425
+                if (volume > 0) {
426
+                    postMessage({ 'function': "GetVolume", 'volume': volume });
427
+                }
428
+                else {
429
+                    console.log("Audio GetVolume failed");
430
+                    return;
431
+                }
432
+                break;
433
+            case "OnlyPlaySound":
434
+                let resOPS = Module._OnlyPlaySound(g_nPort);
435
+                if (resOPS !== PLAYM4_OK) {
436
+                    console.log("OnlyPlaySound failed");
437
+                    return;
438
+                }
439
+                break;
440
+            case "Pause":
441
+                let resPa = Module._Pause(g_nPort, eventData.bPlay);
442
+                if (resPa !== PLAYM4_OK) {
443
+                    console.log("Pause failed");
444
+                    return;
445
+                }
446
+            case "PlayRate":
447
+                Module._SetPlayRate(g_nPort, eventData.playRate);
448
+                break;
449
+            case "SetIFrameDecInterval":
450
+                Module._SetIFrameDecInterval(g_nPort, eventData.data);
451
+                break;
452
+            case "SetLostFrameMode":
453
+                Module._SetLostFrameMode(g_nPort, eventData.data, 0);
454
+                break;
455
+            case "SetDemuxModel":
456
+                Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
457
+                break;
458
+            case "SkipErrorData":
459
+                Module._SkipErrorData(g_nPort, eventData.bSkip);
460
+                break;
461
+            case "SetDecodeERC":
462
+                Module._SetDecodeERC(g_nPort, eventData.nLevel);
463
+                break;
464
+            case "SetANRParam":
465
+                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
466
+                break;
467
+            case "SetResampleValue":
468
+                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
469
+                break;
470
+            case "GetLastError":
471
+                let errorCode = Module._GetLastError(g_nPort);
472
+                postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
473
+                break;
474
+            case "SetGlobalBaseTime":
475
+                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
476
+                break;
477
+            case "SetRunTimeInfoCB":
478
+                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
479
+                break;
480
+            default:
481
+                break;
482
+        }
483
+    };
484
+
485
+    function getOSDTime(oFrameInfo) {
486
+        var iYear = oFrameInfo.year;
487
+        var iMonth = oFrameInfo.month;
488
+        var iDay = oFrameInfo.day;
489
+        var iHour = oFrameInfo.hour;
490
+        var iMinute = oFrameInfo.minute;
491
+        var iSecond = oFrameInfo.second;
492
+
493
+        if (iMonth < 10) {
494
+            iMonth = "0" + iMonth;
495
+        }
496
+        if (iDay < 10) {
497
+            iDay = "0" + iDay;
498
+        }
499
+        if (iHour < 10) {
500
+            iHour = "0" + iHour;
501
+        }
502
+        if (iMinute < 10) {
503
+            iMinute = "0" + iMinute;
504
+        }
505
+        if (iSecond < 10) {
506
+            iSecond = "0" + iSecond;
507
+        }
508
+
509
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
510
+    }
511
+    // 获取帧数据
512
+    function getFrameData() {
513
+        // function getFrameData() {
514
+        // 获取帧数据
515
+        var res = Module._GetFrameData();
516
+        //var res = fun();
517
+        if (res === PLAYM4_OK) {
518
+            var oFrameInfo = Module._GetFrameInfo();
519
+            switch (oFrameInfo.frameType) {
520
+                case AUDIO_TYPE:
521
+                    var iSize = oFrameInfo.frameSize;
522
+                    if (0 === iSize) {
523
+                        return -1;
524
+                    }
525
+                    var pPCM = Module._GetFrameBuffer();
526
+                    // var audioBuf = new ArrayBuffer(iSize);
527
+                    var aPCMData = new Uint8Array(iSize);
528
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
529
+                    if (bWorkerPrintLog) {
530
+                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
531
+                    }
532
+                    postMessage({
533
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
534
+                        'frameInfo': oFrameInfo, 'errorCode': res
535
+                    }, [aPCMData.buffer]);
536
+
537
+                    oFrameInfo = null;
538
+                    pPCM = null;
539
+                    aPCMData = null;
540
+                    return PLAYM4_AUDIO_FRAME;
541
+
542
+                case VIDEO_TYPE:
543
+                    var szOSDTime = getOSDTime(oFrameInfo);
544
+
545
+                    var iWidth = oFrameInfo.width;
546
+                    var iHeight = oFrameInfo.height;
547
+
548
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
549
+                    if (0 === iYUVSize) {
550
+                        return -1;
551
+                    }
552
+
553
+                    var pYUV = Module._GetFrameBuffer();
554
+
555
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
556
+                    var aYUVData = new Uint8Array(iYUVSize);
557
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
558
+                    if (bWorkerPrintLog) {
559
+                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
560
+                    }
561
+
562
+                    postMessage({
563
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
564
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
565
+                    }, [aYUVData.buffer]);
566
+
567
+                    oFrameInfo = null;
568
+                    pYUV = null;
569
+                    aYUVData = null;
570
+                    return PLAYM4_VIDEO_FRAME;
571
+
572
+                case PRIVT_TYPE:
573
+                    postMessage({
574
+                        'function': "GetFrameData", 'type': "", 'data': null,
575
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
576
+                    });
577
+                    return PLAYM4_SYS_NOT_SUPPORT;
578
+
579
+                default:
580
+                    postMessage({
581
+                        'function': "GetFrameData", 'type': "", 'data': null,
582
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
583
+                    });
584
+                    return PLAYM4_SYS_NOT_SUPPORT;
585
+            }
586
+        }
587
+        else {
588
+            let errorCode = Module._GetLastError(g_nPort);
589
+            //解码失败返回裸数据
590
+            if (PLAYM4_DECODE_ERROR === errorCode) {
591
+                var rawInfo = Module._GetRawDataInfo();
592
+                var pRawData = Module._GetRawDataBuffer();
593
+                var aRawData = new Uint8Array(rawInfo.isize);
594
+                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
595
+                postMessage({
596
+                    'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
597
+                    'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
598
+                });
599
+                rawInfo = null;
600
+                pRawData = null;
601
+                aRawData = null;
602
+            }
603
+            //需要更多数据
604
+            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
605
+                postMessage({
606
+                    'function': "GetFrameData", 'type': "", 'data': null,
607
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
608
+                });
609
+            }
610
+            return errorCode;
611
+        }
612
+    }
613
+
614
+    // 开始计算时间
615
+    function startTime() {
616
+        return new Date().getTime();
617
+    }
618
+
619
+    // 结束计算时间
620
+    function endTime() {
621
+        return new Date().getTime();
622
+    }
623
+
624
+    // 字母字符串转byte数组
625
+    function stringToBytes(str) {
626
+        var ch, st, re = [];
627
+        for (var i = 0; i < str.length; i++) {
628
+            ch = str.charCodeAt(i);  // get char
629
+            st = [];                 // set up "stack"
630
+            do {
631
+                st.push(ch & 0xFF);  // push byte to stack
632
+                ch = ch >> 8;          // shift value down by 1 byte
633
+            }
634
+            while (ch);
635
+            // add stack contents to result
636
+            // done because chars have "wrong" endianness
637
+            re = re.concat(st.reverse());
638
+        }
639
+        // return an array of bytes
640
+        return re;
641
+    }
642
+})();

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/hybrid/html/playctrl1/Decoder.js


+ 642 - 0
queue-monitor/hybrid/html/playctrl1simd/DecodeWorker.js

@@ -0,0 +1,642 @@
1
+/**
2
+ * Created by wangweijie5 on 2016/12/5.
3
+ */
4
+(function (event) {
5
+    const AUDIO_TYPE = 0;	// 音频
6
+    const VIDEO_TYPE = 1;   // 视频
7
+    const PRIVT_TYPE = 2;  // 私有帧
8
+
9
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
10
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
11
+
12
+    const PLAYM4_OK = 1;
13
+    const PLAYM4_ORDER_ERROR = 2;
14
+    const PLAYM4_DECODE_ERROR = 44 	// 解码失败
15
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
16
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
17
+    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
18
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
19
+
20
+    importScripts('Decoder.js');
21
+    Module.addOnPostRun(function () {
22
+        postMessage({ 'function': "loaded" });
23
+    });
24
+
25
+    var iStreamMode = 0;  // 流模式
26
+
27
+    var bOpenMode = false;
28
+    var bOpenStream = false;
29
+
30
+    var funGetFrameData = null;
31
+    var funGetAudFrameData = null;
32
+
33
+    var bWorkerPrintLog = false;//worker层log开关
34
+
35
+    var g_nPort = -1;
36
+    var pInputData = null;
37
+    var inputBufferSize = 40960;
38
+
39
+    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
40
+        let port = nPort;
41
+        let user = pUser;
42
+        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
43
+        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
44
+        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
45
+        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
46
+        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
47
+        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
48
+        postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
49
+    }
50
+
51
+    onmessage = function (event) {
52
+        var eventData = event.data;
53
+        var res = 0;
54
+        switch (eventData.command) {
55
+            case "printLog":
56
+                let downloadFlag = eventData.data;
57
+                if (downloadFlag === true) {
58
+                    bWorkerPrintLog = true;
59
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
60
+                }
61
+                else {
62
+                    bWorkerPrintLog = false;
63
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
64
+                }
65
+
66
+                if (res !== PLAYM4_OK) {
67
+                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
68
+                    postMessage({ 'function': "printLog", 'errorCode': res });
69
+                }
70
+                break;
71
+            case "SetPlayPosition":
72
+                let nFrameNumOrTime = eventData.data;
73
+                let enPosType = eventData.type;
74
+                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
75
+                // if (res !== PLAYM4_OK)
76
+                // {
77
+                //     postMessage({'function': "SetPlayPosition", 'errorCode': res});
78
+                //     return;
79
+                // }
80
+                // //有没有buffer需要清除
81
+
82
+                break;
83
+            case "SetStreamOpenMode":
84
+                //获取端口号
85
+                g_nPort = Module._GetPort();
86
+                //设置流打开模式
87
+                iStreamMode = eventData.data;
88
+                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
89
+                if (res !== PLAYM4_OK) {
90
+                    postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
91
+                    return;
92
+                }
93
+                bOpenMode = true;
94
+                break;
95
+
96
+            case "OpenStream":
97
+                // 接收到的数据
98
+                var iHeadLen = eventData.dataSize;
99
+                var pHead = Module._malloc(iHeadLen + 4);
100
+                if (pHead === null) {
101
+                    return;
102
+                }
103
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
104
+                aHead.set(new Uint8Array(eventData.data));
105
+                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
106
+                postMessage({ 'function': "OpenStream", 'errorCode': res });
107
+                if (res !== PLAYM4_OK) {
108
+                    //释放内存
109
+                    Module._free(pHead);
110
+                    pHead = null;
111
+                    return;
112
+                }
113
+                bOpenStream = true;
114
+                break;
115
+            case "Play":
116
+                let resP = Module._Play(g_nPort);
117
+                if (resP !== PLAYM4_OK) {
118
+                    return;
119
+                }
120
+                break;
121
+            case "InputData":
122
+                // 接收到的数据
123
+                var iLen = eventData.dataSize;
124
+                if (iLen > 0) {
125
+                    if (pInputData == null || iLen > inputBufferSize) {
126
+                        if (pInputData != null) {
127
+                            Module._free(pInputData);
128
+                            pInputData = null;
129
+                        }
130
+                        if (iLen > inputBufferSize) {
131
+                            inputBufferSize = iLen;
132
+                        }
133
+
134
+                        pInputData = Module._malloc(inputBufferSize);
135
+                        if (pInputData === null) {
136
+                            return;
137
+                        }
138
+                    }
139
+
140
+                    var inputData = new Uint8Array(eventData.data);
141
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
142
+                    // aInputData.set(inputData);
143
+                    Module.writeArrayToMemory(inputData, pInputData);
144
+                    inputData = null;
145
+                    res = Module._InputData(g_nPort, pInputData, iLen);
146
+                    if (res !== PLAYM4_OK) {
147
+                        let errorCode = Module._GetLastError(g_nPort);
148
+                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
149
+                        postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
150
+                    }
151
+                    //Module._free(pInputData);
152
+                    //pInputData = null;
153
+                } else {
154
+                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
155
+                    if (sourceRemain == 0) {
156
+                        postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
157
+                        return;
158
+                    }
159
+                }
160
+
161
+                /////////////////////
162
+                // if (funGetFrameData === null) {
163
+                //     funGetFrameData = Module.cwrap('GetFrameData', 'number');
164
+                // }
165
+
166
+                while (bOpenMode && bOpenStream) {
167
+
168
+                    var ret = getFrameData();
169
+                    // 直到获取视频帧或数据不足为止
170
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret
171
+                    {
172
+                        break;
173
+                    }
174
+                }
175
+                break;
176
+
177
+            case "SetSecretKey":
178
+                var keyLen = eventData.nKeyLen;
179
+                var pKeyData = Module._malloc(keyLen);
180
+                if (pKeyData === null) {
181
+                    return;
182
+                }
183
+                var nKeySize = eventData.data.length
184
+                var bufData = stringToBytes(eventData.data);
185
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
186
+                let u8array = new Uint8Array(keyLen);
187
+                aKeyData.set(u8array, 0);
188
+                aKeyData.set(new Uint8Array(bufData));
189
+                aKeyData = null;
190
+                u8array = null;
191
+
192
+                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
193
+                if (res !== PLAYM4_OK) {
194
+                    postMessage({ 'function': "SetSecretKey", 'errorCode': res });
195
+                    Module._free(pKeyData);
196
+                    pKeyData = null;
197
+                    return;
198
+                }
199
+
200
+                Module._free(pKeyData);
201
+                pKeyData = null;
202
+                break;
203
+
204
+            case "GetBMP":
205
+                var nBMPWidth = eventData.width;
206
+                var nBMPHeight = eventData.height;
207
+                var pYUVData = eventData.data;
208
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
209
+                var oJpegCropRect = {
210
+                    left: eventData.left,
211
+                    top: eventData.top,
212
+                    right: eventData.right,
213
+                    bottom: eventData.bottom
214
+                };
215
+
216
+                var pDataYUV = Module._malloc(nYUVSize);
217
+                if (pDataYUV === null) {
218
+                    return;
219
+                }
220
+
221
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
222
+
223
+                // 分配BMP空间
224
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
225
+                var pBmpData = Module._malloc(nBmpSize);
226
+                var pBmpSize = Module._malloc(4);
227
+                if (pBmpData === null || pBmpSize === null) {
228
+                    Module._free(pDataYUV);
229
+                    pDataYUV = null;
230
+
231
+                    if (pBmpData != null) {
232
+                        Module._free(pBmpData);
233
+                        pBmpData = null;
234
+                    }
235
+
236
+                    if (pBmpSize != null) {
237
+                        Module._free(pBmpSize);
238
+                        pBmpSize = null;
239
+                    }
240
+                    return;
241
+                }
242
+
243
+                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
244
+                Module.setValue(pBmpSize, nBmpSize, "i32");
245
+                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
246
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
247
+                if (res !== PLAYM4_OK) {
248
+                    postMessage({ 'function': "GetBMP", 'errorCode': res });
249
+                    Module._free(pDataYUV);
250
+                    pDataYUV = null;
251
+                    Module._free(pBmpData);
252
+                    pBmpData = null;
253
+                    Module._free(pBmpSize);
254
+                    pBmpSize = null;
255
+                    return;
256
+                }
257
+
258
+                // 获取BMP图片大小
259
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
260
+
261
+                // 获取BMP图片数据
262
+                var aBmpData = new Uint8Array(nBmpDataSize);
263
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
264
+
265
+                postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
266
+                aBmpData = null;
267
+                if (pDataYUV != null) {
268
+                    Module._free(pDataYUV);
269
+                    pDataYUV = null;
270
+                }
271
+                if (pBmpData != null) {
272
+                    Module._free(pBmpData);
273
+                    pBmpData = null;
274
+                }
275
+                if (pBmpSize != null) {
276
+                    Module._free(pBmpSize);
277
+                    pBmpSize = null;
278
+                }
279
+                break;
280
+
281
+            case "GetJPEG":
282
+                var nJpegWidth = eventData.width;
283
+                var nJpegHeight = eventData.height;
284
+                var pYUVData1 = eventData.data;
285
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
286
+                var oJpegCropRect = {
287
+                    left: eventData.left,
288
+                    top: eventData.top,
289
+                    right: eventData.right,
290
+                    bottom: eventData.bottom
291
+                };
292
+
293
+                var pDataYUV1 = Module._malloc(nYUVSize1);
294
+                if (pDataYUV1 === null) {
295
+                    return;
296
+                }
297
+
298
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
299
+
300
+                // 分配JPEG空间
301
+                var pJpegData = Module._malloc(nYUVSize1);
302
+                var pJpegSize = Module._malloc(4);
303
+                if (pJpegData === null || pJpegSize === null) {
304
+                    if (pJpegData != null) {
305
+                        Module._free(pJpegData);
306
+                        pJpegData = null;
307
+                    }
308
+
309
+                    if (pJpegSize != null) {
310
+                        Module._free(pJpegSize);
311
+                        pJpegSize = null;
312
+                    }
313
+
314
+                    if (pDataYUV1 != null) {
315
+                        Module._free(pDataYUV1);
316
+                        pDataYUV1 = null;
317
+                    }
318
+                    return;
319
+                }
320
+
321
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
322
+
323
+                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
324
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
325
+                if (res !== PLAYM4_OK) {
326
+                    postMessage({ 'function': "GetJPEG", 'errorCode': res });
327
+                    if (pJpegData != null) {
328
+                        Module._free(pJpegData);
329
+                        pJpegData = null;
330
+                    }
331
+
332
+                    if (pJpegSize != null) {
333
+                        Module._free(pJpegSize);
334
+                        pJpegSize = null;
335
+                    }
336
+
337
+                    if (pDataYUV1 != null) {
338
+                        Module._free(pDataYUV1);
339
+                        pDataYUV1 = null;
340
+                    }
341
+                    return;
342
+                }
343
+
344
+                // 获取JPEG图片大小
345
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
346
+
347
+                // 获取JPEG图片数据
348
+                var aJpegData = new Uint8Array(nJpegSize);
349
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
350
+
351
+                postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
352
+
353
+                nJpegSize = null;
354
+                aJpegData = null;
355
+
356
+                if (pDataYUV1 != null) {
357
+                    Module._free(pDataYUV1);
358
+                    pDataYUV1 = null;
359
+                }
360
+                if (pJpegData != null) {
361
+                    Module._free(pJpegData);
362
+                    pJpegData = null;
363
+                }
364
+                if (pJpegSize != null) {
365
+                    Module._free(pJpegSize);
366
+                    pJpegSize = null;
367
+                }
368
+                break;
369
+
370
+            case "SetDecodeFrameType":
371
+                var nFrameType = eventData.data;
372
+                res = Module._SetDecodeFrameType(g_nPort, nFrameType);
373
+                if (res !== PLAYM4_OK) {
374
+                    postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
375
+                    return;
376
+                }
377
+                break;
378
+            case "CloseStream":
379
+                //stop
380
+                let resS = Module._Stop(g_nPort);
381
+                if (resS !== PLAYM4_OK) {
382
+                    postMessage({ 'function': "Stop", 'errorCode': res });
383
+                    return;
384
+                }
385
+                //closeStream
386
+                res = Module._CloseStream(g_nPort);
387
+                if (res !== PLAYM4_OK) {
388
+                    postMessage({ 'function': "CloseStream", 'errorCode': res });
389
+                    return;
390
+                }
391
+                //freePort
392
+                let resF = Module._FreePort(g_nPort);
393
+                if (resF !== PLAYM4_OK) {
394
+                    postMessage({ 'function': "FreePort", 'errorCode': res });
395
+                    return;
396
+                }
397
+                if (pInputData != null) {
398
+                    Module._free(pInputData);
399
+                    pInputData = null;
400
+                }
401
+                break;
402
+            case "PlaySound":
403
+                let resPS = Module._PlaySound(g_nPort);
404
+                if (resPS !== PLAYM4_OK) {
405
+                    console.log("PlaySound failed");
406
+                    return;
407
+                }
408
+                break;
409
+            case "StopSound":
410
+                let resSS = Module._StopSound();
411
+                if (resSS !== PLAYM4_OK) {
412
+                    console.log("StopSound failed");
413
+                    return;
414
+                }
415
+                break;
416
+            case "SetVolume":
417
+                let resSV = Module._SetVolume(g_nPort, eventData.volume);
418
+                if (resSV !== PLAYM4_OK) {
419
+                    console.log("Audio SetVolume failed");
420
+                    return;
421
+                }
422
+                break;
423
+            case "GetVolume":
424
+                let volume = Module._GetVolume();
425
+                if (volume > 0) {
426
+                    postMessage({ 'function': "GetVolume", 'volume': volume });
427
+                }
428
+                else {
429
+                    console.log("Audio GetVolume failed");
430
+                    return;
431
+                }
432
+                break;
433
+            case "OnlyPlaySound":
434
+                let resOPS = Module._OnlyPlaySound(g_nPort);
435
+                if (resOPS !== PLAYM4_OK) {
436
+                    console.log("OnlyPlaySound failed");
437
+                    return;
438
+                }
439
+                break;
440
+            case "Pause":
441
+                let resPa = Module._Pause(g_nPort, eventData.bPlay);
442
+                if (resPa !== PLAYM4_OK) {
443
+                    console.log("Pause failed");
444
+                    return;
445
+                }
446
+            case "PlayRate":
447
+                Module._SetPlayRate(g_nPort, eventData.playRate);
448
+                break;
449
+            case "SetIFrameDecInterval":
450
+                Module._SetIFrameDecInterval(g_nPort, eventData.data);
451
+                break;
452
+            case "SetLostFrameMode":
453
+                Module._SetLostFrameMode(g_nPort, eventData.data, 0);
454
+                break;
455
+            case "SetDemuxModel":
456
+                Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
457
+                break;
458
+            case "SkipErrorData":
459
+                Module._SkipErrorData(g_nPort, eventData.bSkip);
460
+                break;
461
+            case "SetDecodeERC":
462
+                Module._SetDecodeERC(g_nPort, eventData.nLevel);
463
+                break;
464
+            case "SetANRParam":
465
+                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
466
+                break;
467
+            case "SetResampleValue":
468
+                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
469
+                break;
470
+            case "GetLastError":
471
+                let errorCode = Module._GetLastError(g_nPort);
472
+                postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
473
+                break;
474
+            case "SetGlobalBaseTime":
475
+                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
476
+                break;
477
+            case "SetRunTimeInfoCB":
478
+                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
479
+                break;
480
+            default:
481
+                break;
482
+        }
483
+    };
484
+
485
+    function getOSDTime(oFrameInfo) {
486
+        var iYear = oFrameInfo.year;
487
+        var iMonth = oFrameInfo.month;
488
+        var iDay = oFrameInfo.day;
489
+        var iHour = oFrameInfo.hour;
490
+        var iMinute = oFrameInfo.minute;
491
+        var iSecond = oFrameInfo.second;
492
+
493
+        if (iMonth < 10) {
494
+            iMonth = "0" + iMonth;
495
+        }
496
+        if (iDay < 10) {
497
+            iDay = "0" + iDay;
498
+        }
499
+        if (iHour < 10) {
500
+            iHour = "0" + iHour;
501
+        }
502
+        if (iMinute < 10) {
503
+            iMinute = "0" + iMinute;
504
+        }
505
+        if (iSecond < 10) {
506
+            iSecond = "0" + iSecond;
507
+        }
508
+
509
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
510
+    }
511
+    // 获取帧数据
512
+    function getFrameData() {
513
+        // function getFrameData() {
514
+        // 获取帧数据
515
+        var res = Module._GetFrameData();
516
+        //var res = fun();
517
+        if (res === PLAYM4_OK) {
518
+            var oFrameInfo = Module._GetFrameInfo();
519
+            switch (oFrameInfo.frameType) {
520
+                case AUDIO_TYPE:
521
+                    var iSize = oFrameInfo.frameSize;
522
+                    if (0 === iSize) {
523
+                        return -1;
524
+                    }
525
+                    var pPCM = Module._GetFrameBuffer();
526
+                    // var audioBuf = new ArrayBuffer(iSize);
527
+                    var aPCMData = new Uint8Array(iSize);
528
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
529
+                    if (bWorkerPrintLog) {
530
+                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
531
+                    }
532
+                    postMessage({
533
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
534
+                        'frameInfo': oFrameInfo, 'errorCode': res
535
+                    }, [aPCMData.buffer]);
536
+
537
+                    oFrameInfo = null;
538
+                    pPCM = null;
539
+                    aPCMData = null;
540
+                    return PLAYM4_AUDIO_FRAME;
541
+
542
+                case VIDEO_TYPE:
543
+                    var szOSDTime = getOSDTime(oFrameInfo);
544
+
545
+                    var iWidth = oFrameInfo.width;
546
+                    var iHeight = oFrameInfo.height;
547
+
548
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
549
+                    if (0 === iYUVSize) {
550
+                        return -1;
551
+                    }
552
+
553
+                    var pYUV = Module._GetFrameBuffer();
554
+
555
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
556
+                    var aYUVData = new Uint8Array(iYUVSize);
557
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
558
+                    if (bWorkerPrintLog) {
559
+                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
560
+                    }
561
+
562
+                    postMessage({
563
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
564
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
565
+                    }, [aYUVData.buffer]);
566
+
567
+                    oFrameInfo = null;
568
+                    pYUV = null;
569
+                    aYUVData = null;
570
+                    return PLAYM4_VIDEO_FRAME;
571
+
572
+                case PRIVT_TYPE:
573
+                    postMessage({
574
+                        'function': "GetFrameData", 'type': "", 'data': null,
575
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
576
+                    });
577
+                    return PLAYM4_SYS_NOT_SUPPORT;
578
+
579
+                default:
580
+                    postMessage({
581
+                        'function': "GetFrameData", 'type': "", 'data': null,
582
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
583
+                    });
584
+                    return PLAYM4_SYS_NOT_SUPPORT;
585
+            }
586
+        }
587
+        else {
588
+            let errorCode = Module._GetLastError(g_nPort);
589
+            //解码失败返回裸数据
590
+            if (PLAYM4_DECODE_ERROR === errorCode) {
591
+                var rawInfo = Module._GetRawDataInfo();
592
+                var pRawData = Module._GetRawDataBuffer();
593
+                var aRawData = new Uint8Array(rawInfo.isize);
594
+                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
595
+                postMessage({
596
+                    'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
597
+                    'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
598
+                });
599
+                rawInfo = null;
600
+                pRawData = null;
601
+                aRawData = null;
602
+            }
603
+            //需要更多数据
604
+            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
605
+                postMessage({
606
+                    'function': "GetFrameData", 'type': "", 'data': null,
607
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
608
+                });
609
+            }
610
+            return errorCode;
611
+        }
612
+    }
613
+
614
+    // 开始计算时间
615
+    function startTime() {
616
+        return new Date().getTime();
617
+    }
618
+
619
+    // 结束计算时间
620
+    function endTime() {
621
+        return new Date().getTime();
622
+    }
623
+
624
+    // 字母字符串转byte数组
625
+    function stringToBytes(str) {
626
+        var ch, st, re = [];
627
+        for (var i = 0; i < str.length; i++) {
628
+            ch = str.charCodeAt(i);  // get char
629
+            st = [];                 // set up "stack"
630
+            do {
631
+                st.push(ch & 0xFF);  // push byte to stack
632
+                ch = ch >> 8;          // shift value down by 1 byte
633
+            }
634
+            while (ch);
635
+            // add stack contents to result
636
+            // done because chars have "wrong" endianness
637
+            re = re.concat(st.reverse());
638
+        }
639
+        // return an array of bytes
640
+        return re;
641
+    }
642
+})();

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/hybrid/html/playctrl1simd/Decoder.js


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/hybrid/html/playctrl2/Decoder.js


BIN
queue-monitor/hybrid/html/playctrl2/Decoder.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/hybrid/html/playctrl2/Decoder.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/hybrid/html/playctrl3/Decoder.js


BIN
queue-monitor/hybrid/html/playctrl3/Decoder.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/hybrid/html/playctrl3/Decoder.worker.js


+ 71 - 0
queue-monitor/hybrid/html/player.html

@@ -0,0 +1,71 @@
1
+<html>
2
+  <head>
3
+	  <title>实时联动</title>
4
+	  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
5
+	  <link rel="stylesheet" type="text/css" href="./style.css">
6
+	  <script src="./jquery-3.7.1.min.js"></script>
7
+	  <script src="./vconsole.min.js"></script>
8
+    <script src="./h5player.min.js"></script>
9
+	<script src="./utils.js"></script>
10
+  </head>
11
+  <body>
12
+	<div class="box">
13
+		<select id="orgSelect" class="orgSelect"></select>
14
+
15
+		<div>
16
+		<input id="url" />
17
+		<input type="button" value="播放" onclick="play()"></input>
18
+		</div>
19
+		<div id="msg"></div>
20
+	</div>
21
+	<script>
22
+		$(function () {
23
+			var v = new VConsole();
24
+			var token = getQueryParams('token')
25
+			var base = getQueryParams('base')
26
+			var boxWidth = $('.box').width()
27
+			var playerHeight = boxWidth * 5 / 8
28
+			getOrgOptions(base, token)
29
+			$('#orgSelect').on('change', function (e) {
30
+				var orgId = e.target.value
31
+				getPlayUrl(base, token, orgId, function(list) {
32
+					for(var i = 0; i < 5 ; i ++) {
33
+						var playerDiv = $('<div></div>');
34
+						playerDiv.css({
35
+							'width': boxWidth + 'px',
36
+							'height': playerHeight + 'px',
37
+							'margin-top': '5px';
38
+							'background-color': 'lightblue',
39
+							'border': '1px solid black'
40
+						})
41
+						$('.box').append(playerDiv)
42
+					}
43
+				})
44
+			})
45
+
46
+
47
+			// window.myPalyer = new window.JSPlugin({
48
+			//     szId: 'player',
49
+			//     szBasePath: "./",
50
+			//     iMaxSplit: 1,
51
+			//     iCurrentSplit: 1,
52
+			//     openDebug: true,
53
+			//     oStyle: {
54
+			//       borderSelect: '#000',
55
+			//     }
56
+			//   })
57
+		})
58
+
59
+
60
+		function play() {
61
+			var url = document.getElementById('url').value
62
+			console.log(url)
63
+			window.myPalyer.JS_Play(url, { playURL: url, mode: 0 }, 0).then(
64
+            () => { document.getElementById('msg').innerText = 'success'; console.log('ok')},
65
+            e => { document.getElementById('msg').innerText = e; console.log(e) }
66
+          )
67
+		}
68
+	</script>
69
+
70
+  </body>
71
+</html>

+ 21 - 0
queue-monitor/hybrid/html/style.css

@@ -0,0 +1,21 @@
1
+ html,
2
+ body {
3
+ 	padding: 0px 0px;
4
+ 	margin: 0px 0px;
5
+ 	wdith: 100%;
6
+ 	height: 100%;
7
+ }
8
+ 
9
+ .box {
10
+	 margin: 10px 10px;
11
+ }
12
+ 
13
+.orgSelect {
14
+	margin-bottom: 10px;
15
+}
16
+
17
+ #player {
18
+ 	width: 100%;
19
+ 	height: calc(100% * 5 / 8);
20
+ 	background-color: black;
21
+ }

Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/hybrid/html/talk/AudioInterCom.js


BIN
queue-monitor/hybrid/html/talk/AudioInterCom.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/hybrid/html/talkW/AudioInterCom.js


BIN
queue-monitor/hybrid/html/talkW/AudioInterCom.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/hybrid/html/talkW/AudioInterCom.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 6525 - 0
queue-monitor/hybrid/html/transform/libSystemTransform.js


BIN
queue-monitor/hybrid/html/transform/libSystemTransform.wasm


+ 120 - 0
queue-monitor/hybrid/html/transform/systemTransform-worker.js

@@ -0,0 +1,120 @@
1
+importScripts('libSystemTransform.js');
2
+    const RECORDRTP = 0;  //录制一份未经过转封装的码流原始数据,用于定位问题
3
+    let dataType = 1;
4
+    
5
+    // 转封装库回调函数
6
+    self.STCallBack = function (fileIndex,indexLen, data, dataLen)
7
+    {
8
+        //stFrameInfo的类型见DETAIL_FRAME_INFO
9
+		let stFrameInfo = Module._GetDetialFrameInfo();
10
+        let nIsMp4Index = stFrameInfo.nIsMp4Index;
11
+		//console.log("FrameType is " , stFrameInfo);	
12
+		//console.log("nIsMp4Index is " + nIsMp4Index);
13
+        //debugger
14
+        var pData = null;
15
+        pData = new Uint8Array(dataLen);
16
+        pData.set(Module.HEAPU8.subarray(data, data + dataLen));
17
+        if (dataType === 1) {
18
+            if (pData[0] == 0x49 && pData[1] == 0x4d && pData[2] == 0x4b && pData[3] == 0x48) {//码流头丢掉
19
+                return;
20
+            }
21
+            postMessage({type: "outputData", buf: pData, dType: 1});
22
+            dataType = 2;
23
+        } else {
24
+            if (nIsMp4Index) {
25
+                postMessage({type: "outputData", buf: pData, dType: 6}); //6:索引类型
26
+            } else {
27
+                postMessage({type: "outputData", buf: pData, dType: 2}); //2:码流
28
+            }
29
+        }
30
+
31
+        //stFrameInfo的类型见DETAIL_FRAME_INFO
32
+		//let stFrameInfo = Module._GetDetialFrameInfo();
33
+		//let stFrameType = stFrameInfo.nFrameType;
34
+		//let nFrameNum = stFrameInfo.nFrameNum;
35
+		//let nTimeStamp = stFrameInfo.nTimeStamp;
36
+        //let nIsMp4Index = stFrameInfo.nIsMp4Index;
37
+		
38
+		//console.log("FrameType is " + stFrameType);	
39
+		//console.log("nIsMp4Index is " + nIsMp4Index);	
40
+        
41
+    }
42
+
43
+    // self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };
44
+    // importScripts('SystemTransform.js');
45
+
46
+    self.Module['onRuntimeInitialized'] = function (){
47
+        postMessage({type: "loaded"});
48
+    }
49
+    onmessage = function (e) {
50
+        var data = e.data;
51
+        if ("create" === data.type) {
52
+            if (RECORDRTP) {
53
+                postMessage({type: "created"});
54
+                postMessage({type: "outputData", buf: data.buf, dType: 1});
55
+            } else {
56
+                var iHeadLen = data.len;
57
+                var pHead = Module._malloc(iHeadLen);
58
+    
59
+                self.writeArrayToMemory(new Uint8Array(data.buf), pHead);
60
+                var iTransType = data.packType;//目标格式
61
+                var iRet = Module._CreatHandle(pHead, iTransType, 4096);
62
+                if (iRet != 0) {
63
+                    console.log("_CreatHandle failed!" + iRet);
64
+                } else {
65
+                    iRet = Module._SysTransRegisterDataCallBack();			
66
+                    if(iRet != 0)
67
+                    {
68
+                        console.log("_SysTransRegisterDataCallBack Failed:" + iRet);
69
+                    }
70
+
71
+                    iRet = Module._SysTransStart(null, null);
72
+                    if(iRet != 0)
73
+                    {
74
+                        console.log("_SysTransStart Failed:" + iRet);
75
+                    }
76
+                    postMessage({type: "created"});
77
+                }
78
+            }
79
+
80
+        } else if ("inputData" === data.type) {
81
+            if (RECORDRTP) {
82
+                var aFileData = new Uint8Array(data.buf);  // 拷贝一份
83
+                var iBufferLen = aFileData.length;
84
+                var szBufferLen = iBufferLen.toString(16);
85
+                if (szBufferLen.length === 1) {
86
+                    szBufferLen = "000" + szBufferLen;
87
+                } else if (szBufferLen.length === 2) {
88
+                    szBufferLen = "00" + szBufferLen;
89
+                } else if (szBufferLen.length === 3) {
90
+                    szBufferLen = "0" + szBufferLen;
91
+                }
92
+                var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];
93
+                for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {
94
+                    aData[iIndex + 4] = aFileData[iIndex]
95
+                }
96
+                var dataUint8 = new Uint8Array(aData);
97
+                postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2});
98
+            } else {
99
+                let pInputDataBuf = Module._malloc(data.len);
100
+                var idataLen = data.len;
101
+                self.writeArrayToMemory(new Uint8Array(data.buf), pInputDataBuf);
102
+                    // 输入数据,每次最多2m
103
+                let pp = Module._SysTransInputData(0, pInputDataBuf, idataLen);
104
+                if(pp != 0) {
105
+                    //console.log("InputData Failed:" + pp);
106
+                }
107
+                Module._free(pInputDataBuf);
108
+            }
109
+        } else if ("release" === data.type) {
110
+            var iRet = Module._SysTransStop();
111
+            if (iRet != 0) {
112
+                console.log("_SysTransStop Failed:", iRet);
113
+            }
114
+            Module._SysTransRelease();
115
+            if (iRet != 0) {
116
+                console.log("_SysTransRelease Failed:", iRet);
117
+            }
118
+            close();
119
+        }
120
+    };

+ 78 - 0
queue-monitor/hybrid/html/utils.js

@@ -0,0 +1,78 @@
1
+function getQueryParams(name) {
2
+	var url = window.location.href
3
+	var parts = url.split('?')
4
+
5
+	var query = parts[1]
6
+	if (!query) return null
7
+	var pairs = query.split('&')
8
+	for (var i = 0; i < pairs.length; i++) {
9
+		var pair = pairs[i].split('=')
10
+		// 解码键和值
11
+		var key = decodeURIComponent(pair[0])
12
+		var value = decodeURIComponent(pair[1])
13
+		if (key === name) {
14
+			return value
15
+		}
16
+	}
17
+	return null
18
+}
19
+
20
+function getOrgOptions(base, token) {
21
+	$.ajax({
22
+		url: base + '/client/c/mobileInfo/selection/selectionOrg',
23
+		type: 'GET',
24
+		headers: {
25
+			'token': token
26
+		},
27
+		success: function(response) {
28
+			if (response.code === 200) {
29
+				const dropdown = $('#orgSelect');
30
+				response.data.forEach(item => {
31
+					const option = $('<option></option>').val(item.orgId).text(item.orgName);
32
+					dropdown.append(option);
33
+				});
34
+			} else {
35
+				console.error('Error:', response);
36
+			}
37
+		},
38
+		error: function(error) {
39
+			console.error('Request failed:', error);
40
+		}
41
+	});
42
+}
43
+
44
+function getPlayUrl(base, token, orgId, cb) {
45
+	$.ajax({
46
+		url: base + '/client/c/mobileInfo/selection/selectionOrg',
47
+		type: 'GET',
48
+		headers: {
49
+			'token': token
50
+		},
51
+		success: function(response) {
52
+			if (response.code === 200) {
53
+				var data = response.data
54
+				cb(data)
55
+			} else {
56
+				console.error('Error:', response);
57
+			}
58
+		},
59
+		error: function(error) {
60
+			console.error('Request failed:', error);
61
+		}
62
+	});
63
+}
64
+
65
+function createPlayer(id) {
66
+	var myPalyer = new window.JSPlugin({
67
+		szId: id,
68
+		szBasePath: "./",
69
+		iMaxSplit: 1,
70
+		iCurrentSplit: 1,
71
+		openDebug: true,
72
+		oStyle: {
73
+			borderSelect: '#000',
74
+		}
75
+	})
76
+	myPlayer.myId = id
77
+	return myPlayer
78
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 10 - 0
queue-monitor/hybrid/html/vconsole.min.js


+ 7 - 0
queue-monitor/pages.json

@@ -114,6 +114,13 @@
114 114
 					"scrollIndicator": false
115 115
 				}
116 116
 			}
117
+		},
118
+		{
119
+			"path" : "pages/video/video",
120
+			"style" : 
121
+			{
122
+				"navigationBarTitleText" : ""
123
+			}
117 124
 		}
118 125
 	],
119 126
 	"globalStyle": {

+ 7 - 1
queue-monitor/pages/home/home.vue

@@ -14,7 +14,7 @@
14 14
 				</view>
15 15
 			</view>
16 16
 			<view class="row">
17
-				<view class="item live">
17
+				<view class="item live" @click="live">
18 18
 					<view>实时联动</view>
19 19
 					<view class="en">Real Time Linkage</view>
20 20
 				</view>
@@ -59,6 +59,12 @@
59 59
 				uni.navigateTo({
60 60
 					url: '/pages/carManager/carManager'
61 61
 				})
62
+			},
63
+			live() {
64
+				getApp().globalData.tabIndex = LIVE_INDEX
65
+				uni.navigateTo({
66
+					url: '/pages/video/video'
67
+				})
62 68
 			}
63 69
 		}
64 70
 	}

+ 4 - 2
queue-monitor/pages/index/index.vue

@@ -74,8 +74,10 @@
74 74
 			return {
75 75
 				index: 0,
76 76
 				userInfo: {
77
-					name: null,
78
-					password: null,
77
+					// name: null,
78
+					// password: null,
79
+					name: "13777777777",
80
+					password: "123456",
79 81
 				},
80 82
 				registInfo: {
81 83
 					name: null,

+ 4 - 3
queue-monitor/pages/monitor/monitor.vue

@@ -23,9 +23,9 @@
23 23
 			</view>
24 24
 		</view>
25 25
 
26
-		<u-action-sheet :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
26
+		<u-action-sheet2 :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
27 27
 			:show="storehouseSelectShow" @select="onOrgSelect" @close="storehouseSelectShow = false">
28
-		</u-action-sheet>
28
+		</u-action-sheet2>
29 29
 
30 30
 		<u-modal :show="showPop" title="车辆详细信息" confirmText="入场" cancelText="取消" :showCancelButton="true"
31 31
 			:buttonReverse="true" @close="showPop = false" @cancel="showPop = false" @confirm="enter">
@@ -67,9 +67,10 @@
67 67
 	} from '@/api/basic'
68 68
 	import appHeader from '@/pages/components/header/header.vue'
69 69
 	import tabbar from '@/pages/components/tabbar.vue'
70
+	import uActionSheet2 from '@/components/u-action-sheet/my-action-sheet.vue'
70 71
 	export default {
71 72
 		components: {
72
-			appHeader, tabbar
73
+			appHeader, tabbar, uActionSheet2
73 74
 		},
74 75
 		data() {
75 76
 			return {

+ 5 - 3
queue-monitor/pages/registration/registration.vue

@@ -6,9 +6,9 @@
6 6
 			<u-cell title="选择粮库" :value="form.orgName" :is-link="true" @click="storehouseSelectShow = true"></u-cell>
7 7
 			<user-info ref="userInfo"></user-info>
8 8
 			<u-button @click="submit" type="primary">提交</u-button>
9
-			<u-action-sheet :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
9
+			<u-action-sheet2 :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
10 10
 				:show="storehouseSelectShow" @select="onOrgSelect" @close="storehouseSelectShow = false">
11
-			</u-action-sheet>
11
+			</u-action-sheet2>
12 12
 			<tabbar></tabbar>
13 13
 		</view>
14 14
 	</view>
@@ -26,11 +26,13 @@
26 26
 	} from '@/api/basic'
27 27
 	import appHeader from '@/pages/components/header/header.vue'
28 28
 	import tabbar from '@/pages/components/tabbar.vue'
29
+	import uActionSheet2 from '@/components/u-action-sheet/my-action-sheet.vue'
29 30
 	export default {
30 31
 		components: {
31 32
 			userInfo,
32 33
 			appHeader,
33
-			tabbar
34
+			tabbar,
35
+			uActionSheet2
34 36
 		},
35 37
 		data() {
36 38
 			return {

+ 4 - 3
queue-monitor/pages/reservation/reservation.vue

@@ -28,9 +28,9 @@
28 28
 
29 29
 		</view>
30 30
 		</view>
31
-		<u-action-sheet :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
31
+		<u-action-sheet2 :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
32 32
 			:show="storehouseSelectShow" @select="onOrgSelect" @close="storehouseSelectShow = false">
33
-		</u-action-sheet>
33
+		</u-action-sheet2>
34 34
 
35 35
 		<u-calendar :show="dateSelectShow" :closeOnClickOverlay="true" @confirm="onDateSelect"
36 36
 			@close="dateSelectShow = false">
@@ -55,8 +55,9 @@
55 55
 	import userInfo from '@/pages/components/userInfo.vue'
56 56
 	import appHeader from '@/pages/components/header/header.vue'
57 57
 	import tabbar from '@/pages/components/tabbar.vue'
58
+	import uActionSheet2 from '@/components/u-action-sheet/my-action-sheet.vue'
58 59
 	export default {
59
-		components: {userInfo, appHeader, tabbar},
60
+		components: {userInfo, appHeader, tabbar, uActionSheet2},
60 61
 		data() {
61 62
 			return {
62 63
 				form: {

+ 5 - 3
queue-monitor/pages/schedule/schedule.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
 	<view id="main" class="content main">
3
-		<app-header @back="back">车辆动态监测</app-header>
3
+		<app-header @back="back">远程调度</app-header>
4 4
 		<view>
5 5
 			<view>
6 6
 				<view id="top">
@@ -21,9 +21,9 @@
21 21
 					   :listHeight="listH" :rowHeight="55" @confirm="confirm"></HM-dragSorts>
22 22
 				</view>
23 23
 
24
-				<u-action-sheet :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
24
+				<u-action-sheet2 :actions="orgList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="选择粮库"
25 25
 					:show="storehouseSelectShow" @select="onOrgSelect" @close="storehouseSelectShow = false">
26
-				</u-action-sheet>
26
+				</u-action-sheet2>
27 27
 			</view>
28 28
 			<tabbar></tabbar>
29 29
 		</view>
@@ -48,11 +48,13 @@
48 48
 	} from '@/api/basic'
49 49
 	import appHeader from '@/pages/components/header/header.vue'
50 50
 	import tabbar from '@/pages/components/tabbar.vue'
51
+	import uActionSheet2 from '@/components/u-action-sheet/my-action-sheet.vue'
51 52
 	export default {
52 53
 		components: {
53 54
 			'HM-dragSorts': dragSorts,
54 55
 			appHeader,
55 56
 			tabbar,
57
+			uActionSheet2,
56 58
 		},
57 59
 		data() {
58 60
 			return {

+ 33 - 0
queue-monitor/pages/video/video.vue

@@ -0,0 +1,33 @@
1
+<template>
2
+	<view>
3
+		<web-view v-if=url :src="url"></web-view>
4
+	</view>
5
+</template>
6
+
7
+<script>
8
+	import {
9
+		server_host
10
+	} from "@/config/system"
11
+	export default {
12
+		data() {
13
+			return {
14
+				url: null,
15
+			}
16
+		},
17
+		mounted() {
18
+			const token = uni.getStorageSync('token')
19
+			console.log('token', token);
20
+			this.url = `/hybrid/html/player.html?token=${token}&base=${server_host}`
21
+		},
22
+		methods: {
23
+			
24
+		}
25
+	}
26
+</script>
27
+
28
+<style>
29
+#player {
30
+	width: 100vw;
31
+	height: calc(100vw * 5 / 8)
32
+}
33
+</style>

BIN
queue-monitor/unpackage/cache/apk/__UNI__FB8F249_cm.apk


+ 1 - 1
queue-monitor/unpackage/cache/apk/apkurl

@@ -1 +1 @@
1
-https://app.liuyingyong.cn/build/download/154dfcf0-0d23-11ef-b18c-2b832dc306bf
1
+https://app.liuyingyong.cn/build/download/fd02d580-424e-11ef-8f3b-4b2f5f0eabb1

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/cache/apk/cmManifestCache.json


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/app-config-service.js


Datei-Diff unterdrückt, da er zu groß ist
+ 4 - 4
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/app-service.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/app-view.js


Datei-Diff unterdrückt, da er zu groß ist
+ 313 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/h5player.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/jquery-3.7.1.min.js


+ 642 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1/DecodeWorker.js

@@ -0,0 +1,642 @@
1
+/**
2
+ * Created by wangweijie5 on 2016/12/5.
3
+ */
4
+(function (event) {
5
+    const AUDIO_TYPE = 0;	// 音频
6
+    const VIDEO_TYPE = 1;   // 视频
7
+    const PRIVT_TYPE = 2;  // 私有帧
8
+
9
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
10
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
11
+
12
+    const PLAYM4_OK = 1;
13
+    const PLAYM4_ORDER_ERROR = 2;
14
+    const PLAYM4_DECODE_ERROR = 44 	// 解码失败
15
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
16
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
17
+    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
18
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
19
+
20
+    importScripts('Decoder.js');
21
+    Module.addOnPostRun(function () {
22
+        postMessage({ 'function': "loaded" });
23
+    });
24
+
25
+    var iStreamMode = 0;  // 流模式
26
+
27
+    var bOpenMode = false;
28
+    var bOpenStream = false;
29
+
30
+    var funGetFrameData = null;
31
+    var funGetAudFrameData = null;
32
+
33
+    var bWorkerPrintLog = false;//worker层log开关
34
+
35
+    var g_nPort = -1;
36
+    var pInputData = null;
37
+    var inputBufferSize = 40960;
38
+
39
+    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
40
+        let port = nPort;
41
+        let user = pUser;
42
+        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
43
+        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
44
+        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
45
+        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
46
+        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
47
+        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
48
+        postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
49
+    }
50
+
51
+    onmessage = function (event) {
52
+        var eventData = event.data;
53
+        var res = 0;
54
+        switch (eventData.command) {
55
+            case "printLog":
56
+                let downloadFlag = eventData.data;
57
+                if (downloadFlag === true) {
58
+                    bWorkerPrintLog = true;
59
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
60
+                }
61
+                else {
62
+                    bWorkerPrintLog = false;
63
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
64
+                }
65
+
66
+                if (res !== PLAYM4_OK) {
67
+                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
68
+                    postMessage({ 'function': "printLog", 'errorCode': res });
69
+                }
70
+                break;
71
+            case "SetPlayPosition":
72
+                let nFrameNumOrTime = eventData.data;
73
+                let enPosType = eventData.type;
74
+                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
75
+                // if (res !== PLAYM4_OK)
76
+                // {
77
+                //     postMessage({'function': "SetPlayPosition", 'errorCode': res});
78
+                //     return;
79
+                // }
80
+                // //有没有buffer需要清除
81
+
82
+                break;
83
+            case "SetStreamOpenMode":
84
+                //获取端口号
85
+                g_nPort = Module._GetPort();
86
+                //设置流打开模式
87
+                iStreamMode = eventData.data;
88
+                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
89
+                if (res !== PLAYM4_OK) {
90
+                    postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
91
+                    return;
92
+                }
93
+                bOpenMode = true;
94
+                break;
95
+
96
+            case "OpenStream":
97
+                // 接收到的数据
98
+                var iHeadLen = eventData.dataSize;
99
+                var pHead = Module._malloc(iHeadLen + 4);
100
+                if (pHead === null) {
101
+                    return;
102
+                }
103
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
104
+                aHead.set(new Uint8Array(eventData.data));
105
+                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
106
+                postMessage({ 'function': "OpenStream", 'errorCode': res });
107
+                if (res !== PLAYM4_OK) {
108
+                    //释放内存
109
+                    Module._free(pHead);
110
+                    pHead = null;
111
+                    return;
112
+                }
113
+                bOpenStream = true;
114
+                break;
115
+            case "Play":
116
+                let resP = Module._Play(g_nPort);
117
+                if (resP !== PLAYM4_OK) {
118
+                    return;
119
+                }
120
+                break;
121
+            case "InputData":
122
+                // 接收到的数据
123
+                var iLen = eventData.dataSize;
124
+                if (iLen > 0) {
125
+                    if (pInputData == null || iLen > inputBufferSize) {
126
+                        if (pInputData != null) {
127
+                            Module._free(pInputData);
128
+                            pInputData = null;
129
+                        }
130
+                        if (iLen > inputBufferSize) {
131
+                            inputBufferSize = iLen;
132
+                        }
133
+
134
+                        pInputData = Module._malloc(inputBufferSize);
135
+                        if (pInputData === null) {
136
+                            return;
137
+                        }
138
+                    }
139
+
140
+                    var inputData = new Uint8Array(eventData.data);
141
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
142
+                    // aInputData.set(inputData);
143
+                    Module.writeArrayToMemory(inputData, pInputData);
144
+                    inputData = null;
145
+                    res = Module._InputData(g_nPort, pInputData, iLen);
146
+                    if (res !== PLAYM4_OK) {
147
+                        let errorCode = Module._GetLastError(g_nPort);
148
+                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
149
+                        postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
150
+                    }
151
+                    //Module._free(pInputData);
152
+                    //pInputData = null;
153
+                } else {
154
+                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
155
+                    if (sourceRemain == 0) {
156
+                        postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
157
+                        return;
158
+                    }
159
+                }
160
+
161
+                /////////////////////
162
+                // if (funGetFrameData === null) {
163
+                //     funGetFrameData = Module.cwrap('GetFrameData', 'number');
164
+                // }
165
+
166
+                while (bOpenMode && bOpenStream) {
167
+
168
+                    var ret = getFrameData();
169
+                    // 直到获取视频帧或数据不足为止
170
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret
171
+                    {
172
+                        break;
173
+                    }
174
+                }
175
+                break;
176
+
177
+            case "SetSecretKey":
178
+                var keyLen = eventData.nKeyLen;
179
+                var pKeyData = Module._malloc(keyLen);
180
+                if (pKeyData === null) {
181
+                    return;
182
+                }
183
+                var nKeySize = eventData.data.length
184
+                var bufData = stringToBytes(eventData.data);
185
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
186
+                let u8array = new Uint8Array(keyLen);
187
+                aKeyData.set(u8array, 0);
188
+                aKeyData.set(new Uint8Array(bufData));
189
+                aKeyData = null;
190
+                u8array = null;
191
+
192
+                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
193
+                if (res !== PLAYM4_OK) {
194
+                    postMessage({ 'function': "SetSecretKey", 'errorCode': res });
195
+                    Module._free(pKeyData);
196
+                    pKeyData = null;
197
+                    return;
198
+                }
199
+
200
+                Module._free(pKeyData);
201
+                pKeyData = null;
202
+                break;
203
+
204
+            case "GetBMP":
205
+                var nBMPWidth = eventData.width;
206
+                var nBMPHeight = eventData.height;
207
+                var pYUVData = eventData.data;
208
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
209
+                var oJpegCropRect = {
210
+                    left: eventData.left,
211
+                    top: eventData.top,
212
+                    right: eventData.right,
213
+                    bottom: eventData.bottom
214
+                };
215
+
216
+                var pDataYUV = Module._malloc(nYUVSize);
217
+                if (pDataYUV === null) {
218
+                    return;
219
+                }
220
+
221
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
222
+
223
+                // 分配BMP空间
224
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
225
+                var pBmpData = Module._malloc(nBmpSize);
226
+                var pBmpSize = Module._malloc(4);
227
+                if (pBmpData === null || pBmpSize === null) {
228
+                    Module._free(pDataYUV);
229
+                    pDataYUV = null;
230
+
231
+                    if (pBmpData != null) {
232
+                        Module._free(pBmpData);
233
+                        pBmpData = null;
234
+                    }
235
+
236
+                    if (pBmpSize != null) {
237
+                        Module._free(pBmpSize);
238
+                        pBmpSize = null;
239
+                    }
240
+                    return;
241
+                }
242
+
243
+                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
244
+                Module.setValue(pBmpSize, nBmpSize, "i32");
245
+                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
246
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
247
+                if (res !== PLAYM4_OK) {
248
+                    postMessage({ 'function': "GetBMP", 'errorCode': res });
249
+                    Module._free(pDataYUV);
250
+                    pDataYUV = null;
251
+                    Module._free(pBmpData);
252
+                    pBmpData = null;
253
+                    Module._free(pBmpSize);
254
+                    pBmpSize = null;
255
+                    return;
256
+                }
257
+
258
+                // 获取BMP图片大小
259
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
260
+
261
+                // 获取BMP图片数据
262
+                var aBmpData = new Uint8Array(nBmpDataSize);
263
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
264
+
265
+                postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
266
+                aBmpData = null;
267
+                if (pDataYUV != null) {
268
+                    Module._free(pDataYUV);
269
+                    pDataYUV = null;
270
+                }
271
+                if (pBmpData != null) {
272
+                    Module._free(pBmpData);
273
+                    pBmpData = null;
274
+                }
275
+                if (pBmpSize != null) {
276
+                    Module._free(pBmpSize);
277
+                    pBmpSize = null;
278
+                }
279
+                break;
280
+
281
+            case "GetJPEG":
282
+                var nJpegWidth = eventData.width;
283
+                var nJpegHeight = eventData.height;
284
+                var pYUVData1 = eventData.data;
285
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
286
+                var oJpegCropRect = {
287
+                    left: eventData.left,
288
+                    top: eventData.top,
289
+                    right: eventData.right,
290
+                    bottom: eventData.bottom
291
+                };
292
+
293
+                var pDataYUV1 = Module._malloc(nYUVSize1);
294
+                if (pDataYUV1 === null) {
295
+                    return;
296
+                }
297
+
298
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
299
+
300
+                // 分配JPEG空间
301
+                var pJpegData = Module._malloc(nYUVSize1);
302
+                var pJpegSize = Module._malloc(4);
303
+                if (pJpegData === null || pJpegSize === null) {
304
+                    if (pJpegData != null) {
305
+                        Module._free(pJpegData);
306
+                        pJpegData = null;
307
+                    }
308
+
309
+                    if (pJpegSize != null) {
310
+                        Module._free(pJpegSize);
311
+                        pJpegSize = null;
312
+                    }
313
+
314
+                    if (pDataYUV1 != null) {
315
+                        Module._free(pDataYUV1);
316
+                        pDataYUV1 = null;
317
+                    }
318
+                    return;
319
+                }
320
+
321
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
322
+
323
+                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
324
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
325
+                if (res !== PLAYM4_OK) {
326
+                    postMessage({ 'function': "GetJPEG", 'errorCode': res });
327
+                    if (pJpegData != null) {
328
+                        Module._free(pJpegData);
329
+                        pJpegData = null;
330
+                    }
331
+
332
+                    if (pJpegSize != null) {
333
+                        Module._free(pJpegSize);
334
+                        pJpegSize = null;
335
+                    }
336
+
337
+                    if (pDataYUV1 != null) {
338
+                        Module._free(pDataYUV1);
339
+                        pDataYUV1 = null;
340
+                    }
341
+                    return;
342
+                }
343
+
344
+                // 获取JPEG图片大小
345
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
346
+
347
+                // 获取JPEG图片数据
348
+                var aJpegData = new Uint8Array(nJpegSize);
349
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
350
+
351
+                postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
352
+
353
+                nJpegSize = null;
354
+                aJpegData = null;
355
+
356
+                if (pDataYUV1 != null) {
357
+                    Module._free(pDataYUV1);
358
+                    pDataYUV1 = null;
359
+                }
360
+                if (pJpegData != null) {
361
+                    Module._free(pJpegData);
362
+                    pJpegData = null;
363
+                }
364
+                if (pJpegSize != null) {
365
+                    Module._free(pJpegSize);
366
+                    pJpegSize = null;
367
+                }
368
+                break;
369
+
370
+            case "SetDecodeFrameType":
371
+                var nFrameType = eventData.data;
372
+                res = Module._SetDecodeFrameType(g_nPort, nFrameType);
373
+                if (res !== PLAYM4_OK) {
374
+                    postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
375
+                    return;
376
+                }
377
+                break;
378
+            case "CloseStream":
379
+                //stop
380
+                let resS = Module._Stop(g_nPort);
381
+                if (resS !== PLAYM4_OK) {
382
+                    postMessage({ 'function': "Stop", 'errorCode': res });
383
+                    return;
384
+                }
385
+                //closeStream
386
+                res = Module._CloseStream(g_nPort);
387
+                if (res !== PLAYM4_OK) {
388
+                    postMessage({ 'function': "CloseStream", 'errorCode': res });
389
+                    return;
390
+                }
391
+                //freePort
392
+                let resF = Module._FreePort(g_nPort);
393
+                if (resF !== PLAYM4_OK) {
394
+                    postMessage({ 'function': "FreePort", 'errorCode': res });
395
+                    return;
396
+                }
397
+                if (pInputData != null) {
398
+                    Module._free(pInputData);
399
+                    pInputData = null;
400
+                }
401
+                break;
402
+            case "PlaySound":
403
+                let resPS = Module._PlaySound(g_nPort);
404
+                if (resPS !== PLAYM4_OK) {
405
+                    console.log("PlaySound failed");
406
+                    return;
407
+                }
408
+                break;
409
+            case "StopSound":
410
+                let resSS = Module._StopSound();
411
+                if (resSS !== PLAYM4_OK) {
412
+                    console.log("StopSound failed");
413
+                    return;
414
+                }
415
+                break;
416
+            case "SetVolume":
417
+                let resSV = Module._SetVolume(g_nPort, eventData.volume);
418
+                if (resSV !== PLAYM4_OK) {
419
+                    console.log("Audio SetVolume failed");
420
+                    return;
421
+                }
422
+                break;
423
+            case "GetVolume":
424
+                let volume = Module._GetVolume();
425
+                if (volume > 0) {
426
+                    postMessage({ 'function': "GetVolume", 'volume': volume });
427
+                }
428
+                else {
429
+                    console.log("Audio GetVolume failed");
430
+                    return;
431
+                }
432
+                break;
433
+            case "OnlyPlaySound":
434
+                let resOPS = Module._OnlyPlaySound(g_nPort);
435
+                if (resOPS !== PLAYM4_OK) {
436
+                    console.log("OnlyPlaySound failed");
437
+                    return;
438
+                }
439
+                break;
440
+            case "Pause":
441
+                let resPa = Module._Pause(g_nPort, eventData.bPlay);
442
+                if (resPa !== PLAYM4_OK) {
443
+                    console.log("Pause failed");
444
+                    return;
445
+                }
446
+            case "PlayRate":
447
+                Module._SetPlayRate(g_nPort, eventData.playRate);
448
+                break;
449
+            case "SetIFrameDecInterval":
450
+                Module._SetIFrameDecInterval(g_nPort, eventData.data);
451
+                break;
452
+            case "SetLostFrameMode":
453
+                Module._SetLostFrameMode(g_nPort, eventData.data, 0);
454
+                break;
455
+            case "SetDemuxModel":
456
+                Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
457
+                break;
458
+            case "SkipErrorData":
459
+                Module._SkipErrorData(g_nPort, eventData.bSkip);
460
+                break;
461
+            case "SetDecodeERC":
462
+                Module._SetDecodeERC(g_nPort, eventData.nLevel);
463
+                break;
464
+            case "SetANRParam":
465
+                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
466
+                break;
467
+            case "SetResampleValue":
468
+                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
469
+                break;
470
+            case "GetLastError":
471
+                let errorCode = Module._GetLastError(g_nPort);
472
+                postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
473
+                break;
474
+            case "SetGlobalBaseTime":
475
+                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
476
+                break;
477
+            case "SetRunTimeInfoCB":
478
+                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
479
+                break;
480
+            default:
481
+                break;
482
+        }
483
+    };
484
+
485
+    function getOSDTime(oFrameInfo) {
486
+        var iYear = oFrameInfo.year;
487
+        var iMonth = oFrameInfo.month;
488
+        var iDay = oFrameInfo.day;
489
+        var iHour = oFrameInfo.hour;
490
+        var iMinute = oFrameInfo.minute;
491
+        var iSecond = oFrameInfo.second;
492
+
493
+        if (iMonth < 10) {
494
+            iMonth = "0" + iMonth;
495
+        }
496
+        if (iDay < 10) {
497
+            iDay = "0" + iDay;
498
+        }
499
+        if (iHour < 10) {
500
+            iHour = "0" + iHour;
501
+        }
502
+        if (iMinute < 10) {
503
+            iMinute = "0" + iMinute;
504
+        }
505
+        if (iSecond < 10) {
506
+            iSecond = "0" + iSecond;
507
+        }
508
+
509
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
510
+    }
511
+    // 获取帧数据
512
+    function getFrameData() {
513
+        // function getFrameData() {
514
+        // 获取帧数据
515
+        var res = Module._GetFrameData();
516
+        //var res = fun();
517
+        if (res === PLAYM4_OK) {
518
+            var oFrameInfo = Module._GetFrameInfo();
519
+            switch (oFrameInfo.frameType) {
520
+                case AUDIO_TYPE:
521
+                    var iSize = oFrameInfo.frameSize;
522
+                    if (0 === iSize) {
523
+                        return -1;
524
+                    }
525
+                    var pPCM = Module._GetFrameBuffer();
526
+                    // var audioBuf = new ArrayBuffer(iSize);
527
+                    var aPCMData = new Uint8Array(iSize);
528
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
529
+                    if (bWorkerPrintLog) {
530
+                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
531
+                    }
532
+                    postMessage({
533
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
534
+                        'frameInfo': oFrameInfo, 'errorCode': res
535
+                    }, [aPCMData.buffer]);
536
+
537
+                    oFrameInfo = null;
538
+                    pPCM = null;
539
+                    aPCMData = null;
540
+                    return PLAYM4_AUDIO_FRAME;
541
+
542
+                case VIDEO_TYPE:
543
+                    var szOSDTime = getOSDTime(oFrameInfo);
544
+
545
+                    var iWidth = oFrameInfo.width;
546
+                    var iHeight = oFrameInfo.height;
547
+
548
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
549
+                    if (0 === iYUVSize) {
550
+                        return -1;
551
+                    }
552
+
553
+                    var pYUV = Module._GetFrameBuffer();
554
+
555
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
556
+                    var aYUVData = new Uint8Array(iYUVSize);
557
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
558
+                    if (bWorkerPrintLog) {
559
+                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
560
+                    }
561
+
562
+                    postMessage({
563
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
564
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
565
+                    }, [aYUVData.buffer]);
566
+
567
+                    oFrameInfo = null;
568
+                    pYUV = null;
569
+                    aYUVData = null;
570
+                    return PLAYM4_VIDEO_FRAME;
571
+
572
+                case PRIVT_TYPE:
573
+                    postMessage({
574
+                        'function': "GetFrameData", 'type': "", 'data': null,
575
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
576
+                    });
577
+                    return PLAYM4_SYS_NOT_SUPPORT;
578
+
579
+                default:
580
+                    postMessage({
581
+                        'function': "GetFrameData", 'type': "", 'data': null,
582
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
583
+                    });
584
+                    return PLAYM4_SYS_NOT_SUPPORT;
585
+            }
586
+        }
587
+        else {
588
+            let errorCode = Module._GetLastError(g_nPort);
589
+            //解码失败返回裸数据
590
+            if (PLAYM4_DECODE_ERROR === errorCode) {
591
+                var rawInfo = Module._GetRawDataInfo();
592
+                var pRawData = Module._GetRawDataBuffer();
593
+                var aRawData = new Uint8Array(rawInfo.isize);
594
+                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
595
+                postMessage({
596
+                    'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
597
+                    'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
598
+                });
599
+                rawInfo = null;
600
+                pRawData = null;
601
+                aRawData = null;
602
+            }
603
+            //需要更多数据
604
+            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
605
+                postMessage({
606
+                    'function': "GetFrameData", 'type': "", 'data': null,
607
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
608
+                });
609
+            }
610
+            return errorCode;
611
+        }
612
+    }
613
+
614
+    // 开始计算时间
615
+    function startTime() {
616
+        return new Date().getTime();
617
+    }
618
+
619
+    // 结束计算时间
620
+    function endTime() {
621
+        return new Date().getTime();
622
+    }
623
+
624
+    // 字母字符串转byte数组
625
+    function stringToBytes(str) {
626
+        var ch, st, re = [];
627
+        for (var i = 0; i < str.length; i++) {
628
+            ch = str.charCodeAt(i);  // get char
629
+            st = [];                 // set up "stack"
630
+            do {
631
+                st.push(ch & 0xFF);  // push byte to stack
632
+                ch = ch >> 8;          // shift value down by 1 byte
633
+            }
634
+            while (ch);
635
+            // add stack contents to result
636
+            // done because chars have "wrong" endianness
637
+            re = re.concat(st.reverse());
638
+        }
639
+        // return an array of bytes
640
+        return re;
641
+    }
642
+})();

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1/Decoder.js


+ 642 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1simd/DecodeWorker.js

@@ -0,0 +1,642 @@
1
+/**
2
+ * Created by wangweijie5 on 2016/12/5.
3
+ */
4
+(function (event) {
5
+    const AUDIO_TYPE = 0;	// 音频
6
+    const VIDEO_TYPE = 1;   // 视频
7
+    const PRIVT_TYPE = 2;  // 私有帧
8
+
9
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
10
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
11
+
12
+    const PLAYM4_OK = 1;
13
+    const PLAYM4_ORDER_ERROR = 2;
14
+    const PLAYM4_DECODE_ERROR = 44 	// 解码失败
15
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
16
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
17
+    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
18
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
19
+
20
+    importScripts('Decoder.js');
21
+    Module.addOnPostRun(function () {
22
+        postMessage({ 'function': "loaded" });
23
+    });
24
+
25
+    var iStreamMode = 0;  // 流模式
26
+
27
+    var bOpenMode = false;
28
+    var bOpenStream = false;
29
+
30
+    var funGetFrameData = null;
31
+    var funGetAudFrameData = null;
32
+
33
+    var bWorkerPrintLog = false;//worker层log开关
34
+
35
+    var g_nPort = -1;
36
+    var pInputData = null;
37
+    var inputBufferSize = 40960;
38
+
39
+    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
40
+        let port = nPort;
41
+        let user = pUser;
42
+        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
43
+        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
44
+        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
45
+        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
46
+        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
47
+        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
48
+        postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
49
+    }
50
+
51
+    onmessage = function (event) {
52
+        var eventData = event.data;
53
+        var res = 0;
54
+        switch (eventData.command) {
55
+            case "printLog":
56
+                let downloadFlag = eventData.data;
57
+                if (downloadFlag === true) {
58
+                    bWorkerPrintLog = true;
59
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
60
+                }
61
+                else {
62
+                    bWorkerPrintLog = false;
63
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
64
+                }
65
+
66
+                if (res !== PLAYM4_OK) {
67
+                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
68
+                    postMessage({ 'function': "printLog", 'errorCode': res });
69
+                }
70
+                break;
71
+            case "SetPlayPosition":
72
+                let nFrameNumOrTime = eventData.data;
73
+                let enPosType = eventData.type;
74
+                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
75
+                // if (res !== PLAYM4_OK)
76
+                // {
77
+                //     postMessage({'function': "SetPlayPosition", 'errorCode': res});
78
+                //     return;
79
+                // }
80
+                // //有没有buffer需要清除
81
+
82
+                break;
83
+            case "SetStreamOpenMode":
84
+                //获取端口号
85
+                g_nPort = Module._GetPort();
86
+                //设置流打开模式
87
+                iStreamMode = eventData.data;
88
+                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
89
+                if (res !== PLAYM4_OK) {
90
+                    postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
91
+                    return;
92
+                }
93
+                bOpenMode = true;
94
+                break;
95
+
96
+            case "OpenStream":
97
+                // 接收到的数据
98
+                var iHeadLen = eventData.dataSize;
99
+                var pHead = Module._malloc(iHeadLen + 4);
100
+                if (pHead === null) {
101
+                    return;
102
+                }
103
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
104
+                aHead.set(new Uint8Array(eventData.data));
105
+                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
106
+                postMessage({ 'function': "OpenStream", 'errorCode': res });
107
+                if (res !== PLAYM4_OK) {
108
+                    //释放内存
109
+                    Module._free(pHead);
110
+                    pHead = null;
111
+                    return;
112
+                }
113
+                bOpenStream = true;
114
+                break;
115
+            case "Play":
116
+                let resP = Module._Play(g_nPort);
117
+                if (resP !== PLAYM4_OK) {
118
+                    return;
119
+                }
120
+                break;
121
+            case "InputData":
122
+                // 接收到的数据
123
+                var iLen = eventData.dataSize;
124
+                if (iLen > 0) {
125
+                    if (pInputData == null || iLen > inputBufferSize) {
126
+                        if (pInputData != null) {
127
+                            Module._free(pInputData);
128
+                            pInputData = null;
129
+                        }
130
+                        if (iLen > inputBufferSize) {
131
+                            inputBufferSize = iLen;
132
+                        }
133
+
134
+                        pInputData = Module._malloc(inputBufferSize);
135
+                        if (pInputData === null) {
136
+                            return;
137
+                        }
138
+                    }
139
+
140
+                    var inputData = new Uint8Array(eventData.data);
141
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
142
+                    // aInputData.set(inputData);
143
+                    Module.writeArrayToMemory(inputData, pInputData);
144
+                    inputData = null;
145
+                    res = Module._InputData(g_nPort, pInputData, iLen);
146
+                    if (res !== PLAYM4_OK) {
147
+                        let errorCode = Module._GetLastError(g_nPort);
148
+                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
149
+                        postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
150
+                    }
151
+                    //Module._free(pInputData);
152
+                    //pInputData = null;
153
+                } else {
154
+                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
155
+                    if (sourceRemain == 0) {
156
+                        postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
157
+                        return;
158
+                    }
159
+                }
160
+
161
+                /////////////////////
162
+                // if (funGetFrameData === null) {
163
+                //     funGetFrameData = Module.cwrap('GetFrameData', 'number');
164
+                // }
165
+
166
+                while (bOpenMode && bOpenStream) {
167
+
168
+                    var ret = getFrameData();
169
+                    // 直到获取视频帧或数据不足为止
170
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret
171
+                    {
172
+                        break;
173
+                    }
174
+                }
175
+                break;
176
+
177
+            case "SetSecretKey":
178
+                var keyLen = eventData.nKeyLen;
179
+                var pKeyData = Module._malloc(keyLen);
180
+                if (pKeyData === null) {
181
+                    return;
182
+                }
183
+                var nKeySize = eventData.data.length
184
+                var bufData = stringToBytes(eventData.data);
185
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
186
+                let u8array = new Uint8Array(keyLen);
187
+                aKeyData.set(u8array, 0);
188
+                aKeyData.set(new Uint8Array(bufData));
189
+                aKeyData = null;
190
+                u8array = null;
191
+
192
+                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
193
+                if (res !== PLAYM4_OK) {
194
+                    postMessage({ 'function': "SetSecretKey", 'errorCode': res });
195
+                    Module._free(pKeyData);
196
+                    pKeyData = null;
197
+                    return;
198
+                }
199
+
200
+                Module._free(pKeyData);
201
+                pKeyData = null;
202
+                break;
203
+
204
+            case "GetBMP":
205
+                var nBMPWidth = eventData.width;
206
+                var nBMPHeight = eventData.height;
207
+                var pYUVData = eventData.data;
208
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
209
+                var oJpegCropRect = {
210
+                    left: eventData.left,
211
+                    top: eventData.top,
212
+                    right: eventData.right,
213
+                    bottom: eventData.bottom
214
+                };
215
+
216
+                var pDataYUV = Module._malloc(nYUVSize);
217
+                if (pDataYUV === null) {
218
+                    return;
219
+                }
220
+
221
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
222
+
223
+                // 分配BMP空间
224
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
225
+                var pBmpData = Module._malloc(nBmpSize);
226
+                var pBmpSize = Module._malloc(4);
227
+                if (pBmpData === null || pBmpSize === null) {
228
+                    Module._free(pDataYUV);
229
+                    pDataYUV = null;
230
+
231
+                    if (pBmpData != null) {
232
+                        Module._free(pBmpData);
233
+                        pBmpData = null;
234
+                    }
235
+
236
+                    if (pBmpSize != null) {
237
+                        Module._free(pBmpSize);
238
+                        pBmpSize = null;
239
+                    }
240
+                    return;
241
+                }
242
+
243
+                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
244
+                Module.setValue(pBmpSize, nBmpSize, "i32");
245
+                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
246
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
247
+                if (res !== PLAYM4_OK) {
248
+                    postMessage({ 'function': "GetBMP", 'errorCode': res });
249
+                    Module._free(pDataYUV);
250
+                    pDataYUV = null;
251
+                    Module._free(pBmpData);
252
+                    pBmpData = null;
253
+                    Module._free(pBmpSize);
254
+                    pBmpSize = null;
255
+                    return;
256
+                }
257
+
258
+                // 获取BMP图片大小
259
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
260
+
261
+                // 获取BMP图片数据
262
+                var aBmpData = new Uint8Array(nBmpDataSize);
263
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
264
+
265
+                postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
266
+                aBmpData = null;
267
+                if (pDataYUV != null) {
268
+                    Module._free(pDataYUV);
269
+                    pDataYUV = null;
270
+                }
271
+                if (pBmpData != null) {
272
+                    Module._free(pBmpData);
273
+                    pBmpData = null;
274
+                }
275
+                if (pBmpSize != null) {
276
+                    Module._free(pBmpSize);
277
+                    pBmpSize = null;
278
+                }
279
+                break;
280
+
281
+            case "GetJPEG":
282
+                var nJpegWidth = eventData.width;
283
+                var nJpegHeight = eventData.height;
284
+                var pYUVData1 = eventData.data;
285
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
286
+                var oJpegCropRect = {
287
+                    left: eventData.left,
288
+                    top: eventData.top,
289
+                    right: eventData.right,
290
+                    bottom: eventData.bottom
291
+                };
292
+
293
+                var pDataYUV1 = Module._malloc(nYUVSize1);
294
+                if (pDataYUV1 === null) {
295
+                    return;
296
+                }
297
+
298
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
299
+
300
+                // 分配JPEG空间
301
+                var pJpegData = Module._malloc(nYUVSize1);
302
+                var pJpegSize = Module._malloc(4);
303
+                if (pJpegData === null || pJpegSize === null) {
304
+                    if (pJpegData != null) {
305
+                        Module._free(pJpegData);
306
+                        pJpegData = null;
307
+                    }
308
+
309
+                    if (pJpegSize != null) {
310
+                        Module._free(pJpegSize);
311
+                        pJpegSize = null;
312
+                    }
313
+
314
+                    if (pDataYUV1 != null) {
315
+                        Module._free(pDataYUV1);
316
+                        pDataYUV1 = null;
317
+                    }
318
+                    return;
319
+                }
320
+
321
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
322
+
323
+                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
324
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
325
+                if (res !== PLAYM4_OK) {
326
+                    postMessage({ 'function': "GetJPEG", 'errorCode': res });
327
+                    if (pJpegData != null) {
328
+                        Module._free(pJpegData);
329
+                        pJpegData = null;
330
+                    }
331
+
332
+                    if (pJpegSize != null) {
333
+                        Module._free(pJpegSize);
334
+                        pJpegSize = null;
335
+                    }
336
+
337
+                    if (pDataYUV1 != null) {
338
+                        Module._free(pDataYUV1);
339
+                        pDataYUV1 = null;
340
+                    }
341
+                    return;
342
+                }
343
+
344
+                // 获取JPEG图片大小
345
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
346
+
347
+                // 获取JPEG图片数据
348
+                var aJpegData = new Uint8Array(nJpegSize);
349
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
350
+
351
+                postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
352
+
353
+                nJpegSize = null;
354
+                aJpegData = null;
355
+
356
+                if (pDataYUV1 != null) {
357
+                    Module._free(pDataYUV1);
358
+                    pDataYUV1 = null;
359
+                }
360
+                if (pJpegData != null) {
361
+                    Module._free(pJpegData);
362
+                    pJpegData = null;
363
+                }
364
+                if (pJpegSize != null) {
365
+                    Module._free(pJpegSize);
366
+                    pJpegSize = null;
367
+                }
368
+                break;
369
+
370
+            case "SetDecodeFrameType":
371
+                var nFrameType = eventData.data;
372
+                res = Module._SetDecodeFrameType(g_nPort, nFrameType);
373
+                if (res !== PLAYM4_OK) {
374
+                    postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
375
+                    return;
376
+                }
377
+                break;
378
+            case "CloseStream":
379
+                //stop
380
+                let resS = Module._Stop(g_nPort);
381
+                if (resS !== PLAYM4_OK) {
382
+                    postMessage({ 'function': "Stop", 'errorCode': res });
383
+                    return;
384
+                }
385
+                //closeStream
386
+                res = Module._CloseStream(g_nPort);
387
+                if (res !== PLAYM4_OK) {
388
+                    postMessage({ 'function': "CloseStream", 'errorCode': res });
389
+                    return;
390
+                }
391
+                //freePort
392
+                let resF = Module._FreePort(g_nPort);
393
+                if (resF !== PLAYM4_OK) {
394
+                    postMessage({ 'function': "FreePort", 'errorCode': res });
395
+                    return;
396
+                }
397
+                if (pInputData != null) {
398
+                    Module._free(pInputData);
399
+                    pInputData = null;
400
+                }
401
+                break;
402
+            case "PlaySound":
403
+                let resPS = Module._PlaySound(g_nPort);
404
+                if (resPS !== PLAYM4_OK) {
405
+                    console.log("PlaySound failed");
406
+                    return;
407
+                }
408
+                break;
409
+            case "StopSound":
410
+                let resSS = Module._StopSound();
411
+                if (resSS !== PLAYM4_OK) {
412
+                    console.log("StopSound failed");
413
+                    return;
414
+                }
415
+                break;
416
+            case "SetVolume":
417
+                let resSV = Module._SetVolume(g_nPort, eventData.volume);
418
+                if (resSV !== PLAYM4_OK) {
419
+                    console.log("Audio SetVolume failed");
420
+                    return;
421
+                }
422
+                break;
423
+            case "GetVolume":
424
+                let volume = Module._GetVolume();
425
+                if (volume > 0) {
426
+                    postMessage({ 'function': "GetVolume", 'volume': volume });
427
+                }
428
+                else {
429
+                    console.log("Audio GetVolume failed");
430
+                    return;
431
+                }
432
+                break;
433
+            case "OnlyPlaySound":
434
+                let resOPS = Module._OnlyPlaySound(g_nPort);
435
+                if (resOPS !== PLAYM4_OK) {
436
+                    console.log("OnlyPlaySound failed");
437
+                    return;
438
+                }
439
+                break;
440
+            case "Pause":
441
+                let resPa = Module._Pause(g_nPort, eventData.bPlay);
442
+                if (resPa !== PLAYM4_OK) {
443
+                    console.log("Pause failed");
444
+                    return;
445
+                }
446
+            case "PlayRate":
447
+                Module._SetPlayRate(g_nPort, eventData.playRate);
448
+                break;
449
+            case "SetIFrameDecInterval":
450
+                Module._SetIFrameDecInterval(g_nPort, eventData.data);
451
+                break;
452
+            case "SetLostFrameMode":
453
+                Module._SetLostFrameMode(g_nPort, eventData.data, 0);
454
+                break;
455
+            case "SetDemuxModel":
456
+                Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
457
+                break;
458
+            case "SkipErrorData":
459
+                Module._SkipErrorData(g_nPort, eventData.bSkip);
460
+                break;
461
+            case "SetDecodeERC":
462
+                Module._SetDecodeERC(g_nPort, eventData.nLevel);
463
+                break;
464
+            case "SetANRParam":
465
+                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
466
+                break;
467
+            case "SetResampleValue":
468
+                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
469
+                break;
470
+            case "GetLastError":
471
+                let errorCode = Module._GetLastError(g_nPort);
472
+                postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
473
+                break;
474
+            case "SetGlobalBaseTime":
475
+                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
476
+                break;
477
+            case "SetRunTimeInfoCB":
478
+                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
479
+                break;
480
+            default:
481
+                break;
482
+        }
483
+    };
484
+
485
+    function getOSDTime(oFrameInfo) {
486
+        var iYear = oFrameInfo.year;
487
+        var iMonth = oFrameInfo.month;
488
+        var iDay = oFrameInfo.day;
489
+        var iHour = oFrameInfo.hour;
490
+        var iMinute = oFrameInfo.minute;
491
+        var iSecond = oFrameInfo.second;
492
+
493
+        if (iMonth < 10) {
494
+            iMonth = "0" + iMonth;
495
+        }
496
+        if (iDay < 10) {
497
+            iDay = "0" + iDay;
498
+        }
499
+        if (iHour < 10) {
500
+            iHour = "0" + iHour;
501
+        }
502
+        if (iMinute < 10) {
503
+            iMinute = "0" + iMinute;
504
+        }
505
+        if (iSecond < 10) {
506
+            iSecond = "0" + iSecond;
507
+        }
508
+
509
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
510
+    }
511
+    // 获取帧数据
512
+    function getFrameData() {
513
+        // function getFrameData() {
514
+        // 获取帧数据
515
+        var res = Module._GetFrameData();
516
+        //var res = fun();
517
+        if (res === PLAYM4_OK) {
518
+            var oFrameInfo = Module._GetFrameInfo();
519
+            switch (oFrameInfo.frameType) {
520
+                case AUDIO_TYPE:
521
+                    var iSize = oFrameInfo.frameSize;
522
+                    if (0 === iSize) {
523
+                        return -1;
524
+                    }
525
+                    var pPCM = Module._GetFrameBuffer();
526
+                    // var audioBuf = new ArrayBuffer(iSize);
527
+                    var aPCMData = new Uint8Array(iSize);
528
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
529
+                    if (bWorkerPrintLog) {
530
+                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
531
+                    }
532
+                    postMessage({
533
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
534
+                        'frameInfo': oFrameInfo, 'errorCode': res
535
+                    }, [aPCMData.buffer]);
536
+
537
+                    oFrameInfo = null;
538
+                    pPCM = null;
539
+                    aPCMData = null;
540
+                    return PLAYM4_AUDIO_FRAME;
541
+
542
+                case VIDEO_TYPE:
543
+                    var szOSDTime = getOSDTime(oFrameInfo);
544
+
545
+                    var iWidth = oFrameInfo.width;
546
+                    var iHeight = oFrameInfo.height;
547
+
548
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
549
+                    if (0 === iYUVSize) {
550
+                        return -1;
551
+                    }
552
+
553
+                    var pYUV = Module._GetFrameBuffer();
554
+
555
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
556
+                    var aYUVData = new Uint8Array(iYUVSize);
557
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
558
+                    if (bWorkerPrintLog) {
559
+                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
560
+                    }
561
+
562
+                    postMessage({
563
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
564
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
565
+                    }, [aYUVData.buffer]);
566
+
567
+                    oFrameInfo = null;
568
+                    pYUV = null;
569
+                    aYUVData = null;
570
+                    return PLAYM4_VIDEO_FRAME;
571
+
572
+                case PRIVT_TYPE:
573
+                    postMessage({
574
+                        'function': "GetFrameData", 'type': "", 'data': null,
575
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
576
+                    });
577
+                    return PLAYM4_SYS_NOT_SUPPORT;
578
+
579
+                default:
580
+                    postMessage({
581
+                        'function': "GetFrameData", 'type': "", 'data': null,
582
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
583
+                    });
584
+                    return PLAYM4_SYS_NOT_SUPPORT;
585
+            }
586
+        }
587
+        else {
588
+            let errorCode = Module._GetLastError(g_nPort);
589
+            //解码失败返回裸数据
590
+            if (PLAYM4_DECODE_ERROR === errorCode) {
591
+                var rawInfo = Module._GetRawDataInfo();
592
+                var pRawData = Module._GetRawDataBuffer();
593
+                var aRawData = new Uint8Array(rawInfo.isize);
594
+                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
595
+                postMessage({
596
+                    'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
597
+                    'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
598
+                });
599
+                rawInfo = null;
600
+                pRawData = null;
601
+                aRawData = null;
602
+            }
603
+            //需要更多数据
604
+            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
605
+                postMessage({
606
+                    'function': "GetFrameData", 'type': "", 'data': null,
607
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
608
+                });
609
+            }
610
+            return errorCode;
611
+        }
612
+    }
613
+
614
+    // 开始计算时间
615
+    function startTime() {
616
+        return new Date().getTime();
617
+    }
618
+
619
+    // 结束计算时间
620
+    function endTime() {
621
+        return new Date().getTime();
622
+    }
623
+
624
+    // 字母字符串转byte数组
625
+    function stringToBytes(str) {
626
+        var ch, st, re = [];
627
+        for (var i = 0; i < str.length; i++) {
628
+            ch = str.charCodeAt(i);  // get char
629
+            st = [];                 // set up "stack"
630
+            do {
631
+                st.push(ch & 0xFF);  // push byte to stack
632
+                ch = ch >> 8;          // shift value down by 1 byte
633
+            }
634
+            while (ch);
635
+            // add stack contents to result
636
+            // done because chars have "wrong" endianness
637
+            re = re.concat(st.reverse());
638
+        }
639
+        // return an array of bytes
640
+        return re;
641
+    }
642
+})();

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl1simd/Decoder.js


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl2/Decoder.js


BIN
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl2/Decoder.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl2/Decoder.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl3/Decoder.js


BIN
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl3/Decoder.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/playctrl3/Decoder.worker.js


+ 62 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/player.html

@@ -0,0 +1,62 @@
1
+<html>
2
+  <head>
3
+	  <title>实时联动</title>
4
+	  <style>
5
+	      html, body {
6
+	          padding: 0px 0px;
7
+	          margin: 0px 0px;
8
+	  		wdith: 100%;
9
+	  		height: 100%;
10
+	      }
11
+	      #player {
12
+	          width: 100vw;
13
+	          height: calc(100vw * 5 / 8);
14
+	          background-color: black;
15
+	      }
16
+	  </style>
17
+	  <script src="./jquery-3.7.1.min.js"></script>
18
+	  <script src="./vconsole.min.js"></script>
19
+    <script src="./h5player.min.js"></script>
20
+  </head>
21
+  <body>
22
+	  <div>v2</div>
23
+    <div id="player"></div>
24
+	<div>
25
+	<input id="url" />
26
+	<input type="button" value="播放" onclick="play()"></input>
27
+	</div>
28
+	<div id="msg"></div>
29
+	<script>
30
+		$(function () {
31
+			$('#msg').text(window.location.href)
32
+			var v = new VConsole();
33
+			window.addEventListener('resize', () => {
34
+				 if(window.myPalyer) {
35
+					 window.myPalyer.JS_Resize()
36
+				 }    
37
+			})
38
+			window.myPalyer = new window.JSPlugin({
39
+			    szId: 'player',
40
+			    szBasePath: "./",
41
+			    iMaxSplit: 1,
42
+			    iCurrentSplit: 1,
43
+			    openDebug: true,
44
+			    oStyle: {
45
+			      borderSelect: '#000',
46
+			    }
47
+			  })
48
+		})
49
+		
50
+		  
51
+		function play() {
52
+			var url = document.getElementById('url').value
53
+			console.log(url)
54
+			window.myPalyer.JS_Play(url, { playURL: url, mode: 0 }, 0).then(
55
+            () => { document.getElementById('msg').innerText = 'success'; console.log('ok')},
56
+            e => { document.getElementById('msg').innerText = e; console.log(e) }
57
+          )
58
+		}
59
+	</script>
60
+    
61
+  </body>
62
+</html>

Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talk/AudioInterCom.js


BIN
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talk/AudioInterCom.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talkW/AudioInterCom.js


BIN
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talkW/AudioInterCom.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/talkW/AudioInterCom.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 6525 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/transform/libSystemTransform.js


BIN
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/transform/libSystemTransform.wasm


+ 120 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/transform/systemTransform-worker.js

@@ -0,0 +1,120 @@
1
+importScripts('libSystemTransform.js');
2
+    const RECORDRTP = 0;  //录制一份未经过转封装的码流原始数据,用于定位问题
3
+    let dataType = 1;
4
+    
5
+    // 转封装库回调函数
6
+    self.STCallBack = function (fileIndex,indexLen, data, dataLen)
7
+    {
8
+        //stFrameInfo的类型见DETAIL_FRAME_INFO
9
+		let stFrameInfo = Module._GetDetialFrameInfo();
10
+        let nIsMp4Index = stFrameInfo.nIsMp4Index;
11
+		//console.log("FrameType is " , stFrameInfo);	
12
+		//console.log("nIsMp4Index is " + nIsMp4Index);
13
+        //debugger
14
+        var pData = null;
15
+        pData = new Uint8Array(dataLen);
16
+        pData.set(Module.HEAPU8.subarray(data, data + dataLen));
17
+        if (dataType === 1) {
18
+            if (pData[0] == 0x49 && pData[1] == 0x4d && pData[2] == 0x4b && pData[3] == 0x48) {//码流头丢掉
19
+                return;
20
+            }
21
+            postMessage({type: "outputData", buf: pData, dType: 1});
22
+            dataType = 2;
23
+        } else {
24
+            if (nIsMp4Index) {
25
+                postMessage({type: "outputData", buf: pData, dType: 6}); //6:索引类型
26
+            } else {
27
+                postMessage({type: "outputData", buf: pData, dType: 2}); //2:码流
28
+            }
29
+        }
30
+
31
+        //stFrameInfo的类型见DETAIL_FRAME_INFO
32
+		//let stFrameInfo = Module._GetDetialFrameInfo();
33
+		//let stFrameType = stFrameInfo.nFrameType;
34
+		//let nFrameNum = stFrameInfo.nFrameNum;
35
+		//let nTimeStamp = stFrameInfo.nTimeStamp;
36
+        //let nIsMp4Index = stFrameInfo.nIsMp4Index;
37
+		
38
+		//console.log("FrameType is " + stFrameType);	
39
+		//console.log("nIsMp4Index is " + nIsMp4Index);	
40
+        
41
+    }
42
+
43
+    // self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };
44
+    // importScripts('SystemTransform.js');
45
+
46
+    self.Module['onRuntimeInitialized'] = function (){
47
+        postMessage({type: "loaded"});
48
+    }
49
+    onmessage = function (e) {
50
+        var data = e.data;
51
+        if ("create" === data.type) {
52
+            if (RECORDRTP) {
53
+                postMessage({type: "created"});
54
+                postMessage({type: "outputData", buf: data.buf, dType: 1});
55
+            } else {
56
+                var iHeadLen = data.len;
57
+                var pHead = Module._malloc(iHeadLen);
58
+    
59
+                self.writeArrayToMemory(new Uint8Array(data.buf), pHead);
60
+                var iTransType = data.packType;//目标格式
61
+                var iRet = Module._CreatHandle(pHead, iTransType, 4096);
62
+                if (iRet != 0) {
63
+                    console.log("_CreatHandle failed!" + iRet);
64
+                } else {
65
+                    iRet = Module._SysTransRegisterDataCallBack();			
66
+                    if(iRet != 0)
67
+                    {
68
+                        console.log("_SysTransRegisterDataCallBack Failed:" + iRet);
69
+                    }
70
+
71
+                    iRet = Module._SysTransStart(null, null);
72
+                    if(iRet != 0)
73
+                    {
74
+                        console.log("_SysTransStart Failed:" + iRet);
75
+                    }
76
+                    postMessage({type: "created"});
77
+                }
78
+            }
79
+
80
+        } else if ("inputData" === data.type) {
81
+            if (RECORDRTP) {
82
+                var aFileData = new Uint8Array(data.buf);  // 拷贝一份
83
+                var iBufferLen = aFileData.length;
84
+                var szBufferLen = iBufferLen.toString(16);
85
+                if (szBufferLen.length === 1) {
86
+                    szBufferLen = "000" + szBufferLen;
87
+                } else if (szBufferLen.length === 2) {
88
+                    szBufferLen = "00" + szBufferLen;
89
+                } else if (szBufferLen.length === 3) {
90
+                    szBufferLen = "0" + szBufferLen;
91
+                }
92
+                var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];
93
+                for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {
94
+                    aData[iIndex + 4] = aFileData[iIndex]
95
+                }
96
+                var dataUint8 = new Uint8Array(aData);
97
+                postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2});
98
+            } else {
99
+                let pInputDataBuf = Module._malloc(data.len);
100
+                var idataLen = data.len;
101
+                self.writeArrayToMemory(new Uint8Array(data.buf), pInputDataBuf);
102
+                    // 输入数据,每次最多2m
103
+                let pp = Module._SysTransInputData(0, pInputDataBuf, idataLen);
104
+                if(pp != 0) {
105
+                    //console.log("InputData Failed:" + pp);
106
+                }
107
+                Module._free(pInputDataBuf);
108
+            }
109
+        } else if ("release" === data.type) {
110
+            var iRet = Module._SysTransStop();
111
+            if (iRet != 0) {
112
+                console.log("_SysTransStop Failed:", iRet);
113
+            }
114
+            Module._SysTransRelease();
115
+            if (iRet != 0) {
116
+                console.log("_SysTransRelease Failed:", iRet);
117
+            }
118
+            close();
119
+        }
120
+    };

Datei-Diff unterdrückt, da er zu groß ist
+ 10 - 0
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/hybrid/html/vconsole.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/manifest.json


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/view.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/cache/wgt/__UNI__FB8F249/view.umd.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
queue-monitor/unpackage/dist/build/app-plus/app-config-service.js


Datei-Diff unterdrückt, da er zu groß ist
+ 4 - 4
queue-monitor/unpackage/dist/build/app-plus/app-service.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/dist/build/app-plus/app-view.js


Datei-Diff unterdrückt, da er zu groß ist
+ 313 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/h5player.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/jquery-3.7.1.min.js


+ 642 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1/DecodeWorker.js

@@ -0,0 +1,642 @@
1
+/**
2
+ * Created by wangweijie5 on 2016/12/5.
3
+ */
4
+(function (event) {
5
+    const AUDIO_TYPE = 0;	// 音频
6
+    const VIDEO_TYPE = 1;   // 视频
7
+    const PRIVT_TYPE = 2;  // 私有帧
8
+
9
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
10
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
11
+
12
+    const PLAYM4_OK = 1;
13
+    const PLAYM4_ORDER_ERROR = 2;
14
+    const PLAYM4_DECODE_ERROR = 44 	// 解码失败
15
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
16
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
17
+    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
18
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
19
+
20
+    importScripts('Decoder.js');
21
+    Module.addOnPostRun(function () {
22
+        postMessage({ 'function': "loaded" });
23
+    });
24
+
25
+    var iStreamMode = 0;  // 流模式
26
+
27
+    var bOpenMode = false;
28
+    var bOpenStream = false;
29
+
30
+    var funGetFrameData = null;
31
+    var funGetAudFrameData = null;
32
+
33
+    var bWorkerPrintLog = false;//worker层log开关
34
+
35
+    var g_nPort = -1;
36
+    var pInputData = null;
37
+    var inputBufferSize = 40960;
38
+
39
+    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
40
+        let port = nPort;
41
+        let user = pUser;
42
+        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
43
+        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
44
+        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
45
+        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
46
+        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
47
+        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
48
+        postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
49
+    }
50
+
51
+    onmessage = function (event) {
52
+        var eventData = event.data;
53
+        var res = 0;
54
+        switch (eventData.command) {
55
+            case "printLog":
56
+                let downloadFlag = eventData.data;
57
+                if (downloadFlag === true) {
58
+                    bWorkerPrintLog = true;
59
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
60
+                }
61
+                else {
62
+                    bWorkerPrintLog = false;
63
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
64
+                }
65
+
66
+                if (res !== PLAYM4_OK) {
67
+                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
68
+                    postMessage({ 'function': "printLog", 'errorCode': res });
69
+                }
70
+                break;
71
+            case "SetPlayPosition":
72
+                let nFrameNumOrTime = eventData.data;
73
+                let enPosType = eventData.type;
74
+                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
75
+                // if (res !== PLAYM4_OK)
76
+                // {
77
+                //     postMessage({'function': "SetPlayPosition", 'errorCode': res});
78
+                //     return;
79
+                // }
80
+                // //有没有buffer需要清除
81
+
82
+                break;
83
+            case "SetStreamOpenMode":
84
+                //获取端口号
85
+                g_nPort = Module._GetPort();
86
+                //设置流打开模式
87
+                iStreamMode = eventData.data;
88
+                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
89
+                if (res !== PLAYM4_OK) {
90
+                    postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
91
+                    return;
92
+                }
93
+                bOpenMode = true;
94
+                break;
95
+
96
+            case "OpenStream":
97
+                // 接收到的数据
98
+                var iHeadLen = eventData.dataSize;
99
+                var pHead = Module._malloc(iHeadLen + 4);
100
+                if (pHead === null) {
101
+                    return;
102
+                }
103
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
104
+                aHead.set(new Uint8Array(eventData.data));
105
+                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
106
+                postMessage({ 'function': "OpenStream", 'errorCode': res });
107
+                if (res !== PLAYM4_OK) {
108
+                    //释放内存
109
+                    Module._free(pHead);
110
+                    pHead = null;
111
+                    return;
112
+                }
113
+                bOpenStream = true;
114
+                break;
115
+            case "Play":
116
+                let resP = Module._Play(g_nPort);
117
+                if (resP !== PLAYM4_OK) {
118
+                    return;
119
+                }
120
+                break;
121
+            case "InputData":
122
+                // 接收到的数据
123
+                var iLen = eventData.dataSize;
124
+                if (iLen > 0) {
125
+                    if (pInputData == null || iLen > inputBufferSize) {
126
+                        if (pInputData != null) {
127
+                            Module._free(pInputData);
128
+                            pInputData = null;
129
+                        }
130
+                        if (iLen > inputBufferSize) {
131
+                            inputBufferSize = iLen;
132
+                        }
133
+
134
+                        pInputData = Module._malloc(inputBufferSize);
135
+                        if (pInputData === null) {
136
+                            return;
137
+                        }
138
+                    }
139
+
140
+                    var inputData = new Uint8Array(eventData.data);
141
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
142
+                    // aInputData.set(inputData);
143
+                    Module.writeArrayToMemory(inputData, pInputData);
144
+                    inputData = null;
145
+                    res = Module._InputData(g_nPort, pInputData, iLen);
146
+                    if (res !== PLAYM4_OK) {
147
+                        let errorCode = Module._GetLastError(g_nPort);
148
+                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
149
+                        postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
150
+                    }
151
+                    //Module._free(pInputData);
152
+                    //pInputData = null;
153
+                } else {
154
+                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
155
+                    if (sourceRemain == 0) {
156
+                        postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
157
+                        return;
158
+                    }
159
+                }
160
+
161
+                /////////////////////
162
+                // if (funGetFrameData === null) {
163
+                //     funGetFrameData = Module.cwrap('GetFrameData', 'number');
164
+                // }
165
+
166
+                while (bOpenMode && bOpenStream) {
167
+
168
+                    var ret = getFrameData();
169
+                    // 直到获取视频帧或数据不足为止
170
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret
171
+                    {
172
+                        break;
173
+                    }
174
+                }
175
+                break;
176
+
177
+            case "SetSecretKey":
178
+                var keyLen = eventData.nKeyLen;
179
+                var pKeyData = Module._malloc(keyLen);
180
+                if (pKeyData === null) {
181
+                    return;
182
+                }
183
+                var nKeySize = eventData.data.length
184
+                var bufData = stringToBytes(eventData.data);
185
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
186
+                let u8array = new Uint8Array(keyLen);
187
+                aKeyData.set(u8array, 0);
188
+                aKeyData.set(new Uint8Array(bufData));
189
+                aKeyData = null;
190
+                u8array = null;
191
+
192
+                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
193
+                if (res !== PLAYM4_OK) {
194
+                    postMessage({ 'function': "SetSecretKey", 'errorCode': res });
195
+                    Module._free(pKeyData);
196
+                    pKeyData = null;
197
+                    return;
198
+                }
199
+
200
+                Module._free(pKeyData);
201
+                pKeyData = null;
202
+                break;
203
+
204
+            case "GetBMP":
205
+                var nBMPWidth = eventData.width;
206
+                var nBMPHeight = eventData.height;
207
+                var pYUVData = eventData.data;
208
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
209
+                var oJpegCropRect = {
210
+                    left: eventData.left,
211
+                    top: eventData.top,
212
+                    right: eventData.right,
213
+                    bottom: eventData.bottom
214
+                };
215
+
216
+                var pDataYUV = Module._malloc(nYUVSize);
217
+                if (pDataYUV === null) {
218
+                    return;
219
+                }
220
+
221
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
222
+
223
+                // 分配BMP空间
224
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
225
+                var pBmpData = Module._malloc(nBmpSize);
226
+                var pBmpSize = Module._malloc(4);
227
+                if (pBmpData === null || pBmpSize === null) {
228
+                    Module._free(pDataYUV);
229
+                    pDataYUV = null;
230
+
231
+                    if (pBmpData != null) {
232
+                        Module._free(pBmpData);
233
+                        pBmpData = null;
234
+                    }
235
+
236
+                    if (pBmpSize != null) {
237
+                        Module._free(pBmpSize);
238
+                        pBmpSize = null;
239
+                    }
240
+                    return;
241
+                }
242
+
243
+                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
244
+                Module.setValue(pBmpSize, nBmpSize, "i32");
245
+                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
246
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
247
+                if (res !== PLAYM4_OK) {
248
+                    postMessage({ 'function': "GetBMP", 'errorCode': res });
249
+                    Module._free(pDataYUV);
250
+                    pDataYUV = null;
251
+                    Module._free(pBmpData);
252
+                    pBmpData = null;
253
+                    Module._free(pBmpSize);
254
+                    pBmpSize = null;
255
+                    return;
256
+                }
257
+
258
+                // 获取BMP图片大小
259
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
260
+
261
+                // 获取BMP图片数据
262
+                var aBmpData = new Uint8Array(nBmpDataSize);
263
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
264
+
265
+                postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
266
+                aBmpData = null;
267
+                if (pDataYUV != null) {
268
+                    Module._free(pDataYUV);
269
+                    pDataYUV = null;
270
+                }
271
+                if (pBmpData != null) {
272
+                    Module._free(pBmpData);
273
+                    pBmpData = null;
274
+                }
275
+                if (pBmpSize != null) {
276
+                    Module._free(pBmpSize);
277
+                    pBmpSize = null;
278
+                }
279
+                break;
280
+
281
+            case "GetJPEG":
282
+                var nJpegWidth = eventData.width;
283
+                var nJpegHeight = eventData.height;
284
+                var pYUVData1 = eventData.data;
285
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
286
+                var oJpegCropRect = {
287
+                    left: eventData.left,
288
+                    top: eventData.top,
289
+                    right: eventData.right,
290
+                    bottom: eventData.bottom
291
+                };
292
+
293
+                var pDataYUV1 = Module._malloc(nYUVSize1);
294
+                if (pDataYUV1 === null) {
295
+                    return;
296
+                }
297
+
298
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
299
+
300
+                // 分配JPEG空间
301
+                var pJpegData = Module._malloc(nYUVSize1);
302
+                var pJpegSize = Module._malloc(4);
303
+                if (pJpegData === null || pJpegSize === null) {
304
+                    if (pJpegData != null) {
305
+                        Module._free(pJpegData);
306
+                        pJpegData = null;
307
+                    }
308
+
309
+                    if (pJpegSize != null) {
310
+                        Module._free(pJpegSize);
311
+                        pJpegSize = null;
312
+                    }
313
+
314
+                    if (pDataYUV1 != null) {
315
+                        Module._free(pDataYUV1);
316
+                        pDataYUV1 = null;
317
+                    }
318
+                    return;
319
+                }
320
+
321
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
322
+
323
+                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
324
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
325
+                if (res !== PLAYM4_OK) {
326
+                    postMessage({ 'function': "GetJPEG", 'errorCode': res });
327
+                    if (pJpegData != null) {
328
+                        Module._free(pJpegData);
329
+                        pJpegData = null;
330
+                    }
331
+
332
+                    if (pJpegSize != null) {
333
+                        Module._free(pJpegSize);
334
+                        pJpegSize = null;
335
+                    }
336
+
337
+                    if (pDataYUV1 != null) {
338
+                        Module._free(pDataYUV1);
339
+                        pDataYUV1 = null;
340
+                    }
341
+                    return;
342
+                }
343
+
344
+                // 获取JPEG图片大小
345
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
346
+
347
+                // 获取JPEG图片数据
348
+                var aJpegData = new Uint8Array(nJpegSize);
349
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
350
+
351
+                postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
352
+
353
+                nJpegSize = null;
354
+                aJpegData = null;
355
+
356
+                if (pDataYUV1 != null) {
357
+                    Module._free(pDataYUV1);
358
+                    pDataYUV1 = null;
359
+                }
360
+                if (pJpegData != null) {
361
+                    Module._free(pJpegData);
362
+                    pJpegData = null;
363
+                }
364
+                if (pJpegSize != null) {
365
+                    Module._free(pJpegSize);
366
+                    pJpegSize = null;
367
+                }
368
+                break;
369
+
370
+            case "SetDecodeFrameType":
371
+                var nFrameType = eventData.data;
372
+                res = Module._SetDecodeFrameType(g_nPort, nFrameType);
373
+                if (res !== PLAYM4_OK) {
374
+                    postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
375
+                    return;
376
+                }
377
+                break;
378
+            case "CloseStream":
379
+                //stop
380
+                let resS = Module._Stop(g_nPort);
381
+                if (resS !== PLAYM4_OK) {
382
+                    postMessage({ 'function': "Stop", 'errorCode': res });
383
+                    return;
384
+                }
385
+                //closeStream
386
+                res = Module._CloseStream(g_nPort);
387
+                if (res !== PLAYM4_OK) {
388
+                    postMessage({ 'function': "CloseStream", 'errorCode': res });
389
+                    return;
390
+                }
391
+                //freePort
392
+                let resF = Module._FreePort(g_nPort);
393
+                if (resF !== PLAYM4_OK) {
394
+                    postMessage({ 'function': "FreePort", 'errorCode': res });
395
+                    return;
396
+                }
397
+                if (pInputData != null) {
398
+                    Module._free(pInputData);
399
+                    pInputData = null;
400
+                }
401
+                break;
402
+            case "PlaySound":
403
+                let resPS = Module._PlaySound(g_nPort);
404
+                if (resPS !== PLAYM4_OK) {
405
+                    console.log("PlaySound failed");
406
+                    return;
407
+                }
408
+                break;
409
+            case "StopSound":
410
+                let resSS = Module._StopSound();
411
+                if (resSS !== PLAYM4_OK) {
412
+                    console.log("StopSound failed");
413
+                    return;
414
+                }
415
+                break;
416
+            case "SetVolume":
417
+                let resSV = Module._SetVolume(g_nPort, eventData.volume);
418
+                if (resSV !== PLAYM4_OK) {
419
+                    console.log("Audio SetVolume failed");
420
+                    return;
421
+                }
422
+                break;
423
+            case "GetVolume":
424
+                let volume = Module._GetVolume();
425
+                if (volume > 0) {
426
+                    postMessage({ 'function': "GetVolume", 'volume': volume });
427
+                }
428
+                else {
429
+                    console.log("Audio GetVolume failed");
430
+                    return;
431
+                }
432
+                break;
433
+            case "OnlyPlaySound":
434
+                let resOPS = Module._OnlyPlaySound(g_nPort);
435
+                if (resOPS !== PLAYM4_OK) {
436
+                    console.log("OnlyPlaySound failed");
437
+                    return;
438
+                }
439
+                break;
440
+            case "Pause":
441
+                let resPa = Module._Pause(g_nPort, eventData.bPlay);
442
+                if (resPa !== PLAYM4_OK) {
443
+                    console.log("Pause failed");
444
+                    return;
445
+                }
446
+            case "PlayRate":
447
+                Module._SetPlayRate(g_nPort, eventData.playRate);
448
+                break;
449
+            case "SetIFrameDecInterval":
450
+                Module._SetIFrameDecInterval(g_nPort, eventData.data);
451
+                break;
452
+            case "SetLostFrameMode":
453
+                Module._SetLostFrameMode(g_nPort, eventData.data, 0);
454
+                break;
455
+            case "SetDemuxModel":
456
+                Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
457
+                break;
458
+            case "SkipErrorData":
459
+                Module._SkipErrorData(g_nPort, eventData.bSkip);
460
+                break;
461
+            case "SetDecodeERC":
462
+                Module._SetDecodeERC(g_nPort, eventData.nLevel);
463
+                break;
464
+            case "SetANRParam":
465
+                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
466
+                break;
467
+            case "SetResampleValue":
468
+                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
469
+                break;
470
+            case "GetLastError":
471
+                let errorCode = Module._GetLastError(g_nPort);
472
+                postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
473
+                break;
474
+            case "SetGlobalBaseTime":
475
+                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
476
+                break;
477
+            case "SetRunTimeInfoCB":
478
+                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
479
+                break;
480
+            default:
481
+                break;
482
+        }
483
+    };
484
+
485
+    function getOSDTime(oFrameInfo) {
486
+        var iYear = oFrameInfo.year;
487
+        var iMonth = oFrameInfo.month;
488
+        var iDay = oFrameInfo.day;
489
+        var iHour = oFrameInfo.hour;
490
+        var iMinute = oFrameInfo.minute;
491
+        var iSecond = oFrameInfo.second;
492
+
493
+        if (iMonth < 10) {
494
+            iMonth = "0" + iMonth;
495
+        }
496
+        if (iDay < 10) {
497
+            iDay = "0" + iDay;
498
+        }
499
+        if (iHour < 10) {
500
+            iHour = "0" + iHour;
501
+        }
502
+        if (iMinute < 10) {
503
+            iMinute = "0" + iMinute;
504
+        }
505
+        if (iSecond < 10) {
506
+            iSecond = "0" + iSecond;
507
+        }
508
+
509
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
510
+    }
511
+    // 获取帧数据
512
+    function getFrameData() {
513
+        // function getFrameData() {
514
+        // 获取帧数据
515
+        var res = Module._GetFrameData();
516
+        //var res = fun();
517
+        if (res === PLAYM4_OK) {
518
+            var oFrameInfo = Module._GetFrameInfo();
519
+            switch (oFrameInfo.frameType) {
520
+                case AUDIO_TYPE:
521
+                    var iSize = oFrameInfo.frameSize;
522
+                    if (0 === iSize) {
523
+                        return -1;
524
+                    }
525
+                    var pPCM = Module._GetFrameBuffer();
526
+                    // var audioBuf = new ArrayBuffer(iSize);
527
+                    var aPCMData = new Uint8Array(iSize);
528
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
529
+                    if (bWorkerPrintLog) {
530
+                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
531
+                    }
532
+                    postMessage({
533
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
534
+                        'frameInfo': oFrameInfo, 'errorCode': res
535
+                    }, [aPCMData.buffer]);
536
+
537
+                    oFrameInfo = null;
538
+                    pPCM = null;
539
+                    aPCMData = null;
540
+                    return PLAYM4_AUDIO_FRAME;
541
+
542
+                case VIDEO_TYPE:
543
+                    var szOSDTime = getOSDTime(oFrameInfo);
544
+
545
+                    var iWidth = oFrameInfo.width;
546
+                    var iHeight = oFrameInfo.height;
547
+
548
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
549
+                    if (0 === iYUVSize) {
550
+                        return -1;
551
+                    }
552
+
553
+                    var pYUV = Module._GetFrameBuffer();
554
+
555
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
556
+                    var aYUVData = new Uint8Array(iYUVSize);
557
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
558
+                    if (bWorkerPrintLog) {
559
+                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
560
+                    }
561
+
562
+                    postMessage({
563
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
564
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
565
+                    }, [aYUVData.buffer]);
566
+
567
+                    oFrameInfo = null;
568
+                    pYUV = null;
569
+                    aYUVData = null;
570
+                    return PLAYM4_VIDEO_FRAME;
571
+
572
+                case PRIVT_TYPE:
573
+                    postMessage({
574
+                        'function': "GetFrameData", 'type': "", 'data': null,
575
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
576
+                    });
577
+                    return PLAYM4_SYS_NOT_SUPPORT;
578
+
579
+                default:
580
+                    postMessage({
581
+                        'function': "GetFrameData", 'type': "", 'data': null,
582
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
583
+                    });
584
+                    return PLAYM4_SYS_NOT_SUPPORT;
585
+            }
586
+        }
587
+        else {
588
+            let errorCode = Module._GetLastError(g_nPort);
589
+            //解码失败返回裸数据
590
+            if (PLAYM4_DECODE_ERROR === errorCode) {
591
+                var rawInfo = Module._GetRawDataInfo();
592
+                var pRawData = Module._GetRawDataBuffer();
593
+                var aRawData = new Uint8Array(rawInfo.isize);
594
+                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
595
+                postMessage({
596
+                    'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
597
+                    'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
598
+                });
599
+                rawInfo = null;
600
+                pRawData = null;
601
+                aRawData = null;
602
+            }
603
+            //需要更多数据
604
+            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
605
+                postMessage({
606
+                    'function': "GetFrameData", 'type': "", 'data': null,
607
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
608
+                });
609
+            }
610
+            return errorCode;
611
+        }
612
+    }
613
+
614
+    // 开始计算时间
615
+    function startTime() {
616
+        return new Date().getTime();
617
+    }
618
+
619
+    // 结束计算时间
620
+    function endTime() {
621
+        return new Date().getTime();
622
+    }
623
+
624
+    // 字母字符串转byte数组
625
+    function stringToBytes(str) {
626
+        var ch, st, re = [];
627
+        for (var i = 0; i < str.length; i++) {
628
+            ch = str.charCodeAt(i);  // get char
629
+            st = [];                 // set up "stack"
630
+            do {
631
+                st.push(ch & 0xFF);  // push byte to stack
632
+                ch = ch >> 8;          // shift value down by 1 byte
633
+            }
634
+            while (ch);
635
+            // add stack contents to result
636
+            // done because chars have "wrong" endianness
637
+            re = re.concat(st.reverse());
638
+        }
639
+        // return an array of bytes
640
+        return re;
641
+    }
642
+})();

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1/Decoder.js


+ 642 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1simd/DecodeWorker.js

@@ -0,0 +1,642 @@
1
+/**
2
+ * Created by wangweijie5 on 2016/12/5.
3
+ */
4
+(function (event) {
5
+    const AUDIO_TYPE = 0;	// 音频
6
+    const VIDEO_TYPE = 1;   // 视频
7
+    const PRIVT_TYPE = 2;  // 私有帧
8
+
9
+    const PLAYM4_AUDIO_FRAME = 100; // 音频帧
10
+    const PLAYM4_VIDEO_FRAME = 101; // 视频帧
11
+
12
+    const PLAYM4_OK = 1;
13
+    const PLAYM4_ORDER_ERROR = 2;
14
+    const PLAYM4_DECODE_ERROR = 44 	// 解码失败
15
+    const PLAYM4_NOT_KEYFRAME = 48; 	// 非关键帧
16
+    const PLAYM4_NEED_MORE_DATA = 31;   // 需要更多数据才能解析
17
+    const PLAYM4_NEED_NEET_LOOP = 35; //丢帧需要下个循环
18
+    const PLAYM4_SYS_NOT_SUPPORT = 16; 	// 不支持
19
+
20
+    importScripts('Decoder.js');
21
+    Module.addOnPostRun(function () {
22
+        postMessage({ 'function': "loaded" });
23
+    });
24
+
25
+    var iStreamMode = 0;  // 流模式
26
+
27
+    var bOpenMode = false;
28
+    var bOpenStream = false;
29
+
30
+    var funGetFrameData = null;
31
+    var funGetAudFrameData = null;
32
+
33
+    var bWorkerPrintLog = false;//worker层log开关
34
+
35
+    var g_nPort = -1;
36
+    var pInputData = null;
37
+    var inputBufferSize = 40960;
38
+
39
+    self.JSPlayM4_RunTimeInfoCallBack = function (nPort, pstRunTimeInfo, pUser) {
40
+        let port = nPort;
41
+        let user = pUser;
42
+        let nRunTimeModule = Module.HEAP32[pstRunTimeInfo >> 2];
43
+        let nStrVersion = Module.HEAP32[pstRunTimeInfo + 4 >> 2];
44
+        let nFrameTimeStamp = Module.HEAP32[pstRunTimeInfo + 8 >> 2];
45
+        let nFrameNum = Module.HEAP32[pstRunTimeInfo + 12 >> 2];
46
+        let nErrorCode = Module.HEAP32[pstRunTimeInfo + 16 >> 2];
47
+        // console.log("nRunTimeModule:"+nRunTimeModule+",nFrameNum:"+nFrameNum+",nErrorCode:"+nErrorCode);
48
+        postMessage({ 'function': "RunTimeInfoCallBack", 'nRunTimeModule': nRunTimeModule, 'nStrVersion': nStrVersion, 'nFrameTimeStamp': nFrameTimeStamp, 'nFrameNum': nFrameNum, 'nErrorCode': nErrorCode });
49
+    }
50
+
51
+    onmessage = function (event) {
52
+        var eventData = event.data;
53
+        var res = 0;
54
+        switch (eventData.command) {
55
+            case "printLog":
56
+                let downloadFlag = eventData.data;
57
+                if (downloadFlag === true) {
58
+                    bWorkerPrintLog = true;
59
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
60
+                }
61
+                else {
62
+                    bWorkerPrintLog = false;
63
+                    res = Module._SetPrintLogFlag(g_nPort, downloadFlag);
64
+                }
65
+
66
+                if (res !== PLAYM4_OK) {
67
+                    console.log("DecodeWorker.js: PlayerSDK print log failed,res" + res);
68
+                    postMessage({ 'function': "printLog", 'errorCode': res });
69
+                }
70
+                break;
71
+            case "SetPlayPosition":
72
+                let nFrameNumOrTime = eventData.data;
73
+                let enPosType = eventData.type;
74
+                // res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
75
+                // if (res !== PLAYM4_OK)
76
+                // {
77
+                //     postMessage({'function': "SetPlayPosition", 'errorCode': res});
78
+                //     return;
79
+                // }
80
+                // //有没有buffer需要清除
81
+
82
+                break;
83
+            case "SetStreamOpenMode":
84
+                //获取端口号
85
+                g_nPort = Module._GetPort();
86
+                //设置流打开模式
87
+                iStreamMode = eventData.data;
88
+                res = Module._SetStreamOpenMode(g_nPort, iStreamMode);
89
+                if (res !== PLAYM4_OK) {
90
+                    postMessage({ 'function': "SetStreamOpenMode", 'errorCode': res });
91
+                    return;
92
+                }
93
+                bOpenMode = true;
94
+                break;
95
+
96
+            case "OpenStream":
97
+                // 接收到的数据
98
+                var iHeadLen = eventData.dataSize;
99
+                var pHead = Module._malloc(iHeadLen + 4);
100
+                if (pHead === null) {
101
+                    return;
102
+                }
103
+                var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
104
+                aHead.set(new Uint8Array(eventData.data));
105
+                res = Module._OpenStream(g_nPort, pHead, iHeadLen, eventData.bufPoolSize);
106
+                postMessage({ 'function': "OpenStream", 'errorCode': res });
107
+                if (res !== PLAYM4_OK) {
108
+                    //释放内存
109
+                    Module._free(pHead);
110
+                    pHead = null;
111
+                    return;
112
+                }
113
+                bOpenStream = true;
114
+                break;
115
+            case "Play":
116
+                let resP = Module._Play(g_nPort);
117
+                if (resP !== PLAYM4_OK) {
118
+                    return;
119
+                }
120
+                break;
121
+            case "InputData":
122
+                // 接收到的数据
123
+                var iLen = eventData.dataSize;
124
+                if (iLen > 0) {
125
+                    if (pInputData == null || iLen > inputBufferSize) {
126
+                        if (pInputData != null) {
127
+                            Module._free(pInputData);
128
+                            pInputData = null;
129
+                        }
130
+                        if (iLen > inputBufferSize) {
131
+                            inputBufferSize = iLen;
132
+                        }
133
+
134
+                        pInputData = Module._malloc(inputBufferSize);
135
+                        if (pInputData === null) {
136
+                            return;
137
+                        }
138
+                    }
139
+
140
+                    var inputData = new Uint8Array(eventData.data);
141
+                    // var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
142
+                    // aInputData.set(inputData);
143
+                    Module.writeArrayToMemory(inputData, pInputData);
144
+                    inputData = null;
145
+                    res = Module._InputData(g_nPort, pInputData, iLen);
146
+                    if (res !== PLAYM4_OK) {
147
+                        let errorCode = Module._GetLastError(g_nPort);
148
+                        let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
149
+                        postMessage({ 'function': "InputData", 'errorCode': errorCode, "sourceRemain": sourceRemain });
150
+                    }
151
+                    //Module._free(pInputData);
152
+                    //pInputData = null;
153
+                } else {
154
+                    let sourceRemain = Module._GetSourceBufferRemain(g_nPort);
155
+                    if (sourceRemain == 0) {
156
+                        postMessage({ 'function': "InputData", 'errorCode': PLAYM4_NEED_MORE_DATA });
157
+                        return;
158
+                    }
159
+                }
160
+
161
+                /////////////////////
162
+                // if (funGetFrameData === null) {
163
+                //     funGetFrameData = Module.cwrap('GetFrameData', 'number');
164
+                // }
165
+
166
+                while (bOpenMode && bOpenStream) {
167
+
168
+                    var ret = getFrameData();
169
+                    // 直到获取视频帧或数据不足为止
170
+                    if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret || PLAYM4_ORDER_ERROR === ret)//PLAYM4_VIDEO_FRAME === ret ||  || PLAYM4_NEED_NEET_LOOP === ret
171
+                    {
172
+                        break;
173
+                    }
174
+                }
175
+                break;
176
+
177
+            case "SetSecretKey":
178
+                var keyLen = eventData.nKeyLen;
179
+                var pKeyData = Module._malloc(keyLen);
180
+                if (pKeyData === null) {
181
+                    return;
182
+                }
183
+                var nKeySize = eventData.data.length
184
+                var bufData = stringToBytes(eventData.data);
185
+                var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
186
+                let u8array = new Uint8Array(keyLen);
187
+                aKeyData.set(u8array, 0);
188
+                aKeyData.set(new Uint8Array(bufData));
189
+                aKeyData = null;
190
+                u8array = null;
191
+
192
+                res = Module._SetSecretKey(g_nPort, eventData.nKeyType, pKeyData, keyLen);//, nKeySize
193
+                if (res !== PLAYM4_OK) {
194
+                    postMessage({ 'function': "SetSecretKey", 'errorCode': res });
195
+                    Module._free(pKeyData);
196
+                    pKeyData = null;
197
+                    return;
198
+                }
199
+
200
+                Module._free(pKeyData);
201
+                pKeyData = null;
202
+                break;
203
+
204
+            case "GetBMP":
205
+                var nBMPWidth = eventData.width;
206
+                var nBMPHeight = eventData.height;
207
+                var pYUVData = eventData.data;
208
+                var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
209
+                var oJpegCropRect = {
210
+                    left: eventData.left,
211
+                    top: eventData.top,
212
+                    right: eventData.right,
213
+                    bottom: eventData.bottom
214
+                };
215
+
216
+                var pDataYUV = Module._malloc(nYUVSize);
217
+                if (pDataYUV === null) {
218
+                    return;
219
+                }
220
+
221
+                Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
222
+
223
+                // 分配BMP空间
224
+                var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
225
+                var pBmpData = Module._malloc(nBmpSize);
226
+                var pBmpSize = Module._malloc(4);
227
+                if (pBmpData === null || pBmpSize === null) {
228
+                    Module._free(pDataYUV);
229
+                    pDataYUV = null;
230
+
231
+                    if (pBmpData != null) {
232
+                        Module._free(pBmpData);
233
+                        pBmpData = null;
234
+                    }
235
+
236
+                    if (pBmpSize != null) {
237
+                        Module._free(pBmpSize);
238
+                        pBmpSize = null;
239
+                    }
240
+                    return;
241
+                }
242
+
243
+                //Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
244
+                Module.setValue(pBmpSize, nBmpSize, "i32");
245
+                res = Module._GetBMP(g_nPort, pDataYUV, nYUVSize, pBmpData, pBmpSize,
246
+                    oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
247
+                if (res !== PLAYM4_OK) {
248
+                    postMessage({ 'function': "GetBMP", 'errorCode': res });
249
+                    Module._free(pDataYUV);
250
+                    pDataYUV = null;
251
+                    Module._free(pBmpData);
252
+                    pBmpData = null;
253
+                    Module._free(pBmpSize);
254
+                    pBmpSize = null;
255
+                    return;
256
+                }
257
+
258
+                // 获取BMP图片大小
259
+                var nBmpDataSize = Module.getValue(pBmpSize, "i32");
260
+
261
+                // 获取BMP图片数据
262
+                var aBmpData = new Uint8Array(nBmpDataSize);
263
+                aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
264
+
265
+                postMessage({ 'function': "GetBMP", 'data': aBmpData, 'errorCode': res }, [aBmpData.buffer]);
266
+                aBmpData = null;
267
+                if (pDataYUV != null) {
268
+                    Module._free(pDataYUV);
269
+                    pDataYUV = null;
270
+                }
271
+                if (pBmpData != null) {
272
+                    Module._free(pBmpData);
273
+                    pBmpData = null;
274
+                }
275
+                if (pBmpSize != null) {
276
+                    Module._free(pBmpSize);
277
+                    pBmpSize = null;
278
+                }
279
+                break;
280
+
281
+            case "GetJPEG":
282
+                var nJpegWidth = eventData.width;
283
+                var nJpegHeight = eventData.height;
284
+                var pYUVData1 = eventData.data;
285
+                var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
286
+                var oJpegCropRect = {
287
+                    left: eventData.left,
288
+                    top: eventData.top,
289
+                    right: eventData.right,
290
+                    bottom: eventData.bottom
291
+                };
292
+
293
+                var pDataYUV1 = Module._malloc(nYUVSize1);
294
+                if (pDataYUV1 === null) {
295
+                    return;
296
+                }
297
+
298
+                Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
299
+
300
+                // 分配JPEG空间
301
+                var pJpegData = Module._malloc(nYUVSize1);
302
+                var pJpegSize = Module._malloc(4);
303
+                if (pJpegData === null || pJpegSize === null) {
304
+                    if (pJpegData != null) {
305
+                        Module._free(pJpegData);
306
+                        pJpegData = null;
307
+                    }
308
+
309
+                    if (pJpegSize != null) {
310
+                        Module._free(pJpegSize);
311
+                        pJpegSize = null;
312
+                    }
313
+
314
+                    if (pDataYUV1 != null) {
315
+                        Module._free(pDataYUV1);
316
+                        pDataYUV1 = null;
317
+                    }
318
+                    return;
319
+                }
320
+
321
+                Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32");    // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
322
+
323
+                res = Module._GetJPEG(g_nPort, pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
324
+                    oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
325
+                if (res !== PLAYM4_OK) {
326
+                    postMessage({ 'function': "GetJPEG", 'errorCode': res });
327
+                    if (pJpegData != null) {
328
+                        Module._free(pJpegData);
329
+                        pJpegData = null;
330
+                    }
331
+
332
+                    if (pJpegSize != null) {
333
+                        Module._free(pJpegSize);
334
+                        pJpegSize = null;
335
+                    }
336
+
337
+                    if (pDataYUV1 != null) {
338
+                        Module._free(pDataYUV1);
339
+                        pDataYUV1 = null;
340
+                    }
341
+                    return;
342
+                }
343
+
344
+                // 获取JPEG图片大小
345
+                var nJpegSize = Module.getValue(pJpegSize, "i32");
346
+
347
+                // 获取JPEG图片数据
348
+                var aJpegData = new Uint8Array(nJpegSize);
349
+                aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
350
+
351
+                postMessage({ 'function': "GetJPEG", 'data': aJpegData, 'errorCode': res }, [aJpegData.buffer]);
352
+
353
+                nJpegSize = null;
354
+                aJpegData = null;
355
+
356
+                if (pDataYUV1 != null) {
357
+                    Module._free(pDataYUV1);
358
+                    pDataYUV1 = null;
359
+                }
360
+                if (pJpegData != null) {
361
+                    Module._free(pJpegData);
362
+                    pJpegData = null;
363
+                }
364
+                if (pJpegSize != null) {
365
+                    Module._free(pJpegSize);
366
+                    pJpegSize = null;
367
+                }
368
+                break;
369
+
370
+            case "SetDecodeFrameType":
371
+                var nFrameType = eventData.data;
372
+                res = Module._SetDecodeFrameType(g_nPort, nFrameType);
373
+                if (res !== PLAYM4_OK) {
374
+                    postMessage({ 'function': "SetDecodeFrameType", 'errorCode': res });
375
+                    return;
376
+                }
377
+                break;
378
+            case "CloseStream":
379
+                //stop
380
+                let resS = Module._Stop(g_nPort);
381
+                if (resS !== PLAYM4_OK) {
382
+                    postMessage({ 'function': "Stop", 'errorCode': res });
383
+                    return;
384
+                }
385
+                //closeStream
386
+                res = Module._CloseStream(g_nPort);
387
+                if (res !== PLAYM4_OK) {
388
+                    postMessage({ 'function': "CloseStream", 'errorCode': res });
389
+                    return;
390
+                }
391
+                //freePort
392
+                let resF = Module._FreePort(g_nPort);
393
+                if (resF !== PLAYM4_OK) {
394
+                    postMessage({ 'function': "FreePort", 'errorCode': res });
395
+                    return;
396
+                }
397
+                if (pInputData != null) {
398
+                    Module._free(pInputData);
399
+                    pInputData = null;
400
+                }
401
+                break;
402
+            case "PlaySound":
403
+                let resPS = Module._PlaySound(g_nPort);
404
+                if (resPS !== PLAYM4_OK) {
405
+                    console.log("PlaySound failed");
406
+                    return;
407
+                }
408
+                break;
409
+            case "StopSound":
410
+                let resSS = Module._StopSound();
411
+                if (resSS !== PLAYM4_OK) {
412
+                    console.log("StopSound failed");
413
+                    return;
414
+                }
415
+                break;
416
+            case "SetVolume":
417
+                let resSV = Module._SetVolume(g_nPort, eventData.volume);
418
+                if (resSV !== PLAYM4_OK) {
419
+                    console.log("Audio SetVolume failed");
420
+                    return;
421
+                }
422
+                break;
423
+            case "GetVolume":
424
+                let volume = Module._GetVolume();
425
+                if (volume > 0) {
426
+                    postMessage({ 'function': "GetVolume", 'volume': volume });
427
+                }
428
+                else {
429
+                    console.log("Audio GetVolume failed");
430
+                    return;
431
+                }
432
+                break;
433
+            case "OnlyPlaySound":
434
+                let resOPS = Module._OnlyPlaySound(g_nPort);
435
+                if (resOPS !== PLAYM4_OK) {
436
+                    console.log("OnlyPlaySound failed");
437
+                    return;
438
+                }
439
+                break;
440
+            case "Pause":
441
+                let resPa = Module._Pause(g_nPort, eventData.bPlay);
442
+                if (resPa !== PLAYM4_OK) {
443
+                    console.log("Pause failed");
444
+                    return;
445
+                }
446
+            case "PlayRate":
447
+                Module._SetPlayRate(g_nPort, eventData.playRate);
448
+                break;
449
+            case "SetIFrameDecInterval":
450
+                Module._SetIFrameDecInterval(g_nPort, eventData.data);
451
+                break;
452
+            case "SetLostFrameMode":
453
+                Module._SetLostFrameMode(g_nPort, eventData.data, 0);
454
+                break;
455
+            case "SetDemuxModel":
456
+                Module._SetDemuxModel(g_nPort, eventData.nIdemuxType, eventData.bTrue);
457
+                break;
458
+            case "SkipErrorData":
459
+                Module._SkipErrorData(g_nPort, eventData.bSkip);
460
+                break;
461
+            case "SetDecodeERC":
462
+                Module._SetDecodeERC(g_nPort, eventData.nLevel);
463
+                break;
464
+            case "SetANRParam":
465
+                Module._SetANRParam(g_nPort, eventData.nEnable, eventData.nANRLevel);
466
+                break;
467
+            case "SetResampleValue":
468
+                Module._SetResampleValue(g_nPort, eventData.nEnable, eventData.resampleValue);
469
+                break;
470
+            case "GetLastError":
471
+                let errorCode = Module._GetLastError(g_nPort);
472
+                postMessage({ 'function': "GetLastError", 'errorCode': errorCode });
473
+                break;
474
+            case "SetGlobalBaseTime":
475
+                Module._SetGlobalBaseTime(g_nPort, eventData.year, eventData.month, eventData.day, eventData.hour, eventData.min, eventData.sec, eventData.ms);
476
+                break;
477
+            case "SetRunTimeInfoCB":
478
+                Module._SetRunTimeInfoCallBackEx(g_nPort, eventData.nModuleType, 0);
479
+                break;
480
+            default:
481
+                break;
482
+        }
483
+    };
484
+
485
+    function getOSDTime(oFrameInfo) {
486
+        var iYear = oFrameInfo.year;
487
+        var iMonth = oFrameInfo.month;
488
+        var iDay = oFrameInfo.day;
489
+        var iHour = oFrameInfo.hour;
490
+        var iMinute = oFrameInfo.minute;
491
+        var iSecond = oFrameInfo.second;
492
+
493
+        if (iMonth < 10) {
494
+            iMonth = "0" + iMonth;
495
+        }
496
+        if (iDay < 10) {
497
+            iDay = "0" + iDay;
498
+        }
499
+        if (iHour < 10) {
500
+            iHour = "0" + iHour;
501
+        }
502
+        if (iMinute < 10) {
503
+            iMinute = "0" + iMinute;
504
+        }
505
+        if (iSecond < 10) {
506
+            iSecond = "0" + iSecond;
507
+        }
508
+
509
+        return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
510
+    }
511
+    // 获取帧数据
512
+    function getFrameData() {
513
+        // function getFrameData() {
514
+        // 获取帧数据
515
+        var res = Module._GetFrameData();
516
+        //var res = fun();
517
+        if (res === PLAYM4_OK) {
518
+            var oFrameInfo = Module._GetFrameInfo();
519
+            switch (oFrameInfo.frameType) {
520
+                case AUDIO_TYPE:
521
+                    var iSize = oFrameInfo.frameSize;
522
+                    if (0 === iSize) {
523
+                        return -1;
524
+                    }
525
+                    var pPCM = Module._GetFrameBuffer();
526
+                    // var audioBuf = new ArrayBuffer(iSize);
527
+                    var aPCMData = new Uint8Array(iSize);
528
+                    aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
529
+                    if (bWorkerPrintLog) {
530
+                        console.log("<<<Worker: audio media Info: nSise:" + oFrameInfo.frameSize + ",nSampleRate:" + oFrameInfo.samplesPerSec + ',channel:' + oFrameInfo.channels + ',bitsPerSample:' + oFrameInfo.bitsPerSample);
531
+                    }
532
+                    postMessage({
533
+                        'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
534
+                        'frameInfo': oFrameInfo, 'errorCode': res
535
+                    }, [aPCMData.buffer]);
536
+
537
+                    oFrameInfo = null;
538
+                    pPCM = null;
539
+                    aPCMData = null;
540
+                    return PLAYM4_AUDIO_FRAME;
541
+
542
+                case VIDEO_TYPE:
543
+                    var szOSDTime = getOSDTime(oFrameInfo);
544
+
545
+                    var iWidth = oFrameInfo.width;
546
+                    var iHeight = oFrameInfo.height;
547
+
548
+                    var iYUVSize = iWidth * iHeight * 3 / 2;
549
+                    if (0 === iYUVSize) {
550
+                        return -1;
551
+                    }
552
+
553
+                    var pYUV = Module._GetFrameBuffer();
554
+
555
+                    // 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
556
+                    var aYUVData = new Uint8Array(iYUVSize);
557
+                    aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
558
+                    if (bWorkerPrintLog) {
559
+                        console.log("<<<Worker: video media Info: Width:" + oFrameInfo.width + ",Height:" + oFrameInfo.height + ",timeStamp:" + oFrameInfo.timeStamp);
560
+                    }
561
+
562
+                    postMessage({
563
+                        'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
564
+                        'dataLen': aYUVData.length, 'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
565
+                    }, [aYUVData.buffer]);
566
+
567
+                    oFrameInfo = null;
568
+                    pYUV = null;
569
+                    aYUVData = null;
570
+                    return PLAYM4_VIDEO_FRAME;
571
+
572
+                case PRIVT_TYPE:
573
+                    postMessage({
574
+                        'function': "GetFrameData", 'type': "", 'data': null,
575
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
576
+                    });
577
+                    return PLAYM4_SYS_NOT_SUPPORT;
578
+
579
+                default:
580
+                    postMessage({
581
+                        'function': "GetFrameData", 'type': "", 'data': null,
582
+                        'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
583
+                    });
584
+                    return PLAYM4_SYS_NOT_SUPPORT;
585
+            }
586
+        }
587
+        else {
588
+            let errorCode = Module._GetLastError(g_nPort);
589
+            //解码失败返回裸数据
590
+            if (PLAYM4_DECODE_ERROR === errorCode) {
591
+                var rawInfo = Module._GetRawDataInfo();
592
+                var pRawData = Module._GetRawDataBuffer();
593
+                var aRawData = new Uint8Array(rawInfo.isize);
594
+                aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
595
+                postMessage({
596
+                    'function': "GetRawData", 'type': "", 'data': aRawData.buffer,
597
+                    'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
598
+                });
599
+                rawInfo = null;
600
+                pRawData = null;
601
+                aRawData = null;
602
+            }
603
+            //需要更多数据
604
+            if (PLAYM4_NEED_MORE_DATA === errorCode || PLAYM4_SYS_NOT_SUPPORT === errorCode || PLAYM4_NEED_NEET_LOOP === errorCode) {
605
+                postMessage({
606
+                    'function': "GetFrameData", 'type': "", 'data': null,
607
+                    'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': errorCode
608
+                });
609
+            }
610
+            return errorCode;
611
+        }
612
+    }
613
+
614
+    // 开始计算时间
615
+    function startTime() {
616
+        return new Date().getTime();
617
+    }
618
+
619
+    // 结束计算时间
620
+    function endTime() {
621
+        return new Date().getTime();
622
+    }
623
+
624
+    // 字母字符串转byte数组
625
+    function stringToBytes(str) {
626
+        var ch, st, re = [];
627
+        for (var i = 0; i < str.length; i++) {
628
+            ch = str.charCodeAt(i);  // get char
629
+            st = [];                 // set up "stack"
630
+            do {
631
+                st.push(ch & 0xFF);  // push byte to stack
632
+                ch = ch >> 8;          // shift value down by 1 byte
633
+            }
634
+            while (ch);
635
+            // add stack contents to result
636
+            // done because chars have "wrong" endianness
637
+            re = re.concat(st.reverse());
638
+        }
639
+        // return an array of bytes
640
+        return re;
641
+    }
642
+})();

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl1simd/Decoder.js


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl2/Decoder.js


BIN
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl2/Decoder.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl2/Decoder.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl3/Decoder.js


BIN
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl3/Decoder.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/playctrl3/Decoder.worker.js


+ 62 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/player.html

@@ -0,0 +1,62 @@
1
+<html>
2
+  <head>
3
+	  <title>实时联动</title>
4
+	  <style>
5
+	      html, body {
6
+	          padding: 0px 0px;
7
+	          margin: 0px 0px;
8
+	  		wdith: 100%;
9
+	  		height: 100%;
10
+	      }
11
+	      #player {
12
+	          width: 100vw;
13
+	          height: calc(100vw * 5 / 8);
14
+	          background-color: black;
15
+	      }
16
+	  </style>
17
+	  <script src="./jquery-3.7.1.min.js"></script>
18
+	  <script src="./vconsole.min.js"></script>
19
+    <script src="./h5player.min.js"></script>
20
+  </head>
21
+  <body>
22
+	  <div>v2</div>
23
+    <div id="player"></div>
24
+	<div>
25
+	<input id="url" />
26
+	<input type="button" value="播放" onclick="play()"></input>
27
+	</div>
28
+	<div id="msg"></div>
29
+	<script>
30
+		$(function () {
31
+			$('#msg').text(window.location.href)
32
+			var v = new VConsole();
33
+			window.addEventListener('resize', () => {
34
+				 if(window.myPalyer) {
35
+					 window.myPalyer.JS_Resize()
36
+				 }    
37
+			})
38
+			window.myPalyer = new window.JSPlugin({
39
+			    szId: 'player',
40
+			    szBasePath: "./",
41
+			    iMaxSplit: 1,
42
+			    iCurrentSplit: 1,
43
+			    openDebug: true,
44
+			    oStyle: {
45
+			      borderSelect: '#000',
46
+			    }
47
+			  })
48
+		})
49
+		
50
+		  
51
+		function play() {
52
+			var url = document.getElementById('url').value
53
+			console.log(url)
54
+			window.myPalyer.JS_Play(url, { playURL: url, mode: 0 }, 0).then(
55
+            () => { document.getElementById('msg').innerText = 'success'; console.log('ok')},
56
+            e => { document.getElementById('msg').innerText = e; console.log(e) }
57
+          )
58
+		}
59
+	</script>
60
+    
61
+  </body>
62
+</html>

Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talk/AudioInterCom.js


BIN
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talk/AudioInterCom.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 21 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talkW/AudioInterCom.js


BIN
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talkW/AudioInterCom.wasm


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/talkW/AudioInterCom.worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 6525 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/transform/libSystemTransform.js


BIN
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/transform/libSystemTransform.wasm


+ 120 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/transform/systemTransform-worker.js

@@ -0,0 +1,120 @@
1
+importScripts('libSystemTransform.js');
2
+    const RECORDRTP = 0;  //录制一份未经过转封装的码流原始数据,用于定位问题
3
+    let dataType = 1;
4
+    
5
+    // 转封装库回调函数
6
+    self.STCallBack = function (fileIndex,indexLen, data, dataLen)
7
+    {
8
+        //stFrameInfo的类型见DETAIL_FRAME_INFO
9
+		let stFrameInfo = Module._GetDetialFrameInfo();
10
+        let nIsMp4Index = stFrameInfo.nIsMp4Index;
11
+		//console.log("FrameType is " , stFrameInfo);	
12
+		//console.log("nIsMp4Index is " + nIsMp4Index);
13
+        //debugger
14
+        var pData = null;
15
+        pData = new Uint8Array(dataLen);
16
+        pData.set(Module.HEAPU8.subarray(data, data + dataLen));
17
+        if (dataType === 1) {
18
+            if (pData[0] == 0x49 && pData[1] == 0x4d && pData[2] == 0x4b && pData[3] == 0x48) {//码流头丢掉
19
+                return;
20
+            }
21
+            postMessage({type: "outputData", buf: pData, dType: 1});
22
+            dataType = 2;
23
+        } else {
24
+            if (nIsMp4Index) {
25
+                postMessage({type: "outputData", buf: pData, dType: 6}); //6:索引类型
26
+            } else {
27
+                postMessage({type: "outputData", buf: pData, dType: 2}); //2:码流
28
+            }
29
+        }
30
+
31
+        //stFrameInfo的类型见DETAIL_FRAME_INFO
32
+		//let stFrameInfo = Module._GetDetialFrameInfo();
33
+		//let stFrameType = stFrameInfo.nFrameType;
34
+		//let nFrameNum = stFrameInfo.nFrameNum;
35
+		//let nTimeStamp = stFrameInfo.nTimeStamp;
36
+        //let nIsMp4Index = stFrameInfo.nIsMp4Index;
37
+		
38
+		//console.log("FrameType is " + stFrameType);	
39
+		//console.log("nIsMp4Index is " + nIsMp4Index);	
40
+        
41
+    }
42
+
43
+    // self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };
44
+    // importScripts('SystemTransform.js');
45
+
46
+    self.Module['onRuntimeInitialized'] = function (){
47
+        postMessage({type: "loaded"});
48
+    }
49
+    onmessage = function (e) {
50
+        var data = e.data;
51
+        if ("create" === data.type) {
52
+            if (RECORDRTP) {
53
+                postMessage({type: "created"});
54
+                postMessage({type: "outputData", buf: data.buf, dType: 1});
55
+            } else {
56
+                var iHeadLen = data.len;
57
+                var pHead = Module._malloc(iHeadLen);
58
+    
59
+                self.writeArrayToMemory(new Uint8Array(data.buf), pHead);
60
+                var iTransType = data.packType;//目标格式
61
+                var iRet = Module._CreatHandle(pHead, iTransType, 4096);
62
+                if (iRet != 0) {
63
+                    console.log("_CreatHandle failed!" + iRet);
64
+                } else {
65
+                    iRet = Module._SysTransRegisterDataCallBack();			
66
+                    if(iRet != 0)
67
+                    {
68
+                        console.log("_SysTransRegisterDataCallBack Failed:" + iRet);
69
+                    }
70
+
71
+                    iRet = Module._SysTransStart(null, null);
72
+                    if(iRet != 0)
73
+                    {
74
+                        console.log("_SysTransStart Failed:" + iRet);
75
+                    }
76
+                    postMessage({type: "created"});
77
+                }
78
+            }
79
+
80
+        } else if ("inputData" === data.type) {
81
+            if (RECORDRTP) {
82
+                var aFileData = new Uint8Array(data.buf);  // 拷贝一份
83
+                var iBufferLen = aFileData.length;
84
+                var szBufferLen = iBufferLen.toString(16);
85
+                if (szBufferLen.length === 1) {
86
+                    szBufferLen = "000" + szBufferLen;
87
+                } else if (szBufferLen.length === 2) {
88
+                    szBufferLen = "00" + szBufferLen;
89
+                } else if (szBufferLen.length === 3) {
90
+                    szBufferLen = "0" + szBufferLen;
91
+                }
92
+                var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];
93
+                for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {
94
+                    aData[iIndex + 4] = aFileData[iIndex]
95
+                }
96
+                var dataUint8 = new Uint8Array(aData);
97
+                postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2});
98
+            } else {
99
+                let pInputDataBuf = Module._malloc(data.len);
100
+                var idataLen = data.len;
101
+                self.writeArrayToMemory(new Uint8Array(data.buf), pInputDataBuf);
102
+                    // 输入数据,每次最多2m
103
+                let pp = Module._SysTransInputData(0, pInputDataBuf, idataLen);
104
+                if(pp != 0) {
105
+                    //console.log("InputData Failed:" + pp);
106
+                }
107
+                Module._free(pInputDataBuf);
108
+            }
109
+        } else if ("release" === data.type) {
110
+            var iRet = Module._SysTransStop();
111
+            if (iRet != 0) {
112
+                console.log("_SysTransStop Failed:", iRet);
113
+            }
114
+            Module._SysTransRelease();
115
+            if (iRet != 0) {
116
+                console.log("_SysTransRelease Failed:", iRet);
117
+            }
118
+            close();
119
+        }
120
+    };

Datei-Diff unterdrückt, da er zu groß ist
+ 10 - 0
queue-monitor/unpackage/dist/build/app-plus/hybrid/html/vconsole.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/dist/build/app-plus/manifest.json


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/dist/build/app-plus/view.css


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
queue-monitor/unpackage/dist/build/app-plus/view.umd.min.js


+ 0 - 0
queue-monitor/unpackage/dist/dev/app-plus/__uniappchooselocation.js


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.