Ignore:
Timestamp:
Mar 6, 2009, 9:27:24 PM (16 years ago)
Author:
dkearney
Message:

adding flowvisviewer widget and flowvis-test program for exercising flow
commands. most stuff works in the flowvis-test gui, there are not transfer
functions or legends. play/pause, stop and record work, record download's or
saves the video file to users's desktop. adding iconc for pause, record and
stop.

added "flow play" command to nanovis. the goal of this command is to send back
the next frame to the client. the play functionality allows users to see
frames as if they were a movie, and also send command nanovis server. this
makes the experience more interactive than waiting for a movie to be made and
downloading it. also the play functionality can be used as a cheap preview to
get the best angle and settings before recording the movie.

added sendDataToClient function to nanovis server so i could send back movie
files. we create the movie on the render server and send back the mpeg binary
for the user to download. the function is pretty general so it can be used to
send any blob of data.

File:
1 edited

Legend:

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

    r1282 r1295  
    12431243    stats.nFrames++;
    12441244    stats.nBytes += (bytesPerRow * win_height);
     1245}
     1246
     1247void
     1248NanoVis::sendDataToClient(const char *command, const char *data, size_t dlen)
     1249{
     1250/*
     1251    char header[200];
     1252
     1253    // Generate the PPM binary file header
     1254    sprintf(header, "P6 %d %d %d\n", win_width, win_height, PPM_MAXVAL);
     1255
     1256    size_t header_length = strlen(header);
     1257    size_t data_length = win_width * win_height * 3;
     1258
     1259    char command[200];
     1260    sprintf(command, "%s %lu\n", prefix,
     1261            (unsigned long)header_length + data_length);
     1262*/
     1263
     1264//    size_t wordsPerRow = (win_width * 24 + 31) / 32;
     1265//    size_t bytesPerRow = wordsPerRow * 4;
     1266//    size_t rowLength = win_width * 3;
     1267    size_t nRecs = 2;
     1268
     1269    struct iovec *iov;
     1270    iov = (struct iovec *)malloc(sizeof(struct iovec) * nRecs);
     1271
     1272    // Write the nanovisviewer command, then the image header and data.
     1273    // Command
     1274// FIXME: shouldn't have to cast this
     1275    iov[0].iov_base = (char *)command;
     1276    iov[0].iov_len = strlen(command);
     1277    // Data
     1278// FIXME: shouldn't have to cast this
     1279    iov[1].iov_base = (char *)data;
     1280    iov[1].iov_len = dlen;
     1281    writev(0, iov, nRecs);
     1282    free(iov);
     1283    // stats.nFrames++;
     1284    // stats.nBytes += (bytesPerRow * win_height);
    12451285}
    12461286
Note: See TracChangeset for help on using the changeset viewer.