Fix h265 aggregation packet issue
This commit is contained in:
parent
d2c1fa003f
commit
8e9c950389
16
Cargo.lock
generated
16
Cargo.lock
generated
@ -3094,19 +3094,3 @@ dependencies = [
|
||||
"syn",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[patch.unused]]
|
||||
name = "messagebus"
|
||||
version = "0.10.0"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "mpeg2ts"
|
||||
version = "0.1.1"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "metrix"
|
||||
version = "0.2.1"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "metrix-macros"
|
||||
version = "0.2.1"
|
||||
|
@ -292,17 +292,21 @@ impl AccessUnit {
|
||||
|
||||
fn finish(self, dst: &mut VecDeque<VideoFrame>, ctx: crate::PacketContext, loss: u32) {
|
||||
let mut data = self.data.to_vec();
|
||||
// let length = data.len() as u32 - 4;
|
||||
// data[0..4].copy_from_slice();
|
||||
|
||||
if let Some(hdr) = self.header {
|
||||
let is_random_access_point = if let Some(hdr) = self.header {
|
||||
(&mut data[4..6]).put_u16(hdr.0);
|
||||
}
|
||||
|
||||
let is_random_access_point = match self.header.unwrap().nalu_type() {
|
||||
H265NALU_BLA_W_LP | H265NALU_BLA_W_RADL | H265NALU_BLA_N_LP | H265NALU_IDR_W_RADL
|
||||
| H265NALU_IDR_N_LP | H265NALU_CRA_NUT => true,
|
||||
_ => false,
|
||||
matches!(
|
||||
hdr.nalu_type(),
|
||||
H265NALU_BLA_W_LP
|
||||
| H265NALU_BLA_W_RADL
|
||||
| H265NALU_BLA_N_LP
|
||||
| H265NALU_IDR_W_RADL
|
||||
| H265NALU_IDR_N_LP
|
||||
| H265NALU_CRA_NUT
|
||||
)
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
dst.push_back(VideoFrame {
|
||||
|
Loading…
Reference in New Issue
Block a user