mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 23:19:02 +08:00
fix andriod jni update
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
67d0ff4fe1
commit
dc3104dac4
@ -49,10 +49,11 @@ impl FrameRaw {
|
|||||||
self.enable = value;
|
self.enable = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, data: *mut u8) {
|
fn update(&mut self, data: *mut u8, len: usize) {
|
||||||
if self.enable.not() {
|
if self.enable.not() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
self.len = len;
|
||||||
self.ptr.store(data, SeqCst);
|
self.ptr.store(data, SeqCst);
|
||||||
self.last_update = Instant::now();
|
self.last_update = Instant::now();
|
||||||
}
|
}
|
||||||
@ -98,8 +99,9 @@ pub extern "system" fn Java_com_carriez_flutter_1hbb_MainService_onVideoFrameUpd
|
|||||||
buffer: JObject,
|
buffer: JObject,
|
||||||
) {
|
) {
|
||||||
let jb = JByteBuffer::from(buffer);
|
let jb = JByteBuffer::from(buffer);
|
||||||
let slice = env.get_direct_buffer_address(&jb).unwrap();
|
let data = env.get_direct_buffer_address(&jb).unwrap();
|
||||||
VIDEO_RAW.lock().unwrap().update(slice);
|
let len = env.get_direct_buffer_capacity(&jb).unwrap();
|
||||||
|
VIDEO_RAW.lock().unwrap().update(data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
@ -109,8 +111,9 @@ pub extern "system" fn Java_com_carriez_flutter_1hbb_MainService_onAudioFrameUpd
|
|||||||
buffer: JObject,
|
buffer: JObject,
|
||||||
) {
|
) {
|
||||||
let jb = JByteBuffer::from(buffer);
|
let jb = JByteBuffer::from(buffer);
|
||||||
let slice = env.get_direct_buffer_address(&jb).unwrap();
|
let data = env.get_direct_buffer_address(&jb).unwrap();
|
||||||
AUDIO_RAW.lock().unwrap().update(slice);
|
let len = env.get_direct_buffer_capacity(&jb).unwrap();
|
||||||
|
AUDIO_RAW.lock().unwrap().update(data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
Loading…
Reference in New Issue
Block a user