| 56 | } |
| 57 | |
| 58 | static 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 | |
| 72 | OfflineVideoEncoder::~OfflineVideoEncoder() { |
| 73 | close(); |
no test coverage detected