Exemplo n.º 1
0
        private VideoEncoderTrunkConfig RebuildVideoEncoder(int videoBitrate, bool receiverMode)
        {
            Action <FrameOutputData> onUiFrame = null;

            if (ScreenRenderer.IsEnabled.Value)
            {
                onUiFrame = ScreenRenderer.OnFrame;
            }

            var settings   = _coreData.Settings;
            var resolution = settings.Resolution;

            return(new VideoEncoderTrunkConfig(receiverMode, new EncoderSpec {
                width = resolution.Width, height = resolution.Height, Quality = ModelToStreamerTranslator.Translate(settings.EncoderQuality)
            },
                                               ModelToStreamerTranslator.Translate(settings.EncoderType),
                                               ModelToStreamerTranslator.Translate(settings.EncoderQuality),
                                               settings.PreferNalHdr,
                                               !settings.DisableQsvNv12Optimization,
                                               videoBitrate,
                                               settings.Fps,
                                               ModelToStreamerTranslator.Translate(_coreData.ThisDevice.DeviceSettings.BlenderType),
                                               null,  //CreateVideoFilter(VideoFilterAll.Value), - no global filter supported so far
                                               onUiFrame,
                                               new FixedFrameData(nameof(AppData.CanvasBackground), _appResource.AppData.CanvasBackground, SingleFrameType.Png),
                                               new FixedFrameData(nameof(StaticResources.NoSignal), StaticResources.NoSignal, SingleFrameType.Png)));
        }
Exemplo n.º 2
0
 private VideoFilterDescriptor RebuildFilter(SceneItemFilter s)
 {
     if (s.LutResourceId != null)
     {
         var data = _resourceService.GetResource(s.LutResourceId);
         if (data != null && _coreData.Root.Resources.TryGetValue(s.LutResourceId, out var res))
         {
             return(new VideoFilterDescriptor(ModelToStreamerTranslator.Translate(s.Type), s.Value, new FixedFrameData(s.LutResourceId, data, res.Info.Type == ResourceType.LutCube ? SingleFrameType.Cube : SingleFrameType.Png)));
         }
         else
         {
             return(null);
         }
     }
     else
     {
         return(new VideoFilterDescriptor(ModelToStreamerTranslator.Translate(s.Type), s.Value, null));
     }
 }
Exemplo n.º 3
0
        private VideoInputTrunkConfig RebuildSceneVideo(string id, ISceneItem s, StreamerRebuildContext rebuildContext)
        {
            var input = RebuildInputSource(id, s.Source, s, rebuildContext);

            return(new VideoInputTrunkConfig(id, input, RebuildFilters(s.Filters), ModelToStreamerTranslator.Translate(s.Rect), AdjustPtzHFlip(ModelToStreamerTranslator.Translate(s.Ptz), s.Filters), s.Visible, s.ZOrder));
        }
Exemplo n.º 4
0
 private VideoRenderOptions RebuildVideoRenderOptions(int dxFailureCounter)
 {
     return(new VideoRenderOptions(ModelToStreamerTranslator.Translate(_coreData.ThisDevice.DeviceSettings.RendererType), _coreData.ThisDevice.DeviceSettings.RendererAdapter, _windowStateManager.WindowHandle, false, dxFailureCounter));
 }