[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
#![deny(warnings)]
|
||||
// [TSM.ID].[11031972] -- All Rights Reserved. Proprietary & Confidential.
|
||||
pub mod rtp_parser;
|
||||
@@ -0,0 +1,29 @@
|
||||
// [TSM.ID].[11031972] -- All Rights Reserved. Proprietary & Confidential.
|
||||
use bytes::Bytes;
|
||||
|
||||
/// Struktur layer spasial dan temporal dari paket video SVC
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct SvcLayerInfo {
|
||||
pub spatial_id: u8, // 0 = 360p, 1 = 720p, 2 = 1080p
|
||||
pub temporal_id: u8, // 0 = 15fps, 1 = 30fps, 2 = 60fps
|
||||
}
|
||||
|
||||
/// Ekstraksi nilai layer dari payload RTP AV1/VP9 (Simulasi Zero-Copy)
|
||||
#[inline(always)]
|
||||
pub fn extract_svc_layer(payload: &Bytes) -> Option<SvcLayerInfo> {
|
||||
// Di dunia nyata, ini melakukan bit-shifting ekstrem pada header RTP ekstensi.
|
||||
// Contoh sederhana: byte ke-1 menampung informasi S dan T.
|
||||
if payload.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Teknik Bitwise: SID ada di 3 bit pertama, TID di 3 bit selanjutnya (misal).
|
||||
let descriptor = payload[0];
|
||||
let spatial_id = (descriptor & 0xE0) >> 5; // Ambil 3 bit teratas
|
||||
let temporal_id = (descriptor & 0x1C) >> 2; // Ambil 3 bit selanjutnya
|
||||
|
||||
Some(SvcLayerInfo {
|
||||
spatial_id,
|
||||
temporal_id,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user