-
Notifications
You must be signed in to change notification settings - Fork 196
sendrecv.py: poll bus with asyncio #34
base: master
Are you sure you want to change the base?
sendrecv.py: poll bus with asyncio #34
Conversation
@@ -113,7 +133,11 @@ def start_pipeline(self): | |||
self.webrtc.connect('pad-added', self.on_incoming_stream) | |||
self.pipe.set_state(Gst.State.PLAYING) | |||
|
|||
async def handle_sdp(self, message): | |||
self.bus = self.pipe.get_bus() | |||
pollfd = self.bus.get_pollfd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second user of the new API I added in 1.14 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I was pretty happy to see this had just been added, however I had to fix an annotation issue right after 1.14.2 was merged, which reminds me this will break unless master is used :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could put this in a try except block for now?
def poll_cb(self): | ||
done = False | ||
while self.bus.peek() != None: | ||
msg = self.bus.pop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can directly pop or not? Without peek first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that I could, as poll_cb will get called again immediately if all messages haven't been read, not sure what's best?
No description provided.