portable service

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-10 10:27:13 +08:00
parent eb60ab0b79
commit 8e1545b432
46 changed files with 1217 additions and 72 deletions

View File

@@ -61,7 +61,7 @@ impl TraitCapturer for Capturer {
}
}
pub struct Frame<'a>(&'a [u8]);
pub struct Frame<'a>(pub &'a [u8]);
impl<'a> ops::Deref for Frame<'a> {
type Target = [u8];

View File

@@ -4,7 +4,7 @@
use hbb_common::anyhow::{anyhow, Context};
use hbb_common::message_proto::{EncodedVideoFrame, EncodedVideoFrames, Message, VideoFrame};
use hbb_common::{ResultType, get_time};
use hbb_common::{get_time, ResultType};
use crate::codec::EncoderApi;
use crate::STRIDE_ALIGN;
@@ -233,7 +233,9 @@ impl EncoderApi for VpxEncoder {
impl VpxEncoder {
pub fn encode(&mut self, pts: i64, data: &[u8], stride_align: usize) -> Result<EncodeFrames> {
assert!(2 * data.len() >= 3 * self.width * self.height);
if 2 * data.len() < 3 * self.width * self.height {
return Err(Error::FailedCall("len not enough".to_string()));
}
let mut image = Default::default();
call_vpx_ptr!(vpx_img_wrap(