示例#1
0
 internal RTCRtpSendParameters(ref RTCRtpSendParametersInternal src)
     : base(ref src)
 {
     this.encodings = Array.ConvertAll(src.encodings.ToArray(),
                                       v => new RTCRtpEncodingParameters(ref v));
     transactionId = src.transactionId.AsAnsiStringWithFreeMem();
 }
示例#2
0
 internal RTCRtpParameters(ref RTCRtpSendParametersInternal src)
 {
     headerExtensions = Array.ConvertAll(src.headerExtensions.ToArray(),
                                         v => new RTCRtpHeaderExtensionParameters(ref v));
     rtcp   = new RTCRtcpParameters(ref src.rtcp);
     codecs = Array.ConvertAll(src.codecs.ToArray(),
                               v => new RTCRtpCodecParameters(ref v));
 }
 internal RTCRtpSendParameters(RTCRtpSendParametersInternal parameters)
 {
     int length = parameters.encodingsLength;
     RTCRtpEncodingParametersInternal[] encodings =
         parameters.encodings.AsArray<RTCRtpEncodingParametersInternal>(length);
     _encodings = Array.ConvertAll(encodings, _ => new RTCRtpEncodingParameters(_));
     _transactionId = parameters.transactionId.AsAnsiStringWithFreeMem();
 }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public RTCRtpSendParameters GetParameters()
        {
            NativeMethods.SenderGetParameters(self, out var ptr);
            RTCRtpSendParametersInternal parametersInternal = Marshal.PtrToStructure <RTCRtpSendParametersInternal>(ptr);
            RTCRtpSendParameters         parameters         = new RTCRtpSendParameters(ref parametersInternal);

            Marshal.FreeHGlobal(ptr);
            return(parameters);
        }
示例#5
0
 internal void CreateInstance(out RTCRtpSendParametersInternal instance)
 {
     instance = default;
     RTCRtpEncodingParametersInternal[] encodings =
         new RTCRtpEncodingParametersInternal[this.encodings.Length];
     for (int i = 0; i < this.encodings.Length; i++)
     {
         this.encodings[i].CopyInternal(ref encodings[i]);
     }
     instance.encodings     = encodings;
     instance.transactionId = Marshal.StringToCoTaskMemAnsi(transactionId);
 }
 internal IntPtr CreatePtr()
 {
     RTCRtpEncodingParametersInternal[] encodings =
         new RTCRtpEncodingParametersInternal[_encodings.Length];
     for(int i = 0; i < _encodings.Length; i++)
     {
         _encodings[i].CopyInternal(ref encodings[i]);
     }
     RTCRtpSendParametersInternal instance = default;
     instance.encodingsLength = _encodings.Length;
     instance.encodings = IntPtrExtension.ToPtr(encodings);
     instance.transactionId = Marshal.StringToCoTaskMemAnsi(_transactionId);
     IntPtr ptr = Marshal.AllocCoTaskMem(Marshal.SizeOf(instance));
     Marshal.StructureToPtr(instance, ptr, false);
     return ptr;
 }