1079 lines · 39.3 KB · C++
RawDownload
  const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight;   WelsStrncpy (strFileName, 256, "pic_in_");	// confirmed_safe_unsafe_usage   if (m_iMaxPicWidth == 640) {    WelsStrcat (strFileName, 256, "360p.");	// confirmed_safe_unsafe_usage  } else if (m_iMaxPicWidth == 320) {    WelsStrcat (strFileName, 256, "180p.");	// confirmed_safe_unsafe_usage  } else if (m_iMaxPicWidth == 160) {    WelsStrcat (strFileName, 256, "90p.");	// confirmed_safe_unsafe_usage  }   switch (m_iCspInternal) {  case videoFormatI420:  case videoFormatYV12:    WelsStrcat (strFileName, 256, "yuv");	// confirmed_safe_unsafe_usage    pFile = WelsFopen (strFileName, "ab+");    //				WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x\n", m_iCspInternal);    if (NULL != pFile) {      fwrite (pSrc, sizeof (uint8_t), (iDataLength * 3) >> 1, pFile);      fflush (pFile);      fclose (pFile);    }    break;  case videoFormatRGB:    WelsStrcat (strFileName, 256, "rgb");	// confirmed_safe_unsafe_usage    pFile = WelsFopen (strFileName, "ab+");    if (NULL != pFile) {      fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile);      fflush (pFile);      fclose (pFile);    }  case videoFormatBGR:    WelsStrcat (strFileName, 256, "bgr");	// confirmed_safe_unsafe_usage    pFile = WelsFopen (strFileName, "ab+");    //				WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_BGR, m_iCspInternal= 0x%x\n", m_iCspInternal);    if (NULL != pFile) {      fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile);      fflush (pFile);      fclose (pFile);    }    break;  case videoFormatYUY2:    WelsStrcat (strFileName, 256, "yuy2");	// confirmed_safe_unsafe_usage    pFile = WelsFopen (strFileName, "ab+");    if (NULL != pFile) {      fwrite (pSrc, sizeof (uint8_t), (CALC_BI_STRIDE (m_iMaxPicWidth,  16)) * m_iMaxPicHeight, pFile);      fflush (pFile);      fclose (pFile);    }    break;  default:    WelsLog (m_pEncContext, WELS_LOG_INFO, "Exclusive case, m_iCspInternal= 0x%x\n", m_iCspInternal);    break;  }#endif//DUMP_SRC_PICTURE  return;}} using namespace WelsSVCEnc; int32_t WelsCreateSVCEncoder (ISVCEncoder** ppEncoder) {  if ((*ppEncoder = new CWelsH264SVCEncoder()) != NULL) {    return 0;  }   return 1;} void WelsDestroySVCEncoder (ISVCEncoder* pEncoder) {  CWelsH264SVCEncoder* pSVCEncoder = (CWelsH264SVCEncoder*)pEncoder;   if (pSVCEncoder) {    delete pSVCEncoder;    pSVCEncoder = NULL;  }}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Lines 1001–1079 of 1079. Previous lines

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t