Пример #1
0
    public void OnI420RemoteFrameReady(int id,
                                       IntPtr dataY, IntPtr dataU, IntPtr dataV, IntPtr dataA,
                                       int strideY, int strideU, int strideV, int strideA,
                                       uint width, uint height)
    {
        /* if (  (++sFrameCount % 25) == 0)
         * {
         *   Debug.Log("OnI420RemoteFrameReady clientID" +  id);
         * }
         */

        //Debug.Log("OnI420RemoteFrameReady called! w=" + width + " h=" + height + " thread:" + Thread.CurrentThread.ManagedThreadId);

        //Debug.Log("OnI420RemoteFrameReady called! w=" + width + " h=" + height + " thread:" + Thread.CurrentThread.ManagedThreadId);
        FramePacket packet = frameQueueRemote.GetDataBufferWithoutContents((int)(width * height * 4));

        if (packet == null)
        {
            Debug.LogError("OnI420RemoteFrameReady: FramePacket is null!");
            return;
        }
        CopyYuvToBuffer(dataY, dataU, dataV, strideY, strideU, strideV, width, height, packet.Buffer);
        packet.width  = (int)width;
        packet.height = (int)height;
        frameQueueRemote.Push(packet);
    }
Пример #2
0
        private void Peer_RemoteI420FrameReady(IntPtr dataY, IntPtr dataU, IntPtr dataV, IntPtr dataA, int strideY, int strideU, int strideV, int strideA, uint width, uint height)
        {
            FramePacket packet = remoteFrameQueue.GetDataBufferWithoutContents((int)(width * height * 4));

            if (packet == null)
            {
                return;
            }
            CopyYuvToBuffer(dataY, dataU, dataV, strideY, strideU, strideV, width, height, packet.Buffer);
            packet.width  = (int)width;
            packet.height = (int)height;
            remoteFrameQueue.Push(packet);
        }
    public void OnI420LocalFrameReady(int id,
                                      IntPtr dataY, IntPtr dataU, IntPtr dataV, IntPtr dataA,
                                      int strideY, int strideU, int strideV, int strideA,
                                      uint width, uint height)
    {
        //Debug.Log("OnI420LocalFrameReady called! w=" + width + " h=" + height+" thread:"+ Thread.CurrentThread.ManagedThreadId + ":" + Thread.CurrentThread.Name);
        FramePacket packet = frameQueueLocal.GetDataBufferWithoutContents((int)(width * height * 4));

        if (packet == null)
        {
            //Debug.LogError("OnI420LocalFrameReady: FramePacket is null!");
            return;
        }
        CopyYuvToBuffer(dataY, dataU, dataV, strideY, strideU, strideV, width, height, packet.Buffer);
        packet.width  = (int)width;
        packet.height = (int)height;
        frameQueueLocal.Push(packet);
    }