Author: ygrego Date: 2015-05-28 08:25:12 +0000 (Thu, 28 May 2015) New Revision: 1511 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1511 Log: The repository "js/configuration" has been moved to the root of project. ("oipf/configuration") Added: oipf/configuration/ oipf/configuration/CapabilitiesProperties.js oipf/configuration/ConfigDefaultProperties.js oipf/configuration/OipfConfiguration.js oipf/configuration/TestConfig.js Copied: oipf/configuration/CapabilitiesProperties.js (from rev 1419, oipf/js/configuration/CapabilitiesProperties.js) =================================================================== --- oipf/configuration/CapabilitiesProperties.js (rev 0) +++ oipf/configuration/CapabilitiesProperties.js 2015-05-28 08:25:12 UTC (rev 1511) @@ -0,0 +1,157 @@ +/* + * The OITF SHALL support following non-visual embedded object with + * the mime type application/oipfCapabilities. + */ +var CapabilitiesProperties = Class.extend({ + defaultConfig: { + extraSDVideoDecodes: null, + extraHDVideoDecodes: null + }, + + baseUIProfileName: [ + "OITF_SDEU_UIPROF", + "OITF_SD60_UIPROF", + "OITF_SDUS_UIPROF", + "OITF_HD_UIPROF", + "OITF_FULL_HD_UIPROF" + ], + + UIProfileNameFragment: [ + "+TRICKMODE", + "+AVCAD", + "+DL", + "+IPTV_SDS", + "+IPTV_URI", + "+ANA", + "+DVB_C", + "+DVB_T", + "+DVB_S", + "+DVB_C2", + "+DVB_T2", + "+DVB_S2", + "+META_BCG", + "+META_EIT", + "+META_SI", + "+ITV_KEYS", + "+CONTROLLED", + "+PVR", + "+DRM", + "+CommunicationServices", + "+SVG", + "+POINTER", + "+WIDGETS", + "+HTML5_MEDIA", + "+RCF", + "+TELEPHONY", + "+VIDEOTELEPHONY" + ], + + profileNameMapping: { + "+DVB_T": "DVB", + "+META_EIT": "META" + /*"+AVCAD": "DVB", + "+IPTV_SDS": "DVB", + "+IPTV_URI": "DVB", + "+ANA": "DVB", + "+DVB_C": "DVB", + "+DVB_S": "DVB", + "+DVB_C2": "DVB", + "+DVB_T2": "DVB", + "+DVB_S2": "DVB", + "+META_BCG": "META", + "+META_SI": "META"*/ + }, + + roots: "profilelist", + + defaultCapabilities: { + "DVB": { + video_broadcast: { + value: true, + attributes: { + type: "ID_DVB_T ID_DVB_SI_DIRECT", + transport: "", + nrstreams: 1, + scaling: "arbitrary", + minSize: 0, + postList: false, + networkTimeshift: false, + localTimeshift: false + } + } + }, + "OITF_SDEU_UIPROF": { + overlaylocaltuner: { + value: "per-pixel" + } + }, + "+PVR": { + recording: { + value: true, + attributes: { + ipBroadcast: false, + HAS: false, + DASH: false, + manageRecordings: "initiator", + postList: false + } + } + }, + META: { + clientMetadata: { + value: true, + attributes: { + type: "eit-pf" + } + } + }, + "+CONTROLLED": { + configurationChanges: { + value: true + } + } + }, + + rearrangeDefaultProperties: function() { + var defaultProperties = {}; + + var defaultCapabilitiesKeys = Object.keys(this.defaultCapabilities); + + for (var i = 0, l = defaultCapabilitiesKeys.length; i < l; i++) { + var currentKey = defaultCapabilitiesKeys[i]; + var currentCapability = this.defaultCapabilities[currentKey]; + var currentCapabilityKeysList = Object.keys(currentCapability); + + for (var j = 0, l1 = currentCapabilityKeysList.length; j < l1; j++) { + var currentCapabilityKeys = currentCapabilityKeysList[j]; + defaultProperties[currentCapabilityKeys] = + currentCapability[currentCapabilityKeys]; + } + } + return defaultProperties; + }, + + /* + * FIXME: + * Yannis - 13/05/2015 - Achieved a more detailed verification on capability + * but it's not an obligation + */ + hasCapablity: function(profileName) { + this.defaultCapabilities[profileName]; + this.profileNameMapping[profileName]; + + return this.defaultCapabilities[profileName] || + this.profileNameMapping[profileName]; + }, + + searchAnAttributeValue: function(attributeValue) { + + }, + searchATagName: function(tagName) { + + }, + searchAValue: function(value) { + + } +}); + Copied: oipf/configuration/ConfigDefaultProperties.js (from rev 1419, oipf/js/configuration/ConfigDefaultProperties.js) =================================================================== --- oipf/configuration/ConfigDefaultProperties.js (rev 0) +++ oipf/configuration/ConfigDefaultProperties.js 2015-05-28 08:25:12 UTC (rev 1511) @@ -0,0 +1,135 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var ConfigDefaultProperties = Class.extend({ + + init: function() { + + this.restrictedPowerState = { + 0: true, // OFF + 6: true // FACTORY_RESET + }, + + this.tvStandardsSupported = { + 1: true, + 2: true, + 4: true, + 8: true, + 16: true + }, + + this.screenSize = { + "1280x720": true, //HD 720 + "1920x1080": true, //HD 1080 + "640x480": true //VGA + }, + + this.configuration = { + preferredAudioLanguage: "fra", + preferredSubtitleLanguage: "fra", + preferredUILanguage: "fra", + countryId: "FRA", + regionId: 0, + pvrPolicy: configurationConstants.pvrPolicy.WATCHED_RECORDINGS, + pvrSaveEpisodes: 5, + pvrSaveDays: 15, + pvrStartPadding: 0, //Measured in (s) + pvrEndPadding: 0, //Measured in (s) + preferredTimeShiftMode: videoBroadcastConstants.timeShiftMode.OFF + }; + + this.startupInformation = { + urlSource: null, + url: null + }; + + this.aVOutput = { + name: null, + type: null, + enabled: null, + subtitleEnabled: null, + videoMode: null, + digitalAudioMode: null, + audioRange: null, + hdVideoFormat: null, + tvAspectRatio: null, + supportedVideoModes: null, + supportedDigitalAudioModes: null, + supportedAudioRanges: null, + supportedHdVideoFormats: null, + supportedAspectRatios: null, + current3DMode: null + }; + + this.signalInfo = { + strength: null, + quality: null, + ber: null, + snr: null, + lock: null + }; + + this.lNBInfo = { + lnbType: null, + lnbLowFreq: null, + lnbHighFreq: null, + crossoverFrequency: null, + lnbStartFrequency: null, + lnbStopFrequency: null, + orbitalPosition: null + }; + + this.tuner = { + id: null, + enableTuner: true, + signalInfo: new SignalInfo(this.signalInfo), + lnbInfo: new LNBInfo(this.lNBInfo), + frontEndPosition: null, + powerOnExternal: null + }; + + var idTypes = new IntegerCollection(12, 11); + var tunerTNT = new Tuner("TNT", idTypes, this.tuner); + var tuners = new TunerCollection(tunerTNT); + + var masterAVOutput = + new AVOutput("master", "both", true, this.aVOutput); + + var networkInterface = + new NetworkInterface("192.168.99.191", "6D:FF:29:E1:AF:33", true, true); + + this.localSystem = { + deviceID: undefined, + systemReady: false, + vendorName: null, + modelName: null, + familyName: null, + softwareVersion: null, + hardwareVersion: null, + serialNumber: null, + releaseVersion: null, + majorVersion: null, + minorVersion: null, + oipfProfile: null, + pvrEnabled: true, //This property is deprecated. + ciplusEnabled: false, + powerState: 1, + previousPowerState: 0, + timeCurrentPowerState: new Date().getTime(), + volume: 0, + mute: false, + tuners: tuners, + outputs: new AVOutputCollection(masterAVOutput), + networkInterfaces: new NetworkInterfaceCollection(networkInterface), + tvStandardsSupported: null, //Represented by a bitfield + tvStandard: configurationConstants.tvStandard.SECAM, + pvrSupport: 1, + startupInformation: null + }; + + } +}); + Copied: oipf/configuration/OipfConfiguration.js (from rev 1474, oipf/js/configuration/OipfConfiguration.js) =================================================================== --- oipf/configuration/OipfConfiguration.js (rev 0) +++ oipf/configuration/OipfConfiguration.js 2015-05-28 08:25:12 UTC (rev 1511) @@ -0,0 +1,24 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var OipfConfiguration = Class.extend({ + + init: function() { + + //Channels configuration + this.channelNumber = 13; + this.channelCountry = "France"; + this.channelList = "../../data/oipfChannels.xml"; + + //Programmes configuration + this.programmeType = "xmlTV"; + this.programmeCountry = "France"; + this.programmes = "../../data/xmlTVProgrammes.xml"; + + + } +}); + Copied: oipf/configuration/TestConfig.js (from rev 1419, oipf/js/configuration/TestConfig.js) =================================================================== --- oipf/configuration/TestConfig.js (rev 0) +++ oipf/configuration/TestConfig.js 2015-05-28 08:25:12 UTC (rev 1511) @@ -0,0 +1,226 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +if (!String.prototype.includes) { + String.prototype.includes = function() {'use strict'; + return String.prototype.indexOf.apply(this, arguments) !== -1; + }; +} + +var userAgent = navigator.userAgent; + +if (userAgent.includes("HbbTV") || userAgent.includes("SmartTv")) { + + console.log("OIPF TESTS ON TV PLATFORM"); + var hbbTv = ApplicationManager.getWindows[2]; + hbbTv && hbbTv.deactivate(); + var ui = ApplicationManager.getWindows()[0]; //or getWindowsByName + ui && ui.keySet.setValue(0x10, []); + !ui.visible && ui.show(); + ui.activate(); + + var VideoBroadcastManager = VideoBroadcastTest.extend({ + + init: function() { +// this.superBeforeTest = VideoBroadcastTest.prototype.super.beforeTest; + this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject(); + + this.superBeforeTest = this.super.beforeTest; + this.superOnChangeState = this.super.onChangeState; + }, + + onChangeState: function(resolve, reject, event) { + this.superOnChangeState.call(this, + resolve, reject, event.state, event.error); + }, + + beforeTest: function(resolve, reject) { + this.onPlayStateChange = this.onChangeState.bind(this, resolve, reject); + this.vidBroadObj.addEventListener("PlayStateChange", this.onPlayStateChange, false); + this.transitions = []; + this.previousState = this.vidBroadObj.playState; + this.currentIndex = 0; + this.channel = null; + this.timerManager = new TimerManager(); + this.timeout = this.timerManager.createTimer.bind(this.timerManager); + logTest("State: Pending"); + this.cancel = true; + }, + + unrealizedToConnecting: function(begin, end, callback) { + if (callback) { + throw ("Untestable Case."); + } + }, + + connectingToPresenting: function(begin, end, callback) { + /** + * Avoid that the future transition C->P be canceled. + * More extend super method beforeTest in order to reset + * 'startEndStates' property. + */ + if (this.cancel) { + callback && this.timeout().then(callback).then(console.log.bind(console, "TOTO")); + this.cancel = false; + } else { + this.pushTransition(begin, end, callback, null); + } + }, + + unrealizedToUnrealized: function(begin, end, callback) { + this.reject("Untestable Case."); + }, + + stopToStop: function(begin, end, callback) { + this.reject("Untestable Case."); + }, + + noStatesDefined: function(begin, end, callback) { + this.reject("Untestable Case."); + }, + + startEndStates: { + + "00": "unrealizedToUnrealized", + "01": "unrealizedToConnecting", + "12": "connectingToPresenting", + "33": "stopToStop", + "nullnull": "noStatesDefined" + }, + + pushTransition: function(begin, end, callback, error) { + this.transitions.push({ + begin: begin, + end: end, + error: error, + callback: callback + }); + }, + + pushTransitionWithError: function(begin, end, callback, error) { + var method = this.startEndStates[""+begin+end]; + if (method) { + this[method].call(this, begin, end, callback); + } else { + this.pushTransition(begin, end, callback, error); + } + }, + + addTransition: function(begin, end, callback) { + this.addTransitionWithError(begin, end, callback, null); + }, + + addTransitionWithError: function(begin, end, callback, error) { + this.pushTransitionWithError(begin, end, callback, error); + } + }); + + var VideoBroadcastTest = VideoBroadcastManager.extend({ + + init: function() { + this.super.init(); + } + + }); + + var SearchManagerTest = SearchManagerTest.extend({ + init: function() { + this.searchManagerObj = oipfObjectFactory.createSearchManagerObject(); + this.super.init(); + }, + + beforeTest: function(resolve, reject) { + this.super.beforeTest(resolve, reject); + this.cancel = true; + }, + + noStatesDefined: function(begin, end, callback) { + this.reject("Untestable Case."); + }, + + unrealizedToConnecting: function(begin, end, callback) { + if (callback) { + throw ("Untestable Case."); + } + }, + + connectingToPresenting: function(begin, end, callback) { + /** + * Avoid that the future transition C->P be canceled. + * More extend super method beforeTest in order to reset + * 'startEndStates' property. + */ + if (this.cancel) { + callback && this.timeout().then(callback).then(console.log.bind(console, "TOTO")); + this.cancel = false; + } else { + this.pushTransition(begin, end, callback, null); + } + }, + + startEndStates: { + + "00": "unrealizedToUnrealized", + "01": "unrealizedToConnecting", + "12": "connectingToPresenting", + "33": "stopToStop", + "nullnull": "noStatesDefined" + }, + + pushTransition: function(begin, end, callback, error) { + this.transitions.push({ + begin: begin, + end: end, + error: error, + callback: callback + }); + }, + + pushTransitionWithError: function(begin, end, callback, error) { + var method = this.startEndStates[""+begin+end]; + if (method) { + this[method].call(this, begin, end, callback); + } else { + this.pushTransition(begin, end, callback, error); + } + }, + + addTransition: function(begin, end, callback) { + this.addTransitionWithError(begin, end, callback, null); + }, + + addTransitionWithError: function(begin, end, callback, error) { + this.pushTransitionWithError(begin, end, callback, error); + } + }); + + var RecordingSchedulerTest = RecordingSchedulerTest.extend({ + + init: function() { + this.super.init(); + this.blocked = function() {}; + this.bindToCurrentChannel = this.blocked; + this.onChangeState = this.blocked; + this.createVideoBroadcast = function() { + if (!this.vidBroadObj) { + this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject(); + } + } + }, + + onPVREvent: function(resolve, reject, event) { + console.log("beforeTest"); + this.super.onPVREvent(resolve, reject, event.state, event.recording); + }, + + beforeTest: function(resolve, reject) { + console.log("beforeTest"); + this.super.beforeTest(resolve, reject); + } + + }); + +}
participants (1)
-
ygregoï¼ users.nuiton.org