From e34a83a86f6218bd2fc48e011311522bff06e699 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Thu, 14 Mar 2024 23:51:55 +0100 Subject: [PATCH] add data getter in avio context custom --- src/avformat/avio.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/avformat/avio.rs b/src/avformat/avio.rs index 1e51d65..9ca65a5 100644 --- a/src/avformat/avio.rs +++ b/src/avformat/avio.rs @@ -154,6 +154,12 @@ impl AVIOContextCustom { _opaque: opaque, } } + + // Extract the data passed in `alloc_context` + // and set that data inside it to an empty vec. + pub fn take_data(&mut self) -> Vec { + std::mem::take(&mut self._opaque.data) + } } impl Drop for AVIOContextCustom {