Hi. I need use live555 to send a x264 frame from my Camera to the VLC.

I use openCV to get the camera frame and convert from BGR to YUV.
I use x264 to convert the frame.
But the live555 is not sending the frame.


I create a RTSPServer

lookupServerMediaSession(char const* streamName){
         //
         //lookUp for the session with the name
         ServerMediaSession* sms = 
RTSPServer::lookupServerMediaSession(streamName);
         if (!sms){
                 //create the session if this is't exist
                 sms = ServerMediaSession::createNew(envir(), streamName,"send
server","sending the camera");
                 if (sms){
                         //add a subsession
                         sms->addSubsession( 
CameraServerMediaSubsession::createNew(envir(),true) );
                 }
         }
         return sms;
 }



The subsession create a FramedSource and VideoRTPSink

FramedSource* CameraServerMediaSubsession::createNewStreamSource(unsigned
clientSessionId,
                                              unsigned& estBitrate)

{
        //
        return new CameraStream(this->envir());
}
RTPSink* CameraServerMediaSubsession::createNewRTPSink(Groupsock* rtpGroupsock,
                                    unsigned char rtpPayloadTypeIfDynamic,
                                    FramedSource* inputSource){
        //
        return CameraVideoRTPSink::createNew(this->envir(),
                                        rtpGroupsock,
                                        rtpPayloadTypeIfDynamic);
}



And I write the CameraStream (FramedSource) using this example:

http://www.live555.com/liveMedia/doxygen/html/DeviceSource_8cpp-source.html

Here is the code.

void CameraStream::doGetNextFrame(){
        //
        if (!isCurrentlyAwaitingData()) return; // we're not ready for the data 
yet

        //get the size of the x264 frame
        unsigned newFrameSize = cameraSize;
        //create the frame
        u_int8_t* newFrameDataStart = new u_int8_t[newFrameSize];

        
        //copy the frame data
        memcpy(newFrameDataStart,camera,cameraSize);

        //This I found in the example
        if (newFrameSize > fMaxSize) {
                fFrameSize = fMaxSize;
                fNumTruncatedBytes = newFrameSize - fMaxSize;
        } else {
                fFrameSize = newFrameSize;
        }

        //move the frame to FTO
        memmove(fTo, newFrameDataStart, fFrameSize);

        //Inform the reader it's now avaliable
        FramedSource::afterGetting(this);

}



The server run the doGetNextFrame function in CameraStream. But the frame
is not sent.
How can I set the live555 to send the frame?
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to