[video_player/camera] add gst_caps_unref (#91)

After using gst_pad_get_current_caps, it should be followed by a call to gst_caps_unref.

Signed-off-by: Makoto Sato <makoto.sato@atmark-techno.com>
This commit is contained in:
Makoto Sato
2023-12-13 13:27:12 +09:00
committed by GitHub
parent 1069768787
commit 489ae3ccd2
2 changed files with 4 additions and 0 deletions

View File

@ -272,6 +272,7 @@ void GstCamera::HandoffHandler(GstElement* fakesink, GstBuffer* buf,
int height;
gst_structure_get_int(structure, "width", &width);
gst_structure_get_int(structure, "height", &height);
gst_caps_unref(caps);
if (width != self->width_ || height != self->height_) {
self->width_ = width;
self->height_ = height;

View File

@ -403,6 +403,8 @@ void GstVideoPlayer::GetVideoSize(int32_t& width, int32_t& height) {
return;
}
#endif // USE_EGL_IMAGE_DMABUF
gst_caps_unref(caps);
}
// static
@ -416,6 +418,7 @@ void GstVideoPlayer::HandoffHandler(GstElement* fakesink, GstBuffer* buf,
int height;
gst_structure_get_int(structure, "width", &width);
gst_structure_get_int(structure, "height", &height);
gst_caps_unref(caps);
if (width != self->width_ || height != self->height_) {
self->width_ = width;
self->height_ = height;