使用gstreamer播放的媒体文件路径带中文时的处理方法

来源:互联网 发布:mac日历垃圾广告 编辑:程序博客网 时间:2024/05/01 05:05

参考文章:

gstreamer 指定有中文的 URI地址,需使用UTF8编码

http://blog.csdn.net/gxp/article/details/6719199



假设要播放的文件路径是f:/temp/测试.mp3

相关代码:

wstring wstr = L"file:///f:/temp/测试.mp3";const gchar* uri = g_utf16_to_utf8((const gunichar2*)wstr.c_str(), -1, NULL, NULL, NULL);g_object_set(G_OBJECT(playpipe), "uri", uri, NULL);g_free((gpointer)uri);


0 0
原创粉丝点击