本文整理汇总了Java中org.kurento.module.crowddetector.CrowdDetectorFilter类的典型用法代码示例。如果您正苦于以下问题:Java CrowdDetectorFilter类的具体用法?Java CrowdDetectorFilter怎么用?Java CrowdDetectorFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CrowdDetectorFilter类属于org.kurento.module.crowddetector包,在下文中一共展示了CrowdDetectorFilter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFeedUrl
import org.kurento.module.crowddetector.CrowdDetectorFilter; //导入依赖的package包/类
public void setFeedUrl(String feedUrl) {
this.feedUrl = feedUrl;
if (this.playerEndpoint != null) {
log.debug("Releasing previous elements");
this.crowdDetectorFilter.release();
this.playerEndpoint.release();
}
log.debug("Creating new elements");
this.crowdDetectorFilter = new CrowdDetectorFilter.Builder(this.pipe, this.rois).build();
this.crowdDetectorFilter.setProcessingWidth(640);
addOrionListeners();
this.playerEndpoint = new PlayerEndpoint.Builder(this.pipe, this.feedUrl).build();
addPlayerListeners();
this.playing = true;
this.playerEndpoint.connect(this.crowdDetectorFilter);
this.playerEndpoint.play();
log.debug("New player is now runing");
log.debug("Connecting " + this.webRtcEndpoints.size() + " webrtcendpoints");
// change the feed for all the webrtc clients connected.
for (Entry<String, WebRtcEndpoint> ep : this.webRtcEndpoints.entrySet()) {
this.crowdDetectorFilter.connect(ep.getValue());
}
}
示例2: init
import org.kurento.module.crowddetector.CrowdDetectorFilter; //导入依赖的package包/类
@PostConstruct
public void init() {
this.pipe = this.kurento.createMediaPipeline();
this.rois = new ArrayList<>();
JsonArray loadedRois;
JsonObject config = this.configuration.getConfig();
if (config != null) {
JsonElement feedUrlJson = config.get("feedUrl");
if (feedUrlJson != null) {
this.feedUrl = feedUrlJson.getAsString();
} else {
log.debug("Url feed not defined.");
}
JsonElement loadedRoisJson = config.get("rois");
if (loadedRoisJson != null) {
loadedRois = loadedRoisJson.getAsJsonArray();
this.rois = readRoisFromJson(loadedRois);
} else {
this.rois = getDummyRois();
log.debug("Rois not defined. Using dummy rois");
}
}
if (this.feedUrl == null) {
// PlayerEndpoint will be configured later.
return;
}
try {
this.orionPublisher.registerRoisInOrion(this.rois);
} catch (OrionConnectorException e) {
log.warn("Could not register ROIs in ORION");
}
this.crowdDetectorFilter = new CrowdDetectorFilter.Builder(this.pipe, this.rois).build();
this.crowdDetectorFilter.setProcessingWidth(640);
addOrionListeners();
this.playerEndpoint = new PlayerEndpoint.Builder(this.pipe, this.feedUrl).build();
addPlayerListeners();
this.playing = true;
this.playerEndpoint.connect(this.crowdDetectorFilter);
this.playerEndpoint.play();
}
示例3: getCrowdDetectorFilter
import org.kurento.module.crowddetector.CrowdDetectorFilter; //导入依赖的package包/类
public CrowdDetectorFilter getCrowdDetectorFilter() {
return this.crowdDetectorFilter;
}
示例4: connectWithMediaProcessing
import org.kurento.module.crowddetector.CrowdDetectorFilter; //导入依赖的package包/类
private void connectWithMediaProcessing(WebRtcEndpoint inputEndpoint,
WebRtcEndpoint outputEndpoint) {
switch (mediaProcessingType) {
case ENCODER:
Filter filter = new GStreamerFilter.Builder(mp, "capsfilter caps=video/x-raw")
.withFilterType(FilterType.VIDEO).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> GStreamerFilter -> WebRtcEndpoint");
break;
case FILTER:
case FACEOVERLAY:
filter = new FaceOverlayFilter.Builder(mp).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> FaceOverlayFilter -> WebRtcEndpoint");
break;
case ZBAR:
filter = new ZBarFilter.Builder(mp).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> ZBarFilter -> WebRtcEndpoint");
break;
case IMAGEOVERLAY:
filter = new ImageOverlayFilter.Builder(mp).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> ImageOverlayFilter -> WebRtcEndpoint");
break;
case PLATEDETECTOR:
filter = new PlateDetectorFilter.Builder(mp).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> PlateDetectorFilter -> WebRtcEndpoint");
break;
case CROWDDETECTOR:
List<RegionOfInterest> rois = getDummyRois();
filter = new CrowdDetectorFilter.Builder(mp, rois).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> CrowdDetectorFilter -> WebRtcEndpoint");
break;
case CHROMA:
filter = new ChromaFilter.Builder(mp, new WindowParam(0, 0, 640, 480)).build();
inputEndpoint.connect(filter);
filter.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> ChromaFilter -> WebRtcEndpoint");
break;
case NONE:
default:
inputEndpoint.connect(outputEndpoint);
log.debug("Pipeline: WebRtcEndpoint -> WebRtcEndpoint");
break;
}
}