Esempio n. 1
0
int MediaSession::RecorderAttachToEndpoint(int recorderId,int endpointId,MediaFrame::Type media)
{
	//Get Player
        Recorders::iterator it = recorders.find(recorderId);

        //If not found
        if (it==recorders.end())
                //Exit
                return Error("Recorder not found\n");
        //Get it
        Recorder* recorder = it->second;

	//Get source endpoint
        Endpoints::iterator itEndpoints = endpoints.find(endpointId);

        //If not found
        if (itEndpoints==endpoints.end())
                //Exit
                return Error("Endpoint not found\n");
        //Get it
        Endpoint* source = itEndpoints->second;

	//Attach
	return recorder->Attach(media,source->GetJoinable(media));
}
Esempio n. 2
0
int MediaSession::RecorderAttachToVideoMixerPort(int recorderId,int mixerId,int portId)
{
	//Get Player
        Recorders::iterator it = recorders.find(recorderId);

        //If not found
        if (it==recorders.end())
                //Exit
                return Error("Recorder not found\n");
        //Get it
        Recorder* recorder = it->second;

	 //Get Player
        VideoMixers::iterator itMixer = videoMixers.find(mixerId);

        //If not found
        if (itMixer==videoMixers.end())
                //Exit
                return Error("AudioMixerResource not found\n");

	 //Get it
        VideoMixerResource* videoMixer = itMixer->second;

	//And attach
	return recorder->Attach(MediaFrame::Video,videoMixer->GetJoinable(portId));
}