1

我正在尝试从 GstBaseSink 派生的 GstXvImageSink 访问“last-sample”属性。我越来越:

TypeError:“GstXvImageSink”类型的对象没有属性“last-sample”

有没有一种特殊的方法可以从 pygtk 中的基类获取属性,或者这个属性是否以某种方式隐藏?

代码:

def take_snapshoot(self):
    sample = self.__snapshot_source_video_sink.get_property("last-sample")
4

1 回答 1

0

我的错。我正在使用 gstreamer 0.1,并且我正在阅读 gstreamer 1.0 的文档 引用 GstBuffer 的所有内容现在都是 GstSample。在http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-porting-1.0.html之后

GST_TAG_IMAGE、GST_TAG_PREVIEW_IMAGE、GST_TAG_ATTACHMENT:许多以前属于 GstBuffer 类型的标签现在属于 GstSample 类型(它基本上是一个包含缓冲区以及大写字母和其他一些信息的结构)。

所以在我的情况下,答案是使用:

def take_snapshoot(self):
sample = self.__snapshot_source_video_sink.get_property("last-buffer")
于 2015-04-18T13:41:57.760 回答