Beispiel #1
0
        internal static MEETINGMANAGE_publishMicParam ToStruct(this PublishAudioModel model)
        {
            MEETINGMANAGE_publishMicParam publishMicParam = new MEETINGMANAGE_publishMicParam();

            try
            {
                publishMicParam.mediaType = (MEETINGMANAGE_MediaType)model.MediaType;
                publishMicParam.sType     = (MEETINGMANAGE_StreamType)model.StreamType;
                publishMicParam.transParam.checkRetransSendCount = model.TransModel.CheckRetransSendCount;
                publishMicParam.transParam.checkSendCount        = model.TransModel.CheckSendCount;
                publishMicParam.transParam.dataResendCount       = model.TransModel.DataResendCount;
                publishMicParam.transParam.dataRetransSendCount  = model.TransModel.DataRetransSendCount;
                publishMicParam.transParam.dataSendCount         = model.TransModel.DataSendCount;
                publishMicParam.transParam.delayTimeWinsize      = model.TransModel.DelayTimeWinsize;
                publishMicParam.transParam.fecCheckCount         = model.TransModel.FecCheckCount;
                publishMicParam.transParam.fecDataCount          = model.TransModel.FecDataCount;

                publishMicParam.sParam.sourceName    = model.AudioSendModel.SourceName;
                publishMicParam.sParam.sourceType    = (MEETINGMANAGESourceType)model.AudioSendModel.SourceType;
                publishMicParam.sParam.asParam.isMix = model.AudioSendModel.IsMix;

                publishMicParam.sParam.extraInfo = model.AudioSendModel.ExtraInfo;
                publishMicParam.avSynGroupID     = model.AvSyncGroupId;


                MEETINGMANAGEAudioCapParam audioCapParam = new MEETINGMANAGEAudioCapParam()
                {
                    bitspersample = model.AudioSendModel.AudioCapModel.BitsPerSample,
                    channels      = model.AudioSendModel.AudioCapModel.Channels,
                    samplerate    = model.AudioSendModel.AudioCapModel.SampleRate,
                };

                MEETINGMANAGEAudioEncParam audioEncParam = new MEETINGMANAGEAudioEncParam()
                {
                    bitrate       = model.AudioSendModel.AudioEncModel.Bitrate,
                    bitspersample = model.AudioSendModel.AudioEncModel.BitsPerSample,
                    channels      = model.AudioSendModel.AudioEncModel.Channels,
                    codecID       = (MEETINGMANAGEAudioCodecID)model.AudioSendModel.AudioEncModel.AudioCodeId,
                    samplerate    = model.AudioSendModel.AudioEncModel.SampleRate,
                };

                publishMicParam.sParam.asParam.capParam = Marshal.AllocHGlobal(Marshal.SizeOf(audioCapParam));
                publishMicParam.sParam.asParam.encParam = Marshal.AllocHGlobal(Marshal.SizeOf(audioEncParam));

                Marshal.StructureToPtr(audioCapParam, publishMicParam.sParam.asParam.capParam, true);
                Marshal.StructureToPtr(audioEncParam, publishMicParam.sParam.asParam.encParam, true);
            }
            catch (Exception exception)
            {
                throw new Exception($"发布音频流结构转换失败。{exception}");
            }

            return(publishMicParam);
        }
Beispiel #2
0
 internal static extern int PublishMicAudio(MEETINGMANAGE_publishMicParam param, IntPtr ctx);