Freeing a libvlc_video_viewpoint_t

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Freeing a libvlc_video_viewpoint_t

Postby sherington » 10 Apr 2020 19:52

A libvlc_video_viewpoint_t is created by libvlc_video_new_viewpoint():

Code: Select all

LIBVLC_API libvlc_video_viewpoint_t *libvlc_video_new_viewpoint(void);

IIRC this used to be able to be freed by libvlc_free, but as libvlc_free has been removed what now is the correct thing to do here?

Should there be a corresponding libvlc_video_viewpoint_destroy(libvlc_video_viewpoint_t*) or something?

I should not be just calling the standard native free() on memory that LibVLC allocated should I?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Freeing a libvlc_video_viewpoint_t

Postby Rémi Denis-Courmont » 10 Apr 2020 19:53

libvlc_free() is useless as you can call free(). LibVLC uses malloc().
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: Freeing a libvlc_video_viewpoint_t

Postby sherington » 10 Apr 2020 19:58

I'm fine with that, thanks, I can call a native free.

It just seemed like maybe it's something that would be better encapsulated, other native API in LibVLC has destroy counterparts that's what prompted my question.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Freeing a libvlc_video_viewpoint_t

Postby Rémi Denis-Courmont » 10 Apr 2020 20:35

For opaque LibVLC types, there should be probably a type-specific destructor function, yes.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Freeing a libvlc_video_viewpoint_t

Postby mfkl » 10 Apr 2020 21:19

You didn't mention which version of libvlc you are using.

Both latest libvlc 3 and libvlc 4 have libvlc_free again, so update.
https://mfkl.github.io

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: Freeing a libvlc_video_viewpoint_t

Postby sherington » 10 Apr 2020 21:43

Ah, I remember the mailing list discussion but didn't realise this was added back in.

Thanks for the suggestion.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 23 guests