public MetadataProcessor(EventMetadataProcessor eventMetadataProcessor, SceneMetadataProcessor sceneMetadataProcessor) { this.eventMetadataProcessor = eventMetadataProcessor; this.sceneMetadataProcessor = sceneMetadataProcessor; }
void VideoStartup(Model model, VideoResolution resolution) { //subscribe to metadata IMetadataReceiver metadataReceiver = null; if (AppDefaults.visualSettings.EnableGraphicAnnotation) { string vaConfToken = model.engineConfToken; var eventMetadataProcessor = new EventMetadataProcessor(); //eventMetadataProcessor.Processors.Add(new ObjectMotionMetadataProcessor(null, vaConfToken, movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted)); eventMetadataProcessor.Processors.Add(new MotionAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted)); eventMetadataProcessor.Processors.Add(new RegionMotionAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted)); eventMetadataProcessor.Processors.Add(new LoiteringAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted)); eventMetadataProcessor.Processors.Add(new AbandonedItemAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted)); eventMetadataProcessor.Processors.Add(new TripwireAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted)); eventMetadataProcessor.Processors.Add(new TamperingDetectorAlarmMetadataProcessor(null, vaConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted)); var sceneMetadataProcessor = new SceneMetadataProcessor(movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted); var metadataProcessor = new MetadataProcessor(eventMetadataProcessor, sceneMetadataProcessor); metadataReceiver = new MetadataFramer(metadataProcessor.Process); } vidBuff = new VideoBuffer(resolution.width, resolution.height); var streamSetup = new StreamSetup() { transport = new Transport() { protocol = AppDefaults.visualSettings.Transport_Type } }; VideoPlayerView playview = new VideoPlayerView(); disposables.Add(playview); player.Child = playview; playview.Init(new VideoPlayerView.Model( streamSetup: streamSetup, mediaUri: new MediaUri() { uri = model.uri }, encoderResolution: new VideoResolution() { height = resolution.height, width = resolution.width }, isUriEnabled: false, //TODO if true then annotation is not positioned correctly metadataReceiver: metadataReceiver )); uriString.Visibility = System.Windows.Visibility.Visible; uriString.Text = model.uri; }