VirtualBox

Changeset 65415 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 24, 2017 10:36:09 AM (8 years ago)
Author:
vboxsync
Message:

VideoRec: Renaming.

File:
1 edited

Legend:

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

    r65412 r65415  
    5858    /** Initialized, idle. */
    5959    VIDEORECSTS_IDLE          = 1,
    60     /** Currently in VideoRecCopyToIntBuf(), delay termination. */
    61     VIDEORECSTS_COPYING       = 2,
     60    /** Currently busy, delay termination. */
     61    VIDEORECSTS_BUSY          = 2,
    6262    /** Signal that we are terminating. */
    6363    VIDEORECSTS_TERMINATING   = 3
     
    110110    /** Container context. */
    111111    WebMWriter         *pEBML;
     112#ifdef VBOX_WITH_AUDIO_VIDEOREC
    112113    /** Track number of audio stream. */
    113114    uint8_t             uTrackAudio;
     115#endif
    114116    /** Track number of video stream. */
    115117    uint8_t             uTrackVideo;
     
    588590    }
    589591
    590     if (enmState == VIDEORECSTS_COPYING)
     592    if (enmState == VIDEORECSTS_BUSY)
    591593    {
    592594        int rc = RTSemEventWait(pCtx->TermEvent, RT_INDEFINITE_WAIT);
     
    804806            return rc;
    805807        }
     808
     809        LogRel(("VideoRec: Recording screen #%u with %ux%u @ %u kbps, %u fps to '%s'\n",
     810                uScreen, uWidth, uHeight, uRate, uFPS, pszFile));
    806811    }
    807812
     
    809814    if (fHasAudioTrack)
    810815    {
    811         rc = pStream->pEBML->AddAudioTrack(48000, 2, 16, &pStream->uTrackAudio);
     816        rc = pStream->pEBML->AddAudioTrack(48000, 2, 16, &pStream->uTrackAudio); /** @todo Make this configurable. */
    812817        if (RT_FAILURE(rc))
    813818        {
     
    815820            return rc;
    816821        }
     822
     823        LogRel(("VideoRec: Recording audio enabled\n"));
    817824    }
    818825#endif
     
    851858    pStream->fEnabled = true;
    852859
    853     LogRel(("VideoRec: Recording screen #%u with %ux%u @ %u kbps, %u fps to '%s' started\n",
    854             uScreen, uWidth, uHeight, uRate, uFPS, pszFile));
     860
    855861
    856862    return VINF_SUCCESS;
     
    868874    uint32_t enmState = ASMAtomicReadU32(&g_enmState);
    869875    return (   enmState == VIDEORECSTS_IDLE
    870             || enmState == VIDEORECSTS_COPYING);
     876            || enmState == VIDEORECSTS_BUSY);
    871877}
    872878
     
    10481054
    10491055/**
    1050  * VideoRec utility function to copy a source image (FrameBuf) to the intermediate
     1056 * VideoRec utility function to copy a source video frame to the intermediate
    10511057 * RGB buffer. This function is executed only once per time.
    10521058 *
     
    10561062 * @param   pCtx               Pointer to the video recording context.
    10571063 * @param   uScreen            Screen number.
    1058  * @param   x                  Starting x coordinate of the source buffer (Framebuffer).
    1059  * @param   y                  Starting y coordinate of the source buffer (Framebuffer).
    1060  * @param   uPixelFormat       Pixel Format.
    1061  * @param   uBitsPerPixel      Bits Per Pixel
    1062  * @param   uBytesPerLine      Bytes per source scanlineName.
    1063  * @param   uSrcWidth          Width of the source frame.
    1064  * @param   uSrcHeight         Height of the source frame.
    1065  * @param   puSrcData          Pointer to source frame data.
     1064 * @param   x                  Starting x coordinate of the video frame.
     1065 * @param   y                  Starting y coordinate of the video frame.
     1066 * @param   uPixelFormat       Pixel format.
     1067 * @param   uBPP               Bits Per Pixel (BPP).
     1068 * @param   uBytesPerLine      Bytes per scanline.
     1069 * @param   uSrcWidth          Width of the video frame.
     1070 * @param   uSrcHeight         Height of the video frame.
     1071 * @param   puSrcData          Pointer to video frame data.
    10661072 * @param   u64TimeStampMs     Time stamp (in ms).
    10671073 */
    10681074int VideoRecSendVideoFrame(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint32_t x, uint32_t y,
    1069                            uint32_t uPixelFormat, uint32_t uBitsPerPixel, uint32_t uBytesPerLine,
     1075                           uint32_t uPixelFormat, uint32_t uBPP, uint32_t uBytesPerLine,
    10701076                           uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData,
    10711077                           uint64_t uTimeStampMs)
    10721078{
    10731079    /* Do not execute during termination and guard against termination */
    1074     if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_COPYING, VIDEORECSTS_IDLE))
     1080    if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_BUSY, VIDEORECSTS_IDLE))
    10751081        return VINF_TRY_AGAIN;
    10761082
     
    11611167        if (uPixelFormat == BitmapFormat_BGR)
    11621168        {
    1163             switch (uBitsPerPixel)
     1169            switch (uBPP)
    11641170            {
    11651171                case 32:
     
    11761182                    break;
    11771183                default:
    1178                     AssertMsgFailed(("Unknown color depth! mBitsPerPixel=%d\n", uBitsPerPixel));
     1184                    AssertMsgFailed(("Unknown color depth! mBitsPerPixel=%d\n", uBPP));
    11791185                    break;
    11801186            }
     
    12121218    } while (0);
    12131219
    1214     if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_IDLE, VIDEORECSTS_COPYING))
     1220    if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_IDLE, VIDEORECSTS_BUSY))
    12151221    {
    12161222        rc = RTSemEventSignal(pCtx->TermEvent);
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