| 108 | |
| 109 | |
| 110 | RRFrame *RRTransGetFrame(void *handle, int width, int height, int format, |
| 111 | int stereo) |
| 112 | { |
| 113 | _vgl_disableFaker(); |
| 114 | |
| 115 | RRFrame *frame = NULL; |
| 116 | try |
| 117 | { |
| 118 | VGLTrans *vglconn = (VGLTrans *)handle; |
| 119 | if(!vglconn) THROW("Invalid handle"); |
| 120 | frame = new RRFrame; |
| 121 | memset(frame, 0, sizeof(RRFrame)); |
| 122 | int compress = fconfig->compress; |
| 123 | if(compress == RRCOMP_PROXY || compress == RRCOMP_RGB) |
| 124 | compress = RRCOMP_RGB; |
| 125 | else compress = RRCOMP_JPEG; |
| 126 | int pixelFormat = PF_RGB; |
| 127 | if(compress != RRCOMP_RGB) pixelFormat = trans2pf[format]; |
| 128 | Frame *f = vglconn->getFrame(width, height, pixelFormat, FRAME_BOTTOMUP, |
| 129 | (bool)stereo); |
| 130 | f->hdr.compress = compress; |
| 131 | frame->opaque = (void *)f; |
| 132 | frame->w = f->hdr.framew; |
| 133 | frame->h = f->hdr.frameh; |
| 134 | frame->pitch = f->pitch; |
| 135 | frame->bits = f->bits; |
| 136 | frame->rbits = f->rbits; |
| 137 | frame->format = pf2trans[f->pf->id]; |
| 138 | if(frame->format < 0) THROW("Unsupported pixel format"); |
| 139 | } |
| 140 | catch(std::exception &e) |
| 141 | { |
| 142 | snprintf(errStr, MAXSTR + 14, "Error in %s -- %s", GET_METHOD(e), |
| 143 | e.what()); |
| 144 | delete frame; |
| 145 | frame = NULL; |
| 146 | } |
| 147 | |
| 148 | _vgl_enableFaker(); |
| 149 | |
| 150 | return frame; |
| 151 | } |
| 152 | |
| 153 | |
| 154 | int RRTransReady(void *handle) |
nothing calls this directly
no test coverage detected