Beispiel #1
0
void VRRecorder::capture() {
    auto v = view.lock();
    if (!v) {
        v = VRSetup::getCurrent()->getView(viewID);
        view = v;
    }
    if (!v) return;
    if (frameLimitReached()) return;

    //int ts = VRGlobals::get()->CURRENT_FRAME;
    VRFrame* f = new VRFrame();
    captures.push_back(f);
    f->capture = v->grab();
    f->timestamp = getTime()*1e-3;

    VRTransformPtr t = v->getCamera();
    if (t == 0) return;
    f->f = t->getFrom();
    f->a = t->getAt();
    f->u = t->getUp();

    f->width = f->capture->getImage()->getWidth();
    f->height = f->capture->getImage()->getHeight();

    if (!frame) initFrame();

    f->transcode(frame, codec_context, sws_context, captures.size()-1);
}
Beispiel #2
0
void VRRecorder::capture() {
    auto v = view.lock();
    if (!v) {
        v = VRSetupManager::getCurrent()->getView(viewID);
        view = v;
    }
    if (!v) return;
    if (frameLimitReached()) return;

    //int ts = VRGlobals::get()->CURRENT_FRAME;
    VRFrame* f = new VRFrame();
    captures.push_back(f);
    f->capture = v->grab();
    f->timestamp = glutGet(GLUT_ELAPSED_TIME);

    VRTransformPtr t = v->getCamera();
    if (t == 0) return;
    f->f = t->getFrom();
    f->a = t->getAt();
    f->u = t->getUp();
}