Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect transcoding user policy #1383

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions source/utils/deviceCapabilities.brs
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,35 @@ function getDeviceProfile() as object
deviceProfile.CodecProfiles.push(codecProfileArray)
end if

' respect user policy in regards to transcoding permission
enableVideoTranscoding = m.global.session.user.policy.EnableVideoPlaybackTranscoding
enableAudioTranscoding = m.global.session.user.policy.EnableAudioPlaybackTranscoding

if isValid(enableVideoTranscoding) and isValid(enableAudioTranscoding)
if not enableVideoTranscoding and not enableAudioTranscoding
' no transcoding allowed
deviceProfile.TranscodingProfiles = []
else if not enableVideoTranscoding and enableAudioTranscoding
' no video transcoding allowed
newProfile = []
for i = 0 to deviceProfile.TranscodingProfiles.count() - 1
if Lcase(deviceProfile.TranscodingProfiles[i].Type) <> "video"
newProfile.push(deviceProfile.TranscodingProfiles[i])
end if
end for
deviceProfile.TranscodingProfiles = newProfile
else if enableVideoTranscoding and not enableAudioTranscoding
' no audio transcoding allowed
newProfile = []
for i = 0 to deviceProfile.TranscodingProfiles.count() - 1
if Lcase(deviceProfile.TranscodingProfiles[i].Type) <> "audio"
newProfile.push(deviceProfile.TranscodingProfiles[i])
end if
end for
deviceProfile.TranscodingProfiles = newProfile
end if
end if

return deviceProfile
end function

Expand Down