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_NODE_H_INCLUDED 19 #include "pvmf_jitter_buffer_node.h" 20 #endif 21 #ifndef PVMF_JITTER_BUFFER_INTERNAL_H_INCLUDED 22 #include "pvmf_jitter_buffer_internal.h" 23 #endif 24 #ifndef PV_LOGGGER_H_INCLUDED 25 #include "pvlogger.h" 26 #endif 27 28 PVMFJitterBufferExtensionInterfaceImpl::PVMFJitterBufferExtensionInterfaceImpl(PVMFJitterBufferNode*c) 29 : PVInterfaceImpl<OsclMemAllocator>(PVUuid(PVMF_JITTERBUFFERNODE_EXTENSIONINTERFACE_UUID)) 30 , iContainer(c) 31 {} 32 33 PVMFJitterBufferExtensionInterfaceImpl::~PVMFJitterBufferExtensionInterfaceImpl() 34 {} 35 36 OSCL_EXPORT_REF 37 bool PVMFJitterBufferExtensionInterfaceImpl::setPortParams(PVMFPortInterface* aPort, 38 uint32 aTimeScale, 39 uint32 aBitRate, 40 OsclRefCounterMemFrag& aConfig, 41 bool aRateAdaptation, 42 uint32 aRateAdaptationFeedBackFrequency) 43 { 44 return (iContainer->SetPortParams(aPort, 45 aTimeScale, 46 aBitRate, 47 aConfig, 48 aRateAdaptation, 49 aRateAdaptationFeedBackFrequency)); 50 } 51 52 OSCL_EXPORT_REF 53 void PVMFJitterBufferExtensionInterfaceImpl::setPlayBackThresholdInMilliSeconds(uint32 threshold) 54 { 55 iContainer->SetPlayBackThresholdInMilliSeconds(threshold); 56 } 57 58 OSCL_EXPORT_REF 59 void PVMFJitterBufferExtensionInterfaceImpl::setJitterBufferRebufferingThresholdInMilliSeconds(uint32 aThreshold) 60 { 61 iContainer->SetJitterBufferRebufferingThresholdInMilliSeconds(aThreshold); 62 } 63 64 OSCL_EXPORT_REF 65 void PVMFJitterBufferExtensionInterfaceImpl::getJitterBufferRebufferingThresholdInMilliSeconds(uint32& aThreshold) 66 { 67 iContainer->GetJitterBufferRebufferingThresholdInMilliSeconds(aThreshold); 68 } 69 70 OSCL_EXPORT_REF 71 void PVMFJitterBufferExtensionInterfaceImpl::setJitterBufferDurationInMilliSeconds(uint32 duration) 72 { 73 iContainer->SetJitterBufferDurationInMilliSeconds(duration); 74 } 75 76 OSCL_EXPORT_REF 77 void PVMFJitterBufferExtensionInterfaceImpl::getJitterBufferDurationInMilliSeconds(uint32& duration) 78 { 79 iContainer->GetJitterBufferDurationInMilliSeconds(duration); 80 } 81 82 OSCL_EXPORT_REF 83 void PVMFJitterBufferExtensionInterfaceImpl::setEarlyDecodingTimeInMilliSeconds(uint32 duration) 84 { 85 iContainer->SetEarlyDecodingTimeInMilliSeconds(duration); 86 } 87 88 OSCL_EXPORT_REF 89 void PVMFJitterBufferExtensionInterfaceImpl::setBurstThreshold(float burstThreshold) 90 { 91 iContainer->SetBurstThreshold(burstThreshold); 92 } 93 94 OSCL_EXPORT_REF 95 void PVMFJitterBufferExtensionInterfaceImpl::setClientPlayBackClock(PVMFMediaClock* clientClock) 96 { 97 iContainer->SetClientPlayBackClock(clientClock); 98 } 99 100 OSCL_EXPORT_REF 101 void PVMFJitterBufferExtensionInterfaceImpl::setMaxInactivityDurationForMediaInMs(uint32 duration) 102 { 103 iContainer->SetMaxInactivityDurationForMediaInMs(duration); 104 } 105 106 OSCL_EXPORT_REF 107 void PVMFJitterBufferExtensionInterfaceImpl::getMaxInactivityDurationForMediaInMs(uint32& duration) 108 { 109 iContainer->GetMaxInactivityDurationForMediaInMs(duration); 110 } 111 112 OSCL_EXPORT_REF 113 void PVMFJitterBufferExtensionInterfaceImpl::setRTCPIntervalInMicroSecs(uint32 aRTCPInterval) 114 { 115 iContainer->SetRTCPIntervalInMicroSecs(aRTCPInterval); 116 } 117 118 OSCL_EXPORT_REF 119 bool PVMFJitterBufferExtensionInterfaceImpl::setPlayRange(int32 aStartTimeInMS, 120 int32 aStopTimeInMS, 121 bool oPlayAfterASeek, 122 bool aStopTimeAvailable) 123 { 124 return (iContainer->SetPlayRange(aStartTimeInMS, 125 aStopTimeInMS, 126 oPlayAfterASeek, 127 aStopTimeAvailable)); 128 } 129 130 OSCL_EXPORT_REF 131 bool PVMFJitterBufferExtensionInterfaceImpl::PrepareForRepositioning(bool oUseExpectedClientClockVal, 132 uint32 aExpectedClientClockVal) 133 { 134 return (iContainer->PrepareForRepositioning(oUseExpectedClientClockVal, aExpectedClientClockVal)); 135 } 136 137 OSCL_EXPORT_REF 138 bool PVMFJitterBufferExtensionInterfaceImpl::setPortSSRC(PVMFPortInterface* aPort, uint32 aSSRC) 139 { 140 return (iContainer->SetPortSSRC(aPort, aSSRC)); 141 } 142 143 144 OSCL_EXPORT_REF 145 bool PVMFJitterBufferExtensionInterfaceImpl::setPortRTPParams(PVMFPortInterface* aPort, 146 bool aSeqNumBasePresent, 147 uint32 aSeqNumBase, 148 bool aRTPTimeBasePresent, 149 uint32 aRTPTimeBase, 150 bool aNPTTimeBasePresent, 151 uint32 aNPTInMS, 152 bool oPlayAfterASeek) 153 { 154 return (iContainer->SetPortRTPParams(aPort, 155 aSeqNumBasePresent, 156 aSeqNumBase, 157 aRTPTimeBasePresent, 158 aRTPTimeBase, 159 aNPTTimeBasePresent, 160 aNPTInMS, 161 oPlayAfterASeek)); 162 } 163 164 OSCL_EXPORT_REF 165 bool PVMFJitterBufferExtensionInterfaceImpl::setPortRTCPParams(PVMFPortInterface* aPort, 166 int aNumSenders, 167 uint32 aRR, 168 uint32 aRS) 169 { 170 return iContainer->SetPortRTCPParams(aPort, aNumSenders, aRR, aRS); 171 } 172 173 OSCL_EXPORT_REF 174 PVMFTimestamp PVMFJitterBufferExtensionInterfaceImpl::getActualMediaDataTSAfterSeek() 175 { 176 return (iContainer->GetActualMediaDataTSAfterSeek()); 177 } 178 179 OSCL_EXPORT_REF 180 PVMFTimestamp PVMFJitterBufferExtensionInterfaceImpl::getMaxMediaDataTS() 181 { 182 return (iContainer->GetMaxMediaDataTS()); 183 } 184 185 OSCL_EXPORT_REF PVMFStatus 186 PVMFJitterBufferExtensionInterfaceImpl::setServerInfo(PVMFJitterBufferFireWallPacketInfo& aServerInfo) 187 { 188 return (iContainer->SetServerInfo(aServerInfo)); 189 } 190 191 OSCL_EXPORT_REF PVMFStatus 192 PVMFJitterBufferExtensionInterfaceImpl::NotifyOutOfBandEOS() 193 { 194 return (iContainer->NotifyOutOfBandEOS()); 195 } 196 197 OSCL_EXPORT_REF PVMFStatus 198 PVMFJitterBufferExtensionInterfaceImpl::SendBOSMessage(uint32 aStreamID) 199 { 200 return (iContainer->SendBOSMessage(aStreamID)); 201 } 202 203 OSCL_EXPORT_REF void 204 PVMFJitterBufferExtensionInterfaceImpl::SetSharedBufferResizeParams(uint32 maxNumResizes, uint32 resizeSize) 205 { 206 iContainer->SetSharedBufferResizeParams(maxNumResizes, resizeSize); 207 } 208 209 OSCL_EXPORT_REF void 210 PVMFJitterBufferExtensionInterfaceImpl::GetSharedBufferResizeParams(uint32& maxNumResizes, uint32& resizeSize) 211 { 212 iContainer->GetSharedBufferResizeParams(maxNumResizes, resizeSize); 213 } 214 215 OSCL_EXPORT_REF bool 216 PVMFJitterBufferExtensionInterfaceImpl::ClearJitterBuffer(PVMFPortInterface* aPort, uint32 aSeqNum) 217 { 218 return (iContainer->ClearJitterBuffer(aPort, aSeqNum)); 219 } 220 221 OSCL_EXPORT_REF void 222 PVMFJitterBufferExtensionInterfaceImpl::FlushJitterBuffer() 223 { 224 iContainer->FlushJitterBuffer(); 225 } 226 227 OSCL_EXPORT_REF bool 228 PVMFJitterBufferExtensionInterfaceImpl::NotifyAutoPauseComplete() 229 { 230 return (iContainer->NotifyAutoPauseComplete()); 231 } 232 233 OSCL_EXPORT_REF bool 234 PVMFJitterBufferExtensionInterfaceImpl::NotifyAutoResumeComplete() 235 { 236 return (iContainer->NotifyAutoResumeComplete()); 237 } 238 239 OSCL_EXPORT_REF PVMFStatus 240 PVMFJitterBufferExtensionInterfaceImpl::SetInputMediaHeaderPreParsed(PVMFPortInterface* aPort, 241 bool aHeaderPreParsed) 242 { 243 return (iContainer->SetInputMediaHeaderPreParsed(aPort, aHeaderPreParsed)); 244 } 245 246 OSCL_EXPORT_REF PVMFStatus 247 PVMFJitterBufferExtensionInterfaceImpl::HasSessionDurationExpired(bool& aExpired) 248 { 249 return (iContainer->HasSessionDurationExpired(aExpired)); 250 } 251 OSCL_EXPORT_REF bool 252 PVMFJitterBufferExtensionInterfaceImpl::PurgeElementsWithNPTLessThan(NptTimeFormat &aNPTTime) 253 { 254 return (iContainer->PurgeElementsWithNPTLessThan(aNPTTime)); 255 } 256 OSCL_EXPORT_REF void 257 PVMFJitterBufferExtensionInterfaceImpl::SetBroadCastSession() 258 { 259 iContainer->SetBroadCastSession(); 260 } 261 OSCL_EXPORT_REF void 262 PVMFJitterBufferExtensionInterfaceImpl::DisableFireWallPackets() 263 { 264 iContainer->DisableFireWallPackets(); 265 } 266 OSCL_EXPORT_REF void 267 PVMFJitterBufferExtensionInterfaceImpl::StartOutputPorts() 268 { 269 iContainer->StartOutputPorts(); 270 } 271 OSCL_EXPORT_REF void 272 PVMFJitterBufferExtensionInterfaceImpl::StopOutputPorts() 273 { 274 iContainer->StopOutputPorts(); 275 } 276 277 OSCL_EXPORT_REF void 278 PVMFJitterBufferExtensionInterfaceImpl::UpdateJitterBufferState() 279 { 280 iContainer->UpdateJitterBufferState(); 281 } 282 283 OSCL_EXPORT_REF void 284 PVMFJitterBufferExtensionInterfaceImpl::SetJitterBufferMemPoolInfo(const PvmfPortBaseImpl* aPort, uint32 aSize, uint32 aResizeSize, uint32 aMaxNumResizes, uint32 aExpectedNumberOfBlocksPerBuffer) 285 { 286 iContainer->SetJitterBufferMemPoolInfo(aPort, aSize, aResizeSize, aMaxNumResizes, aExpectedNumberOfBlocksPerBuffer); 287 } 288 289 OSCL_EXPORT_REF void 290 PVMFJitterBufferExtensionInterfaceImpl::GetJitterBufferMemPoolInfo(const PvmfPortBaseImpl* aPort, uint32& aSize, uint32& aResizeSize, uint32& aMaxNumResizes, uint32& aExpectedNumberOfBlocksPerBuffer) const 291 { 292 iContainer->GetJitterBufferMemPoolInfo(aPort, aSize, aResizeSize, aMaxNumResizes, aExpectedNumberOfBlocksPerBuffer); 293 } 294 295 OSCL_EXPORT_REF void 296 PVMFJitterBufferExtensionInterfaceImpl::SetJitterBufferChunkAllocator(OsclMemPoolResizableAllocator* aDataBufferAllocator, const PVMFPortInterface* aPort) 297 { 298 iContainer->SetJitterBufferChunkAllocator(aDataBufferAllocator, aPort); 299 } 300 301 OSCL_EXPORT_REF bool 302 PVMFJitterBufferExtensionInterfaceImpl::PrepareForPlaylistSwitch() 303 { 304 return (iContainer->PrepareForPlaylistSwitch()); 305 } 306