pub struct Picture<S: PictureState> {
inner: Box<PictureInner>,
phantom: PhantomData<S>,
}
Expand description
A Surface
that is being rendered into.
This struct abstracts the decoding flow using vaBeginPicture
, vaRenderPicture
,
vaEndPicture
and vaSyncSurface
in a type-safe way.
The surface will have valid picture data after all the stages of decoding are called.
Fields
inner: Box<PictureInner>
phantom: PhantomData<S>
Implementations
sourceimpl Picture<PictureNew>
impl Picture<PictureNew>
sourcepub fn new(timestamp: u64, context: Rc<Context>, surface: Surface) -> Self
pub fn new(timestamp: u64, context: Rc<Context>, surface: Surface) -> Self
Creates a new Picture with a given timestamp
. surface
is the underlying surface that
libva will render to.
sourcepub fn new_from_same_surface<T: PictureReclaimableSurface, S: PictureReclaimableSurface>(
timestamp: u64,
picture: &Picture<S>
) -> Picture<T>
pub fn new_from_same_surface<T: PictureReclaimableSurface, S: PictureReclaimableSurface>(
timestamp: u64,
picture: &Picture<S>
) -> Picture<T>
Creates a new Picture with a given frame_number
to identify it,
reusing the Surface from picture
. This is useful for interlaced
decoding as one can render both fields to the same underlying surface.
sourcepub fn add_buffer(&mut self, buffer: Buffer)
pub fn add_buffer(&mut self, buffer: Buffer)
Add buffer
to the picture.
sourcepub fn begin(self) -> Result<Picture<PictureBegin>>
pub fn begin(self) -> Result<Picture<PictureBegin>>
Wrapper around vaBeginPicture
.
sourceimpl Picture<PictureBegin>
impl Picture<PictureBegin>
sourcepub fn render(self) -> Result<Picture<PictureRender>>
pub fn render(self) -> Result<Picture<PictureRender>>
Wrapper around vaRenderPicture
.
sourceimpl Picture<PictureRender>
impl Picture<PictureRender>
sourcepub fn end(self) -> Result<Picture<PictureEnd>>
pub fn end(self) -> Result<Picture<PictureEnd>>
Wrapper around vaEndPicture
.
sourceimpl Picture<PictureEnd>
impl Picture<PictureEnd>
sourcepub fn sync(self) -> Result<Picture<PictureSync>>
pub fn sync(self) -> Result<Picture<PictureSync>>
Syncs the picture, ensuring that all pending operations are complete when this call returns.
sourcepub fn query_status(&self) -> Result<Type>
pub fn query_status(&self) -> Result<Type>
Queries the status of the underlying surface.
This call can be used to implement a non-blocking path, wherein a decoder queries the status of the surface after each decode operation instead of blocking on it.
sourceimpl<S: PictureState> Picture<S>
impl<S: PictureState> Picture<S>
sourceimpl<S: PictureReclaimableSurface> Picture<S>
impl<S: PictureReclaimableSurface> Picture<S>
sourcepub fn take_surface(self) -> Result<Surface>
pub fn take_surface(self) -> Result<Surface>
Reclaim ownership of the Surface this picture has been created from, consuming the picture in the process. Useful if the Surface is part of a pool.
sourcepub fn surface(&self) -> Ref<'_, Surface>
pub fn surface(&self) -> Ref<'_, Surface>
Returns a reference to the underlying Surface
for this Picture
sourcepub fn surface_mut(&mut self) -> RefMut<'_, Surface>
pub fn surface_mut(&mut self) -> RefMut<'_, Surface>
Returns a mutable reference to the underlying Surface
for this Picture