Ai
2 Star 0 Fork 0

mirrors_grafov/go-vlc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
library.go 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
Henry Malthus 提交于 2013-08-04 18:23 +08:00 . Fix so that it builds with Go 1.1.1
// This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// license. Its contents can be found at:
// http://creativecommons.org/publicdomain/zero/1.0
package vlc
// #include "glue.h"
import "C"
// A media library
type Library struct {
ptr *C.libvlc_media_library_t
}
// Retain increments the reference count of the instance.
func (this *Library) Retain() (err error) {
if this.ptr == nil {
return &VLCError{"Library is nil"}
}
C.libvlc_media_library_retain(this.ptr)
return
}
// Release decreases the reference count of the instance and destroys it when it reaches zero.
func (this *Library) Release() (err error) {
if this.ptr == nil {
return &VLCError{"Library is nil"}
}
C.libvlc_media_library_release(this.ptr)
return
}
// Load loads the library contents.
func (this *Library) Load() error {
if this.ptr == nil {
return &VLCError{"Library is nil"}
}
C.libvlc_media_library_load(this.ptr)
return checkError()
}
// Items returns a list of all the media items in this library.
func (this *Library) Items() (*MediaList, error) {
if this.ptr == nil {
return nil, &VLCError{"Library is nil"}
}
if c := C.libvlc_media_library_media_list(this.ptr); c != nil {
return &MediaList{c}, nil
}
return nil, checkError()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_grafov/go-vlc.git
git@gitee.com:mirrors_grafov/go-vlc.git
mirrors_grafov
go-vlc
go-vlc
f64db8c39be1

搜索帮助