public void ProcessVideo() { while (true) { while (videoBuffer.IsComplete == false) { curVideoItem = videoBuffer.Get(); if (curVideoItem != null) { using (Bitmap bitmap = new Bitmap(inVideoParams.Width, inVideoParams.Height, curVideoItem.Size, PixelFormat.Format24bppRgb, curVideoItem.Data)) { OnShowVideo(bitmap); } } if (Break == true) { break; } } Thread.Sleep(33); //Thread.Yield(); if (Break == true) { break; } } }
//public void ProcessAudio() //{ // while (true) // { // //audioEvent.WaitOne(); // if (/*(audioBuffer.Count == 0) && */(audioBuffer.IsComplete == true)) // break; // curAudioItem = audioBuffer.Get(); // if (curAudioItem != null)//audioBuffer.TryGet(out curAudioItem) == true) // { // //lock (ffmpegMedia) // //{ // // ffmpegMedia.WriteAudioDataToFile(curAudioItem.Data, curAudioItem.Size, curAudioItem.Time, 0); // //} // OnPlayAudio(curAudioItem.Data, curAudioItem.Size); // //videoForm.PlayAudio(curAudioItem.Data, curAudioItem.Size); // } // } //} public void ProcessAudio() { while (true) { while (audioBuffer.IsComplete == false) { curAudioItem = audioBuffer.Get(); if (curAudioItem != null) { OnPlayAudio(curAudioItem.Data, curAudioItem.Size); } if (Break == true) { break; } } Thread.Sleep(33); //Thread.Yield(); if (Break == true) { break; } } }
public void ProcessVideo() { while (true) { while (videoBuffer.IsComplete == false) { curVideoItem = videoBuffer.Get(); if (curVideoItem != null) { using (Bitmap bitmap = new Bitmap(inVideoParams.Width, inVideoParams.Height, curVideoItem.Size, PixelFormat.Format24bppRgb, curVideoItem.Data)) { OnShowVideo(bitmap); } } if (Break == true) break; } Thread.Sleep(33); //Thread.Yield(); if (Break == true) break; } }
//public void ProcessAudio() //{ // while (true) // { // //audioEvent.WaitOne(); // if (/*(audioBuffer.Count == 0) && */(audioBuffer.IsComplete == true)) // break; // curAudioItem = audioBuffer.Get(); // if (curAudioItem != null)//audioBuffer.TryGet(out curAudioItem) == true) // { // //lock (ffmpegMedia) // //{ // // ffmpegMedia.WriteAudioDataToFile(curAudioItem.Data, curAudioItem.Size, curAudioItem.Time, 0); // //} // OnPlayAudio(curAudioItem.Data, curAudioItem.Size); // //videoForm.PlayAudio(curAudioItem.Data, curAudioItem.Size); // } // } //} public void ProcessAudio() { while (true) { while (audioBuffer.IsComplete == false) { curAudioItem = audioBuffer.Get(); if (curAudioItem != null) { OnPlayAudio(curAudioItem.Data, curAudioItem.Size); } if (Break == true) break; } Thread.Sleep(33); //Thread.Yield(); if (Break == true) break; } }