Esempio n. 1
0
        /// <summary>
        /// Convert this AVC420BitmapStream to a RFX_AVC420_BITMAP_STREAM
        /// </summary>
        /// <returns></returns>
        public RFX_AVC420_BITMAP_STREAM To_RFX_AVC420_BITMAP_STREAM()
        {
            RFX_AVC420_METABLOCK metaBlock = new RFX_AVC420_METABLOCK();

            metaBlock.numRegionRects = numRegionRects;
            List <RDPGFX_RECT16> regionList = new List <RDPGFX_RECT16>();
            List <RDPGFX_AVC420_QUANT_QUALITY> qualityList = new List <RDPGFX_AVC420_QUANT_QUALITY>();

            foreach (Rect rect in RegionRects.RectList)
            {
                regionList.Add(new RDPGFX_RECT16(rect.left, rect.top, rect.right, rect.bottom));
                RDPGFX_AVC420_QUANT_QUALITY quality = new RDPGFX_AVC420_QUANT_QUALITY();
                quality.qpVal      = rect.Quality.qpVal;
                quality.qualityVal = rect.Quality.qualityVal;
                qualityList.Add(quality);
            }
            metaBlock.regionRects      = regionList.ToArray();
            metaBlock.quantQualityVals = qualityList.ToArray();

            return(new RFX_AVC420_BITMAP_STREAM(metaBlock, GetAVC420EncodedBitstream()));
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="h264MetaData">h264MetaData field</param>
 /// <param name="h264EncodedBitstream">h264EncodedBitstream field</param>
 public RFX_AVC420_BITMAP_STREAM(RFX_AVC420_METABLOCK avc420MetaData, byte[] avc420EncodedBitstream)
 {
     this.avc420EncodedBitstream = avc420EncodedBitstream;
     this.avc420MetaData = avc420MetaData;
 }
        /// <summary>
        /// Convert this AVC420BitmapStream to a RFX_AVC420_BITMAP_STREAM
        /// </summary>
        /// <returns></returns>
        public RFX_AVC420_BITMAP_STREAM To_RFX_AVC420_BITMAP_STREAM()
        {
            RFX_AVC420_METABLOCK metaBlock = new RFX_AVC420_METABLOCK();
            metaBlock.numRegionRects = numRegionRects;
            List<RDPGFX_RECT16> regionList = new List<RDPGFX_RECT16>();
            List<RDPGFX_AVC420_QUANT_QUALITY> qualityList = new List<RDPGFX_AVC420_QUANT_QUALITY>();
            foreach (Rect rect in RegionRects.RectList)
            {
                regionList.Add(new RDPGFX_RECT16(rect.left, rect.top, rect.right, rect.bottom));
                RDPGFX_AVC420_QUANT_QUALITY quality = new RDPGFX_AVC420_QUANT_QUALITY();
                quality.qpVal = rect.Quality.qpVal;
                quality.qualityVal = rect.Quality.qualityVal;
                qualityList.Add(quality);
            }
            metaBlock.regionRects = regionList.ToArray();
            metaBlock.quantQualityVals = qualityList.ToArray();

            return new RFX_AVC420_BITMAP_STREAM(metaBlock, GetAVC420EncodedBitstream());
        }
        /// <summary>
        /// Send bitmap data in H264 AVC444 codec
        /// </summary>
        /// <param name="sId">This is used to indicate the target surface id</param>
        /// <param name="pixFormat">This is used to indicate the pixel format to fill target surface.</param>
        /// <param name="bmRect">The rectangle of whole Image</param>
        /// <param name="lcValue">Code specifies how data is encoded in the avc420EncodedBitstream1 and avc420EncodedBitstream2 fields</param>
        /// <param name="stream1NumRects">Number of rects of avc420EncodedBitstream1</param>
        /// <param name="steam1RegionRects">Rect list of avc420EncodedBitstream1</param>
        /// <param name="stream1QuantQualityVals">Quality list of avc420EncodedBitstream1</param>
        /// <param name="avc420EncodedBitstream1">encoded H264 AVC420 data stream of avc420EncodedBitstream1</param>
        /// <param name="stream2NumRects">Number of rects of avc420EncodedBitstream2</param>
        /// <param name="steam2RegionRects">Rect list of avc420EncodedBitstream2</param>
        /// <param name="stream2QuantQualityVals">Quality list of avc420EncodedBitstream2</param>
        /// <param name="avc420EncodedBitstream2">encoded H264 AVC420 data stream of avc420EncodedBitstream2</param>
        /// <param name="baseImage">Base Image used to verify output</param>
        /// <returns></returns>
        public uint SendImageWithH264AVC444Codec(ushort sId, PixelFormat pixFormat, RDPGFX_RECT16 bmRect, AVC444LCValue lcValue,
            uint stream1NumRects, RDPGFX_RECT16[] steam1RegionRects, RDPGFX_AVC420_QUANT_QUALITY[] stream1QuantQualityVals, byte[] avc420EncodedBitstream1,
            uint stream2NumRects, RDPGFX_RECT16[] steam2RegionRects, RDPGFX_AVC420_QUANT_QUALITY[] stream2QuantQualityVals, byte[] avc420EncodedBitstream2,
            Image baseImage)
        {
            uint fid = MakeStartFramePdu();
            RFX_AVC420_METABLOCK avc420MetaData = new RFX_AVC420_METABLOCK();
            avc420MetaData.numRegionRects = stream1NumRects;
            avc420MetaData.regionRects = steam1RegionRects;
            avc420MetaData.quantQualityVals = stream1QuantQualityVals;
            RFX_AVC420_BITMAP_STREAM avc420Stream1 = new RFX_AVC420_BITMAP_STREAM(avc420MetaData, avc420EncodedBitstream1);

            RFX_AVC420_BITMAP_STREAM avc420Stream2 = null;
            if (stream2NumRects != 0 && avc420EncodedBitstream2 != null)
            {
                avc420MetaData = new RFX_AVC420_METABLOCK();
                avc420MetaData.numRegionRects = stream2NumRects;
                avc420MetaData.regionRects = steam2RegionRects;
                avc420MetaData.quantQualityVals = stream2QuantQualityVals;
                avc420Stream2 = new RFX_AVC420_BITMAP_STREAM(avc420MetaData, avc420EncodedBitstream2);
            }

            RFX_AVC444_BITMAP_STREAM avc444Stream = new RFX_AVC444_BITMAP_STREAM(lcValue, avc420Stream1, avc420Stream2);
            MakeWireToSurfacePdu1(sId, CodecType.RDPGFX_CODECID_AVC444, pixFormat, bmRect, avc444Stream.Encode());
            MakeEndFramePdu(fid);

            PackAndSendServerPdu();

            if (this.bcgrAdapter.SimulatedScreen != null)
            {
                if (baseImage == null)
                {
                    Site.Assume.Inconclusive("Cannot verify the output since base image is not find, check the existance and format of BaseImage element in test data file.");
                }
                this.bcgrAdapter.SimulatedScreen.RenderUncompressedImage(sId, baseImage, bmRect.left, bmRect.top);
            }

            return fid;
        }
Esempio n. 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="h264MetaData">h264MetaData field</param>
 /// <param name="h264EncodedBitstream">h264EncodedBitstream field</param>
 public RFX_AVC420_BITMAP_STREAM(RFX_AVC420_METABLOCK avc420MetaData, byte[] avc420EncodedBitstream)
 {
     this.avc420EncodedBitstream = avc420EncodedBitstream;
     this.avc420MetaData         = avc420MetaData;
 }