Hololens/Lib/Cameras.cs
//#############################################################################################
/// <summary>
/// Find a source coresponding to parameters of <see cref="Init(MediaStreamType, MediaFrameSourceKind)"/>
/// </summary>
/// <param name="streamType"> MediaStreamType object property </param>
/// <param name="sourceKind"> MediaFrameSourceKind object property </param>
Find a source coresponding to parameters of
Find a source coresponding to parameters of
private async Task FindSource(MediaStreamType streamType, MediaFrameSourceKind sourceKind)
        {
            var frameSourceGroups = await MediaFrameSourceGroup.FindAllAsync(); 
            _selectedGroup = null;
            _selectedSourceInfo = null;
            foreach (var sourceGroup in frameSourceGroups)
            {
                foreach (var sourceInfo in sourceGroup.SourceInfos)
                {
                    if (sourceInfo.MediaStreamType == streamType && sourceInfo.SourceKind == sourceKind)
                    {
                        _selectedSourceInfo = sourceInfo;
                        break;
                    }
                }
                if (_selectedSourceInfo != null)
                {
                    _selectedGroup = sourceGroup;
                    break;
                }
            }
            if (_selectedSourceInfo == null) System.Diagnostics.Debug.WriteLine("Source not find");
        }
private async Task FindSource ( MediaStreamType streamType , MediaFrameSourceKind sourceKind ) { var frameSourceGroups = await MediaFrameSourceGroup . FindAllAsync ( ) ; _selectedGroup = null ; _selectedSourceInfo = null ; foreach ( var sourceGroup in frameSourceGroups ) { foreach ( var sourceInfo in sourceGroup . SourceInfos ) { if ( sourceInfo . MediaStreamType == streamType && sourceInfo . SourceKind == sourceKind ) { _selectedSourceInfo = sourceInfo ; break ; } } if ( _selectedSourceInfo != null ) { _selectedGroup = sourceGroup ; break ; } } if ( _selectedSourceInfo == null ) System . Diagnostics . Debug . WriteLine ( " " ) ; }
Find a source coresponding to parameters of
Find a source coresponding to parameters of
// list available sources // indicate that source is not set // if a source is matching with arguments // in case no source was found
streamType
MediaStreamType
MediaStreamType object property
MediaStreamType object property
sourceKind
MediaFrameSourceKind
MediaFrameSourceKind object property
MediaFrameSourceKind object property