MCPcopy Create free account
hub / github.com/Tencent/libpag / encodeFrame

Method encodeFrame

exporter/src/export/encode/OfflineVideoEncoder.cpp:186–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void OfflineVideoEncoder::encodeFrame(uint8_t* data[], int stride[], FrameType frameType) {
187 if (data[0] == nullptr) {
188 return;
189 }
190
191 std::string yuvFile = JoinPaths(rootPath, "YUV-" + std::to_string(frames) + ".yuv");
192 WriteYUVData(data, stride, width, height, yuvFile);
193
194 FrameInfo frameInfo;
195 frameInfo.frameType = frameType;
196 frameInfo.timeStamp = frames;
197 frameInfo.frameSize = width * height * 3 / 2;
198
199 std::string frameInfoFile = JoinPaths(rootPath, "InFrameInfo-" + std::to_string(frames) + ".txt");
200 writeFrameInfo(frameInfo, frameInfoFile);
201 frames++;
202}
203
204int OfflineVideoEncoder::getEncodedFrame(bool wait, uint8_t** outData, FrameType* outFrameType,
205 int64_t* outFrameIndex) {

Callers

nothing calls this directly

Calls 2

JoinPathsFunction · 0.85
WriteYUVDataFunction · 0.85

Tested by

no test coverage detected