本文整理汇总了C++中StreamState类的典型用法代码示例。如果您正苦于以下问题:C++ StreamState类的具体用法?C++ StreamState怎么用?C++ StreamState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StreamState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: liveLogInfo
void OnDemandServerMediaSubsession
::sendRTCPAppPacket(u_int8_t subtype, char const* name,
u_int8_t* appDependentData, unsigned appDependentDataSize) {
liveLogInfo(" OnDemandServerMediaSubsession::sendRTCPAppPacket \n");
StreamState* streamState = (StreamState*)fLastStreamToken;
if (streamState != NULL) {
streamState->sendRTCPAppPacket(subtype, name, appDependentData, appDependentDataSize);
}
}
示例2: seekStream
void OnDemandServerMediaSubsession::seekStream(unsigned /*clientSessionId*/,
void* streamToken, double seekNPT, double streamDuration) {
// Seeking isn't allowed if multiple clients are receiving data from
// the same source:
if (fReuseFirstSource) return;
StreamState* streamState = (StreamState*)streamToken;
if (streamState != NULL && streamState->mediaSource() != NULL) {
seekStreamSource(streamState->mediaSource(), seekNPT, streamDuration);
}
}
示例3: setStreamScale
void OnDemandServerMediaSubsession::setStreamScale(unsigned /*clientSessionId*/,
void* streamToken, float scale) {
// Changing the scale factor isn't allowed if multiple clients are receiving data
// from the same source:
if (fReuseFirstSource) return;
StreamState* streamState = (StreamState*)streamToken;
if (streamState != NULL && streamState->mediaSource() != NULL) {
setStreamSourceScale(streamState->mediaSource(), scale);
}
}
示例4:
void OnDemandServerMediaSubsession
::getRTPSinkandRTCP(void* streamToken,
RTPSink const*& rtpSink, RTCPInstance const*& rtcp) {
if (streamToken == NULL) {
rtpSink = NULL;
rtcp = NULL;
return;
}
StreamState* streamState = (StreamState*)streamToken;
rtpSink = streamState->rtpSink();
rtcp = streamState->rtcpInstance();
}
示例5: afterPlayingStreamState
static void afterPlayingStreamState(void* clientData) {
StreamState* streamState = (StreamState*)clientData;
if (streamState->streamDuration() == 0.0) {
// When the input stream ends, tear it down. This will cause a RTCP "BYE"
// to be sent to each client, teling it that the stream has ended.
// (Because the stream didn't have a known duration, there was no other
// way for clients to know when the stream ended.)
streamState->reclaim();
}
// Otherwise, keep the stream alive, in case a client wants to
// subsequently re-play the stream starting from somewhere other than the end.
// (This can be done only on streams that have a known duration.)
}
示例6: getCurrentNPT
float OnDemandServerMediaSubsession::getCurrentNPT(void* streamToken) {
do {
if (streamToken == NULL) break;
StreamState* streamState = (StreamState*)streamToken;
RTPSink* rtpSink = streamState->rtpSink();
if (rtpSink == NULL) break;
return streamState->startNPT()
+ (rtpSink->mostRecentPresentationTime().tv_sec - rtpSink->initialPresentationTime().tv_sec)
+ (rtpSink->mostRecentPresentationTime().tv_sec - rtpSink->initialPresentationTime().tv_sec)/1000000.0f;
} while (0);
return 0.0;
}
开发者ID:Michael-Lfx,项目名称:Android-RTP-RTSP-Library-Porting,代码行数:15,代码来源:OnDemandServerMediaSubsession.cpp
示例7: seekStream
void OnDemandServerMediaSubsession::seekStream(unsigned /*clientSessionId*/,
void* streamToken, double& seekNPT, double streamDuration, u_int64_t& numBytes) {
numBytes = 0; // by default: unknown
// Seeking isn't allowed if multiple clients are receiving data from the same source:
if (fReuseFirstSource) return;
StreamState* streamState = (StreamState*)streamToken;
if (streamState != NULL && streamState->mediaSource() != NULL) {
seekStreamSource(streamState->mediaSource(), seekNPT, streamDuration, numBytes);
streamState->startNPT() = (float)seekNPT;
RTPSink* rtpSink = streamState->rtpSink(); // alias
if (rtpSink != NULL) rtpSink->resetPresentationTimes();
}
}
开发者ID:Michael-Lfx,项目名称:Android-RTP-RTSP-Library-Porting,代码行数:16,代码来源:OnDemandServerMediaSubsession.cpp
示例8: startStream
void OnDemandServerMediaSubsession::startStream(unsigned clientSessionId,
void* streamToken,
TaskFunc* rtcpRRHandler,
void* rtcpRRHandlerClientData,
unsigned short& rtpSeqNum,
unsigned& rtpTimestamp) {
StreamState* streamState = (StreamState*)streamToken;
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (streamState != NULL) {
DEBUG_LOG(INF, "StartPlaying to %s", inet_ntoa(destinations->addr));
streamState->startPlaying(destinations,
rtcpRRHandler, rtcpRRHandlerClientData);
DEBUG_LOG(INF, "StartPlaying to %s end", inet_ntoa(destinations->addr));
if (streamState->rtpSink() != NULL) {
rtpSeqNum = streamState->rtpSink()->currentSeqNo();
rtpTimestamp = streamState->rtpSink()->presetNextTimestamp();
}
}
}
示例9: isLeaked
static bool isLeaked(SymbolRef Sym, const StreamState &SS,
bool IsSymDead, ProgramStateRef State) {
if (IsSymDead && SS.isOpened()) {
// If a symbol is NULL, assume that fopen failed on this path.
// A symbol should only be considered leaked if it is non-null.
ConstraintManager &CMgr = State->getConstraintManager();
ConditionTruthVal OpenFailed = CMgr.isNull(State, Sym);
return !OpenFailed.isConstrainedTrue();
}
return false;
}
示例10: checkEndPath
void StreamChecker::checkEndPath(CheckerContext &Ctx) const {
const ProgramState *state = Ctx.getState();
typedef llvm::ImmutableMap<SymbolRef, StreamState> SymMap;
SymMap M = state->get<StreamState>();
for (SymMap::iterator I = M.begin(), E = M.end(); I != E; ++I) {
StreamState SS = I->second;
if (SS.isOpened()) {
ExplodedNode *N = Ctx.addTransition(state);
if (N) {
if (!BT_ResourceLeak)
BT_ResourceLeak.reset(new BuiltinBug("Resource Leak",
"Opened File never closed. Potential Resource leak."));
BugReport *R = new BugReport(*BT_ResourceLeak,
BT_ResourceLeak->getDescription(), N);
Ctx.EmitReport(R);
}
}
}
}
示例11: startStream
void OnDemandServerMediaSubsession::startStream(unsigned clientSessionId,
void* streamToken,
TaskFunc* rtcpRRHandler,
void* rtcpRRHandlerClientData,
unsigned short& rtpSeqNum,
unsigned& rtpTimestamp,
ServerRequestAlternativeByteHandler* serverRequestAlternativeByteHandler,
void* serverRequestAlternativeByteHandlerClientData) {
StreamState* streamState = (StreamState*)streamToken;
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (streamState != NULL) {
streamState->startPlaying(destinations,
rtcpRRHandler, rtcpRRHandlerClientData,
serverRequestAlternativeByteHandler, serverRequestAlternativeByteHandlerClientData);
if (streamState->rtpSink() != NULL) {
rtpSeqNum = streamState->rtpSink()->currentSeqNo();
rtpTimestamp = streamState->rtpSink()->presetNextTimestamp();
}
}
}
示例12: Debug
void EncoderMediaSubsession::pauseStream(unsigned /*clientSessionId*/,
void* streamToken) {
// Pausing isn't allowed if multiple clients are receiving data from
// the same source:
struct timeval tv;
struct timezone tz;
unsigned int t_time = 0;
if (fReuseFirstSource) return;
if( gettimeofday(&tv, &tz) == 0 )
{
if (!fIsAudio)
{
t_time = tv.tv_sec * 1000 + tv.tv_usec/1000;
Debug(ckite_log_message, "pauseStream sec time is of %d\n", tv.tv_sec);
Debug(ckite_log_message, "pauseStream usec time is of %d\n", tv.tv_usec);
((EncoderVideoSource*)fMediaSource)->setPauseTime(t_time);
}
}
StreamState* streamState = (StreamState*)streamToken;
if (streamState != NULL) streamState->pause();
}
示例13: Debug
void EncoderMediaSubsession::startStream(unsigned clientSessionId,
void* streamToken,
TaskFunc* rtcpRRHandler,
void* rtcpRRHandlerClientData,
unsigned short& rtpSeqNum,
unsigned& rtpTimestamp,
ServerRequestAlternativeByteHandler* serverRequestAlternativeByteHandler,
void* serverRequestAlternativeByteHandlerClientData,
void* videofp,
unsigned int fMagic,
Boolean isResponse) {
struct timeval tv;
// struct timezone tz;
unsigned int t_time = 0;
Debug(ckite_log_message, "startStream %x\n", (int)this);
StreamState* streamState = (StreamState*)streamToken;
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (streamState != NULL) {
if( gettimeofday(&tv, NULL) == 0 )
{
if (!fIsAudio)
{
t_time = tv.tv_sec * 1000 + tv.tv_usec/1000;
Debug(ckite_log_message, "pauseStream sec time is of %d\n", tv.tv_sec);
Debug(ckite_log_message, "pauseStream usec time is of %d\n", tv.tv_usec);
Debug(ckite_log_message, "startStream fMediaSource = %x\n", fMediaSource);
((EncoderVideoSource*)fMediaSource)->setPlayTime(t_time);
}
}
if(isResponse)
{
if(!fIsAudio)
{
if(videofp != NULL)
((EncoderVideoSource*)fMediaSource)->setPlayFile((FILE *)videofp);
if (fMagic != 0xffffffff)
streamState->rtpSink()->setMagic((unsigned char)fMagic);
if (fChannel > 0)
((EncoderVideoSource*)fMediaSource)->setChannelNumber(fChannel);
}
streamState->startPlaying(destinations,
rtcpRRHandler, rtcpRRHandlerClientData,
serverRequestAlternativeByteHandler, serverRequestAlternativeByteHandlerClientData);
}
if (streamState->rtpSink() != NULL) {
rtpSeqNum = streamState->rtpSink()->currentSeqNo();
rtpTimestamp = streamState->rtpSink()->presetNextTimestamp();
}
}
}
示例14: nullSeekStream
void OnDemandServerMediaSubsession::nullSeekStream(unsigned /*clientSessionId*/, void* streamToken,
double streamEndTime, u_int64_t& numBytes) {
numBytes = 0; // by default: unknown
StreamState* streamState = (StreamState*)streamToken;
if (streamState != NULL && streamState->mediaSource() != NULL) {
// Because we're not seeking here, get the current NPT, and remember it as the new 'start' NPT:
streamState->startNPT() = getCurrentNPT(streamToken);
double duration = streamEndTime - streamState->startNPT();
if (duration < 0.0) duration = 0.0;
setStreamSourceDuration(streamState->mediaSource(), duration, numBytes);
RTPSink* rtpSink = streamState->rtpSink(); // alias
if (rtpSink != NULL) rtpSink->resetPresentationTimes();
}
}
示例15: startStream
void OnDemandServerMediaSubsession::startStream(unsigned clientSessionId,
void* streamToken,
TaskFunc* rtcpRRHandler,
void* rtcpRRHandlerClientData,
unsigned short& rtpSeqNum,
unsigned& rtpTimestamp) {
StreamState* streamState = (StreamState*)streamToken;
printf("startStream\n");
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (streamState != NULL) {
if (streamState->rtpSink() != NULL) {
rtpSeqNum = streamState->rtpSink()->currentSeqNo();
if (streamState->isPlaying())
rtpTimestamp = streamState->rtpSink()->currentTimeStamp();
else
rtpTimestamp = streamState->rtpSink()->presetNextTimestamp();
}
}
streamState->startPlaying(destinations,
rtcpRRHandler, rtcpRRHandlerClientData);
}