Changeset 6380


Ignore:
Timestamp:
Jun 13, 2016 1:02:31 PM (8 years ago)
Author:
ldelgass
Message:

Add commandline option to set max bitrate (in kbps)

Location:
geovis/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/ReadBuffer.cpp

    r3998 r6380  
    2626    _lastStatus(OK)
    2727{
    28     _bytes = new unsigned char [_bufferSize];
     28    _bytes = new unsigned char[_bufferSize];
    2929    flush();
    3030}
  • geovis/trunk/RenderServer.cpp

    r5942 r6380  
    296296
    297297    std::string resourcePath;
     298    double maxbitrate = 1.0e8;
    298299    while (1) {
    299         int c = getopt(argc, argv, "p:i:o:");
     300        int c = getopt(argc, argv, "r:p:i:o:");
    300301        if (c == -1) {
    301302            break;
     
    304305        case 'p':
    305306            resourcePath = optarg;
     307            break;
     308        case 'r':
     309            // Option is in kbps
     310            maxbitrate = 1000.0 * (double)atol(optarg);
    306311            break;
    307312        case 'i': {
     
    355360    g_inBufPtr = new ReadBuffer(g_fdIn, 1<<12);
    356361
     362    g_renderer->setMaximumBitrate(maxbitrate);
    357363    if (resourcePath.empty()) {
    358364        resourcePath = "/usr/share/osgearth/data";
  • geovis/trunk/Renderer.cpp

    r6354 r6380  
    136136    _bgColor[1] = 0;
    137137    _bgColor[2] = 0;
    138     //setMaximumFrameRateInHertz(15.0);
    139138    // 100 Mbps
    140139    setMaximumBitrate(1.0e8);
    141140    _lastFrameTime = _minFrameTime;
    142     TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6));
    143     TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz());
    144     TRACE("Frame time target: %.2f msec", _minFrameTime * 1000.0f);
    145141
    146142    iDataInit(getenv("USER"));
     
    23172313
    23182314    setMaximumBitrate(origBitrate);
    2319     TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6));
    2320     TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz());
    23212315
    23222316    if (_viewer.valid()) {
  • geovis/trunk/Renderer.h

    r6354 r6380  
    500500            }
    501501        }
     502        TRACE("Frame rate target: %.2f Hz", (float)getMaximumFrameRateInHertz());
     503        TRACE("Frame time target: %.2f msec", _minFrameTime * 1000.0f);
    502504    }
    503505
    504506    void setMaximumBitrate(double bitsPerSecond)
    505507    {
     508        TRACE("Setting max bitrate to %g", bitsPerSecond);
    506509        unsigned long bitsPerFrame = (_windowWidth * _windowHeight * 3 + 16) * 8;
    507510        double fps = bitsPerSecond / ((double)bitsPerFrame);
    508511        setMaximumFrameRateInHertz(fps);
     512        TRACE("Bandwidth target: %.2f Mbps", (float)(getMaximumBitrate()/1.0e6));
    509513    }
    510514
Note: See TracChangeset for help on using the changeset viewer.