Changeset 80 for trunk/sources/applications/applestreamingclient/src/protocols/rtmp/rtmpappprotocolhandler.cpp
- Timestamp:
- 08/17/10 13:54:17 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/applications/applestreamingclient/src/protocols/rtmp/rtmpappprotocolhandler.cpp
r56 r80 26 26 #include "application/baseclientapplication.h" 27 27 #include "eventsink/rtmpeventsink.h" 28 #include "protocols/variant/messagestructure.h" 29 #include "protocols/rtmp/messagefactories/genericmessagefactory.h" 28 30 29 31 RTMPAppProtocolHandler::RTMPAppProtocolHandler(Variant &configuration) … … 45 47 if (functionName == "setupStream") { 46 48 return ProcessSetupStream(pFrom, request); 49 } else if (functionName == "getBWInfo") { 50 return ProcessGetBWInfo(pFrom, request); 47 51 } else { 48 52 WARN("Invalid function name"); … … 88 92 return pContext->StartProcessing(); 89 93 } 94 95 bool RTMPAppProtocolHandler::ProcessGetBWInfo(BaseRTMPProtocol *pFrom, 96 Variant &request) { 97 uint32_t contextId = pFrom->GetCustomParameters()["contextId"]; 98 Variant response; 99 Variant parameters; 100 parameters.PushToArray(Variant()); 101 parameters.PushToArray(Variant()); 102 if (contextId == 0) { 103 WARN("No context available yet"); 104 response = GenericMessageFactory::GetInvokeResult(request, parameters); 105 return SendRTMPMessage(pFrom, response); 106 } 107 ClientContext *pContext = ClientContext::GetContext(contextId, 108 GetApplication()->GetId(), pFrom->GetType()); 109 if (pContext == NULL) { 110 FATAL("Unable to get context"); 111 return false; 112 } 113 114 115 ASC_RES_BUILD_OK_INFO_BANDWIDTH(parameters[(uint32_t) 1], 116 pContext->GetAvailableBandwidths(), 117 pContext->GetDetectedBandwidth(), 118 pContext->GetSelectedBandwidth(), 119 pContext->GetBufferLevel(), 120 pContext->GetMaxBufferLevel(), 121 pContext->GetBufferLevelPercent()); 122 response = GenericMessageFactory::GetInvokeResult(request, parameters); 123 return SendRTMPMessage(pFrom, response); 124 } 125 90 126 #endif /* HAS_PROTOCOL_RTMP */
Note: See TracChangeset
for help on using the changeset viewer.
