libvlc_video_format_t 在vlc3中被移除了吗
时间: 2024-06-07 21:09:47 浏览: 13
在VLC 3.0版本中,`libvlc_video_format_t`结构体被重新设计,但没有被移除。它仍然存在于`libvlc`库中,但是使用方式可能有所改变。如果您正在升级您的代码以适应VLC 3.0,请仔细查看`libvlc_video_format_t`的新设计,并相应地更新您的代码。您可以查看VLC的文档以获得更多详细信息。
相关问题
vlc3.0中 libvlc_video_set_format h265 怎么传参
在使用 `libvlc_video_set_format` 函数设置 H.265 格式时,需要传入一个 `libvlc_video_format_t` 结构体指针作为参数。你可以按照以下方式设置 `libvlc_video_format_t` 结构体中的参数:
```c
libvlc_video_format_t fmt;
memset(&fmt, 0, sizeof(fmt));
fmt.i_width = width; // 设置视频宽度
fmt.i_height = height; // 设置视频高度
fmt.i_chroma = VLC_CODEC_HEVC; // 设置编码器为 H.265
```
其中 `width` 和 `height` 分别表示视频的宽度和高度,`VLC_CODEC_HEVC` 表示编码器为 H.265。
然后将 `libvlc_video_format_t` 结构体指针作为参数传入 `libvlc_video_set_format` 函数中:
```c
libvlc_video_set_format(media_player, &fmt);
```
vlc3 libvlc_video_set_format h265 应该怎么传参
要在 libvlc_video_set_format 函数中传递 H.265 格式的参数,可以使用 libvlc_video_format_t 结构体。该结构体定义了视频格式的各种属性,包括编解码器、宽度、高度、帧速率等等。
下面是一个示例代码,展示如何设置 H.265 格式的参数:
```
libvlc_instance_t *instance = ...;
libvlc_media_player_t *media_player = ...;
// 创建一个 libvlc_video_format_t 结构体
libvlc_video_format_t video_format = {
.i_width = 1920,
.i_height = 1080,
.i_codec = VLC_CODEC_HEVC,
.i_frame_rate = { 25, 1 }, // 帧率为 25
};
// 设置视频格式
libvlc_video_set_format(media_player, &video_format);
// 播放视频
libvlc_media_t *media = libvlc_media_new_path(instance, "/path/to/video.mp4");
libvlc_media_player_set_media(media_player, media);
libvlc_media_player_play(media_player);
```
在上面的代码中,我们通过设置 video_format 结构体的 i_codec 属性为 VLC_CODEC_HEVC,来指定使用 H.265 编解码器。同时也设置了视频的宽度、高度和帧率等属性。最后,调用 libvlc_video_set_format 函数来设置视频格式。