コード例 #1
0
ファイル: Aja.cs プロジェクト: ratsil/bethe.helpers
 byte[] GetAudioFrame()
 {
     if (bFirsTime)
     {
         Preferences.nQueueDeviceLength = (byte)(_cCard.nBufferMaxLength - 2);
     }
     _bNeedToAddFrame = true;
     Frame.Audio cA = _AjaFramesAudioBuffer.Dequeue();
     _AjaFramesAudioToDispose.Enqueue(cA);
     return(cA.aFrameBytes.aBytes);
 }
コード例 #2
0
ファイル: Device.cs プロジェクト: ratsil/bethe.btl
		virtual public void TurnOn()
		{
			if (Preferences.bAudio)
			{
				_cFrameAudioEmpty = new Frame.Audio();
				_cFrameAudioEmpty.aFrameBytes = new byte[Preferences.nAudioBytesPerFrame];
			}
            if (!Preferences.bDeviceInput)
            {
                _cVideoFrameEmpty = FrameBufferPrepare();
                if (_cVideoFrameEmpty.oFrameBytes is IntPtr)
                {
                    uint nBlack = 0x0;
                    for (int nIndx = 0; nIndx < _stArea.nWidth * _stArea.nHeight * 4; nIndx += 4)
                        Marshal.WriteInt32(_cVideoFrameEmpty.pFrameBytes, nIndx, (Int32)nBlack); //pixel format
                }
                _cFrameVideoLast = _cVideoFrameEmpty;
                while (Preferences.nQueueBaetylusLength + 2 > _aFrames.Count)
                    AddNewFrameToConveyor("! from TurnOn !");

                _cThread = new System.Threading.Thread(FrameScheduleWorker);
                _cThread.Priority = System.Threading.ThreadPriority.Highest;
                _cThread.Start();
                _cBugCatcherOnFrameGet = new BugCatcher(_cVideoFrameEmpty);  // bug
                _cBugCatcherOnVideoFrameReturn = new BugCatcher(_cVideoFrameEmpty);  // bug
                _cBugCatcherOnVideoFramePrepare = new BugCatcher(_cVideoFrameEmpty);  // bug
                _cBugCatcherScheduleFrame = new BugCatcher(_cVideoFrameEmpty);  // bug
                //System.Threading.ThreadPool.QueueUserWorkItem(FrameScheduleWorker);
            }




		}