def emit_buffer1(self, sample): buf = sample.get_buffer() #info = sample.get_info() size = buf.get_size() extract_dup = getattr(buf, "extract_dup", None) if extract_dup: data = extract_dup(0, size) else: #crappy gi bindings detected, using workaround: from xpra.sound.gst_hacks import map_gst_buffer with map_gst_buffer(buf) as a: data = bytes(a[:]) return self.emit_buffer(data, {"timestamp" : normv(buf.pts), "duration" : normv(buf.duration), })
def emit_buffer(self, sample): buf = sample.get_buffer() #info = sample.get_info() size = buf.get_size() extract_dup = getattr(buf, "extract_dup", None) if extract_dup: data = extract_dup(0, size) else: #crappy gi bindings detected, using workaround: from xpra.sound.gst_hacks import map_gst_buffer with map_gst_buffer(buf) as a: data = bytes(a[:]) pts = normv(buf.pts) duration = normv(buf.duration) if pts==-1 and duration==-1 and BUNDLE_METADATA and len(self.pending_metadata)<10: self.pending_metadata.append(data) return 0 return self._emit_buffer(data, { "timestamp" : pts, "duration" : duration, })
def emit_buffer1(self, sample): buf = sample.get_buffer() #info = sample.get_info() size = buf.get_size() extract_dup = getattr(buf, "extract_dup", None) if extract_dup: data = extract_dup(0, size) else: #crappy gi bindings detected, using workaround: from xpra.sound.gst_hacks import map_gst_buffer with map_gst_buffer(buf) as a: data = bytes(a[:]) pts = normv(buf.pts) duration = normv(buf.duration) if pts==-1 and duration==-1 and BUNDLE_METADATA and len(self.pending_metadata)<10: self.pending_metadata.append(data) return 0 return self.emit_buffer(data, { "timestamp" : pts, "duration" : duration, })