VSFlowReturn _configMasterVideoLayer(void * vshandle, void * config) { VS_FLOW("Fun %s in\n", __FUNCTION__); VideoSurface * vs; vs = (VideoSurface *)vshandle; if (NEXTSURFACE(vs)==NULL) return VS_FLOW_OK; VideoDevice * vd=SURFACE2DEVICE(vs); VS_LOCK(gVSlock); _removeVideoSurfaceFromDevice(vd,vs); _addVideoSurface2Device(vd,vs); _refreshOnDevice(vd); VS_UNLOCK(gVSlock); VS_FLOW("Fun %s out\n", __FUNCTION__); return VS_FLOW_OK; }
void _destroyVideoSurface (void *vshandle, int force) { VideoSurface *vs, *vs1; VideoDevice *vd; vs = (VideoSurface *) vshandle; if (vs == NULL) return; VS_LOCK (gVSlock); if (force == 0) { vs1 = gvslocal; if (vs1 == vs) { gvslocal = vs->next; } else { while (vs1->next != vs) vs1 = vs1->next; vs1->next = vs->next; } } vd = SURFACE2DEVICE (vs); _removeVideoSurfaceFromDevice (vd, vs); // _clearBackground(vd, vs); _destroySubFrameBuffer (vs); vd->cleanmask = 0xffffffff; vd->cnt--; if (DEVICE2HEADSURFACE (vd) == NULL) { _closeDevice (vd); vd->init = 0; } else { if (_checkOnDevice (vd)) { _reconfigAllVideoSurfaces (vd); _setDeviceConfig (vd); } if (vd->setalpha) _setAlpha (vd); _refreshOnDevice (vd); } VS_MESSAGE ("VS%d destroyed, force=%d!\n", vs->id - 1, force); vs->status = VS_STATUS_IDLE; VS_UNLOCK (gVSlock); }
VSFlowReturn _configMasterVideoSurface(void * vshandle, void * config) { VS_FLOW("Fun %s in\n", __FUNCTION__); DestinationFmt * des = (DestinationFmt *)config; VideoSurface * vs; SourceFmt src; vs = (VideoSurface *)vshandle; VS_MESSAGE("reconfig win from "WIN_FMT" to "WIN_FMT"\n", WIN_ARGS(&vs->desfmt.rect), WIN_ARGS(&des->rect)); VideoDevice * vd=SURFACE2DEVICE(vs); VS_LOCK(gVSlock); vs->desfmt = *des; vs->outside = _adjustDestRect(&des->rect, vd); vs->adjustdesrect = des->rect; if (NEXTSURFACE(vs)){ _removeVideoSurfaceFromDevice(vd,vs); _addVideoSurface2Device(vd,vs); } _clearVideoSurfaceBackground(vd, vs); if (_checkOnDevice(vd)){ _reconfigAllVideoSurfaces(vd); _setDeviceConfig(vd); }else{ _initVSIPUTask(vs); } if (vd->setalpha) _setAlpha(vd); vs->mainframeupdate = 1; if (vs->itask.mode){ _reconfigSubFrameBuffer(vs); vs->mainframeupdate = 0; _updateSubFrame(vs); } _refreshOnDevice(vd); VS_UNLOCK(gVSlock); VS_FLOW("Fun %s out\n", __FUNCTION__); return VS_FLOW_OK; }