Skip to content

Commit fd412e2

Browse files
committed
Update H264Encoder.cpp
1 parent aa0f5d7 commit fd412e2

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/video/H264Encoder.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
#include "H264Encoder.h"
1+
// #include "H264Encoder.h"
22

3-
namespace video {
4-
H264Encoder::H264Encoder(int fps, int rf) : fps(fps), rf(rf) {}
3+
// namespace video {
4+
// H264Encoder::H264Encoder(int fps, int rf) : fps(fps), rf(rf) {}
55

6-
std::vector<std::basic_string<uint8_t>> H264Encoder::encode_frame(const cv::Mat& frame) {
7-
if (!encoder) {
8-
auto size = frame.size();
9-
encoder = std::make_unique<h264encoder::Encoder>(size.width, size.height, size.width,
10-
size.height, fps, rf);
11-
}
12-
std::vector<std::basic_string<uint8_t>> video_data_units;
13-
auto frame_size = encoder->encode(frame.data);
14-
for (auto video_data : encoder->getNals()) {
15-
std::basic_string<uint8_t> data(video_data.p_payload, video_data.i_payload);
16-
video_data_units.push_back(data);
17-
}
18-
return video_data_units;
19-
}
20-
} // namespace video
6+
// std::vector<std::basic_string<uint8_t>> H264Encoder::encode_frame(const cv::Mat& frame) {
7+
// if (!encoder) {
8+
// auto size = frame.size();
9+
// encoder = std::make_unique<h264encoder::Encoder>(size.width, size.height, size.width,
10+
// size.height, fps, rf);
11+
// }
12+
// std::vector<std::basic_string<uint8_t>> video_data_units;
13+
// auto frame_size = encoder->encode(frame.data);
14+
// for (auto video_data : encoder->getNals()) {
15+
// std::basic_string<uint8_t> data(video_data.p_payload, video_data.i_payload);
16+
// video_data_units.push_back(data);
17+
// }
18+
// return video_data_units;
19+
// }
20+
// } // namespace video

0 commit comments

Comments
 (0)