|
1 | 1 | //! Module for frame related types and functionality. |
2 | 2 | mod enums; |
3 | 3 |
|
4 | | -use std::{marker::PhantomData, ops::Deref, ptr::NonNull}; |
| 4 | +use std::{borrow::Cow, marker::PhantomData, ops::Deref, ptr::NonNull}; |
5 | 5 |
|
6 | 6 | use rustsynth_sys as ffi; |
7 | 7 |
|
8 | 8 | use crate::{ |
9 | 9 | api::API, |
10 | 10 | core::CoreRef, |
11 | 11 | format::{AudioFormat, MediaType, VideoFormat}, |
12 | | - map::{MapRef, MapRefMut, MapResult}, |
| 12 | + map::{Map, MapResult}, |
13 | 13 | }; |
14 | 14 |
|
15 | 15 | // One frame of a clip. |
@@ -248,16 +248,16 @@ impl<'core> Frame<'core> { |
248 | 248 |
|
249 | 249 | /// Get read-only access to frame properties |
250 | 250 | #[inline] |
251 | | - pub fn properties(&self) -> MapRef<'_, 'core> { |
| 251 | + pub fn properties(&self) -> Map<'core> { |
252 | 252 | let map_ptr = unsafe { API::get_cached().get_frame_props_ro(self.handle.as_ref()) }; |
253 | | - unsafe { MapRef::from_ptr(map_ptr) } |
| 253 | + unsafe { Map::from_ptr(map_ptr) } |
254 | 254 | } |
255 | 255 |
|
256 | 256 | /// Get read-write access to frame properties (only for owned frames) |
257 | 257 | #[inline] |
258 | | - pub fn properties_mut(&mut self) -> MapRefMut<'_, 'core> { |
| 258 | + pub fn properties_mut(&mut self) -> Map<'core> { |
259 | 259 | let map_ptr = unsafe { API::get_cached().get_frame_props_rw(self.handle.as_ptr()) }; |
260 | | - unsafe { MapRefMut::from_ptr(map_ptr) } |
| 260 | + unsafe { Map::from_ptr(map_ptr) } |
261 | 261 | } |
262 | 262 |
|
263 | 263 | // Standard frame property getters |
@@ -384,7 +384,7 @@ impl<'core> Frame<'core> { |
384 | 384 | } |
385 | 385 |
|
386 | 386 | /// Get picture type (single character describing frame type) |
387 | | - pub fn picture_type(&self) -> Option<String> { |
| 387 | + pub fn picture_type(&self) -> Option<Cow<'core, str>> { |
388 | 388 | unsafe { |
389 | 389 | self.properties() |
390 | 390 | .get_string_raw_unchecked(c"_PictType", 0) |
|
0 commit comments