Re-implementation of MediaPlayer and Stream update

Avoid using gst video frames, and simply copy buffer instead. Use gst memory map to access pointer to RGBA data. unreferencing the buffer frees the memory (apparently). Also free OpenGL objects on close to free memory.
Overall, memory consumption seems to be reduced.
This commit is contained in:
Bruno Herbelin
2024-10-04 16:29:02 +02:00
parent 01d3a91e40
commit b2ce0f3934
5 changed files with 159 additions and 210 deletions

View File

@@ -368,18 +368,18 @@ private:
} FrameStatus;
struct Frame {
GstVideoFrame vframe;
GstBuffer *buffer;
FrameStatus status;
bool full;
bool is_new;
GstClockTime position;
std::mutex access;
Frame() {
full = false;
buffer = NULL;
is_new = false;
status = INVALID;
position = GST_CLOCK_TIME_NONE;
}
void unmap();
};
Frame frame_[N_VFRAME];
guint write_index_;