Skip to content

Commit

Permalink
javascript API updated to version 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorHidalgoVT committed Jun 20, 2016
1 parent 419439f commit ac63585
Show file tree
Hide file tree
Showing 18 changed files with 1,514 additions and 167 deletions.
251 changes: 228 additions & 23 deletions nuboeardetector/js/kurento-module-nuboeardetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ
/*
* (C) Copyright 2013-2015 Kurento (http://kurento.org/)
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the GNU Lesser General Public License (LGPL)
* version 2.1 which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-2.1.html
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var inherits = require('inherits');
Expand Down Expand Up @@ -46,6 +48,8 @@ function noop(error, result) {
* @extends module:core/abstracts.Filter
*
* @constructor module:nuboeardetector.NuboEarDetector
*
* @fires {@link module:nuboeardetector#event:OnEar OnEar}
*/
function NuboEarDetector(){
NuboEarDetector.super_.call(this);
Expand All @@ -57,6 +61,46 @@ inherits(NuboEarDetector, Filter);
// Public methods
//

/**
* The events will be launched to the server with the information about the ear
* detected. milliseconds indicate the frequency with which events will be
* launched (0 millisecons => an event will be lauched, when there is some
* information
*
* @alias module:nuboeardetector.NuboEarDetector.activateServerEvents
*
* @param {external:Integer} activate
* 1=>activate it, 0 desactivated
*
* @param {external:Integer} time
* the frequency in ms to send the events
*
* @param {module:nuboeardetector.NuboEarDetector~activateServerEventsCallback} [callback]
*
* @return {external:Promise}
*/
NuboEarDetector.prototype.activateServerEvents = function(activate, time, callback){
var transaction = (arguments[0] instanceof Transaction)
? Array.prototype.shift.apply(arguments)
: undefined;

checkType('int', 'activate', activate, {required: true});
checkType('int', 'time', time, {required: true});

var params = {
activate: activate,
time: time
};

callback = (callback || noop).bind(this)

return disguise(this._invoke(transaction, 'activateServerEvents', params, callback), this)
};
/**
* @callback module:nuboeardetector.NuboEarDetector~activateServerEventsCallback
* @param {external:Error} error
*/

/**
* To indicate the algorithm if process all the images or only when it receives
*
Expand Down Expand Up @@ -259,7 +303,7 @@ NuboEarDetector.prototype.widthToProcess = function(width, callback){
*/
NuboEarDetector.constructorParams = {
mediaPipeline: {
type: 'MediaPipeline',
type: 'kurento.MediaPipeline',
required: true
}
};
Expand All @@ -269,7 +313,7 @@ NuboEarDetector.constructorParams = {
*
* @extends module:core/abstracts.Filter.events
*/
NuboEarDetector.events = Filter.events;
NuboEarDetector.events = Filter.events.concat(['OnEar']);


/**
Expand Down Expand Up @@ -298,21 +342,180 @@ NuboEarDetector.check = checkNuboEarDetector;

require('.');

},{".":"kurento-module-nuboeardetector"}],"kurento-module-nuboeardetector":[function(require,module,exports){
},{".":"kurento-module-nuboeardetector"}],3:[function(require,module,exports){
/* Autogenerated with Kurento Idl */

/*
* (C) Copyright 2013-2015 Kurento (http://kurento.org/)
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the GNU Lesser General Public License (LGPL)
* version 2.1 which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-2.1.html
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var inherits = require('inherits');

var kurentoClient = require('kurento-client');

var checkType = kurentoClient.checkType;
var ChecktypeError = checkType.ChecktypeError;

var ComplexType = kurentoClient.register.complexTypes.ComplexType;


/**
* EarInfo contains information about the detected ears
*
* @constructor module:nuboeardetector/complexTypes.EarInfo
*
* @property {external:String} name
* This value contains the word ear in order to identify the register
* @property {external:Integer} x
* represent the x value of the upper left corner of the ear
* @property {external:Integer} y
* represent the y value of the upper left corner of the ear
* @property {external:Integer} height
* Represent the height of the detected ear
* @property {external:Integer} width
* Represent the width of the detected ear
*/
function EarInfo(earInfoDict){
if(!(this instanceof EarInfo))
return new EarInfo(earInfoDict)

earInfoDict = earInfoDict || {}

// Check earInfoDict has the required fields
checkType('String', 'earInfoDict.name', earInfoDict.name, {required: true});
checkType('int', 'earInfoDict.x', earInfoDict.x, {required: true});
checkType('int', 'earInfoDict.y', earInfoDict.y, {required: true});
checkType('int', 'earInfoDict.height', earInfoDict.height, {required: true});
checkType('int', 'earInfoDict.width', earInfoDict.width, {required: true});

// Init parent class
EarInfo.super_.call(this, earInfoDict)

// Set object properties
Object.defineProperties(this, {
name: {
writable: true,
enumerable: true,
value: earInfoDict.name
},
x: {
writable: true,
enumerable: true,
value: earInfoDict.x
},
y: {
writable: true,
enumerable: true,
value: earInfoDict.y
},
height: {
writable: true,
enumerable: true,
value: earInfoDict.height
},
width: {
writable: true,
enumerable: true,
value: earInfoDict.width
}
})
}
inherits(EarInfo, ComplexType)

// Private identifiers to allow re-construction of the complexType on the server
// They need to be enumerable so JSON.stringify() can access to them
Object.defineProperties(EarInfo.prototype, {
__module__: {
enumerable: true,
value: "nuboeardetector"
},
__type__: {
enumerable: true,
value: "EarInfo"
}
})

/**
* Checker for {@link module:nuboeardetector/complexTypes.EarInfo}
*
* @memberof module:nuboeardetector/complexTypes
*
* @param {external:String} key
* @param {module:nuboeardetector/complexTypes.EarInfo} value
*/
function checkEarInfo(key, value)
{
if(!(value instanceof EarInfo))
throw ChecktypeError(key, EarInfo, value);
};


module.exports = EarInfo;

EarInfo.check = checkEarInfo;

},{"inherits":"inherits","kurento-client":"kurento-client"}],4:[function(require,module,exports){
/* Autogenerated with Kurento Idl */

/*
* (C) Copyright 2013-2015 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Media API for the Kurento Web SDK
*
* @module nuboeardetector/complexTypes
*
* @copyright 2013-2015 Kurento (http://kurento.org/)
* @license ALv2
*/

var EarInfo = require('./EarInfo');


exports.EarInfo = EarInfo;

},{"./EarInfo":3}],"kurento-module-nuboeardetector":[function(require,module,exports){
/* Autogenerated with Kurento Idl */

/*
* (C) Copyright 2013-2015 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
Expand All @@ -321,16 +524,18 @@ require('.');
* @module nuboeardetector
*
* @copyright 2013-2015 Kurento (http://kurento.org/)
* @license LGPL
* @license ALv2
*/

Object.defineProperty(exports, 'name', {value: 'nuboeardetector'});
Object.defineProperty(exports, 'version', {value: '0.0.4-dev'});
Object.defineProperty(exports, 'version', {value: '6.5.0'});


var NuboEarDetector = require('./NuboEarDetector');


exports.NuboEarDetector = NuboEarDetector;

},{"./NuboEarDetector":1}]},{},[2]);
exports.complexTypes = require('./complexTypes');

},{"./NuboEarDetector":1,"./complexTypes":4}]},{},[2]);
Loading

0 comments on commit ac63585

Please sign in to comment.