Esempio n. 1
0
        public void OnTracksChanged(TrackGroupArray p0, TrackSelectionArray p1)
        {
            var trackGroupArray = new TrackGroup[p0.Length];

            for (var i = 0; i < p0.Length; i++)
            {
                trackGroupArray[i] = p0.Get(i);
            }

            var trackSelectionArray = new ITrackSelection[p1.Length];

            for (var i = 0; i < p1.Length; i++)
            {
                trackSelectionArray[i] = p1.Get(i);
            }
            TracksChanged?.Invoke(trackGroupArray, trackSelectionArray);
        }
Esempio n. 2
0
        public void OnTracksChanged(TrackGroupArray ignored, TrackSelectionArray trackSelections)
        {
            var mappedTrackInfo = trackSelector.CurrentMappedTrackInfo;

            if (mappedTrackInfo == null)
            {
                Log.Debug(TAG, "Tracks []");
                return;
            }
            Log.Debug(TAG, "Tracks [");
            // Log tracks associated to renderers.
            for (var rendererIndex = 0; rendererIndex < mappedTrackInfo.Length; rendererIndex++)
            {
                var rendererTrackGroups = mappedTrackInfo.GetTrackGroups(rendererIndex);
                var trackSelection      = trackSelections.Get(rendererIndex);
                if (rendererTrackGroups.Length > 0)
                {
                    Log.Debug(TAG, "  Renderer:" + rendererIndex + " [");
                    for (int groupIndex = 0; groupIndex < rendererTrackGroups.Length; groupIndex++)
                    {
                        TrackGroup trackGroup      = rendererTrackGroups.Get(groupIndex);
                        var        adaptiveSupport = getAdaptiveSupportString(trackGroup.Length,
                                                                              mappedTrackInfo.GetAdaptiveSupport(rendererIndex, groupIndex, false));
                        Log.Debug(TAG, "    Group:" + groupIndex + ", adaptive_supported=" + adaptiveSupport + " [");
                        for (int trackIndex = 0; trackIndex < trackGroup.Length; trackIndex++)
                        {
                            var status        = getTrackStatusString(trackSelection, trackGroup, trackIndex);
                            var formatSupport = getFormatSupportString(
                                mappedTrackInfo.GetTrackFormatSupport(rendererIndex, groupIndex, trackIndex));
                            Log.Debug(TAG, "      " + status + " Track:" + trackIndex + ", "
                                      + Format.ToLogString(trackGroup.GetFormat(trackIndex))
                                      + ", supported=" + formatSupport);
                        }
                        Log.Debug(TAG, "    ]");
                    }
                    // Log metadata for at most one of the tracks selected for the renderer.
                    if (trackSelection != null)
                    {
                        for (var selectionIndex = 0; selectionIndex < trackSelection.Length(); selectionIndex++)
                        {
                            var metadata = trackSelection.GetFormat(selectionIndex).Metadata;
                            if (metadata != null)
                            {
                                Log.Debug(TAG, "    Metadata [");
                                printMetadata(metadata, "      ");
                                Log.Debug(TAG, "    ]");
                                break;
                            }
                        }
                    }
                    Log.Debug(TAG, "  ]");
                }
            }
            // Log tracks not associated with a renderer.
            TrackGroupArray unassociatedTrackGroups = mappedTrackInfo.UnassociatedTrackGroups;

            if (unassociatedTrackGroups.Length > 0)
            {
                Log.Debug(TAG, "  Renderer:None [");
                for (int groupIndex = 0; groupIndex < unassociatedTrackGroups.Length; groupIndex++)
                {
                    Log.Debug(TAG, "    Group:" + groupIndex + " [");
                    var trackGroup = unassociatedTrackGroups.Get(groupIndex);
                    for (int trackIndex = 0; trackIndex < trackGroup.Length; trackIndex++)
                    {
                        var status        = getTrackStatusString(false);
                        var formatSupport = getFormatSupportString(
                            RendererCapabilities.FormatUnsupportedType);
                        Log.Debug(TAG, "      " + status + " Track:" + trackIndex + ", "
                                  + Format.ToLogString(trackGroup.GetFormat(trackIndex))
                                  + ", supported=" + formatSupport);
                    }
                    Log.Debug(TAG, "    ]");
                }
                Log.Debug(TAG, "  ]");
            }
            Log.Debug(TAG, "]");
        }