tav-media
Version:
Cross platform media editing framework
48 lines (47 loc) • 1.5 kB
TypeScript
import { MediaClip } from '../clips/tav-media-clip';
import { ScaleMode } from '../types/types';
import { TAVSurface } from './tav-surface';
/**
* A video reader is used to obtain the video frames of a media.
* @category Engine
*/
export declare class TAVVideoReader {
private ref;
private static dispatcher;
/**
* Make a video reader from a media clip.
* @param root The root media clip.
* @param frameRate The frame rate of the video reader.
* @param isRecycle
* @returns New video reader.
*/
static MakeFrom(root: MediaClip, frameRate: number, isRecycle?: boolean): Promise<TAVVideoReader>;
private surface;
private constructor();
/**
* Set the surface to render the video frames.
* @param surface The surface to render the video.
*/
setSurface(surface: TAVSurface): Promise<void>;
/**
* Sets the current frame to the specified time.
* @param targetTime The target time to seek to.
* @returns seeked or not.
*/
seekTo(targetTime: number): Promise<boolean>;
/**
* Reads the next video frame for the output.
*/
readNextFrame(): Promise<void>;
/**
* Returns the current scale mode.
*/
scaleMode(): ScaleMode;
/**
* Specifies the rule of how to scale the content to fit the surface size. The matrix
* changes when this method is called.
* @param mode The scale mode.
*/
setScaleMode(mode: ScaleMode): void;
release(): void;
}