Struct mpv::MpvHandlerWithGl [] [src]

pub struct MpvHandlerWithGl { /* fields omitted */ }

This struct is a decorator of MpvHandler, and can use all the functions from MpvHandler. It is only used when you must embed mpv somewhere else using openGL.

Methods

impl MpvHandlerWithGl
[src]

Render video

The video will use the full provided framebuffer. Options like "panscan" are applied to determine which part of the video should be visible and how the video should be scaled. You can change these options at runtime by using the mpv property API.

fbo is the framebuffer object to render on. Because the renderer might manage multiple FBOs internally for the purpose of video postprocessing, it will always bind and unbind FBOs itself. If you want mpv to render on the main framebuffer, pass 0.

width is the width of the framebuffer. This is either the video size if the fbo parameter is 0, or the allocated size of the texture backing the fbo. The renderer will always use the full size of the fbo.

height is the height of the framebuffer. Same as with the w parameter, except that this parameter can be negative. In this case, the video frame will be rendered flipped.

Errors

If the external video module has not been configured correctly, libmpv can send various errors such as MPV_ERROR_UNSUPPORTED

returns true if another frame is available

Methods from Deref<Target = MpvHandler>

Set a property synchronously

Set a property asynchronously

Get a property synchronously

Get a property asynchronously

Set an option. Note that you can't normally set options during runtime : changing options at runtime does not always work. For some options, attempts to change them simply fails. Many other options may require reloading the file for changes to take effect. In general, you should prefer calling mpv.set_property() to change settings during playback, because the property mechanism guarantees that changes take effect immediately.

It is preferred that you initialize your options with the Builder instead

Send a command synchronously

Send a command asynchronously

Returns an Event if there is an Event available. Returns None if the event pool is empty.

It is still necessary to empty the event pool even if you don't use the events, since the event pool is not limited and will be full if you don't empty it.

Panics

Will panic if a null pointer is received from the libmpv API (should never happen)

Observe a property change. The property change will be returned via an Event PropertyChange

Unobserve a previously observed property change

Get the raw pointer for the mpv_handle. Use with care.

See mpv_get_time_us.

Trait Implementations

impl Deref for MpvHandlerWithGl
[src]

The resulting type after dereferencing

The method called to dereference a value

impl DerefMut for MpvHandlerWithGl
[src]

The method called to mutably dereference a value

impl Drop for MpvHandlerWithGl
[src]

A method called when the value goes out of scope. Read more