我想配置autoaudiosink
I'd like to configure autoaudiosink
许多简单的程序使用 gstreamer 来处理媒体文件。在这样做的过程中,他们将输出设备定义为 "autoaudiosink"。这对我不起作用,因为这会强制使用我没有连接到计算机的 HDMI 声音输出。我尝试用 alsasink device=hw:1,0
代替 autoaudiosink
修补这样的程序,但这产生了一个错误(并且该程序无法告诉我它是哪个错误)。我怀疑 gstreamer 库不喜欢其库函数参数中的空格。
我的新想法是从我的安装中删除 hdmi 驱动程序?
或者有其他方法可以防止 autoaudiosink 选择那个吗?
在使用 gstreamer 库的程序中,表达上述对我的设备进行硬编码的想法的正确方法是什么?例如在 http://github.com/gkarsay/parlatype.git 我的补丁中说
--- parlatype-1.5.2/libparlatype/src/pt-player.c 2017-08-03 14:58:24.000000000 +0200
+++ parlatype-1.5.2.new/libparlatype/src/pt-player.c 2019-07-18 10:00:49.189372451 +0200
@@ -1472,7 +1472,7 @@
player->priv->play = gst_element_factory_make ("playbin", "play");
scaletempo = gst_element_factory_make ("scaletempo", "tempo");
capsfilter = gst_element_factory_make ("capsfilter", "audiofilter");
- audiosink = gst_element_factory_make ("autoaudiosink", "audiosink");
+ audiosink = gst_element_factory_make ("alsasink device=hw:1,0", "audiosink");
/* checks */
#if GST_CHECK_VERSION(1,3,0)
在 1.5.2 版本中,程序无法创建播放器对象(而是在创建消息框以显示错误时崩溃)!
您使用 g_object_set()
设置元素的属性。简单实例化元素:
audiosink = gst_element_factory_make ("alsasink", "audiosink");
然后设置为属性:
g_object_set(audiosink, "device", "hw:1,0", NULL);
许多简单的程序使用 gstreamer 来处理媒体文件。在这样做的过程中,他们将输出设备定义为 "autoaudiosink"。这对我不起作用,因为这会强制使用我没有连接到计算机的 HDMI 声音输出。我尝试用 alsasink device=hw:1,0
代替 autoaudiosink
修补这样的程序,但这产生了一个错误(并且该程序无法告诉我它是哪个错误)。我怀疑 gstreamer 库不喜欢其库函数参数中的空格。
我的新想法是从我的安装中删除 hdmi 驱动程序? 或者有其他方法可以防止 autoaudiosink 选择那个吗?
在使用 gstreamer 库的程序中,表达上述对我的设备进行硬编码的想法的正确方法是什么?例如在 http://github.com/gkarsay/parlatype.git 我的补丁中说
--- parlatype-1.5.2/libparlatype/src/pt-player.c 2017-08-03 14:58:24.000000000 +0200
+++ parlatype-1.5.2.new/libparlatype/src/pt-player.c 2019-07-18 10:00:49.189372451 +0200
@@ -1472,7 +1472,7 @@
player->priv->play = gst_element_factory_make ("playbin", "play");
scaletempo = gst_element_factory_make ("scaletempo", "tempo");
capsfilter = gst_element_factory_make ("capsfilter", "audiofilter");
- audiosink = gst_element_factory_make ("autoaudiosink", "audiosink");
+ audiosink = gst_element_factory_make ("alsasink device=hw:1,0", "audiosink");
/* checks */
#if GST_CHECK_VERSION(1,3,0)
在 1.5.2 版本中,程序无法创建播放器对象(而是在创建消息框以显示错误时崩溃)!
您使用 g_object_set()
设置元素的属性。简单实例化元素:
audiosink = gst_element_factory_make ("alsasink", "audiosink");
然后设置为属性:
g_object_set(audiosink, "device", "hw:1,0", NULL);