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

Function WriteYUVData

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

Source from the content-addressed store, hash-verified

56}
57
58static bool WriteYUVData(uint8_t* data[4], int stride[4], int width, int height,
59 const std::string& path) {
60 auto fp = fopen(path.c_str(), "wb");
61 if (fp == nullptr) {
62 return false;
63 }
64 bool ret = WriteYUVPlane(data[0], stride[0], width / 1, height / 1, fp);
65 ret = ret && WriteYUVPlane(data[1], stride[1], width / 2, height / 2, fp);
66 ret = ret && WriteYUVPlane(data[2], stride[2], width / 2, height / 2, fp);
67 fflush(fp);
68 fclose(fp);
69 return ret;
70}
71
72OfflineVideoEncoder::~OfflineVideoEncoder() {
73 close();

Callers 1

encodeFrameMethod · 0.85

Calls 1

WriteYUVPlaneFunction · 0.85

Tested by

no test coverage detected