• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QTSS_GetValue函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QTSS_GetValue函数的典型用法代码示例。如果您正苦于以下问题:C++ QTSS_GetValue函数的具体用法?C++ QTSS_GetValue怎么用?C++ QTSS_GetValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了QTSS_GetValue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SendTheResponse

// This sends the HTTP response to the server that contains the RTSPtext Ref movie
QTSS_Error SendTheResponse(QTSS_RTSPSessionObject theSession, QTSS_StreamRef stream, StrPtrLen& movie)
{
    QTSS_Error err = QTSS_NoErr;
    char theMovieFile[512];
    theMovieFile[sizeof(theMovieFile) -1] = 0;
    
    char tmp[600];	
    tmp[sizeof(tmp) -1] = 0;
    
    char tmp2[80];
    tmp2[sizeof(tmp2) -1] = 0;
    
    UInt8 x1, x2, x3, x4;

    // send the HTTP reply header to the client
    err= QTSS_Write(stream, sResponseHeader, ::strlen(sResponseHeader), NULL, qtssWriteFlagsBufferData);
    if (err != QTSS_NoErr)
        return QTSS_NoErr;
   
    UInt32 ip4address = 0;
    UInt32 len = sizeof(ip4address);
    err = QTSS_GetValue(theSession, qtssRTSPSesLocalAddr, 0, &ip4address, &len);
        
	// Format the server IP address for building the RTSP address in the reply.
    x1 = (UInt8)((ip4address >> 24) & 0xff);
    x2 = (UInt8)((ip4address >> 16) & 0xff);
    x3 = (UInt8)((ip4address >> 8) & 0xff);
    x4 = (UInt8)((ip4address) & 0xff);
    
    if (movie.Len > sizeof(theMovieFile)  -1 )
        movie.Len = sizeof(theMovieFile) -1;
        
    ::memcpy(theMovieFile, movie.Ptr, movie.Len);
	theMovieFile[movie.Len] = '\0';
	
    UInt16 port = sRTSPReplyPort;
    if (0 == port)
    {
        len = sizeof(port);
        err = QTSS_GetValue(theSession, qtssRTSPSesLocalPort, 0, &port, &len);
    }
            
	// construct the RTSP address reply string for the client.
	qtss_snprintf(tmp,sizeof(tmp) -1, "rtsptext\r\nrtsp://%d.%d.%d.%d:%d%s\r\n", x1,x2,x3,x4, port, theMovieFile);
    
    // send the 'Content-Length:' part of the HTTP reply
    qtss_snprintf(tmp2, sizeof(tmp2) -1, "Content-Length: %d\r\n\r\n", (int) ::strlen(tmp));
    err = QTSS_Write(stream, tmp2, ::strlen(tmp2), NULL, qtssWriteFlagsBufferData);
    if (err != QTSS_NoErr)
        return QTSS_NoErr;
        
    // send the formatted RTSP reference part of the reply
    err = QTSS_Write(stream, tmp, ::strlen(tmp), NULL, qtssWriteFlagsBufferData);
    if (err != QTSS_NoErr)
        return QTSS_NoErr;
        
    // flush the pending write to the client.
    err = QTSS_Flush(stream);
    return err;
}
开发者ID:ACEZLY,项目名称:EasyDarwin,代码行数:61,代码来源:QTSSRefMovieModule.cpp


示例2: AuthenticateRequest

Bool16 AuthenticateRequest(QTSS_StandardRTSP_Params* inParams, 
                const char* pathBuff, 
                const char* movieRootDir,
                StrPtrLen* ioRealmName,
                Bool16* foundUserPtr)
{
    if (foundUserPtr)
        *foundUserPtr = false;
 
    if (ioRealmName) //Set Value to Empty for now use whatever is set by access file or the default
    {
        ioRealmName->Ptr[0] =  '\0';
        ioRealmName->Len = 0;        
    }
    QTSS_Error theErr = QTSS_NoErr;
    
    char passwordBuff[kBuffLen];
    StrPtrLen passwordStr(passwordBuff, kBuffLen -1);
    
    char nameBuff[kBuffLen];
    StrPtrLen nameStr(nameBuff, kBuffLen -1);

    theErr = QTSS_GetValue (inParams->inRTSPRequest,qtssRTSPReqUserName,0, (void *) nameStr.Ptr, &nameStr.Len);
    if ( (QTSS_NoErr != theErr) || (nameStr.Len >= kBuffLen) ) 
    {
        debug_printf("QTSSDSAuthModule:AuthenticateRequest() Username Error - %"_S32BITARG_"\n", theErr);
        return false;    
    }           
    theErr = QTSS_GetValue (inParams->inRTSPRequest,qtssRTSPReqUserPassword,0, (void *) passwordStr.Ptr, &passwordStr.Len);
    if ( (QTSS_NoErr != theErr) || (passwordStr.Len >= kBuffLen) )
    {
        debug_printf("QTSSDSAuthModule:AuthenticateRequest() Password Error - %"_S32BITARG_"\n", theErr);
        return false;        
    }
    nameBuff[nameStr.Len] = '\0';
    passwordBuff[passwordStr.Len] = '\0';

    //
    // Use the name and password to check access
    DSAccessChecker accessChecker;
    if ( !accessChecker.CheckPassword( nameBuff, passwordBuff) )
    {
         return false;
    }
    
    if (foundUserPtr)
        *foundUserPtr = true;
  
     
    return true;
}
开发者ID:ACEZLY,项目名称:EasyDarwin,代码行数:51,代码来源:QTSSDSAuthModule.cpp


示例3: ProcessIncomingRTCPPacket

QTSS_Error ProcessIncomingRTCPPacket(QTSS_RTCPProcess_Params* inParams)
{
    ProxyClientInfo* theClient = NULL;
    UInt32 theLen = sizeof(theClient);
    QTSS_Error theErr = QTSS_GetValue(inParams->inClientSession, sProxyClientInfoAttr, 0,
                                                                &theClient, &theLen);

    //
    // This role receives ALL RTCP packets. We are only interested in RTCP packets
    // sent to proxy sessions. So we figure this out based on whether there
    // is a ProxyClientInfo object in the client session
    if (theErr != QTSS_NoErr)
        return QTSS_NoErr;
        
    //
    // Let's forward this RTCP packet to the right upstream server
    ProxyDemuxerTask* theTask = theClient->GetDemuxerTaskForStream(inParams->inRTPStream);
    Assert(theTask != NULL);
    if (theTask == NULL)
        return QTSS_NoErr;

    //
    // Using the RTCP socket (SocketB) of the pair, send the packet to the origin server's
    // RTCP port (the port number stored is the RTP port)
    (void)theTask->GetSockets()->GetSocketB()->
        SendTo(theTask->GetRemoteAddr(), theTask->GetOriginServerPort() + 1, inParams->inRTCPPacketData, inParams->inRTCPPacketDataLen);

    return QTSS_NoErr;
}
开发者ID:12307,项目名称:EasyDarwin,代码行数:29,代码来源:QTSSProxyModule.cpp


示例4: QTSS_GetValuePtr

Bool16  RTPSessionOutput::FilterPacket(QTSS_RTPStreamObject *theStreamPtr, StrPtrLen* inPacket)
{ 
    
    UInt32* packetCountPtr = NULL;
    UInt32 theLen = 0;
    
    //see if we started sending and if so then just keep sending (reset on a play)
    QTSS_Error writeErr = QTSS_GetValuePtr(*theStreamPtr, sStreamPacketCountAttr, 0,(void**) &packetCountPtr,&theLen);        
    if (writeErr == QTSS_NoErr && theLen > 0 && *packetCountPtr > 0)
        return false;

    Assert(theStreamPtr);
    Assert(inPacket);
    
    UInt16 seqnum = this->GetPacketSeqNumber(inPacket);
    UInt16 firstSeqNum = 0;            
    theLen = sizeof(firstSeqNum); 

    if (    QTSS_NoErr != QTSS_GetValue(*theStreamPtr, qtssRTPStrFirstSeqNumber, 0, &firstSeqNum, &theLen)  )
         return true;

    if ( seqnum < firstSeqNum ) 
    {   
        //printf("RTPSessionOutput::FilterPacket don't send packet = %u < first=%lu\n", seqnum, firstSeqNum);
        return true;
    }
     
    //printf("RTPSessionOutput::FilterPacket found first packet = %u \n", firstSeqNum);

    fPreFilter = false;    
    return fPreFilter;
}
开发者ID:12307,项目名称:EasyDarwin,代码行数:32,代码来源:RTPSessionOutput.cpp


示例5: theIPAddressStr

HTTPSessionInterface::~HTTPSessionInterface()
{
    // If the input socket is != output socket, the input socket was created dynamically
    if (fInputSocketP != fOutputSocketP)
        delete fInputSocketP;

    char remoteAddress[20] = { 0 };
    StrPtrLen theIPAddressStr(remoteAddress, sizeof(remoteAddress));
    QTSS_GetValue(this, EasyHTTPSesRemoteAddrStr, 0, static_cast<void*>(theIPAddressStr.Ptr), &theIPAddressStr.Len);
    char msgStr[2048] = { 0 };

    switch (fSessionType)
    {
    case EasyCameraSession:
        this->UnRegDevSession();
        qtss_snprintf(msgStr, sizeof(msgStr), "EasyCameraSession offline from ip[%s], device_serial[%s]", remoteAddress, device_->serial_.c_str());
        break;
    case EasyNVRSession:
        this->UnRegDevSession();
        qtss_snprintf(msgStr, sizeof(msgStr), "EasyNVRSession offline from ip[%s]", remoteAddress);
        break;
    case EasyHTTPSession:
        qtss_snprintf(msgStr, sizeof(msgStr), "EasyHTTPSession offline from ip[%s]", remoteAddress);
        break;
    default:
        qtss_snprintf(msgStr, sizeof(msgStr), "Unknown session offline from ip[%s]", remoteAddress);
        break;
    }
    QTSServerInterface::LogError(qtssMessageVerbosity, msgStr);
}
开发者ID:dreamsxin,项目名称:EasyDarwin,代码行数:30,代码来源:HTTPSessionInterface.cpp


示例6: EasyAdmin_GetReflectBufferSecs

UInt32 EasyAdmin_GetReflectBufferSecs()
{
	UInt32 bufferSecs;
    UInt32 len = sizeof(UInt32);
    (void) QTSS_GetValue(sReflectorPrefs, easyPrefsHTTPServicePort, 0, (void*)&bufferSecs, &len);  
    
    return bufferSecs;
}
开发者ID:dalinhuang,项目名称:EasyDarwin,代码行数:8,代码来源:QTSSAdminModule.cpp


示例7: EasyAdmin_GetHTTPServicePort

UInt16 EasyAdmin_GetHTTPServicePort()
{
	UInt16 port;
    UInt32 len = sizeof(UInt16);
    (void) QTSS_GetValue(sServerPrefs, easyPrefsHTTPServicePort, 0, (void*)&port, &len);  
    
    return port;
}
开发者ID:dalinhuang,项目名称:EasyDarwin,代码行数:8,代码来源:QTSSAdminModule.cpp


示例8: EasyAdmin_GetRTSPort

UInt16 EasyAdmin_GetRTSPort()
{
	UInt16 port;
    UInt32 len = sizeof(UInt16);
    (void) QTSS_GetValue(sServerPrefs, qtssPrefsRTSPPorts, 0, (void*)&port, &len);  
    
    return port;
}
开发者ID:dalinhuang,项目名称:EasyDarwin,代码行数:8,代码来源:QTSSAdminModule.cpp


示例9: AcceptSession

Bool16 AcceptSession(QTSS_RTSPSessionObject inRTSPSession)
{   
    char remoteAddress[20] = {0};
    StrPtrLen theClientIPAddressStr(remoteAddress,sizeof(remoteAddress));
    QTSS_Error err = QTSS_GetValue(inRTSPSession, qtssRTSPSesRemoteAddrStr, 0, (void*)theClientIPAddressStr.Ptr, &theClientIPAddressStr.Len);
    if (err != QTSS_NoErr) return false;
    
    return AcceptAddress(&theClientIPAddressStr);    
}
开发者ID:andyhx,项目名称:EasyDarwin,代码行数:9,代码来源:QTSSAdminModule.cpp


示例10: Is3GPPSession

Bool16 Is3GPPSession(QTSS_RTCPProcess_Params *inParams)
{

   Bool16 is3GPP = false;
   UInt32 theLen = sizeof(is3GPP);
   (void)QTSS_GetValue(inParams->inClientSession, qtssCliSessIs3GPPSession, 0, (void*)&is3GPP, &theLen);
 
   return is3GPP;
}
开发者ID:ACEZLY,项目名称:EasyDarwin,代码行数:9,代码来源:QTSSFlowControlModule.cpp


示例11: sizeof

QTSS_Object QTSSModuleUtils::GetModuleAttributesObject(QTSS_ModuleObject inModObject)
{
    QTSS_Object theAttributesObject = NULL;
    UInt32 theLen = sizeof(theAttributesObject);
    QTSS_Error theErr = QTSS_GetValue(inModObject, qtssModAttributes, 0, &theAttributesObject, &theLen);
    Assert(theErr == QTSS_NoErr);
    
    return theAttributesObject;
}
开发者ID:12307,项目名称:EasyDarwin,代码行数:9,代码来源:QTSSModuleUtils.cpp


示例12: GetServerStatusRec

kern_return_t GetServerStatusRec(QTSServerStatusRec* outServerStatus)
{
    Assert(outServerStatus != NULL);
    ::memset(outServerStatus, 0, sizeof(QTSServerStatusRec));
    
    QTSS_ServerState theState = qtssRunningState;
    UInt32 theSize = sizeof(theState);
    
    (void)QTSS_GetValue(sServer, qtssSvrState, 0, &theState, &theSize);
    
    //Convert the RTPServerInterface state to the server control's state
    if (sGracefulShutdownInProgress)
        outServerStatus->serverState = kSCGoingToShutDown;
    else if (theState == qtssRefusingConnectionsState)
        outServerStatus->serverState = kSCRefusingConnections;
    else if (theState == qtssStartingUpState)
        outServerStatus->serverState = kSCStartingUp;
    else if (theState == qtssShuttingDownState)
        outServerStatus->serverState = kSCShuttingDown;
    else
        outServerStatus->serverState = kSCRunning;
        
    outServerStatus->numCurrentConnections = 0;
    outServerStatus->connectionsSinceStartup = 0;
    outServerStatus->currentBandwidth = 0;
    outServerStatus->bytesSinceStartup = 0;
    
    //get the 4 key stats out of the RTP server
    theSize = sizeof(outServerStatus->numCurrentConnections);
    (void)QTSS_GetValue(sServer, qtssRTPSvrCurConn, 0, &outServerStatus->numCurrentConnections, &theSize);

    theSize = sizeof(outServerStatus->connectionsSinceStartup);
    (void)QTSS_GetValue(sServer, qtssRTPSvrTotalConn, 0, &outServerStatus->connectionsSinceStartup, &theSize);

    theSize = sizeof(outServerStatus->currentBandwidth);
    (void)QTSS_GetValue(sServer, qtssRTPSvrCurBandwidth, 0, &outServerStatus->currentBandwidth, &theSize);

    theSize = sizeof(outServerStatus->bytesSinceStartup);
    (void)QTSS_GetValue(sServer, qtssRTPSvrTotalBytes, 0, &outServerStatus->bytesSinceStartup, &theSize);
    return SCNoError;
}
开发者ID:248668342,项目名称:ffmpeg-windows,代码行数:41,代码来源:QTSSvrControlModule.cpp


示例13: sizeof

QTSS_Error  RTPSessionOutput::RewriteRTCP(QTSS_RTPStreamObject *theStreamPtr, StrPtrLen* inPacketStrPtr, SInt64 *currentTimePtr, UInt32 inFlags, SInt64* packetLatenessInMSec, SInt64* timeToSendThisPacketAgain, UInt64* packetIDPtr, SInt64* arrivalTimeMSecPtr)
{   
    UInt32  theLen;
    
    SInt64 firstRTPCurrentTime = 0;
    theLen = sizeof(firstRTPCurrentTime);  
    QTSS_GetValue(*theStreamPtr, sFirstRTPCurrentTimeAttr, 0, (void*)&firstRTPCurrentTime, &theLen);

    SInt64 firstRTPArrivalTime = 0;
    theLen = sizeof(firstRTPArrivalTime);  
    QTSS_GetValue(*theStreamPtr, sFirstRTPArrivalTimeAttr, 0, (void*)&firstRTPArrivalTime, &theLen);


    UInt32 rtpTime = 0;
    theLen = sizeof(rtpTime); 
    QTSS_GetValue(*theStreamPtr, sFirstRTPTimeStampAttr, 0, (void*)&rtpTime, &theLen);
 
        
    UInt32* theReport = (UInt32*) inPacketStrPtr->Ptr; 
    theReport+=2; // point to the NTP time stamp
    SInt64* theNTPTimestampP = (SInt64*)theReport;      
    *theNTPTimestampP = OS::HostToNetworkSInt64(OS::TimeMilli_To_1900Fixed64Secs(*currentTimePtr)); // time now

    UInt32 baseTimeStamp = 0;
    theLen = sizeof(baseTimeStamp);
    (void) QTSS_GetValue(*theStreamPtr, sBaseRTPTimeStampAttr, 0, (void*)&baseTimeStamp, &theLen); // we need a starting stream time that is synched 

    UInt32 streamTimeScale = 0;
    theLen =  sizeof(streamTimeScale);
    QTSS_GetValue(*theStreamPtr, qtssRTPStrTimescale, 0, (void *) &streamTimeScale, &theLen);

    SInt64 packetOffset = *currentTimePtr - fBaseArrivalTime; // real time that has passed
    packetOffset -=  (firstRTPCurrentTime - firstRTPArrivalTime); // less the initial buffer delay for this stream
    if (packetOffset < 0)
        packetOffset = 0;

    Float64 rtpTimeFromStart = (Float64) packetOffset / (Float64) 1000.0;
    UInt32 rtpTimeFromStartInScale =  (UInt32) (Float64) ((Float64) streamTimeScale * rtpTimeFromStart);
    //printf("rtptime offset time =%f in scale =%"_U32BITARG_"\n", rtpTimeFromStart, rtpTimeFromStartInScale );

    theReport += 2; // point to the rtp time stamp of "now" synched and scaled in stream time
    *theReport = htonl(baseTimeStamp + rtpTimeFromStartInScale); 
    
    theLen = sizeof(UInt32);                   
    UInt32 packetCount = 0;
    (void) QTSS_GetValue(*theStreamPtr, sStreamPacketCountAttr, 0, &packetCount,&theLen);
    theReport += 1; // point to the rtp packets sent
    *theReport = htonl(ntohl(*theReport) * 2); 
        
    UInt32 byteCount = 0;
    (void) QTSS_GetValue(*theStreamPtr, sStreamByteCountAttr, 0, &byteCount,&theLen);
    theReport += 1; // point to the rtp payload bytes sent
    *theReport = htonl(ntohl(*theReport) * 2); 
        
    return QTSS_NoErr;
}
开发者ID:12307,项目名称:EasyDarwin,代码行数:56,代码来源:RTPSessionOutput.cpp


示例14: GetRequestFlushState

inline Bool16 GetRequestFlushState(QTSS_Filter_Params* inParams)
{   Bool16 result = false;
    UInt32 paramLen = sizeof(result);
    QTSS_Error err = QTSS_GetValue(inParams->inRTSPRequest, sFlushingID, 0, (void*)&result, &paramLen);
    if (err != QTSS_NoErr)
    {   paramLen = sizeof(result);
        result = false;
        //qtss_printf("no flush val so set to false session=%"_U32BITARG_" err =%"_S32BITARG_"\n",sSessID, err);
        err =QTSS_SetValue(inParams->inRTSPRequest, sFlushingID, 0, (void*)&result, paramLen);
        //qtss_printf("QTSS_SetValue flush session=%"_U32BITARG_" err =%"_S32BITARG_"\n",sSessID, err);
    }
    return result;
}
开发者ID:andyhx,项目名称:EasyDarwin,代码行数:13,代码来源:QTSSAdminModule.cpp


示例15: GetRefuseConnections

kern_return_t GetRefuseConnections(QTSRefuseConnectionsRec* outRefuseConnections)
{
    QTSS_ServerState theState = qtssRunningState;
    UInt32 theSize = sizeof(theState);
    
    (void)QTSS_GetValue(sServer, qtssSvrState, 0, &theState, &theSize);

    if (theState == qtssRefusingConnectionsState)
        outRefuseConnections->refuseConnections = true;
    else
        outRefuseConnections->refuseConnections = false;
    return SCNoError;
}
开发者ID:248668342,项目名称:ffmpeg-windows,代码行数:13,代码来源:QTSSvrControlModule.cpp


示例16: CountRequest

QTSS_Error CountRequest( QTSS_RTSPRequestObject inRTSPRequest, QTSS_ClientSessionObject inClientSession,
                         QTSS_RTSPSessionObject inRTSPSession, QTSS_CliSesClosingReason *inCloseReasonPtr )
{

    char urlBuf[256] = { 0 };   
    StrPtrLen url(urlBuf, 256 -1);
    (void)QTSS_GetValue(inClientSession, qtssCliSesFullURL, 0, url.Ptr, &url.Len);
    
    CountHit( url.Ptr );
    WriteHitCountToFile();
    
    return QTSS_NoErr;
}
开发者ID:248668342,项目名称:ffmpeg-windows,代码行数:13,代码来源:QTSSDemoSMILModule.cpp


示例17: GetRequestAuthenticatedState

inline Bool16 GetRequestAuthenticatedState(QTSS_Filter_Params* inParams) 
{
    Bool16 result = false;
    UInt32 paramLen = sizeof(result);
    QTSS_Error err = QTSS_GetValue(inParams->inRTSPRequest, sAuthenticatedID, 0, (void*)&result, &paramLen);
    if(err != QTSS_NoErr)
    {
           paramLen = sizeof(result);
           result = false;
           err =QTSS_SetValue(inParams->inRTSPRequest, sAuthenticatedID, 0, (void*)&result, paramLen);
    }     
    return result;
}
开发者ID:andyhx,项目名称:EasyDarwin,代码行数:13,代码来源:QTSSAdminModule.cpp


示例18: PrintStatus

void PrintStatus(Bool16 printHeader)
{
    char* thePrefStr = NULL;
    UInt32 theLen = 0;
    
    if ( printHeader )
    {                       
        qtss_printf("     RTP-Conns RTSP-Conns HTTP-Conns  kBits/Sec   Pkts/Sec    TotConn     TotBytes   TotPktsLost          Time\n");   
    }

    (void)QTSS_GetValueAsString(sServer, qtssRTPSvrCurConn, 0, &thePrefStr);
    qtss_printf( "%11s", thePrefStr);
    delete [] thePrefStr; thePrefStr = NULL;
    
    (void)QTSS_GetValueAsString(sServer, qtssRTSPCurrentSessionCount, 0, &thePrefStr);
    qtss_printf( "%11s", thePrefStr);
    delete [] thePrefStr; thePrefStr = NULL;
    
    (void)QTSS_GetValueAsString(sServer, qtssRTSPHTTPCurrentSessionCount, 0, &thePrefStr);
    qtss_printf( "%11s", thePrefStr);
    delete [] thePrefStr; thePrefStr = NULL;
    
    UInt32 curBandwidth = 0;
    theLen = sizeof(curBandwidth);
    (void)QTSS_GetValue(sServer, qtssRTPSvrCurBandwidth, 0, &curBandwidth, &theLen);
    qtss_printf("%11"_U32BITARG_, curBandwidth/1024);
    
    (void)QTSS_GetValueAsString(sServer, qtssRTPSvrCurPackets, 0, &thePrefStr);
    qtss_printf( "%11s", thePrefStr);
    delete [] thePrefStr; thePrefStr = NULL;
    
    (void)QTSS_GetValueAsString(sServer, qtssRTPSvrTotalConn, 0, &thePrefStr);
    qtss_printf( "%11s", thePrefStr);
    delete [] thePrefStr; thePrefStr = NULL;
    
    UInt64 totalBytes = sServer->GetTotalRTPBytes();
    char  displayBuff[32] = "";
    FormattedTotalBytesBuffer(displayBuff, sizeof(displayBuff),totalBytes);
    qtss_printf( "%17s", displayBuff);
    
    qtss_printf( "%11"_64BITARG_"u", sServer->GetTotalRTPPacketsLost());
                    
    char theDateBuffer[QTSSRollingLog::kMaxDateBufferSizeInBytes];
    (void) QTSSRollingLog::FormatDate(theDateBuffer, false);
    qtss_printf( "%25s",theDateBuffer);
    
    qtss_printf( "\n");
    
}
开发者ID:9crk,项目名称:EasyDarwin,代码行数:49,代码来源:RunServer.cpp


示例19: DoDescribeAddRequiredSDPLines2

void DoDescribeAddRequiredSDPLines2(QTSS_StandardRTSP_Params* inParams, ReflectorSession* theSession, QTSS_TimeVal modDate,  ResizeableStringFormatter *editedSDP, StrPtrLen* theSDPPtr)
{
    SDPContainer checkedSDPContainer;
    checkedSDPContainer.SetSDPBuffer( theSDPPtr );  
    if (!checkedSDPContainer.HasReqLines())
    {
        if (!checkedSDPContainer.HasLineType('v'))
        { // add v line
            editedSDP->Put("v=0\r\n");
        }
        
        if (!checkedSDPContainer.HasLineType('s'))
        { // add s line
           char* theSDPName = NULL;            
            (void)QTSS_GetValueAsString(inParams->inRTSPRequest, qtssRTSPReqFilePath, 0, &theSDPName);
            QTSSCharArrayDeleter thePathStrDeleter(theSDPName);
            editedSDP->Put("s=");
            editedSDP->Put(theSDPName);
            editedSDP->PutEOL();
        }
        
       if (!checkedSDPContainer.HasLineType('t'))
       { // add t line
            editedSDP->Put("t=0 0\r\n");
       }

       if (!checkedSDPContainer.HasLineType('o'))
       { // add o line
            editedSDP->Put("o=broadcast_sdp ");
            char tempBuff[256]= "";               
            tempBuff[255] = 0;
            qtss_snprintf(tempBuff,sizeof(tempBuff) - 1, "%lu", (UInt64) theSession);
            editedSDP->Put(tempBuff);

            editedSDP->Put(" ");
            // modified date is in milliseconds.  Convert to NTP seconds as recommended by rfc 2327
            qtss_snprintf(tempBuff, sizeof(tempBuff) - 1, "%"_64BITARG_"d", (SInt64) (modDate/1000) + 2208988800LU);
            editedSDP->Put(tempBuff);

            editedSDP->Put(" IN IP4 ");
            UInt32 buffLen = sizeof(tempBuff) -1;
            (void)QTSS_GetValue(inParams->inClientSession, qtssCliSesHostName, 0, &tempBuff, &buffLen);
            editedSDP->Put(tempBuff, buffLen);

            editedSDP->PutEOL();
        }
    } 
    editedSDP->Put(*theSDPPtr);
}
开发者ID:appotry,项目名称:EasyDarwin-1,代码行数:49,代码来源:QTSSOnDemandRelayModule.cpp


示例20: theContentLenParser

/*
	Content报文读取与解析
	同步进行报文处理,构造回复报文
*/
QTSS_Error CServiceSession::SetupRequest()
{
    //解析请求报文
    QTSS_Error theErr = fRequest->Parse();
    if (theErr != QTSS_NoErr)
        return QTSS_BadArgument;

    QTSS_RTSPStatusCode statusCode = qtssSuccessOK;
    char *body = NULL;
    UInt32 bodySizeBytes = 0;

	//获取具体Content json数据部分

	//1、获取json部分长度
	StrPtrLen* lengthPtr = fRequest->GetHeaderValue(httpContentLengthHeader);

	StringParser theContentLenParser(lengthPtr);
    theContentLenParser.ConsumeWhitespace();
    UInt32 content_length = theContentLenParser.ConsumeInteger(NULL);
       
	qtss_printf("ServiceSession read content-length:%d \n", content_length);

    if (content_length <= 0) return QTSS_BadArgument;

	   //
    // Check for the existence of 2 attributes in the request: a pointer to our buffer for
    // the request body, and the current offset in that buffer. If these attributes exist,
    // then we've already been here for this request. If they don't exist, add them.
    UInt32 theBufferOffset = 0;
    char* theRequestBody = NULL;
	 UInt32 theLen = 0;
    theLen = sizeof(theRequestBody);
    theErr = QTSS_GetValue(this, qtssEasySesContentBody, 0, &theRequestBody, &theLen);

    if (theErr != QTSS_NoErr)
    {
        // First time we've been here for this request. Create a buffer for the content body and
        // shove it in the request.
        theRequestBody = NEW char[content_length + 1];
        memset(theRequestBody,0,content_length + 1);
        theLen = sizeof(theRequestBody);
        theErr = QTSS_SetValue(this, qtssEasySesContentBody, 0, &theRequestBody, theLen);// SetValue creates an internal copy.
        Assert(theErr == QTSS_NoErr);
        
        // Also store the offset in the buffer
        theLen = sizeof(theBufferOffset);
        theErr = QTSS_SetValue(this, qtssEasySesContentBodyOffset, 0, &theBufferOffset, theLen);
        Assert(theErr == QTSS_NoErr);
    }
开发者ID:wuyuan183,项目名称:EasyDarwin,代码行数:53,代码来源:ServiceSession.cpp



注:本文中的QTSS_GetValue函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QTSS_SetValue函数代码示例发布时间:2022-05-30
下一篇:
C++ QTSCRIPT_IS_GENERATED_FUNCTION函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap