Changeset 75393 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Nov 12, 2018 9:53:28 AM (6 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/RecordingStream.cpp
r75392 r75393 349 349 PRECORDINGVIDEOFRAME pVideoFrame = (PRECORDINGVIDEOFRAME)pBlock->pvData; 350 350 351 rc = recordingRGBToYUV(pVideoFrame->uPixelFormat,352 /* Destination */353 this->Video.Codec.VPX.pu8YuvBuf, pVideoFrame->uWidth, pVideoFrame->uHeight,354 /* Source */355 pVideoFrame->pu8RGBBuf, this->ScreenSettings.Video.ulWidth, this->ScreenSettings.Video.ulHeight);351 rc = RecordingUtilsRGBToYUV(pVideoFrame->uPixelFormat, 352 /* Destination */ 353 this->Video.Codec.VPX.pu8YuvBuf, pVideoFrame->uWidth, pVideoFrame->uHeight, 354 /* Source */ 355 pVideoFrame->pu8RGBBuf, this->ScreenSettings.Video.ulWidth, this->ScreenSettings.Video.ulHeight); 356 356 if (RT_SUCCESS(rc)) 357 357 { -
trunk/src/VBox/Main/src-client/RecordingUtils.cpp
r75354 r75393 31 31 * Convert an image to YUV420p format. 32 32 * 33 * @return true on success,false on failure.33 * @return \c true on success, \c false on failure. 34 34 * @param aDstBuf The destination image buffer. 35 35 * @param aDstWidth Width (in pixel) of destination buffer. … … 40 40 */ 41 41 template <class T> 42 inline bool videoRecColorConvWriteYUV420p(uint8_t *aDstBuf, unsigned aDstWidth, unsigned aDstHeight,43 uint8_t *aSrcBuf, unsigned aSrcWidth, unsigned aSrcHeight)42 inline bool recordingUtilsColorConvWriteYUV420p(uint8_t *aDstBuf, unsigned aDstWidth, unsigned aDstHeight, 43 uint8_t *aSrcBuf, unsigned aSrcWidth, unsigned aSrcHeight) 44 44 { 45 45 RT_NOREF(aDstWidth, aDstHeight); … … 103 103 104 104 /** 105 * Convert an image to RGB24 format 106 * @returns true on success, false on failure 107 * @param aWidth width of image 108 * @param aHeight height of image 109 * @param aDestBuf an allocated memory buffer large enough to hold the 110 * destination image (i.e. width * height * 12bits) 111 * @param aSrcBuf the source image as an array of bytes 105 * Convert an image to RGB24 format. 106 * 107 * @returns true on success, false on failure. 108 * @param aWidth Width of image. 109 * @param aHeight Height of image. 110 * @param aDestBuf An allocated memory buffer large enough to hold the 111 * destination image (i.e. width * height * 12bits). 112 * @param aSrcBuf The source image as an array of bytes. 112 113 */ 113 114 template <class T> 114 inline bool videoRecColorConvWriteRGB24(unsigned aWidth, unsigned aHeight,115 uint8_t *aDestBuf, uint8_t *aSrcBuf)115 inline bool RecordingUtilsColorConvWriteRGB24(unsigned aWidth, unsigned aHeight, 116 uint8_t *aDestBuf, uint8_t *aSrcBuf) 116 117 { 117 118 enum { PIX_SIZE = 3 }; … … 147 148 * @param uSrcHeight Height (Y, in pixels) of source buffer. 148 149 */ 149 int recordingRGBToYUV(uint32_t uPixelFormat,150 uint8_t *paDst, uint32_t uDstWidth, uint32_t uDstHeight,151 uint8_t *paSrc, uint32_t uSrcWidth, uint32_t uSrcHeight)150 int RecordingUtilsRGBToYUV(uint32_t uPixelFormat, 151 uint8_t *paDst, uint32_t uDstWidth, uint32_t uDstHeight, 152 uint8_t *paSrc, uint32_t uSrcWidth, uint32_t uSrcHeight) 152 153 { 153 154 switch (uPixelFormat) 154 155 { 155 156 case RECORDINGPIXELFMT_RGB32: 156 if (! videoRecColorConvWriteYUV420p<ColorConvBGRA32Iter>(paDst, uDstWidth, uDstHeight,157 paSrc, uSrcWidth, uSrcHeight))157 if (!recordingUtilsColorConvWriteYUV420p<ColorConvBGRA32Iter>(paDst, uDstWidth, uDstHeight, 158 paSrc, uSrcWidth, uSrcHeight)) 158 159 return VERR_INVALID_PARAMETER; 159 160 break; 160 161 case RECORDINGPIXELFMT_RGB24: 161 if (! videoRecColorConvWriteYUV420p<ColorConvBGR24Iter>(paDst, uDstWidth, uDstHeight,162 paSrc, uSrcWidth, uSrcHeight))162 if (!recordingUtilsColorConvWriteYUV420p<ColorConvBGR24Iter>(paDst, uDstWidth, uDstHeight, 163 paSrc, uSrcWidth, uSrcHeight)) 163 164 return VERR_INVALID_PARAMETER; 164 165 break; 165 166 case RECORDINGPIXELFMT_RGB565: 166 if (! videoRecColorConvWriteYUV420p<ColorConvBGR565Iter>(paDst, uDstWidth, uDstHeight,167 paSrc, uSrcWidth, uSrcHeight))167 if (!recordingUtilsColorConvWriteYUV420p<ColorConvBGR565Iter>(paDst, uDstWidth, uDstHeight, 168 paSrc, uSrcWidth, uSrcHeight)) 168 169 return VERR_INVALID_PARAMETER; 169 170 break;
Note:
See TracChangeset
for help on using the changeset viewer.