-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Iaab1e8994cb41ffd8022d369378dff64524f2f5d
- Loading branch information
Showing
8 changed files
with
284 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* Autogenerated with Kurento Idl */ | ||
|
||
/* | ||
* (C) Copyright 2013-2014 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. | ||
* | ||
*/ | ||
|
||
var checkType = require('../checkType'); | ||
|
||
/** | ||
* Media API for the Kurento Web SDK | ||
* | ||
* @module KwsMedia/complexTypes | ||
* | ||
* @copyright 2014 Kurento (http://kurento.org/) | ||
* @license LGPL | ||
*/ | ||
|
||
/** | ||
* Checker for {@link KwsMedia/complexTypes~RelativePoint} | ||
* | ||
* @param {String} key | ||
* @param {KwsMedia/complexTypes~RelativePoint} value | ||
*/ | ||
function checkRelativePoint(key, value) | ||
{ | ||
checkType('float', key+'.x', value.x, true); | ||
checkType('float', key+'.y', value.y, true); | ||
}; | ||
|
||
|
||
/** | ||
* Relative points in a physical screen, values are a percentage relative to the image dimensions. X left to right and Y top to down. | ||
* | ||
* @typedef KwsMedia/complexTypes~RelativePoint | ||
* | ||
* @type {Object} | ||
* @property {float} x - Percentage relative to the image width to calculate the X coordinate of the point [0..1] | ||
* @property {float} y - Percentage relative to the image height to calculate the Y coordinate of the point [0..1] | ||
*/ | ||
|
||
|
||
module.exports = checkRelativePoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/* | ||
* (C) Copyright 2013-2014 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. | ||
* | ||
*/ | ||
|
||
var inherits = require('inherits'); | ||
|
||
var checkType = require('../checkType'); | ||
|
||
|
||
/** | ||
* Media API for the Kurento Web SDK | ||
* | ||
* @module kwsMediaApi/hubs | ||
* | ||
* @copyright 2013-2014 Kurento (http://kurento.org/) | ||
* @license LGPL | ||
*/ | ||
|
||
var Hub = require('../core/Hub'); | ||
|
||
|
||
/** | ||
* A :rom:cls:`Hub` that allows routing of video between arbitrary port pairs and mixing of audio among several ports | ||
* | ||
* @class module:kwsMediaApi/hubs~Mixer | ||
* @extends module:kwsMediaApi~Hub | ||
*/ | ||
|
||
/** | ||
* Create a :rom:cls:`Mixer` belonging to the given pipeline. | ||
* | ||
* @constructor | ||
* | ||
* @param {string} id | ||
*/ | ||
function Mixer(id) | ||
{ | ||
Hub.call(this, id); | ||
}; | ||
inherits(Mixer, Hub); | ||
|
||
|
||
/** | ||
* Connects each corresponding :rom:enum:`MediaType` of the given source port with the sink port. | ||
* | ||
* @param {MediaType} media | ||
* The sort of media stream to be connected | ||
* | ||
* @param {HubPort} source | ||
* Video source port to be connected | ||
* | ||
* @param {HubPort} sink | ||
* Video sink port to be connected | ||
* | ||
* @param {module:kwsMediaApi/hubs~Mixer.connectCallback} [callback] | ||
* | ||
* @return {module:kwsMediaApi/hubs~Mixer} | ||
* The own media object | ||
*/ | ||
Mixer.prototype.connect = function(media, source, sink, callback){ | ||
checkType('MediaType', 'media', media, {required: true}); | ||
checkType('HubPort', 'source', source, {required: true}); | ||
checkType('HubPort', 'sink', sink, {required: true}); | ||
|
||
var params = { | ||
media: media, | ||
source: source, | ||
sink: sink, | ||
}; | ||
|
||
return this.invoke('connect', params, callback); | ||
}; | ||
/** | ||
* @callback Mixer~connectCallback | ||
* @param {Error} error | ||
*/ | ||
|
||
/** | ||
* Disonnects each corresponding :rom:enum:`MediaType` of the given source port from the sink port. | ||
* | ||
* @param {MediaType} media | ||
* The sort of media stream to be disconnected | ||
* | ||
* @param {HubPort} source | ||
* Audio source port to be disconnected | ||
* | ||
* @param {HubPort} sink | ||
* Audio sink port to be disconnected | ||
* | ||
* @param {module:kwsMediaApi/hubs~Mixer.disconnectCallback} [callback] | ||
* | ||
* @return {module:kwsMediaApi/hubs~Mixer} | ||
* The own media object | ||
*/ | ||
Mixer.prototype.disconnect = function(media, source, sink, callback){ | ||
checkType('MediaType', 'media', media, {required: true}); | ||
checkType('HubPort', 'source', source, {required: true}); | ||
checkType('HubPort', 'sink', sink, {required: true}); | ||
|
||
var params = { | ||
media: media, | ||
source: source, | ||
sink: sink, | ||
}; | ||
|
||
return this.invoke('disconnect', params, callback); | ||
}; | ||
/** | ||
* @callback Mixer~disconnectCallback | ||
* @param {Error} error | ||
*/ | ||
|
||
|
||
/** | ||
* @type module:kwsMediaApi/hubs~Mixer.constructorParams | ||
* | ||
* @property {MediaPipeline} mediaPipeline | ||
* the :rom:cls:`MediaPipeline` to which the Mixer belongs | ||
*/ | ||
Mixer.constructorParams = { | ||
mediaPipeline: { | ||
type: 'MediaPipeline', | ||
required: true | ||
}, | ||
}; | ||
|
||
/** | ||
* @type module:kwsMediaApi/hubs~Mixer.events | ||
* @extend module:kwsMediaApi~Hub.events | ||
*/ | ||
Mixer.events = []; | ||
Mixer.events.concat(Hub.events); | ||
|
||
|
||
module.exports = Mixer; | ||
|
||
|
||
Mixer.check = function(key, value) | ||
{ | ||
if(!(value instanceof Mixer)) | ||
throw SyntaxError(key+' param should be a Mixer, not '+typeof value); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.