Expose demand driven video reads through the stream handle

This commit is contained in:
evgeny committed 2026-10-14 13:25:50 +02:00
1 parent f317d3e989
commit 33f8dacbfc
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -810,14 +810,14 @@ int stream_media_enable(struct STREAM_HANDLE *h, unsigned tracks) {
}
/* Чтение изменяет только локальный cursor; live ingest/READY/выдачи продолжают двигаться независимо. */
int stream_media_read(struct STREAM_HANDLE *h, int64_t position, int64_t video_ahead, int64_t audio_ahead,
int stream_media_read(struct STREAM_HANDLE *h, int64_t position, int want_video, int64_t audio_ahead,
struct stream_media_packet *packet) {
if (!stream_handle_active(h) || !h->media_cursor) {
DEBUG_WARN(DEBUG_CATEGORY_STREAM, "media read: detached/unconfigured reader"); return STREAM_ERR_STATE;
}
if (h->session->media_failed) return STREAM_ERR_FORMAT;
if (h->session->media_seeking || h->session->media_next < h->session->next_seq) return STREAM_WAIT;
return stream_media_cursor_read(h->media_cursor, position, video_ahead, audio_ahead, packet);
return stream_media_cursor_read(h->media_cursor, position, want_video, audio_ahead, packet);
}
int stream_media_get_status(struct STREAM_HANDLE *h, struct stream_media_status *status) {
+2 -1
View File
@@ -92,7 +92,8 @@ int stream_get_info(const struct STREAM_HANDLE *handle, struct stream_info *info
* Все вызовы — uasync. Заимствованный packet действует до следующего read/close.
* LIVE DATA/GAP/END callbacks описывают сетевой прогресс; конец отложенного просмотра получает media_read. */
int stream_media_enable(struct STREAM_HANDLE *handle, unsigned tracks);
int stream_media_read(struct STREAM_HANDLE *handle, int64_t position_us, int64_t video_ahead_us, int64_t audio_ahead_us,
/* Один следующий видеокадр при want_video=1; звук ограничен position_us+audio_ahead_us. */
int stream_media_read(struct STREAM_HANDLE *handle, int64_t position_us, int want_video, int64_t audio_ahead_us,
struct stream_media_packet *packet);
int stream_media_get_status(struct STREAM_HANDLE *handle, struct stream_media_status *status);
int stream_media_resync(struct STREAM_HANDLE *handle);