File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ fn draw(host: String, pwd: String) {
302302 yuv = d. reset ( yuv) . unwrap ( ) ;
303303
304304 yuv. par_iter_mut ( ) . zip ( _yuv. par_iter ( ) ) . for_each ( |( a, b) | {
305- * a = b . wrapping_sub ( * a ) ;
305+ * a = * b ^ * a ;
306306 } ) ;
307307
308308 if let Ok ( mut _buf) = work_buf. write ( ) {
@@ -317,7 +317,7 @@ fn draw(host: String, pwd: String) {
317317 last = cur;
318318 _length_all = _length_sum;
319319 if let Ok ( mut a) = _tool_str. write ( ) {
320- * a = format ! ( "FPS:{:2} | Rate:{:>6}kb/s" , fps, _length_all * 8 / 1024 ) ;
320+ * a = format ! ( "FPS:{:2} | Rate:{:>6}kb/s" , fps, _length_all / 1024 ) ;
321321 }
322322 fps = fpscount;
323323 fpscount = 0 ;
Original file line number Diff line number Diff line change @@ -214,8 +214,11 @@ fn screen_stream(mut stream: TcpStream) {
214214 yuv. set_len ( 0 ) ;
215215 }
216216 dscom:: convert:: bgra_to_i420 ( w, h, bgra, & mut yuv) ;
217+ if yuv[ ..w* h] == last[ ..w* h] {
218+ continue ;
219+ }
217220 last. par_iter_mut ( ) . zip ( yuv. par_iter ( ) ) . for_each ( |( a, b) |{
218- * a = a . wrapping_sub ( * b ) ;
221+ * a = * a ^ * b ;
219222 } ) ;
220223 // 压缩
221224 unsafe {
You can’t perform that action at this time.
0 commit comments