예제 #1
0
파일: src.py 프로젝트: svn2github/Xpra
 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),
                                })
예제 #2
0
파일: src.py 프로젝트: rudresh2319/Xpra
 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),
                                })
예제 #3
0
파일: src.py 프로젝트: svn2github/Xpra
 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,
                                    })
예제 #4
0
파일: src.py 프로젝트: TianyouLi/Xpra
 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,
                                    })