VirtualBox

Changeset 74907 in vbox for trunk


Ignore:
Timestamp:
Oct 18, 2018 8:52:01 AM (6 years ago)
Author:
vboxsync
Message:

VideoRec/Main: Do not check for other constraints like the video FPS rate in VideoRecIsReady(), as this check then also would affect other (non-FPS related) stuff like audio data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/VideoRec.cpp

    r74906 r74907  
    284284        /** Codec-specific data. */
    285285        VIDEORECVIDEOCODEC  Codec;
    286         /** Minimal delay (in ms) between two frames. */
     286        /** Minimal delay (in ms) between two video frames.
     287         *  This value is based on the configured FPS rate. */
    287288        uint32_t            uDelayMs;
    288289        /** Target X resolution (in pixels). */
     
    14451446
    14461447/**
    1447  * Checks if recording engine is ready to accept a new frame for the given screen.
    1448  *
    1449  * @returns true if recording engine is ready.
     1448 * Checks if recording engine is ready to accept new recording data for a given screen.
     1449 *
     1450 * @returns true if recording engine is ready, false if not.
    14501451 * @param   pCtx                Pointer to video recording context.
    14511452 * @param   uScreen             Screen ID.
    1452  * @param   uTimeStampMs        Current time stamp (in ms).
     1453 * @param   uTimeStampMs        Current time stamp (in ms). Currently not being used.
    14531454 */
    14541455bool VideoRecIsReady(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint64_t uTimeStampMs)
    14551456{
    14561457    AssertPtrReturn(pCtx, false);
     1458    RT_NOREF(uTimeStampMs);
    14571459
    14581460    if (ASMAtomicReadU32(&pCtx->enmState) != VIDEORECSTS_INITIALIZED)
    14591461        return false;
    14601462
     1463    bool fIsReady = false;
     1464
    14611465    PVIDEORECSTREAM pStream = videoRecStreamGet(pCtx, uScreen);
    1462     if (   !pStream
    1463         || !pStream->fEnabled)
    1464     {
    1465         return false;
    1466     }
    1467 
    1468     if (uTimeStampMs < pStream->Video.uLastTimeStampMs + pStream->Video.uDelayMs)
    1469         return false;
    1470 
    1471     return true;
     1466    if (pStream)
     1467    {
     1468        videoRecStreamLock(pStream);
     1469        fIsReady = pStream->fEnabled;
     1470        videoRecStreamUnlock(pStream);
     1471    }
     1472
     1473    /* Note: Do not check for other constraints like the video FPS rate here,
     1474     *       as this check then also would affect other (non-FPS related) stuff
     1475     *       like audio data. */
     1476
     1477    return fIsReady;
    14721478}
    14731479
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette