Source: node_modules/kurento-client-elements/lib/HttpPostEndpoint.js

/* Autogenerated with Kurento Idl */

/*
 * (C) Copyright 2013-2015 Kurento (https://kurento.openvidu.io/)
 *
 * 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');

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

var disguise = kurentoClient.disguise;

var ChecktypeError = kurentoClient.checkType.ChecktypeError;

var HttpEndpoint = require('./abstracts/HttpEndpoint');


/**
 * Builder for the {@link HttpPostEndpoint}.
 *
 * @classdesc
 *  An {@link HttpPostEndpoint} contains SINK pads for AUDIO and VIDEO, which 
 *  provide access to an HTTP file upload function
 *     This type of endpoint provide unidirectional communications. Its 
 *     :rom:cls:`MediaSources <MediaSource>` are accessed through the HTTP POST 
 *     method.
 *
 * @extends module:elements/abstracts.HttpEndpoint
 *
 * @constructor module:elements.HttpPostEndpoint
 *
 * @fires {@link module:elements#event:EndOfStream EndOfStream}
 */
function HttpPostEndpoint(){
  HttpPostEndpoint.super_.call(this);
};
inherits(HttpPostEndpoint, HttpEndpoint);


/**
 * @alias module:elements.HttpPostEndpoint.constructorParams
 *
 * @property {external:Integer} [disconnectionTimeout]
 *  This is the time that an http endpoint will wait for a reconnection, in case
 *
 * @property {module:core.MediaPipeline} mediaPipeline
 *  the {@link MediaPipeline} to which the endpoint belongs
 *
 * @property {external:Boolean} [useEncodedMedia]
 *  Feed the input media as-is to the Media Pipeline, instead of first decoding 
 *  it.
 *                <p>
 *                When this property is not enabled, the input media gets always
 *                </p>
 *                <p>
 *                When this property is enabled, the explained behavior gets 
 *                disabled. Instead, The endpoint will provide any input media 
 *                directly to the Media Pipeline, without prior decoding. 
 *                Enabling this mode of operation could have a severe effect on 
 *                stability, because lost video keyframes will not be 
 *                regenerated; however, avoiding a full cycle of decoding and 
 *                encoding can be very useful for certain applications, because 
 *                it improves performance by greatly reducing the CPU processing
 *                </p>
 *                <p>
 *                Keep in mind that if this property is enabled, the original 
 *                source media MUST already have an encoding format which is 
 *                compatible with the destination target. For example: given a 
 *                pipeline which uses this endpoint to read a file and then 
 *                streams it to a WebRTC browser such as Chrome, then the file 
 *                must already be encoded with a VP8 or H.264 codec profile 
 *                which Chrome is able to decode. Note that for this example, 
 *                most browsers don't support ANY combination of H.264 encoding 
 *                options; instead, they tend to support only a very specific 
 *                subset of the codec features (also known as 'profiles').
 *                </p>
 *                <p>
 *                We strongly recommend to avoid using this option, because 
 *                correct behavior cannot be guaranteed.
 *                </p>
 */
HttpPostEndpoint.constructorParams = {
  disconnectionTimeout: {
    type: 'int'  },
  mediaPipeline: {
    type: 'kurento.MediaPipeline',
    required: true
  },
  useEncodedMedia: {
    type: 'boolean'  }
};

/**
 * @alias module:elements.HttpPostEndpoint.events
 *
 * @extends module:elements/abstracts.HttpEndpoint.events
 */
HttpPostEndpoint.events = HttpEndpoint.events.concat(['EndOfStream']);


/**
 * Checker for {@link module:elements.HttpPostEndpoint}
 *
 * @memberof module:elements
 *
 * @param {external:String} key
 * @param {module:elements.HttpPostEndpoint} value
 */
function checkHttpPostEndpoint(key, value)
{
  if(!(value instanceof HttpPostEndpoint))
    throw ChecktypeError(key, HttpPostEndpoint, value);
};


module.exports = HttpPostEndpoint;

HttpPostEndpoint.check = checkHttpPostEndpoint;