char const* OnDemandServerMediaSubsession::sdpLines() { if (fSDPLines == NULL) { // We need to construct a set of SDP lines that describe this // subsession (as a unicast stream). To do so, we first create // dummy (unused) source and "RTPSink" objects, // whose parameters we use for the SDP lines: unsigned estBitrate; FramedSource* inputSource = createNewStreamSource(0, estBitrate); if (inputSource == NULL) return NULL; // file not found struct in_addr dummyAddr; dummyAddr.s_addr = 0; Groupsock dummyGroupsock(envir(), dummyAddr, 0, 0); unsigned char rtpPayloadType = 96 + trackNumber()-1; // if dynamic RTPSink* dummyRTPSink = createNewRTPSink(&dummyGroupsock, rtpPayloadType, inputSource); setSDPLinesFromRTPSink(dummyRTPSink, inputSource, estBitrate); Medium::close(dummyRTPSink); closeStreamSource(inputSource); } return fSDPLines; }
char const* EncoderMediaSubsession::sdpLines() { if (fSDPLines == NULL) { // We need to construct a set of SDP lines that describe this // subsession (as a unicast stream). To do so, we first create // dummy (unused) source and "RTPSink" objects, // whose parameters we use for the SDP lines: unsigned estBitrate; if (!fMediaSource) { if (fIsAudio) fMediaSource = createNewAudioSource(0, estBitrate); else fMediaSource = createNewVideoSource(0, estBitrate); } if (fMediaSource == NULL) return NULL; // file not found struct in_addr dummyAddr; dummyAddr.s_addr = 0; Groupsock dummyGroupsock(envir(), dummyAddr, 0, 0); unsigned char rtpPayloadType = 96 + trackNumber()-1; // if dynamic RTPSink* dummyRTPSink = createNewRTPSink(&dummyGroupsock, rtpPayloadType, fMediaSource); if (!fIsAudio) { Debug(ckite_log_message, "setVideoSize fWidth = %d, fHeight = %d\n", fWidth, fHeight); #ifdef SDKH264 ((H264VideoRTPSink*)dummyRTPSink)->setVideoSize(fWidth, fHeight); // set video size #else ((MPEG4ESVideoRTPSink*)dummyRTPSink)->setVideoSize(fWidth, fHeight); // set video size #endif } setSDPLinesFromRTPSink(dummyRTPSink, fMediaSource, estBitrate); Medium::close(dummyRTPSink); closeStreamSource(fMediaSource); fMediaSource = NULL; } return fSDPLines; }