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;
        }
            public static Model Create(
                StreamSetup streamSetup,
                MediaUri mediaUri,
                VideoResolution encoderResolution,
                bool isUriEnabled,
                IMetadataReceiver metadataReceiver
                )
            {
                var _this = new Model();

                _this.streamSetup       = streamSetup;
                _this.mediaUri          = mediaUri;
                _this.encoderResolution = encoderResolution;
                _this.isUriEnabled      = isUriEnabled;
                _this.metadataReceiver  = metadataReceiver;
                return(_this);
            }
        void VideoStartup(Model model)
        {
            var playerAct = activityContext.container.Resolve <IVideoPlayerActivity>();


            //subscribe to metadata
            IMetadataReceiver metadataReceiver = null;

            if (AppDefaults.visualSettings.EnableGraphicAnnotation)
            {
                var eventMetadataProcessor = new EventMetadataProcessor();
                eventMetadataProcessor.Processors.Add(new ObjectMotionMetadataProcessor(model.videoSourceToken, null, movingObjectsHolder.EntityInitialized, movingObjectsHolder.EntityChanged, movingObjectsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new MotionAlarmMetadataProcessor(model.videoSourceToken, null, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new RegionMotionAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new LoiteringAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new AbandonedItemAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TripwireAlarmMetadataProcessor(model.videoSourceConfToken, model.videoAnalyticsConfToken, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                eventMetadataProcessor.Processors.Add(new TamperingDetectorAlarmMetadataProcessor(model.videoSourceToken, null, alarmsHolder.EntityInitialized, alarmsHolder.EntityChanged, alarmsHolder.EntityDeleted));
                var metadataProcessor = new MetadataProcessor(eventMetadataProcessor, null);
                metadataReceiver = new MetadataFramer(metadataProcessor.Process);
            }

            var playerModel = new VideoPlayerActivityModel(
                profileToken: model.profToken,
                showStreamUrl: false,//TODO when true, annotation is not positioned correctly
                streamSetup: new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = AppDefaults.visualSettings.Transport_Type,
                    tunnel   = null
                }
            },
                metadataReceiver: metadataReceiver
                );



            disposables.Add(
                activityContext.container.RunChildActivity(player, playerModel, (c, m) => playerAct.Run(c, m))
                );

            ShowStreamURI();
        }
示例#4
0
        //public void SetUserNamePassword(string userName, string password){
        //    playerTask.userNameToken = new UserNameToken(userName, password);
        //}

        public void SetMetadataReciever(IMetadataReceiver metadataReceiver)
        {
            playerTask.metadataReceiver = metadataReceiver;
        }
 public Model(
     StreamSetup streamSetup, MediaUri mediaUri, VideoResolution encoderResolution, bool isUriEnabled, IMetadataReceiver metadataReceiver
     )
 {
     this.streamSetup       = streamSetup;
     this.mediaUri          = mediaUri;
     this.encoderResolution = encoderResolution;
     this.isUriEnabled      = isUriEnabled;
     this.metadataReceiver  = metadataReceiver;
 }
示例#6
0
		//public void SetUserNamePassword(string userName, string password){
		//    playerTask.userNameToken = new UserNameToken(userName, password);
		//}

		public void SetMetadataReciever(IMetadataReceiver metadataReceiver) {
			playerTask.metadataReceiver = metadataReceiver;
		}
示例#7
0
 public VideoPlayerActivityModel(StreamSetup streamSetup, Profile profile, bool showStreamUrl, IMetadataReceiver metadataReceiver)
 {
     this.profile          = profile;
     this.profileToken     = profile.token;
     this.streamSetup      = streamSetup;
     this.showStreamUrl    = showStreamUrl;
     this.metadataReceiver = metadataReceiver;
 }
		public VideoPlayerActivityModel(StreamSetup streamSetup, Profile profile, bool showStreamUrl, IMetadataReceiver metadataReceiver) {
			this.profile = profile;
			this.profileToken = profile.token;
			this.streamSetup = streamSetup;
			this.showStreamUrl = showStreamUrl;
			this.metadataReceiver = metadataReceiver;
		}