GF::GF() { boost::property_tree::ptree ac, audioCodecs, vc, videoCodecs; gst_init (NULL, NULL); moduleManager.loadModulesFromDirectories ("../../src/server"); mediaPipelineId = moduleManager.getFactory ("MediaPipeline")->createObject ( config, "", Json::Value() )->getId(); }
static std::shared_ptr <RtpEndpointImpl> createRtpEndpoint (bool useIpv6) { std::shared_ptr <kurento::MediaObjectImpl> rtpEndpoint; Json::Value constructorParams; constructorParams ["mediaPipeline"] = mediaPipelineId; constructorParams ["useIpv6"] = useIpv6; rtpEndpoint = moduleManager.getFactory ("RtpEndpoint")->createObject ( config, "", constructorParams ); return std::dynamic_pointer_cast <RtpEndpointImpl> (rtpEndpoint); }
static std::shared_ptr <RecorderEndpointImpl> createRecorderEndpoint () { std::shared_ptr <kurento::MediaObjectImpl> recorderEndpoint; Json::Value constructorParams; std::string tmp_file = std::tmpnam (nullptr); constructorParams ["mediaPipeline"] = mediaPipelineId; constructorParams ["uri"] = "file://" + tmp_file; recorderEndpoint = moduleManager.getFactory ("RecorderEndpoint")->createObject ( config, "", constructorParams ); return std::dynamic_pointer_cast <RecorderEndpointImpl> (recorderEndpoint); }
GF::GF() { boost::property_tree::ptree ac, audioCodecs, vc, videoCodecs; gst_init(nullptr, nullptr); moduleManager.loadModulesFromDirectories ("../../src/server:../../.."); config.add ("configPath", "../../../tests" ); config.add ("modules.kurento.SdpEndpoint.numAudioMedias", 1); config.add ("modules.kurento.SdpEndpoint.numVideoMedias", 1); ac.put ("name", "opus/48000/2"); audioCodecs.push_back (std::make_pair ("", ac) ); config.add_child ("modules.kurento.SdpEndpoint.audioCodecs", audioCodecs); vc.put ("name", "VP8/90000"); videoCodecs.push_back (std::make_pair ("", vc) ); config.add_child ("modules.kurento.SdpEndpoint.videoCodecs", videoCodecs); mediaPipelineId = moduleManager.getFactory ("MediaPipeline")->createObject ( config, "", Json::Value() )->getId(); }