MCPcopy Create free account
hub / github.com/cisco/openh264 / AllocateSampleBuffer

Method AllocateSampleBuffer

codec/processing/src/downsample/downsample.cpp:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 FreeSampleBuffer();
54}
55bool CDownsampling::AllocateSampleBuffer() {
56 for (int32_t i = 0; i < 2; i++) {
57 m_pSampleBuffer[i][0] = (uint8_t*)WelsMalloc (MAX_SAMPLE_WIDTH * MAX_SAMPLE_HEIGHT);
58 if (!m_pSampleBuffer[i][0])
59 goto FREE_RET;
60 m_pSampleBuffer[i][1] = (uint8_t*)WelsMalloc (MAX_SAMPLE_WIDTH * MAX_SAMPLE_HEIGHT / 4);
61 if (!m_pSampleBuffer[i][1])
62 goto FREE_RET;
63 m_pSampleBuffer[i][2] = (uint8_t*)WelsMalloc (MAX_SAMPLE_WIDTH * MAX_SAMPLE_HEIGHT / 4);
64 if (!m_pSampleBuffer[i][2])
65 goto FREE_RET;
66 }
67 return false;
68FREE_RET:
69 FreeSampleBuffer();
70 return true;
71
72}
73void CDownsampling::FreeSampleBuffer() {
74 for (int32_t i = 0; i < 2; i++) {
75 WelsFree (m_pSampleBuffer[i][0]);

Callers

nothing calls this directly

Calls 1

WelsMallocFunction · 0.50

Tested by

no test coverage detected