pub struct SabrPlaybackSession {
pub video_id: String,
pub cpn: String,
pub current_url: String,
pub po_token: Option<Vec<u8>>,
pub context_token: Option<Vec<u8>>,
pub backoff_ms: u32,
pub current_media_time_ms: u64,
pub buffered_media_time_ms: u64,
pub next_sq: u64,
pub segment_duration_ms: u64,
pub last_request_time_ms: u64,
}Expand description
長時間 YouTube 再生におけるセグメント自動取得と状態維持を担うセッション管理構造体。
Fields§
§video_id: String§cpn: String§current_url: String§po_token: Option<Vec<u8>>§context_token: Option<Vec<u8>>§backoff_ms: u32§current_media_time_ms: u64§buffered_media_time_ms: u64§next_sq: u64§segment_duration_ms: u64§last_request_time_ms: u64Implementations§
Source§impl SabrPlaybackSession
impl SabrPlaybackSession
Sourcepub fn update_with_request(&mut self, url: &str, body: &[u8])
pub fn update_with_request(&mut self, url: &str, body: &[u8])
送信されたリクエスト(URL および protobuf body)からセッション状態(CPN, po_token, 再生ウィンドウ)を更新する。
Sourcepub fn cached_po_token(&self) -> Option<&[u8]>
pub fn cached_po_token(&self) -> Option<&[u8]>
キャッシュされている po_token(Attestation 署名)を取得する。
Sourcepub fn update_playback_head(&mut self, current_ms: u64)
pub fn update_playback_head(&mut self, current_ms: u64)
再生ヘッドの進行を更新する。
Sourcepub fn needs_refill(&self, buffer_threshold_ms: u64) -> bool
pub fn needs_refill(&self, buffer_threshold_ms: u64) -> bool
バッファ残量がしきい値(ミリ秒)を下回っているか判定する。
Sourcepub fn process_response(&mut self, ump_data: &[u8]) -> Option<Vec<u8>>
pub fn process_response(&mut self, ump_data: &[u8]) -> Option<Vec<u8>>
UMP レスポンスを処理し、Part 37(NextRequestPolicy)のメタデータ更新と Part 21(メディア fMP4 チャンク)の抽出を行う。
Sourcepub fn next_window(&self) -> PlaybackWindow
pub fn next_window(&self) -> PlaybackWindow
次に要求すべき再生ウィンドウ情報を生成する。
Trait Implementations§
Source§impl Clone for SabrPlaybackSession
impl Clone for SabrPlaybackSession
Source§impl Debug for SabrPlaybackSession
impl Debug for SabrPlaybackSession
impl Eq for SabrPlaybackSession
Source§impl PartialEq for SabrPlaybackSession
impl PartialEq for SabrPlaybackSession
impl StructuralPartialEq for SabrPlaybackSession
Auto Trait Implementations§
impl Freeze for SabrPlaybackSession
impl RefUnwindSafe for SabrPlaybackSession
impl Send for SabrPlaybackSession
impl Sync for SabrPlaybackSession
impl Unpin for SabrPlaybackSession
impl UnsafeUnpin for SabrPlaybackSession
impl UnwindSafe for SabrPlaybackSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.