基于OpenGL和OpenAL的媒体库,Open Media Library 0.4.0 发布
jopen 12年前
openmedialibrary是一个基于OpenGL和OpenAL的媒体库。它能够将媒体流使用硬件加速显示成视频与声音和真实的立体能力。
mlStreamLoadDefault(filepath); mlStreamConvert(alformat, alfreq, glwidth, glheight, glformat, glsize); for(i = 0; i< NUM_AUDIO_BUFFERS && !mlStreamAudioEnd(); i++) mlStreamConvertBufferChunk(size, bfrs[i]); alSourceQueueBuffers(src, i, bfrs); mlStreamReadFrame(); mlStreamSync(); if(mlStreamFrameCheck()) mlStreamConvertTexSubImage2D(target, level, xoffset, yoffset); alSourcePlay(src); while(!mlStreamEnd()) { alGetSourcei(src, AL_BUFFERS_PROCESSED, prc); alSourceUnqueueBuffers(src, prc, prcs); for(i = 0; i < prc && !mlStreamAudioEnd(); i++) mlStreamConvertBufferChunk(size, prcs[i]); alSourceQueueBuffers(src, i, prcs); if(!mlStreamVideoEnd()) { mlStreamReadFrame(); if(mlStreamFrameCheck()) mlStreamConvertTexSubImage2D(target, level, xoffset, yoffset); } } mlStreamUnload(); ...