Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
7b3cf354
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7b3cf354
编写于
5月 03, 2020
作者:
J
Jim
提交者:
GitHub
5月 03, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2789 from univrsal/vlc-metadata-procs
vlc-video: Add procedure to receive media metadata
上级
027b3b8a
79c6e0dc
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
70 addition
and
0 deletion
+70
-0
plugins/vlc-video/vlc-video-plugin.c
plugins/vlc-video/vlc-video-plugin.c
+4
-0
plugins/vlc-video/vlc-video-plugin.h
plugins/vlc-video/vlc-video-plugin.h
+6
-0
plugins/vlc-video/vlc-video-source.c
plugins/vlc-video/vlc-video-source.c
+60
-0
未找到文件。
plugins/vlc-video/vlc-video-plugin.c
浏览文件 @
7b3cf354
...
...
@@ -24,6 +24,7 @@ LIBVLC_MEDIA_NEW_LOCATION libvlc_media_new_location_;
LIBVLC_MEDIA_ADD_OPTION
libvlc_media_add_option_
;
LIBVLC_MEDIA_RELEASE
libvlc_media_release_
;
LIBVLC_MEDIA_RELEASE
libvlc_media_retain_
;
LIBVLC_MEDIA_GET_META
libvlc_media_get_meta_
;
/* libvlc media player */
LIBVLC_MEDIA_PLAYER_NEW
libvlc_media_player_new_
;
...
...
@@ -41,6 +42,7 @@ LIBVLC_VIDEO_GET_SIZE libvlc_video_get_size_;
LIBVLC_MEDIA_PLAYER_EVENT_MANAGER
libvlc_media_player_event_manager_
;
LIBVLC_MEDIA_PLAYER_GET_STATE
libvlc_media_player_get_state_
;
LIBVLC_MEDIA_PLAYER_GET_LENGTH
libvlc_media_player_get_length_
;
LIBVLC_MEDIA_PLAYER_GET_MEDIA
libvlc_media_player_get_media_
;
/* libvlc media list */
LIBVLC_MEDIA_LIST_NEW
libvlc_media_list_new_
;
...
...
@@ -99,6 +101,7 @@ static bool load_vlc_funcs(void)
LOAD_VLC_FUNC
(
libvlc_media_add_option
);
LOAD_VLC_FUNC
(
libvlc_media_release
);
LOAD_VLC_FUNC
(
libvlc_media_retain
);
LOAD_VLC_FUNC
(
libvlc_media_get_meta
);
/* libvlc media player */
LOAD_VLC_FUNC
(
libvlc_media_player_new
);
...
...
@@ -116,6 +119,7 @@ static bool load_vlc_funcs(void)
LOAD_VLC_FUNC
(
libvlc_media_player_event_manager
);
LOAD_VLC_FUNC
(
libvlc_media_player_get_state
);
LOAD_VLC_FUNC
(
libvlc_media_player_get_length
);
LOAD_VLC_FUNC
(
libvlc_media_player_get_media
);
/* libvlc media list */
LOAD_VLC_FUNC
(
libvlc_media_list_new
);
...
...
plugins/vlc-video/vlc-video-plugin.h
浏览文件 @
7b3cf354
...
...
@@ -35,6 +35,8 @@ typedef void (*LIBVLC_MEDIA_ADD_OPTION)(libvlc_media_t *p_md,
const
char
*
options
);
typedef
void
(
*
LIBVLC_MEDIA_RETAIN
)(
libvlc_media_t
*
p_md
);
typedef
void
(
*
LIBVLC_MEDIA_RELEASE
)(
libvlc_media_t
*
p_md
);
typedef
char
*
(
*
LIBVLC_MEDIA_GET_META
)(
libvlc_media_t
*
p_md
,
libvlc_meta_t
e_meta
);
/* libvlc media player */
typedef
libvlc_media_player_t
*
(
*
LIBVLC_MEDIA_PLAYER_NEW
)(
...
...
@@ -71,6 +73,8 @@ typedef libvlc_state_t (*LIBVLC_MEDIA_PLAYER_GET_STATE)(
libvlc_media_player_t
*
p_mi
);
typedef
libvlc_time_t
(
*
LIBVLC_MEDIA_PLAYER_GET_LENGTH
)(
libvlc_media_player_t
*
p_mi
);
typedef
libvlc_media_t
*
(
*
LIBVLC_MEDIA_PLAYER_GET_MEDIA
)(
libvlc_media_player_t
*
p_mi
);
/* libvlc media list */
typedef
libvlc_media_list_t
*
(
*
LIBVLC_MEDIA_LIST_NEW
)(
...
...
@@ -118,6 +122,7 @@ extern LIBVLC_MEDIA_NEW_LOCATION libvlc_media_new_location_;
extern
LIBVLC_MEDIA_ADD_OPTION
libvlc_media_add_option_
;
extern
LIBVLC_MEDIA_RELEASE
libvlc_media_release_
;
extern
LIBVLC_MEDIA_RETAIN
libvlc_media_retain_
;
extern
LIBVLC_MEDIA_GET_META
libvlc_media_get_meta_
;
/* libvlc media player */
extern
LIBVLC_MEDIA_PLAYER_NEW
libvlc_media_player_new_
;
...
...
@@ -135,6 +140,7 @@ extern LIBVLC_VIDEO_GET_SIZE libvlc_video_get_size_;
extern
LIBVLC_MEDIA_PLAYER_EVENT_MANAGER
libvlc_media_player_event_manager_
;
extern
LIBVLC_MEDIA_PLAYER_GET_STATE
libvlc_media_player_get_state_
;
extern
LIBVLC_MEDIA_PLAYER_GET_LENGTH
libvlc_media_player_get_length_
;
extern
LIBVLC_MEDIA_PLAYER_GET_MEDIA
libvlc_media_player_get_media_
;
/* libvlc media list */
extern
LIBVLC_MEDIA_LIST_NEW
libvlc_media_list_new_
;
...
...
plugins/vlc-video/vlc-video-source.c
浏览文件 @
7b3cf354
...
...
@@ -276,6 +276,61 @@ static enum audio_format convert_vlc_audio_format(char *format)
/* ------------------------------------------------------------------------- */
static
void
vlcs_get_metadata
(
void
*
data
,
calldata_t
*
cd
)
{
struct
vlc_source
*
vlcs
=
data
;
const
char
*
data_id
=
calldata_string
(
cd
,
"tag_id"
);
if
(
!
vlcs
||
!
data_id
)
return
;
libvlc_media_t
*
media
=
libvlc_media_player_get_media_
(
vlcs
->
media_player
);
if
(
!
media
)
return
;
#define VLC_META(media, cd, did, tid, tag) \
else if (strcmp(did, tid) == 0) \
{ \
calldata_set_string(cd, "tag_data", \
libvlc_media_get_meta_(media, tag)); \
}
if
(
strcmp
(
data_id
,
"title"
)
==
0
)
calldata_set_string
(
cd
,
"tag_data"
,
libvlc_media_get_meta_
(
media
,
libvlc_meta_Title
));
VLC_META
(
media
,
cd
,
data_id
,
"artist"
,
libvlc_meta_Artist
)
VLC_META
(
media
,
cd
,
data_id
,
"genre"
,
libvlc_meta_Genre
)
VLC_META
(
media
,
cd
,
data_id
,
"copyright"
,
libvlc_meta_Copyright
)
VLC_META
(
media
,
cd
,
data_id
,
"album"
,
libvlc_meta_Album
)
VLC_META
(
media
,
cd
,
data_id
,
"track_number"
,
libvlc_meta_TrackNumber
)
VLC_META
(
media
,
cd
,
data_id
,
"description"
,
libvlc_meta_Description
)
VLC_META
(
media
,
cd
,
data_id
,
"rating"
,
libvlc_meta_Rating
)
VLC_META
(
media
,
cd
,
data_id
,
"date"
,
libvlc_meta_Date
)
VLC_META
(
media
,
cd
,
data_id
,
"setting"
,
libvlc_meta_Setting
)
VLC_META
(
media
,
cd
,
data_id
,
"url"
,
libvlc_meta_URL
)
VLC_META
(
media
,
cd
,
data_id
,
"language"
,
libvlc_meta_Language
)
VLC_META
(
media
,
cd
,
data_id
,
"now_playing"
,
libvlc_meta_NowPlaying
)
VLC_META
(
media
,
cd
,
data_id
,
"publisher"
,
libvlc_meta_Publisher
)
VLC_META
(
media
,
cd
,
data_id
,
"encoded_by"
,
libvlc_meta_EncodedBy
)
VLC_META
(
media
,
cd
,
data_id
,
"artwork_url"
,
libvlc_meta_ArtworkURL
)
VLC_META
(
media
,
cd
,
data_id
,
"track_id"
,
libvlc_meta_TrackID
)
VLC_META
(
media
,
cd
,
data_id
,
"track_total"
,
libvlc_meta_TrackTotal
)
VLC_META
(
media
,
cd
,
data_id
,
"director"
,
libvlc_meta_Director
)
VLC_META
(
media
,
cd
,
data_id
,
"season"
,
libvlc_meta_Season
)
VLC_META
(
media
,
cd
,
data_id
,
"episode"
,
libvlc_meta_Episode
)
VLC_META
(
media
,
cd
,
data_id
,
"show_name"
,
libvlc_meta_ShowName
)
VLC_META
(
media
,
cd
,
data_id
,
"actors"
,
libvlc_meta_Actors
)
VLC_META
(
media
,
cd
,
data_id
,
"album_artist"
,
libvlc_meta_AlbumArtist
)
VLC_META
(
media
,
cd
,
data_id
,
"disc_number"
,
libvlc_meta_DiscNumber
)
VLC_META
(
media
,
cd
,
data_id
,
"disc_total"
,
libvlc_meta_DiscTotal
)
#undef VLC_META
}
/* ------------------------------------------------------------------------- */
static
const
char
*
vlcs_get_name
(
void
*
unused
)
{
UNUSED_PARAMETER
(
unused
);
...
...
@@ -895,6 +950,11 @@ static void *vlcs_create(obs_data_t *settings, obs_source_t *source)
libvlc_event_attach_
(
event_manager
,
libvlc_MediaPlayerOpening
,
vlcs_started
,
c
);
proc_handler_t
*
ph
=
obs_source_get_proc_handler
(
source
);
proc_handler_add
(
ph
,
"void get_metadata(in string tag_id out string tag_data)"
,
vlcs_get_metadata
,
c
);
obs_source_update
(
source
,
NULL
);
UNUSED_PARAMETER
(
settings
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录