mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
This reverts commit 80afa98d66.
This commit is contained in:
@@ -13,12 +13,12 @@ use std::time::{Duration, Instant};
|
||||
use std::{io, thread};
|
||||
|
||||
use docopt::Docopt;
|
||||
use scrap::codec::{EncoderApi, EncoderCfg, ExtraEncoderCfg, Quality as Q};
|
||||
use scrap::codec::{EncoderApi, EncoderCfg, Quality as Q};
|
||||
use webm::mux;
|
||||
use webm::mux::Track;
|
||||
|
||||
use scrap::{convert_to_yuv, vpxcodec as vpx_encode};
|
||||
use scrap::{Capturer, ColorRange, Display, TraitCapturer, STRIDE_ALIGN};
|
||||
use scrap::{Capturer, Display, TraitCapturer, STRIDE_ALIGN};
|
||||
|
||||
const USAGE: &'static str = "
|
||||
Simple WebM screen capture.
|
||||
@@ -110,10 +110,6 @@ fn main() -> io::Result<()> {
|
||||
Quality::Balanced => Q::Balanced,
|
||||
Quality::Low => Q::Low,
|
||||
};
|
||||
let extra = ExtraEncoderCfg {
|
||||
pixfmt: scrap::Pixfmt::YUV420P,
|
||||
range: ColorRange::Studio,
|
||||
};
|
||||
let mut vpx = vpx_encode::VpxEncoder::new(
|
||||
EncoderCfg::VPX(vpx_encode::VpxEncoderConfig {
|
||||
width,
|
||||
@@ -122,7 +118,7 @@ fn main() -> io::Result<()> {
|
||||
codec: vpx_codec,
|
||||
keyframe_interval: None,
|
||||
}),
|
||||
extra,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@@ -156,7 +152,7 @@ fn main() -> io::Result<()> {
|
||||
|
||||
if let Ok(frame) = c.frame(Duration::from_millis(0)) {
|
||||
let ms = time.as_secs() * 1000 + time.subsec_millis() as u64;
|
||||
convert_to_yuv(&frame, vpx.yuvfmt(), &mut yuv, &mut mid_data).unwrap();
|
||||
convert_to_yuv(&frame, vpx.yuvfmt(), &mut yuv, &mut mid_data);
|
||||
for frame in vpx.encode(ms as i64, &yuv, STRIDE_ALIGN).unwrap() {
|
||||
vt.add_frame(frame.data, frame.pts as u64 * 1_000_000, frame.key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user