Archived
2
0

Merge branch 'dev' of github.com:m1k1o/neko into dev

This commit is contained in:
m1k1o 2021-03-19 14:42:57 +01:00
commit bbea5f5715
4 changed files with 33 additions and 16 deletions

View File

@ -1,6 +1,6 @@
FROM m1k1o/neko:base FROM m1k1o/neko:base
ARG SRC_URL="https://github.com/macchrome/linchrome/releases/download/v88.0.4324.96-r827102-portable-ungoogled-Lin64/ungoogled-chromium_88.0.4324.96_1.vaapi_linux.tar.xz" ARG SRC_URL="https://github.com/macchrome/linchrome/releases/download/v89.0.4389.90-r843830-portable-ungoogled-Lin64/ungoogled-chromium_89.0.4389.90_1.vaapi_linux.tar.xz"
# #
# install custom chromium build from woolyss with support for hevc/x265 # install custom chromium build from woolyss with support for hevc/x265

View File

@ -151,14 +151,21 @@
@Component({ name: 'neko-connect' }) @Component({ name: 'neko-connect' })
export default class extends Vue { export default class extends Vue {
private autoPassword = new URL(location.href).searchParams.get('pwd') private autoPassword: string | null = new URL(location.href).searchParams.get('pwd')
private displayname: string = '' private displayname: string = ''
private password: string = this.autoPassword || '' private password: string = ''
mounted() { mounted() {
if (this.$accessor.displayname !== '' && this.$accessor.password !== '') { let password = this.$accessor.password
this.$accessor.login({ displayname: this.$accessor.displayname, password: this.$accessor.password }) if (this.autoPassword !== null) {
this.removeUrlParam('pwd')
password = this.autoPassword
}
if (this.$accessor.displayname !== '' && password !== '') {
this.$accessor.login({ displayname: this.$accessor.displayname, password })
this.autoPassword = null
} }
} }
@ -188,16 +195,15 @@
} }
async login() { async login() {
try { let password = this.password
await this.$accessor.login({ if (this.autoPassword !== null) {
displayname: this.displayname, password = this.autoPassword
password: this.password, }
})
if (this.autoPassword) { try {
this.removeUrlParam('pwd') await this.$accessor.login({ displayname: this.displayname, password })
this.autoPassword = ''
} this.autoPassword = null
} catch (err) { } catch (err) {
this.$swal({ this.$swal({
title: this.$t('connect.error') as string, title: this.$t('connect.error') as string,

View File

@ -19,6 +19,7 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
protected _displayname?: string protected _displayname?: string
protected _state: RTCIceConnectionState = 'disconnected' protected _state: RTCIceConnectionState = 'disconnected'
protected _id = '' protected _id = ''
protected _candidates: RTCIceCandidate[] = []
get id() { get id() {
return this._id return this._id
@ -220,6 +221,12 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
this._channel.onclose = this.onDisconnected.bind(this, new Error('peer data channel closed')) this._channel.onclose = this.onDisconnected.bind(this, new Error('peer data channel closed'))
this._peer.setRemoteDescription({ type: 'offer', sdp }) this._peer.setRemoteDescription({ type: 'offer', sdp })
for (let candidate of this._candidates) {
this._peer.addIceCandidate(candidate)
}
this._candidates = []
this._peer this._peer
.createAnswer() .createAnswer()
.then((d) => { .then((d) => {
@ -250,7 +257,11 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
if (event === EVENT.SIGNAL.CANDIDATE) { if (event === EVENT.SIGNAL.CANDIDATE) {
const { data } = payload as SignalCandidatePayload const { data } = payload as SignalCandidatePayload
let candidate: RTCIceCandidate = JSON.parse(data) let candidate: RTCIceCandidate = JSON.parse(data)
this._peer!.addIceCandidate(candidate) if (this._peer) {
this._peer.addIceCandidate(candidate)
} else {
this._candidates.push(candidate)
}
return return
} }

View File

@ -90,7 +90,7 @@ func CreateAppPipeline(codecName string, pipelineDevice string, pipelineSrc stri
if pipelineSrc != "" { if pipelineSrc != "" {
pipelineStr = fmt.Sprintf(pipelineSrc+pipelineStr, pipelineDevice) pipelineStr = fmt.Sprintf(pipelineSrc+pipelineStr, pipelineDevice)
} else { } else {
pipelineStr = fmt.Sprintf(videoSrc+"vp8enc target-bitrate=%d cpu-used=4 end-usage=cbr threads=4 deadline=1 undershoot=95 buffer-size=%d buffer-initial-size=%d buffer-optimal-size=%d keyframe-max-dist=30 min-quantizer=3 max-quantizer=40"+pipelineStr, pipelineDevice, fps, bitrate*1000, bitrate*6, bitrate*4, bitrate*5) pipelineStr = fmt.Sprintf(videoSrc+"vp8enc target-bitrate=%d cpu-used=4 end-usage=cbr threads=4 deadline=1 undershoot=95 buffer-size=%d buffer-initial-size=%d buffer-optimal-size=%d keyframe-max-dist=180 min-quantizer=3 max-quantizer=40"+pipelineStr, pipelineDevice, fps, bitrate*1000, bitrate*6, bitrate*4, bitrate*5)
} }
case "VP9": case "VP9":
// https://gstreamer.freedesktop.org/documentation/vpx/vp9enc.html?gi-language=c // https://gstreamer.freedesktop.org/documentation/vpx/vp9enc.html?gi-language=c