Advertisement
Biggie

working GstVideo.VideoFilter in Python

Jul 17th, 2014
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. class TestFilter(GstVideo.VideoFilter):
  2.     __gstmetadata__ = (
  3.         "TestFilter plugin",
  4.         "test_filter.py",
  5.         "Description",
  6.         "Contact"
  7.     )
  8.  
  9.     _srctemplate = Gst.PadTemplate.new(
  10.         'src',
  11.         Gst.PadDirection.SRC,
  12.         Gst.PadPresence.ALWAYS,
  13.         Gst.caps_from_string('video/x-raw, format=(string){ YV12, AYUV, YUY2, UYVY }')
  14.     )
  15.  
  16.     _sinktemplate = Gst.PadTemplate.new(
  17.         'sink',
  18.         Gst.PadDirection.SINK,
  19.         Gst.PadPresence.ALWAYS,
  20.         Gst.caps_from_string('video/x-raw, format=(string){ YV12, AYUV, YUY2, UYVY }')
  21.     )
  22.    
  23.     __gsttemplates__ = (_sinktemplate, _srctemplate)
  24.  
  25.     def __init__(self):
  26.         GstVideo.VideoFilter.__init__(self)
  27.         self.set_passthrough(True)
  28.  
  29.     def do_transform_frame_ip(self, frame):
  30.         print(frame.buffer.pts)
  31.         return Gst.FlowReturn.OK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement