uint32_t swapBuffers() { std::swap(m_frontBuffer, m_backBuffer); std::swap(m_frontBufferTexture, m_backBufferTexture); std::swap(m_frontBufferReadTexture, m_backBufferReadTexture); return IOSurfaceGetID(m_frontBuffer); }
uint32_t GraphicsSurface::platformFrontBuffer() const { return IOSurfaceGetID(m_private->frontBuffer()); }
uint32_t GraphicsSurface::platformExport() { return IOSurfaceGetID(m_platformSurface); }
c_pitch=CFNumberCreate(0,kCFNumberSInt32Type,&tmp_pitch); OSType tmp_pxlfmt=pxlfmt; c_pxlfmt=CFNumberCreate(0,kCFNumberSInt32Type,&tmp_pxlfmt); CFDictionaryRef prop=CFDictionaryCreate(0, (const void*[]){kIOSurfaceWidth,kIOSurfaceHeight,kIOSurfaceBytesPerElement,kIOSurfaceBytesPerRow,kIOSurfacePixelFormat,kIOSurfaceIsGlobal}, (const void*[]){c_width,c_height,c_bpp,c_pitch,c_pxlfmt,kCFBooleanTrue}, 6,&kCFTypeDictionaryKeyCallBacks,&kCFTypeDictionaryValueCallBacks); // TODO m_surface might be set into clientdata... IOSurfaceRef m_surface = IOSurfaceCreate(prop); CFRelease(c_width); CFRelease(c_height); CFRelease(c_bpp); CFRelease(c_pitch); b->bufid = IOSurfaceGetID( m_surface ); b->clientdata = NULL; b->type = SkypekitVideoTransportBase::IOSurfaceBuffer; return true; } void IOSurfaceTransport::FreeBuffer( bufferstruct *b ) { b->bufid = -1; printf( "TODO: IOSurface FreeBuffer unimplemented\n" ); } bool IOSurfaceTransport::Present( bufferstruct *b, long long ts ) {