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

component provides Decoder:h264(Destructor) requires native H264Lib lib {

	int handle
	WH sz

	Decoder:Decoder(store WH size)
		{
		handle = lib.newDecoder()
		if (handle == 0) throw new Exception("decoder initialisation failed")
		sz = size
		}
	
	PixelMapYUV[] Decoder:decode(byte encoded[])
		{
		return lib.decode(handle, encoded, sz)
		}
	
	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:h264 -m "reason for update" -u yourUsername
Version 1 (this version) by barry
Notes for this version: Adds h264 baseline decoder and encoder