| 184 | } |
| 185 | |
| 186 | void 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 | |
| 204 | int OfflineVideoEncoder::getEncodedFrame(bool wait, uint8_t** outData, FrameType* outFrameType, |
| 205 | int64_t* outFrameIndex) { |
nothing calls this directly
no test coverage detected