def debug1():
        filt_src = filt.get_pad('src')
        caps = filt_src.get_negotiated_caps()
        print ''
        print 'NEGOTIATED'
        numpygst.print_caps(caps)
        print ''
        jpegsink = jpegenc.get_pad('sink')
        caps = jpegsink.get_caps()
示例#2
0
def debug1():
    filt_src = filt.get_pad('src')
    caps = filt_src.get_negotiated_caps()
    print ''
    print 'NEGOTIATED'
    numpygst.print_caps(caps)
    print ''
    jpegsink = jpegenc.get_pad('sink')
    caps = jpegsink.get_caps()
                #b = numpy.asarray(b, a.dtype)
                b = b.view(a.dtype)
                b = numpy.array(b)
                print 'FFF', b.shape, b[25,3], len(b.data), a.strides
                #b[:,:,2] = 0
                #b[:,:,0] = 0
                try:
                        newbuf = numpygst.gst_buffer_from_ndarray(b)
                except Exception, e:
                        print e

                try:
                        # fixate caps
                        src_caps = self.srcpad.get_caps()
                        print 'SOURCE CAPS', src_caps
                        numpygst.print_caps(src_caps)
                        print ''
                        newcaps = newbuf.get_caps()
                        ret = self.srcpad.fixate_caps(newcaps)
                        print 'FIXATE', ret
                        ret = self.srcpad.set_caps(newcaps)
                        print 'SET', ret
                        print 'SOURCE CAPS', src_caps
                        numpygst.print_caps(src_caps)
                        print ''
                except Exception, e:
                        print e

                try:
                        print 'BUF LEN', len(newbuf.data)
                        ret = self.srcpad.push(newbuf)
示例#4
0
        #b = numpy.asarray(b, a.dtype)
        b = b.view(a.dtype)
        b = numpy.array(b)
        print 'FFF', b.shape, b[25, 3], len(b.data), a.strides
        #b[:,:,2] = 0
        #b[:,:,0] = 0
        try:
            newbuf = numpygst.gst_buffer_from_ndarray(b)
        except Exception, e:
            print e

        try:
            # fixate caps
            src_caps = self.srcpad.get_caps()
            print 'SOURCE CAPS', src_caps
            numpygst.print_caps(src_caps)
            print ''
            newcaps = newbuf.get_caps()
            ret = self.srcpad.fixate_caps(newcaps)
            print 'FIXATE', ret
            ret = self.srcpad.set_caps(newcaps)
            print 'SET', ret
            print 'SOURCE CAPS', src_caps
            numpygst.print_caps(src_caps)
            print ''
        except Exception, e:
            print e

        try:
            print 'BUF LEN', len(newbuf.data)
            ret = self.srcpad.push(newbuf)