0
我正在從python移植到python GStreamer 1.0示例(play-master.py - noraisin.net),並且不明白如何獲取指向管道的指針。在python綁定中,它似乎被抽象出來,所以元素和管道可以互換使用。如何從gst_parse_launch返回從GstElement獲取GstPipeline的指針?
...
GstElement* element = gst_parse_launch("playbin", &error);
gst_element_set_start_time(element, GST_CLOCK_TIME_NONE);
GstClock* clock = gst_element_get_clock(element);
gst_pipeline_use_clock(???, clock);
...
所以,gst_pipeline_use_clock
需要一個指向一個GstPipeline
結構,但gst_parse_launch
指針返回到GstElement
,如果我理解正確的話,有一個指針指向管道。我如何訪問它?
下面是相同的代碼在Python:
Gst.init()
pipeline = Gst.parse_launch('playbin')
pipeline.set_start_time(Gst.CLOCK_TIME_NONE)
clock = pipeline.get_clock()
pipeline.use_clock(clock)