public class MediaApiPlayerCrowdDetectorBrowserTest extends BrowserMediaApiTest {
@Test
public void testPlayerCrowdDetector() throws Exception {
// Media Pipeline
MediaPipeline mp = pipelineFactory.create();
PlayerEndpoint playerEP = mp.newPlayerEndpoint(
"http://files.kurento.org/video/crowd.mp4").build();
HttpGetEndpoint httpEP = mp.newHttpGetEndpoint().terminateOnEOS()
.build();
List<RegionOfInterest> rois = newArrayList();
List<RelativePoint> points = new ArrayList<RelativePoint>();
points.add(new RelativePoint(0, 0));
points.add(new RelativePoint((float) 0.5, 0));
points.add(new RelativePoint((float) 0.5, (float) 0.5));
points.add(new RelativePoint(0, (float) 0.5));
RegionOfInterestConfig config = new RegionOfInterestConfig();
config.setFluidityLevelMin(10);
config.setFluidityLevelMed(35);
config.setFluidityLevelMax(65);
config.setFluidityNumFramesToEvent(5);
config.setOccupancyLevelMin(10);
config.setOccupancyLevelMed(35);
config.setOccupancyLevelMax(65);
config.setOccupancyNumFramesToEvent(5);
config.setSendOpticalFlowEvent(false);
config.setOpticalFlowNumFramesToEvent(3);
config.setOpticalFlowNumFramesToReset(3);
config.setOpticalFlowAngleOffset(0);
rois.add(new RegionOfInterest(points, config, "roi0"));
CrowdDetectorFilter crowdDetectorFilter = mp.newCrowdDetectorFilter(
rois).build();
playerEP.connect(crowdDetectorFilter);
crowdDetectorFilter.connect(httpEP);
final List<EndOfStreamEvent> eosEvents = new ArrayList<>();