I see the code bellow in vlc code repository.
/** This structure is opaque. It represents a libvlc instance */
typedef struct libvlc_instance_t libvlc_instance_t;
I'm wandering why the structure definition is hidden. As far as I know, it's a open-source project, why choose to hide part of the code when you choose to open-source the entire project?
It's not hidden because they want it to be secret. It's hidden because it is an implementation detail.
Opaque structures and other mechanisms to realize encapsulation and implementation hiding are used in open source and other projects to ensure a degree of API compatibility between releases of the software. Where there is a plugin architecture for example, the authors of the main software want plugins to be able to continue working without modification even when they change the main software. So they hide the implementation details in a way that allows such changes in the future.
Without such techniques, integrations such as between plugins and host software will be brittle and likely to result in incompatibilities between versions.