1

I'm trying to access the "last-sample" property from GstXvImageSink which is derived from GstBaseSink. I'm getting:

TypeError: object of type 'GstXvImageSink' does not have property 'last-sample'

Is there a special way to get properties from base classes in pygtk or is this property somehow hidden?

Code:

def take_snapshoot(self):
    sample = self.__snapshot_source_video_sink.get_property("last-sample")
user1296240
  • 51
  • 1
  • 6
  • Did you try `get_last_sample()`? – elya5 Apr 16 '15 at 07:45
  • @elya5 Yes, with this code: sample = self.__snapshot_source_video_sink.get_last_sample()' I'm getting: AttributeError: '__main__.GstXvImageSink' object has no attribute 'get_last_sample' – user1296240 Apr 18 '15 at 11:22

1 Answers1

0

My fault. I'm using gstreamer 0.1 and I was reading documentation for gstreamer 1.0 Everything that was reffering to GstBuffer is now GstSample. After 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: many tags that used to be of type GstBuffer are now of type GstSample (which is basically a struct containing a buffer alongside caps and some other info).

So in my case the answer is to use:

def take_snapshoot(self):
sample = self.__snapshot_source_video_sink.get_property("last-buffer")
user1296240
  • 51
  • 1
  • 6