MedVideoSource::MedVideoSource( soap * pSoap, const std::string &token, int w, int h, double frmRate) { d = soap_new_tt__VideoSource( pSoap ); d->token = token; d->Framerate = frmRate; d->Resolution = soap_new_tt__VideoResolution( pSoap ); d->Resolution->Width = w; d->Resolution->Height = h; }
void MedGetVideoSourcesResponse::AddEntry( const std::string & sourceToken, int w, int h, float frmRate ) { d->VideoSources.push_back( soap_new_tt__VideoSource( d->soap, -1 ) ); d->VideoSources.back()->token = sourceToken; d->VideoSources.back()->Framerate = frmRate; d->VideoSources.back()->Resolution = soap_new_tt__VideoResolution(d->soap, -1); d->VideoSources.back()->Resolution->Width = w; d->VideoSources.back()->Resolution->Height = h; }
int MediaBindingService::GetVideoSources(_trt__GetVideoSources *trt__GetVideoSources, _trt__GetVideoSourcesResponse *trt__GetVideoSourcesResponse) { std::cout << __FUNCTION__ << std::endl; ServiceContext* ctx = (ServiceContext*)this->soap->user; int width; int height; int format; for (auto it: ctx->m_devices) { if (ctx->getFormat(it.first.c_str(), width, height, format)) { trt__GetVideoSourcesResponse->VideoSources.push_back(soap_new_tt__VideoSource(this->soap)); trt__GetVideoSourcesResponse->VideoSources.back()->token = it.first; trt__GetVideoSourcesResponse->VideoSources.back()->Resolution = soap_new_req_tt__VideoResolution(this->soap, width, height); trt__GetVideoSourcesResponse->VideoSources.back()->Imaging = soap_new_tt__ImagingSettings(this->soap); } } return SOAP_OK; }