import VideoCaptureAndEncodeParameter from './VideoCaptureAndEncodeParameter' ; export default class DefaultVideoCaptureAndEncodeParameter implements VideoCaptureAndEncodeParameter { constructor ( private cameraWidth , private cameraHeight , private cameraFrameRate , private maxEncodeBitrateKbps , private isSimulcast , private scaleResolutionDownBy = 1 ) { } equal ( other ) { let checkForEqual = other . captureWidth ( ) === this . cameraWidth && other . captureHeight ( ) === this . cameraHeight && other . captureFrameRate ( ) === this . cameraFrameRate && other . encodeBitrates ( ) . length === this . encodeBitrates ( ) . length && other . encodeScaleResolutionDownBy ( ) . length === this . encodeScaleResolutionDownBy ( ) . length && other . encodeWidths ( ) . length === this . encodeWidths ( ) . length && other . encodeHeights ( ) . length === this . encodeHeights ( ) . length ; if ( checkForEqual ) { for ( let i = 0 ; i < other . encodeWidths ( ) . length ; i ++ ) { if ( other . encodeWidths ( ) [ i ] !== this . encodeWidths ( ) [ i ] || other . encodeHeights ( ) [ i ] !== this . encodeHeights ( ) [ i ] || other . encodeBitrates ( ) [ i ] !== this . encodeBitrates ( ) [ i ] || other . encodeScaleResolutionDownBy ( ) [ i ] !== this . encodeScaleResolutionDownBy ( ) [ i ] ) { checkForEqual = false ; return checkForEqual ; } } } return checkForEqual ; } clone ( ) { return new DefaultVideoCaptureAndEncodeParameter ( this . cameraWidth , this . cameraHeight , this . cameraFrameRate , this . maxEncodeBitrateKbps , this . isSimulcast , this . scaleResolutionDownBy ) ; } captureWidth ( ) { return this . cameraWidth ; } captureHeight ( ) { return this . cameraHeight ; } captureFrameRate ( ) { return this . cameraFrameRate ; } encodeBitrates ( ) { return [ this . maxEncodeBitrateKbps ] ; } encodeScaleResolutionDownBy ( ) { return [ this . scaleResolutionDownBy ] ; } encodeWidths ( ) { return [ this . cameraWidth ] ; } encodeHeights ( ) { return [ this . cameraHeight ] ; } }