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