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 PVMF_JITTER_BUFFER_EXT_INTERFACE_H_INCLUDED
     19 #define PVMF_JITTER_BUFFER_EXT_INTERFACE_H_INCLUDED
     20 
     21 #ifndef PVMF_PORT_BASE_IMPL_H_INCLUDED
     22 #include "pvmf_port_base_impl.h"
     23 #endif
     24 
     25 #ifndef PVMF_SM_TUNABLES_H_INCLUDED
     26 #include "pvmf_sm_tunables.h"
     27 #endif
     28 
     29 #ifndef RTSP_TIME_FORMAT_H
     30 #include "rtsp_time_formats.h"
     31 #endif
     32 
     33 #ifndef PVMF_JITTER_BUFFER_COMMON_TYPES_H_INCLUDED
     34 #include "pvmf_jitter_buffer_common_types.h"
     35 #endif
     36 
     37 class PVMFMediaClock;
     38 class OsclMemPoolResizableAllocator;
     39 ///////////////////////////////////////////////////////////////////////////////
     40 //Common data structures for all configs
     41 ///////////////////////////////////////////////////////////////////////////////
     42 
     43 
     44 ///////////////////////////////////////////////////////////////////////////////
     45 //ASF based streaming specific data structures
     46 ///////////////////////////////////////////////////////////////////////////////
     47 
     48 ///////////////////////////////////////////////////////////////////////////////
     49 //Class PVMFJitterBufferExtensionInterface
     50 ///////////////////////////////////////////////////////////////////////////////
     51 class PVMFJitterBufferExtensionInterface : public PVInterface
     52 {
     53     public:
     54         OSCL_IMPORT_REF virtual void setRTCPIntervalInMicroSecs(uint32 aRTCPInterval) = 0;  //Not used as of now
     55         OSCL_IMPORT_REF virtual bool setPortParams(PVMFPortInterface* aPort,
     56                 uint32 aTimeScale,
     57                 uint32 aBitRate,
     58                 OsclRefCounterMemFrag& aConfig,
     59                 bool aRateAdaptation = false,
     60                 uint32 aRateAdaptationFeedBackFrequency = 0) = 0;
     61         OSCL_IMPORT_REF virtual bool setPlayRange(int32 aStartTimeInMS,//called when the start of the session controller completes
     62                 int32 aStopTimeInMS,
     63                 bool oPlayAfterASeek,
     64                 bool aStopTimeAvailable = true) = 0;
     65         OSCL_IMPORT_REF virtual void setPlayBackThresholdInMilliSeconds(uint32 threshold) = 0;  //Not used as of now [replace with wait for OOO timeout]
     66         OSCL_IMPORT_REF virtual void setJitterBufferRebufferingThresholdInMilliSeconds(uint32 aThreshold) = 0;
     67         OSCL_IMPORT_REF virtual void getJitterBufferRebufferingThresholdInMilliSeconds(uint32& aThreshold) = 0;
     68         OSCL_IMPORT_REF virtual void setJitterBufferDurationInMilliSeconds(uint32 duration) = 0;
     69         OSCL_IMPORT_REF virtual void getJitterBufferDurationInMilliSeconds(uint32& duration) = 0;
     70 
     71         OSCL_IMPORT_REF virtual void setEarlyDecodingTimeInMilliSeconds(uint32 duration) = 0;
     72         OSCL_IMPORT_REF virtual void setBurstThreshold(float burstThreshold) = 0;
     73 
     74         //While in buffering/start state, Jitter Buffer node expects its upstream peer node to send media msg at its input port in duration < inactivity duration
     75         OSCL_IMPORT_REF virtual void setMaxInactivityDurationForMediaInMs(uint32 duration) = 0;
     76         OSCL_IMPORT_REF virtual void getMaxInactivityDurationForMediaInMs(uint32& duration) = 0;
     77 
     78         OSCL_IMPORT_REF virtual void setClientPlayBackClock(PVMFMediaClock* clientClock) = 0;
     79         OSCL_IMPORT_REF virtual bool PrepareForRepositioning(bool oUseExpectedClientClockVal = false,
     80                 uint32 aExpectedClientClockVal = 0) = 0;   //called for RTSP based streaming only
     81         OSCL_IMPORT_REF virtual bool setPortSSRC(PVMFPortInterface* aPort, uint32 aSSRC) = 0;
     82         OSCL_IMPORT_REF virtual bool setPortRTPParams(PVMFPortInterface* aPort,
     83                 bool   aSeqNumBasePresent,
     84                 uint32 aSeqNumBase,
     85                 bool   aRTPTimeBasePresent,
     86                 uint32 aRTPTimeBase,
     87                 bool   aNPTTimeBasePresent,
     88                 uint32 aNPTInMS,
     89                 bool oPlayAfterASeek = false) = 0;
     90         OSCL_IMPORT_REF virtual bool setPortRTCPParams(PVMFPortInterface* aPort,
     91                 int aNumSenders,
     92                 uint32 aRR,
     93                 uint32 aRS) = 0;
     94         OSCL_IMPORT_REF virtual PVMFTimestamp getActualMediaDataTSAfterSeek() = 0;
     95         OSCL_IMPORT_REF virtual PVMFTimestamp getMaxMediaDataTS() = 0;
     96         OSCL_IMPORT_REF virtual void addRef() = 0;
     97         OSCL_IMPORT_REF virtual void removeRef() = 0;
     98         OSCL_IMPORT_REF virtual bool queryInterface(const PVUuid& uuid, PVInterface*& iface) = 0;
     99         OSCL_IMPORT_REF virtual PVMFStatus setServerInfo(PVMFJitterBufferFireWallPacketInfo& aServerInfo) = 0;
    100         OSCL_IMPORT_REF virtual PVMFStatus NotifyOutOfBandEOS() = 0;
    101         OSCL_IMPORT_REF virtual PVMFStatus SendBOSMessage(uint32 aStramID) = 0;
    102 
    103         OSCL_IMPORT_REF virtual void SetJitterBufferChunkAllocator(OsclMemPoolResizableAllocator* aDataBufferAllocator, const PVMFPortInterface* aPort) = 0;
    104 
    105         OSCL_IMPORT_REF virtual void SetJitterBufferMemPoolInfo(const PvmfPortBaseImpl* aPort, uint32 aSize, uint32 aResizeSize, uint32 aMaxNumResizes, uint32 aExpectedNumberOfBlocksPerBuffer) = 0;
    106         OSCL_IMPORT_REF virtual void GetJitterBufferMemPoolInfo(const PvmfPortBaseImpl* aPort, uint32& aSize, uint32& aResizeSize, uint32& aMaxNumResizes, uint32& aExpectedNumberOfBlocksPerBuffer) const = 0;
    107 
    108         OSCL_IMPORT_REF virtual void SetSharedBufferResizeParams(uint32 maxNumResizes, uint32 resizeSize) = 0;
    109         OSCL_IMPORT_REF virtual void GetSharedBufferResizeParams(uint32& maxNumResizes, uint32& resizeSize) = 0;
    110 
    111         OSCL_IMPORT_REF virtual bool ClearJitterBuffer(PVMFPortInterface* aPort,
    112                 uint32 aSeqNum) = 0;
    113         OSCL_IMPORT_REF virtual void FlushJitterBuffer() = 0;
    114 
    115         OSCL_IMPORT_REF virtual bool NotifyAutoPauseComplete() = 0;
    116         OSCL_IMPORT_REF virtual bool NotifyAutoResumeComplete() = 0;
    117         OSCL_IMPORT_REF virtual PVMFStatus SetInputMediaHeaderPreParsed(PVMFPortInterface* aPort,
    118                 bool aHeaderPreParsed) = 0;
    119         OSCL_IMPORT_REF virtual PVMFStatus HasSessionDurationExpired(bool& aExpired) = 0;
    120         OSCL_IMPORT_REF virtual bool PurgeElementsWithNPTLessThan(NptTimeFormat& aNPTTime) = 0;
    121 
    122         OSCL_IMPORT_REF virtual void SetBroadCastSession() = 0;
    123         OSCL_IMPORT_REF virtual void DisableFireWallPackets() = 0;
    124         OSCL_IMPORT_REF virtual void UpdateJitterBufferState() = 0;
    125         OSCL_IMPORT_REF virtual void StartOutputPorts() = 0;
    126         OSCL_IMPORT_REF virtual void StopOutputPorts() = 0;
    127         OSCL_IMPORT_REF virtual bool PrepareForPlaylistSwitch() = 0;
    128 };
    129 
    130 //Mimetype and Uuid for the extension interface
    131 #define PVMF_JITTERBUFFER_CUSTOMINTERFACE_MIMETYPE "pvxxx/PVMFJitterBufferNode/CustomInterface"
    132 #define PVMF_JITTERBUFFER_MIMETYPE "pvxxx/PVMFJitterBufferNode"
    133 #define PVMF_JITTERBUFFER_BASEMIMETYPE "pvxxx"
    134 #define PVMF_JITTERBUFFERNODE_EXTENSIONINTERFACE_UUID PVUuid(0x440af38b,0xde8d,0x4d61,0xab,0x2a,0x84,0x11,0x07,0x3c,0x60,0x35)
    135 
    136 #endif
    137