Skip to content

Commit

Permalink
support old + new libraries for video caps
Browse files Browse the repository at this point in the history
  • Loading branch information
brookgagnon committed Jun 1, 2024
1 parent 207c705 commit ac7ea5e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions obplayer/player/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,18 +614,16 @@ def __init__(self):
self.bin.add_pad(self.srcpad)

def overlay_caps_changed(self, overlay, caps):
print("overlay caps changed")

# "from_caps" no longer available in GstVideo.VideoInfo, so we use "new_from_caps" instead.
self.overlay_caps = GstVideo.VideoInfo.new_from_caps(caps)
if hasattr(GstVideo.VideoInfo, 'new_from_caps'):
self.overlay_caps = GstVideo.VideoInfo.new_from_caps(caps)

# self.overlay_caps = GstVideo.VideoInfo()
# self.overlay_caps.from_caps(caps)
# fallback to old method
else:
self.overlay_caps = GstVideo.VideoInfo()
self.overlay_caps.from_caps(caps)

def overlay_draw(self, overlay, context, arg1, arg2):

print("overlay draw")

# early return if not caps
if not hasattr(self, "overlay_caps"):
return
Expand Down

0 comments on commit ac7ea5e

Please sign in to comment.