* VRFS-3428 - update how we query backend for frame rates

This commit is contained in:
Seth Call 2015-08-24 15:54:59 -05:00
parent 39d0731d74
commit 04825d2659
2 changed files with 53 additions and 8 deletions

View File

@ -96,6 +96,14 @@
return {} return {}
} }
function FTUESetSendFrameRates(fps) {
}
function FTUEGetSendFrameRates() {
return {20:20, 24:24, 30:30}
}
function isSessVideoShared() { function isSessVideoShared() {
return videoShared; return videoShared;
} }
@ -1226,6 +1234,8 @@
this.FTUECurrentSelectedVideoDevice = FTUECurrentSelectedVideoDevice; this.FTUECurrentSelectedVideoDevice = FTUECurrentSelectedVideoDevice;
this.FTUEGetAvailableEncodeVideoResolutions = FTUEGetAvailableEncodeVideoResolutions; this.FTUEGetAvailableEncodeVideoResolutions = FTUEGetAvailableEncodeVideoResolutions;
this.FTUEGetVideoCaptureDeviceCapabilities = FTUEGetVideoCaptureDeviceCapabilities; this.FTUEGetVideoCaptureDeviceCapabilities = FTUEGetVideoCaptureDeviceCapabilities;
this.FTUEGetSendFrameRates = FTUEGetSendFrameRates;
this.FTUESetSendFrameRates = FTUESetSendFrameRates;
this.isSessVideoShared = isSessVideoShared; this.isSessVideoShared = isSessVideoShared;

View File

@ -2,6 +2,21 @@ $ = jQuery
context = window context = window
context.JK ||= {}; context.JK ||= {};
BackendToFrontend = {
"QCIF (176X144)" : "QCIF (176X144)",
"CIF (352X288)" : "CIF (352X288)",
"VGA (640X480)" : "VGA (640X480)",
"4CIF (704X576)" : "4CIF (704X576)",
"1/2WHD (640X360)" : "1/2WHD (640X360)",
"WHD (1280X720)": "WHD (1280X720)",
"FHD (1920x1080)" : "FHD (1920x1080)"
}
FrontendToBackend = {}
for key, value of BackendToFrontend
FrontendToBackend[value] = key
context.JK.WebcamViewer = class WebcamViewer context.JK.WebcamViewer = class WebcamViewer
constructor: (@root) -> constructor: (@root) ->
@client = context.jamClient @client = context.jamClient
@ -52,8 +67,15 @@ context.JK.WebcamViewer = class WebcamViewer
@logger.debug 'Selecting from res control: ', @resolutionSelect @logger.debug 'Selecting from res control: ', @resolutionSelect
@resolution = @resolutionSelect.val() @resolution = @resolutionSelect.val()
if @resolution? if @resolution?
@logger.debug 'Selecting webcam resolution: ', @resolution bits = @resolution.split('|')
@client.FTUESetVideoEncodeResolution @resolution selectedResolution = bits[0]
selectedFps = bits[1]
@logger.debug 'Selecting webcam resolution: ', selectedResolution
@logger.debug 'Selecting webcam fps: ', selectedFps
@client.FTUESetVideoEncodeResolution selectedResolution
@client.FTUESetSendFrameRates selectedFps
# if @isVideoShared # if @isVideoShared
# this.setVideoOff() # this.setVideoOff()
# this.toggleWebcam() # this.toggleWebcam()
@ -113,13 +135,26 @@ context.JK.WebcamViewer = class WebcamViewer
loadResolutions:() => loadResolutions:() =>
# protect against non-video clients pointed at video-enabled server from getting into a session # protect against non-video clients pointed at video-enabled server from getting into a session
resolutions = if @client.FTUEGetAvailableEncodeVideoResolutions? then @client.FTUEGetAvailableEncodeVideoResolutions() else {} resolutions = if @client.FTUEGetAvailableEncodeVideoResolutions? then @client.FTUEGetAvailableEncodeVideoResolutions() else {}
frames = if @client.FTUEGetSendFrameRates? then @client.FTUEGetSendFrameRates() else {}
selectControl = @resolutionSelect selectControl = @resolutionSelect
@logger.debug 'FOUND THESE RESOLUTIONS', resolutions, selectControl @logger.debug 'FOUND THESE RESOLUTIONS', resolutions
context._.each resolutions, (value, key, obj) -> @logger.debug 'FOUND THESE FPS', frames
option = $('<option/>', context._.each resolutions, (resolution, key, obj) ->
value: value
text: value) #{1: "CIF (352X288)", 2: "VGA (640X480)", 3: "4CIF (704X576)", 4: "1/2WHD (640X360)", 5: "WHD (1280X720)", 6: "FHD (1920x1080)"}
selectControl.append option context._.each frames, (frame, key, obj) ->
frontendResolution = BackendToFrontend[resolution]
@logger.error("unknown resolution! #{resolution}") unless frontendResolution
value = "#{resolution}|#{frame}"
text = "#{frontendResolution} at #{frame} fps"
option = $('<option/>',
value: value
text: text)
selectControl.append option
if @resolution != null and @resolution != '' if @resolution != null and @resolution != ''
selectControl.val(@resolution) selectControl.val(@resolution)