From 1f05c084ac0045120a93c0bd318caf2c86adaf63 Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Mon, 10 Oct 2022 21:36:10 -0600 Subject: [PATCH] add explicit playback information from media --- Sources/VLCUI/UIVLCVideoPlayerView.swift | 16 +++++++++++++++- .../VLCVideoPlayer/PlaybackInformation.swift | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Sources/VLCUI/UIVLCVideoPlayerView.swift b/Sources/VLCUI/UIVLCVideoPlayerView.swift index dd889d1..2e85f89 100644 --- a/Sources/VLCUI/UIVLCVideoPlayerView.swift +++ b/Sources/VLCUI/UIVLCVideoPlayerView.swift @@ -176,7 +176,21 @@ extension UIVLCVideoPlayerView: VLCMediaPlayerDelegate { currentAudioTrack: currentAudioTrack, subtitleTracks: zippedSubtitleTracks, audioTracks: zippedAudioTracks, - stats: media.stats ?? [:] + numberOfReadBytesOnInput: media.numberOfReadBytesOnInput, + inputBitrate: media.inputBitrate, + numberOfReadBytesOnDemux: media.numberOfReadBytesOnDemux, + demuxBitrate: media.demuxBitrate, + numberOfDecodedVideoBlocks: media.numberOfDecodedVideoBlocks, + numberOfDecodedAudioBlocks: media.numberOfDecodedAudioBlocks, + numberOfDisplayedPictures: media.numberOfDisplayedPictures, + numberOfLostPictures: media.numberOfLostPictures, + numberOfPlayedAudioBuffers: media.numberOfPlayedAudioBuffers, + numberOfLostAudioBuffers: media.numberOfLostAudioBuffers, + numberOfSentPackets: media.numberOfSentBytes, + numberOfSentBytes: media.numberOfSentBytes, + streamOutputBitrate: media.streamOutputBitrate, + numberOfCorruptedDataPackets: media.numberOfCorruptedDataPackets, + numberOfDiscontinuties: media.numberOfDiscontinuties ) } diff --git a/Sources/VLCUI/VLCVideoPlayer/PlaybackInformation.swift b/Sources/VLCUI/VLCVideoPlayer/PlaybackInformation.swift index 40f5df5..016cc0d 100644 --- a/Sources/VLCUI/VLCVideoPlayer/PlaybackInformation.swift +++ b/Sources/VLCUI/VLCVideoPlayer/PlaybackInformation.swift @@ -14,6 +14,20 @@ public extension VLCVideoPlayer { public let subtitleTracks: [Int32: String] public let audioTracks: [Int32: String] - public let stats: [AnyHashable: Any] + public let numberOfReadBytesOnInput: Int + public let inputBitrate: Float + public let numberOfReadBytesOnDemux: Int + public let demuxBitrate: Float + public let numberOfDecodedVideoBlocks: Int + public let numberOfDecodedAudioBlocks: Int + public let numberOfDisplayedPictures: Int + public let numberOfLostPictures: Int + public let numberOfPlayedAudioBuffers: Int + public let numberOfLostAudioBuffers: Int + public let numberOfSentPackets: Int + public let numberOfSentBytes: Int + public let streamOutputBitrate: Float + public let numberOfCorruptedDataPackets: Int + public let numberOfDiscontinuties: Int } }