[feat] support dynamic resolution codec

This commit is contained in:
dijunkun
2024-09-05 17:28:58 +08:00
parent c0c2b18b8b
commit c477643aed
25 changed files with 481 additions and 118 deletions

View File

@@ -12,6 +12,13 @@ VideoFrame::VideoFrame(size_t size) {
height_ = 0;
}
VideoFrame::VideoFrame(size_t size, size_t width, size_t height) {
buffer_ = new uint8_t[size];
size_ = size;
width_ = width;
height_ = height;
}
VideoFrame::VideoFrame(const uint8_t *buffer, size_t size) {
buffer_ = new uint8_t[size];
memcpy(buffer_, buffer, size);

View File

@@ -14,6 +14,7 @@ class VideoFrame {
public:
VideoFrame();
VideoFrame(size_t size);
VideoFrame(size_t size, size_t width, size_t height);
VideoFrame(const uint8_t *buffer, size_t size);
VideoFrame(const uint8_t *buffer, size_t size, size_t width, size_t height);
VideoFrame(const VideoFrame &video_frame);
@@ -29,6 +30,9 @@ class VideoFrame {
uint8_t *GetBuffer() { return buffer_; }
size_t GetWidth() { return width_; }
size_t GetHeight() { return height_; }
private:
uint8_t *buffer_ = nullptr;
size_t size_ = 0;