HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Component media.video.Decoder:av1 by barry
expand copy to clipboardexpand
interface AV1Lib {
	int newDecoder()
	PixelMapYUV[] decode(int handle, byte encoded[], int width, int height)
	void destroyDecoder(int handle)
}

component provides Decoder:av1(Destructor) requires native AV1Lib lib {

	int handle

	Decoder:Decoder()
		{
		handle = lib.newDecoder()
		if (handle == 0) throw new Exception("decoder initialisation failed")
		}
	
	PixelMapYUV[] Decoder:decode(byte encoded[], int width, int height)
		{
		return lib.decode(handle, encoded, width, height)
		}
	
	void Destructor:destroy()
		{
		lib.destroyDecoder(handle)
		}

}
Revision history
To propose a new revision to this entity, use dana source put -uc your/new/version.dn -n media.video.Decoder:av1 -m "reason for update" -u yourUsername
Version 2 by barry
Version 1 (this version) by barry
Notes for this version: Adds APIs for video decoding.