本文整理汇总了C++中StreamState::rtpSink方法的典型用法代码示例。如果您正苦于以下问题:C++ StreamState::rtpSink方法的具体用法?C++ StreamState::rtpSink怎么用?C++ StreamState::rtpSink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamState
的用法示例。
在下文中一共展示了StreamState::rtpSink方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startStream
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();
}
}
}
示例2: 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;
/* :TODO:2014/9/12 13:59:55:Sean: */
printf("startStream\n");
/* :TODO:End--- */
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (streamState != NULL) {
streamState->startPlaying(destinations,
rtcpRRHandler, rtcpRRHandlerClientData,
serverRequestAlternativeByteHandler, serverRequestAlternativeByteHandlerClientData);
RTPSink* rtpSink = streamState->rtpSink(); // alias
if (rtpSink != NULL) {
rtpSeqNum = rtpSink->currentSeqNo();
rtpTimestamp = rtpSink->presetNextTimestamp();
}
}
}
示例3: nullSeekStream
void OnDemandServerMediaSubsession::nullSeekStream(unsigned /*clientSessionId*/, void* streamToken) {
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);
RTPSink* rtpSink = streamState->rtpSink(); // alias
if (rtpSink != NULL) rtpSink->resetPresentationTimes();
}
}
开发者ID:Michael-Lfx,项目名称:Android-RTP-RTSP-Library-Porting,代码行数:9,代码来源:OnDemandServerMediaSubsession.cpp
示例4: 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();
}
}
}
示例5: 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();
}
}
}
示例6: 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);
}
示例7:
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();
}
示例8: 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
示例9: 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
示例10: 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();
}
}