Home | History | Annotate | Download | only in include
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 #ifndef TSC_H324M_CONFIG_INTERFACE_H_INCLUDED
     19 #define TSC_H324M_CONFIG_INTERFACE_H_INCLUDED
     20 
     21 #ifndef OSCL_BASE_H_INCLUDED
     22 #include "oscl_base.h"
     23 #endif
     24 
     25 #ifndef PVT_COMMON_H_INCLUDED
     26 #include "pvt_common.h"
     27 #endif
     28 
     29 #ifndef PV_UUID_H_INCLUDED
     30 #include "pv_uuid.h"
     31 #endif
     32 
     33 #ifndef PVMF_NODE_INTERFACE_H_INCLUDED
     34 #include "pvmf_node_interface.h"
     35 #endif
     36 
     37 #define PVH324MConfigUuid PVUuid(0x2b0b54e2,0x7079,0x46c6,0xb2,0x3e,0x04,0xff,0xd3,0x0e,0x14,0x36)
     38 
     39 //----f6b47190-f88d-4cbf-a6f6-c61efe98053f
     40 // UUID for the extension interface
     41 #define PVUuidH324ComponentInterface  PVUuid(0xf6b47190,0xf88d,0x4cbf,0xa6,0xf6,0xc6,0x1e,0xfe,0x98,0x05,0x3f)
     42 
     43 
     44 typedef uint32 H324MConfigInformationalEvent;
     45 typedef uint32 H324MConfigStatusResponse;
     46 
     47 class PVMFComponentInterface: public PVInterface
     48 {
     49         // get, set functions, etc
     50         ////////////////////////////////////
     51         // PVInterface virtuals
     52         ////////////////////////////////////
     53         void addRef() {};
     54         void removeRef() {}
     55 };
     56 
     57 class H324MConfigObserver
     58 {
     59     public:
     60         virtual ~H324MConfigObserver() {}
     61         virtual void H324MConfigCommandCompletedL(PVMFCmdResp& aResponse) = 0;
     62         virtual void H324MConfigHandleInformationalEventL(PVMFAsyncEvent& aNotification) = 0;
     63 };
     64 
     65 
     66 class H324MConfigInterface : public PVInterface
     67 {
     68     public:
     69         /**
     70         * This API allows the user to specify separate observers for the 324m interface.  Otherwise, the default
     71         * observers will be used
     72         *
     73         * @param aObserver        the observer for command status and for unsolicited informational events
     74         **/
     75         virtual void SetObserver(H324MConfigObserver* aObserver) = 0;
     76 
     77         /**
     78         * This API allows the user to specify the starting H223 multiplex level
     79         *
     80         * @param aLevel
     81         *           The starting H223 multiplex level.  Note that the final level that is neotiated will depend
     82         *          on the starting level of the peer
     83         *
     84         * @param aContextData
     85         *         Optional opaque data that will be passed back to the user with the command response
     86         * @returns A unique command id for asynchronous completion
     87         **/
     88         virtual PVMFCommandId SetMultiplexLevel(TPVH223Level aLevel,
     89                                                 OsclAny* aContextData = NULL) = 0;
     90 
     91         /**
     92         * This API allows the user to specify maximum outgoing sdu sizes for each adaptation layer
     93         *
     94         * @param aLayer
     95         *           The h223 adaptation layer type
     96         * @param aSize
     97         *           The sdu size
     98         *
     99         * @param aContextData
    100         *         Optional opaque data that will be passed back to the user with the command response
    101         * @returns A unique command id for asynchronous completion
    102         **/
    103 
    104         virtual PVMFCommandId SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize,
    105                                             OsclAny* aContextData = NULL) = 0;
    106         /**
    107         * This API allows the user to specify maximum incoming sdu sizes for each adaptation layer.  This is indicated
    108         * to the peer via the TCS
    109         *
    110         * @param aLayer
    111         *           The h223 adaptation layer type
    112         * @param aSize
    113         *           The sdu size
    114         *
    115         * @param aContextData
    116         *         Optional opaque data that will be passed back to the user with the command response
    117         * @returns A unique command id for asynchronous completion
    118         **/
    119 
    120         virtual PVMFCommandId SetMaxSduSizeR(TPVAdaptationLayer aLayer,
    121                                              int32 aSize, OsclAny* aContextData = NULL) = 0;
    122 
    123         /**
    124         * This API allows the user to specify the sequence number field for AL2
    125         *
    126         * @param aSeqNumWidth
    127         *           The number of octets to use for AL2 sequence numbers.  Allowed values are 0, 1.
    128         *
    129         * @param aContextData
    130         *         Optional opaque data that will be passed back to the user with the command response
    131         * @returns A unique command id for asynchronous completion
    132         **/
    133 
    134         virtual PVMFCommandId SetAl2SequenceNumbers(int32 aSeqNumWidth,
    135                 OsclAny* aContextData = NULL) = 0;
    136         /**
    137         * This API allows the user to specify the control field octets field for AL3
    138         *
    139         * @param aCfo
    140         *           The number of octets to use for AL3 CFO.  Allowed values are 0, 1, 2.
    141         *
    142         * @param aContextData
    143         *         Optional opaque data that will be passed back to the user with the command response
    144         * @returns A unique command id for asynchronous completion
    145         **/
    146 
    147         virtual PVMFCommandId SetAl3ControlFieldOctets(int32 aCfo,
    148                 OsclAny* aContextData = NULL) = 0;
    149 
    150         /**
    151         * This API allows the user to limit the size of the outgoing h223 pdus
    152         *
    153         * @param aMaxPduSize
    154         *           The max pdu size
    155         *
    156         * @param aContextData
    157         *         Optional opaque data that will be passed back to the user with the command response
    158         * @returns A unique command id for asynchronous completion
    159         **/
    160         virtual PVMFCommandId SetMaxPduSize(int32 aMaxPduSize,
    161                                             OsclAny* aContextData = NULL) = 0;
    162 
    163         /**
    164         * This API allows the user to specify the terminal type that is advertized to the peer.  This can be used to
    165         * force the local terminal to be master/slave when communicating with a peer 324m terminal for testing purposes.
    166         *
    167         * @param aTerminalType The terminal type
    168         * @param aContextData
    169         *         Optional opaque data that will be passed back to the user with the command response
    170         * @returns A unique command id for asynchronous completion
    171         **/
    172         virtual PVMFCommandId SetTerminalType(uint8 aTerminalType,
    173                                               OsclAny* aContextData = NULL) = 0;
    174         /**
    175         * This API allows the user to specify the allowable adaptation layers for audio and video.
    176         * By default AL2 is allowed for audio and AL2, AL3 are allowed for video
    177         *
    178         * @param aMediaType The media type, i.e audio, video, data
    179         * @param aLayer The adaptation layer
    180         * @param aAllow Is this adaptation layer allowed for this media type ?
    181         * @param aContextData
    182         *         Optional opaque data that will be passed back to the user with the command response
    183         * @returns A unique command id for asynchronous completion
    184         **/
    185         virtual PVMFCommandId SetALConfiguration(TPVMediaType_t aMediaType,
    186                 TPVAdaptationLayer aLayer,
    187                 bool aAllow,
    188                 OsclAny* aContextData = NULL) = 0;
    189 
    190         /**
    191         * This API allows the user to specify whether Request Multiplex Entry is sent to the remote terminal after TCS
    192         *
    193         * @param aSendRme If true, RME is sent to the peer after TCS
    194         * @param aContextData
    195         *         Optional opaque data that will be passed back to the user with the command response
    196         * @returns A unique command id for asynchronous completion
    197         **/
    198         virtual PVMFCommandId SendRme(OsclAny* aContextData = NULL) = 0;
    199 
    200         /**
    201         * This API causes a maxMuxPduSize request to be sent to the remote terminal if set to a valid value (64 - 255).
    202         This is done after TCS if the remote terminal supports the maxMuxPduCapability
    203         *
    204         * @param aRequestMaxMuxPduSize The max mux pdu size
    205         * @param aContextData
    206         *         Optional opaque data that will be passed back to the user with the command response
    207         * @returns A unique command id for asynchronous completion
    208         **/
    209         virtual PVMFCommandId SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize,
    210                                                OsclAny* aContextData = NULL) = 0;
    211 
    212         /**
    213         * This API sets the max ccsrl sdu size
    214         *
    215         * @param aMaxCcsrlSduSize The max ccsrl sdu size
    216         * @param aContextData
    217         *         Optional opaque data that will be passed back to the user with the command response
    218         * @returns A unique command id for asynchronous completion
    219         **/
    220         virtual PVMFCommandId SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize,
    221                 OsclAny* aContextData = NULL) = 0;
    222 
    223         /**
    224         * This API may be called only after the media source has been successfully added
    225         * to the pv2way engine.  It causes the 2way engine to immediately send out a fast update frame
    226         * specific to the media type identified by the aTrack parameter.
    227         * @param aContextData
    228         *         Optional opaque data that will be passed back to the user with the command response
    229         * @param aTrack
    230         *         The identifier for the track
    231         * @returns A unique command id for asynchronous completion
    232         **/
    233         virtual PVMFCommandId FastUpdate(PVMFNodeInterface& aTrack,
    234                                          OsclAny* aContextData = NULL) = 0;
    235 
    236         /**
    237         * Sends a Round Trip Determination message to the peer and indicates the round trip delay to the caller
    238         * on completion of the command.  The round trip delay is stored in 4 bytes in the local buffer of the completion event
    239         * in network byte order.
    240         *
    241         * @param aContextData
    242         *         Optional opaque data that will be passed back to the user with the command response
    243         * @returns A unique command id for asynchronous completion
    244         **/
    245         virtual PVMFCommandId SendRtd(OsclAny* aContextData = NULL) = 0;
    246 
    247         /**
    248         * Sets the vendor identification data.  This does not cause the stack to issue a vendor identifiation request.
    249         * Set to NULL to disable sending vendor id.  If set to a valid parameter before Connect, it will cause the stack
    250         * to automatically send it along with the TCS message.
    251         * @param cc
    252         *         T35 Country code
    253         * @param ext
    254         *         T35 Extension
    255         * @param mc
    256         *         T35 Manufacturer code
    257         * @param aProduct
    258         *         Product number
    259         * @param aVersion
    260         *         Version number
    261         * @param aContextData
    262         *         Optional opaque data that will be passed back to the user with the command response
    263         * @returns A unique command id for asynchronous completion
    264         **/
    265         virtual PVMFCommandId SetVendor(uint8 cc, uint8 ext, uint32 mc,
    266                                         const uint8* aProduct, uint16 aProductLen,
    267                                         const uint8* aVersion, uint16 aVersionLen,
    268                                         OsclAny* aContextData = NULL) = 0;
    269 
    270         /**
    271         * Sends an end session command to the peer.  Only to be used for testing purposes.
    272         *
    273         * @param aContextData
    274         *         Optional opaque data that will be passed back to the user with the command response
    275         * @returns A unique command id for asynchronous completion
    276         **/
    277         virtual PVMFCommandId SendEndSession(OsclAny* aContextData = NULL) = 0;
    278 
    279         /**
    280         * Sets the disconnect timeout interval.
    281         *
    282         * @param aTimeout The timeout value in seconds
    283         * @param aContextData
    284         *         Optional opaque data that will be passed back to the user with the command response
    285         * @returns A unique command id for asynchronous completion
    286         **/
    287         virtual PVMFCommandId SetEndSessionTimeout(uint32 aTimeout,
    288                 OsclAny* aContextData = NULL) = 0;
    289 
    290         /**
    291         * Sets an H.324 timer/counter value.  This should be called before ConnectL is invoked.
    292         * The  supported timers are:
    293         *       T106    Master Slave Determination (in units of 1s)
    294         *       T101    Capability Exchange (in units of 1s)
    295         *       T103    Uni-directional and Bi-directional Logical Channel Signalling (in units of 1s)
    296         *       T108    Close Logical Channel (in units of 1s)
    297         *       T104    H.223 Multiplex Table (in units of 1s)
    298         *       T109    Mode Request (in units of 1s)
    299         *       T105    Round Trip Delay (in units of 1s)
    300         *       T107    Request Multiplex Entry (in units of 100ms)
    301         *      T401    SRP retransmission (in units of 100ms)
    302         * The supported counters are:
    303         *      N100 H245 (TCS, MSD)
    304         *      N401    SRP retransmission
    305         * @param aTimerCounter
    306         *         Identifies whether a timer or counter is being set.
    307         * @param aSeries
    308         *         Identifies the H.324 timer/counter series.
    309         * @param aSeriesOffset
    310         *         Specifies the offset within a particular series.
    311         *         E.g.
    312         *              aTimerCounter=EH324Timer, aSeries=1, aSeriesOffset=1 indicates T101.
    313         *              aTimerCounter=EH324Timer, aSeries=4, aSeriesOffset=1 indicates T401.
    314         *              aTimerCounter=EH324Counter, aSeries=4, aSeriesOffset=1 indicates T401.
    315         * @param aValue
    316         *         The new value for the H.324 timer/counter
    317         * @param aContextData
    318         *         Optional opaque data that will be passed back to the user with the command response
    319         **/
    320         virtual PVMFCommandId SetTimerCounter(TPVH324TimerCounter aTimerCounter,
    321                                               uint8 aSeries, uint32 aSeriesOffset,
    322                                               uint32 aValue,
    323                                               OsclAny* aContextData = NULL) = 0;
    324 
    325         /**
    326         * This API allows the user to specify the supported resolutions for video for transmit and receive.
    327         *
    328         * @param aDirection
    329         *         The direction (Tx/Rx) for which the capability is specified.
    330         * @param aResolutions
    331         *         An array of resolutions.
    332         * @param aContextData
    333         *         Optional opaque data that will be passed back to the user with the command response
    334         **/
    335         virtual PVMFCommandId SetVideoResolutions(TPVDirection aDirection,
    336                 Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions,
    337                 OsclAny* aContextData = NULL) = 0;
    338 
    339         /**
    340         * This API allows the user to send the vendor id info to the peer.
    341         * Note:  Calling this API during call-setup negotiations can affect the time for
    342         * call-setup adversely.
    343         *
    344         **/
    345         virtual PVMFCommandId SendVendorId(OsclAny* aContextData = NULL) = 0;
    346 
    347         /**
    348         * This API allows the user to send a videoTemporalSpatialTradeOff command to the peer.
    349         * It is a request to the remote encoder to adjust its encoding in accordance with the tradeoff value.
    350         * A value of 0 indicates a high spatial resolution and a value of 31 indicates a high frame rate.
    351         * The values from 0 to 31 indicate monotonically a higher frame rate. Actual values do not correspond
    352         * to precise values of spatial resolution or frame rate.
    353         *
    354         **/
    355         virtual PVMFCommandId SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel,
    356                 uint8 aTradeoff,
    357                 OsclAny* aContextData = NULL) = 0;
    358 
    359         /**
    360         * This API allows the user to send a videoTemporalSpatialTradeOff command to the peer.
    361         * It is an indication to the remote decoder that the local encoder has adjusted its encoding parameters
    362         * according to the tradeoff value.
    363         * A value of 0 indicates a high spatial resolution and a value of 31 indicates a high frame rate.
    364         * The values from 0 to 31 indicate monotonically a higher frame rate. Actual values do not correspond
    365         * to precise values of spatial resolution or frame rate.
    366         *
    367         **/
    368         virtual PVMFCommandId SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel,
    369                 uint8 aTradeoff, OsclAny* aContextData = NULL) = 0;
    370 
    371         /**
    372         * This API allows the user to send a SkewIndication to the peer.
    373         * Skew is measured in milliseconds, and indicates the maximum number of milliseconds that the data on
    374         * logicalChannel2 is delayed from the data on logicalChannel1 as delivered to the network transport.
    375         *
    376         **/
    377         virtual PVMFCommandId SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2,
    378                 uint16 aSkew, OsclAny* aContextData = NULL) = 0;
    379 
    380 
    381         /**
    382         * This API allows the user to configure the logical channel buffer sizes for incoming
    383         * and outgoing logical channels.
    384         * @param aDirection
    385         *         The direction (Rx or Tx).
    386         * @param aBufferingMs
    387         *         The amount of buffering in milliseconds.
    388         * @param aContextData
    389         *         Optional opaque data that will be passed back to the user with the command response
    390         **/
    391         virtual PVMFCommandId
    392         SetLogicalChannelBufferingMs(uint32 aInBufferingMs,
    393                                      uint32 aOutBufferingMs,
    394                                      OsclAny* aContextData = NULL) = 0;
    395 
    396         /**
    397         * Causes the pv2way to send the specified user input to the remote terminal using
    398         * control channel.  The user input can be either DTMF ot Alphanumeric
    399         * @param user_input A pointer to either CPVUserInputDtmf or CPVUserInputAlphanumeric
    400         * @param aContextData
    401         *         Optional opaque data that will be passed back to the user with the command response
    402         *
    403         * @returns A unique command id for asynchronous completion
    404         **/
    405         virtual PVMFCommandId
    406         SendUserInput(CPVUserInput* user_input,
    407                       OsclAny* aContextData = NULL) = 0;
    408 
    409         /**
    410         * Causes the pv2way to send the specified user input to the remote terminal using
    411         * control channel.
    412         * @param aEnableWnsrp Boolean whether to enable Wnsrp or not
    413         * @param aContextData
    414         *         Optional opaque data that will be passed back to the user with the command response
    415         *
    416         * @returns A unique command id for asynchronous completion
    417         **/
    418         virtual PVMFCommandId SetWnsrp(const bool aEnableWnsrp,
    419                                        OsclAny* aContextData = NULL) = 0;
    420 
    421 };
    422 
    423 
    424 /**
    425 * PVH324MIndicationType enum
    426 *
    427 *  Enumeration of unsolicited H324m specific indications from pv2way.
    428 *
    429 **/
    430 enum PVH324MIndicationType
    431 {
    432     /**
    433     * Indicates the receipt of a videoSpatialTemporalTradeoff command from the peer.
    434     * The first 2 bytes of the event local buffer indicate the logical channel (network byte order) and the 3rd
    435     * byte indicates the tradeoff value.
    436     *
    437     **/
    438     PV_INDICATION_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_COMMAND,
    439     /**
    440     * Indicates the receipt of a videoSpatialTemporalTradeoff indication from the peer.
    441     * The first 2 bytes of the event local buffer indicate the logical channel (network byte order) and the 3rd
    442     * byte indicates the tradeoff value.
    443     *
    444     **/
    445     PV_INDICATION_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION,
    446     /**
    447     * Indicates a fast update message from the remote terminal.  The first two bytes of the
    448     * local buffer encode the logical channel number in network byte order.
    449     *
    450     **/
    451     PV_INDICATION_FAST_UPDATE,
    452     /**
    453     * Indicates an incoming RTD command.
    454     *
    455     **/
    456     PV_INDICATION_RTD,
    457     /**
    458     * Indicates an incoming request multiplex entry command.
    459     *
    460     **/
    461     PV_INDICATION_RME,
    462     /**
    463     * Indicates an incoming vendor id indication message.
    464     *
    465     **/
    466     PV_INDICATION_VENDOR_ID,
    467     /**
    468     * Indicates the receipt of user input capability from the remote terminal.  The local buffer
    469     * contains the indices of the user input formats supported by the peer.
    470     *
    471     **/
    472     PV_INDICATION_USER_INPUT_CAPABILITY,
    473     /**
    474     * Indicates the receipt of user input from the remote terminal.  The derived class
    475     * contains the actual user input sequences received.
    476     *
    477     **/
    478     PV_INDICATION_USER_INPUT,
    479     /**
    480     * Indicates the receipt of a an h223SkewIndication indication from the peer.
    481     * The first 2 bytes of the event local buffer indicate the first logical channel, the 3rd and
    482     * 4th bytes the second logical channel and the 5th and 6th bytes the value of the skew in milliseconds.
    483     * All values are in network byte order.
    484     *
    485     **/
    486     PV_INDICATION_SKEW
    487 };
    488 /**
    489 Extension interface to indicate reverse logical channel parameters to the user of the stack node
    490 **/
    491 class H324MReverseParametersExtensionInterface : public PVInterface
    492 {
    493     public:
    494         /**
    495         * @return The reverse media format and capabilities.
    496         **/
    497         virtual const PvmfMimeString* GetFormatCapabilities() = 0;
    498 
    499         /**
    500         * @param aPortTag The port tag to use for the reverse channel if it is accepted.
    501         **/
    502         virtual void SetPortTag(int32 aPortTag) = 0;
    503 
    504         /**
    505         * @return The port tag for the reverse channel
    506         **/
    507         virtual int32 GetPortTag()const = 0;
    508 };
    509 #endif
    510