예제 #1
0
파일: Info.cs 프로젝트: CarverLab/Oyster
        public MediaBufferServiceInfo.Recording CreateRecording(int RoomId, string RoomName, int UserId,
			string UserName, string CardNumber, MediaBufferServiceInfo.Encoder[] Encoders)
        {
            MediaBufferServiceInfo.Recording recording = new MediaBufferServiceInfo.Recording();

            recording.RoomId = RoomId;
            recording.RoomName = RoomName;
            recording.UserId = UserId;
            recording.UserName = UserName;
            recording.CardNumber = CardNumber;
            recording.Encoders = Encoders;
            recording.UniqueIdentifier = System.Guid.NewGuid().ToString();
            recording.Started = DateTime.Now;

            return recording;
        }
예제 #2
0
파일: Info.cs 프로젝트: CarverLab/Oyster
        public string Add(MediaBufferServiceInfo.Recording recording)
        {
            int RecordingCount = 1;
            if (m_mbsi.CurrentRecordings != null)
            {
                RecordingCount = m_mbsi.CurrentRecordings.GetLength(0) + 1;
            }
            Recording[] recordings = new Recording[RecordingCount];

            if (m_mbsi.CurrentRecordings != null)
            {
                m_mbsi.CurrentRecordings.CopyTo(recordings,0);
            }
            recordings[RecordingCount - 1] = recording;
            m_mbsi.CurrentRecordings = recordings;
            m_mbsi.CurrentRecordingCount = RecordingCount;
            if (m_mbsi.MaxConcurrentRecordingCount < m_mbsi.CurrentRecordingCount)
            {
                m_mbsi.MaxConcurrentRecordingCount = m_mbsi.CurrentRecordingCount;
            }
            return recording.UniqueIdentifier;
        }
예제 #3
0
파일: Info.cs 프로젝트: CarverLab/Oyster
        public MediaBufferServiceInfo.Recording AddEncoderToRecording(string RecordingIdentifier,
			MediaBufferServiceInfo.Encoder encoder)
        {
            MediaBufferServiceInfo.Recording recording = null;
            if (m_mbsi.CurrentRecordings == null)
            {
                return null;
            }
            foreach (MediaBufferServiceInfo.Recording rec in m_mbsi.CurrentRecordings)
            {
                if (rec.UniqueIdentifier == RecordingIdentifier)
                {
                    recording = rec;
                }
            }
            int EncoderCount = 1;

            if (recording.Encoders != null)
            {
                EncoderCount = recording.Encoders.GetLength(0) + 1;
            }
            MediaBufferServiceInfo.Encoder[] encoders =
                new MediaBufferServiceInfo.Encoder[EncoderCount];

            encoder.RecordingIdentifier = RecordingIdentifier;
            if (EncoderCount > 1)
            {
                recording.Encoders.CopyTo(encoders,0);
            }
            encoders[EncoderCount - 1] = encoder;
            recording.Encoders = encoders;

            return recording;
        }