Ignore:
Timestamp:
Apr 2, 2013 1:54:43 PM (11 years ago)
Author:
ldelgass
Message:

Fix for flow video capture

Location:
trunk/packages/vizservers/nanovis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

    r3607 r3608  
    13331333        queueResponse(info, cmdLength, Response::VOLATILE);
    13341334#else
    1335         ssize_t nWritten  = SocketWrite(info, (size_t)cmdLength);
    1336         if (nWritten != (ssize_t)cmdLength) {
     1335        if (SocketWrite(info, (size_t)cmdLength) != (ssize_t)cmdLength) {
    13371336            ERROR("Short write");
    1338              return TCL_ERROR;
     1337            return TCL_ERROR;
    13391338        }
    13401339#endif
  • trunk/packages/vizservers/nanovis/FlowCmd.cpp

    r3605 r3608  
    10701070};
    10711071
    1072 static int
    1073 MakeImageFiles(Tcl_Interp *interp, char *tmpFileName,
    1074                FlowVideoSwitches *switchesPtr, bool *cancelPtr)
     1072static bool
     1073MakeImageFiles(char *tmpFileName,
     1074               int width, int height, int numFrames,
     1075               bool *cancelPtr)
    10751076{
    10761077    struct pollfd pollResults;
     
    10841085    oldHeight = NanoVis::winHeight;
    10851086
    1086     if ((switchesPtr->width != oldWidth) ||
    1087         (switchesPtr->height != oldHeight)) {
     1087    if (width != oldWidth ||
     1088        height != oldHeight) {
    10881089        // Resize to the requested size.
    1089         NanoVis::resizeOffscreenBuffer(switchesPtr->width, switchesPtr->height);
     1090        NanoVis::resizeOffscreenBuffer(width, height);
    10901091    }
    10911092    NanoVis::resetFlows();
    10921093    *cancelPtr = false;
    1093     int result = TCL_OK;
     1094    bool result = true;
    10941095    size_t length = strlen(tmpFileName);
    1095     for (int i = 1; i <= switchesPtr->numFrames; i++) {
     1096    for (int i = 1; i <= numFrames; i++) {
    10961097        if (((i & 0xF) == 0) && (poll(&pollResults, 1, timeout) > 0)) {
    10971098            /* If there's another command on stdin, that means the client is
     
    11161117        sprintf(tmpFileName + length, "/image%d.ppm", i);
    11171118        result = nv::writePPMFile(tmpFileName, NanoVis::screenBuffer,
    1118                                   switchesPtr->width, switchesPtr->height);
    1119         if (result != TCL_OK) {
     1119                                  width, height);
     1120        if (!result) {
    11201121            break;
    11211122        }
    11221123    }
    1123     if ((switchesPtr->width != oldWidth) ||
    1124         (switchesPtr->height != oldHeight)) {
     1124    if (width != oldWidth ||
     1125        height != oldHeight) {
    11251126        NanoVis::resizeOffscreenBuffer(oldWidth, oldHeight);
    11261127    }
     
    12411242    size_t length = strlen(tmpFileName);
    12421243    bool canceled = false;
    1243     result = MakeImageFiles(interp, tmpFileName, &switches, &canceled);
     1244    if (MakeImageFiles(tmpFileName,
     1245                       switches.width, switches.height, switches.numFrames,
     1246                       &canceled)) {
     1247        result = TCL_OK;
     1248    } else {
     1249        result = TCL_ERROR;
     1250    }
    12441251    if ((result == TCL_OK) && (!canceled)) {
    12451252        result = MakeMovie(interp, tmpFileName, token, &switches);
Note: See TracChangeset for help on using the changeset viewer.