Changeset 65415 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jan 24, 2017 10:36:09 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/VideoRec.cpp
r65412 r65415 58 58 /** Initialized, idle. */ 59 59 VIDEORECSTS_IDLE = 1, 60 /** Currently in VideoRecCopyToIntBuf(), delay termination. */61 VIDEORECSTS_ COPYING= 2,60 /** Currently busy, delay termination. */ 61 VIDEORECSTS_BUSY = 2, 62 62 /** Signal that we are terminating. */ 63 63 VIDEORECSTS_TERMINATING = 3 … … 110 110 /** Container context. */ 111 111 WebMWriter *pEBML; 112 #ifdef VBOX_WITH_AUDIO_VIDEOREC 112 113 /** Track number of audio stream. */ 113 114 uint8_t uTrackAudio; 115 #endif 114 116 /** Track number of video stream. */ 115 117 uint8_t uTrackVideo; … … 588 590 } 589 591 590 if (enmState == VIDEORECSTS_ COPYING)592 if (enmState == VIDEORECSTS_BUSY) 591 593 { 592 594 int rc = RTSemEventWait(pCtx->TermEvent, RT_INDEFINITE_WAIT); … … 804 806 return rc; 805 807 } 808 809 LogRel(("VideoRec: Recording screen #%u with %ux%u @ %u kbps, %u fps to '%s'\n", 810 uScreen, uWidth, uHeight, uRate, uFPS, pszFile)); 806 811 } 807 812 … … 809 814 if (fHasAudioTrack) 810 815 { 811 rc = pStream->pEBML->AddAudioTrack(48000, 2, 16, &pStream->uTrackAudio); 816 rc = pStream->pEBML->AddAudioTrack(48000, 2, 16, &pStream->uTrackAudio); /** @todo Make this configurable. */ 812 817 if (RT_FAILURE(rc)) 813 818 { … … 815 820 return rc; 816 821 } 822 823 LogRel(("VideoRec: Recording audio enabled\n")); 817 824 } 818 825 #endif … … 851 858 pStream->fEnabled = true; 852 859 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 855 861 856 862 return VINF_SUCCESS; … … 868 874 uint32_t enmState = ASMAtomicReadU32(&g_enmState); 869 875 return ( enmState == VIDEORECSTS_IDLE 870 || enmState == VIDEORECSTS_ COPYING);876 || enmState == VIDEORECSTS_BUSY); 871 877 } 872 878 … … 1048 1054 1049 1055 /** 1050 * VideoRec utility function to copy a source image (FrameBuf)to the intermediate1056 * VideoRec utility function to copy a source video frame to the intermediate 1051 1057 * RGB buffer. This function is executed only once per time. 1052 1058 * … … 1056 1062 * @param pCtx Pointer to the video recording context. 1057 1063 * @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 uB itsPerPixel Bits Per Pixel1062 * @param uBytesPerLine Bytes per s ource scanlineName.1063 * @param uSrcWidth Width of the sourceframe.1064 * @param uSrcHeight Height of the sourceframe.1065 * @param puSrcData Pointer to sourceframe 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. 1066 1072 * @param u64TimeStampMs Time stamp (in ms). 1067 1073 */ 1068 1074 int VideoRecSendVideoFrame(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint32_t x, uint32_t y, 1069 uint32_t uPixelFormat, uint32_t uB itsPerPixel, uint32_t uBytesPerLine,1075 uint32_t uPixelFormat, uint32_t uBPP, uint32_t uBytesPerLine, 1070 1076 uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData, 1071 1077 uint64_t uTimeStampMs) 1072 1078 { 1073 1079 /* 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)) 1075 1081 return VINF_TRY_AGAIN; 1076 1082 … … 1161 1167 if (uPixelFormat == BitmapFormat_BGR) 1162 1168 { 1163 switch (uB itsPerPixel)1169 switch (uBPP) 1164 1170 { 1165 1171 case 32: … … 1176 1182 break; 1177 1183 default: 1178 AssertMsgFailed(("Unknown color depth! mBitsPerPixel=%d\n", uB itsPerPixel));1184 AssertMsgFailed(("Unknown color depth! mBitsPerPixel=%d\n", uBPP)); 1179 1185 break; 1180 1186 } … … 1212 1218 } while (0); 1213 1219 1214 if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_IDLE, VIDEORECSTS_ COPYING))1220 if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_IDLE, VIDEORECSTS_BUSY)) 1215 1221 { 1216 1222 rc = RTSemEventSignal(pCtx->TermEvent);
Note:
See TracChangeset
for help on using the changeset viewer.