예제 #1
0
        private static string ConfigureProfile(DlnaForthField dlnaField, MediaItem item, string mediaType)
        {
            //TODO: much better type resolution
            switch (mediaType)
            {
            case MediaLibraryHelper.MIMETYPE_AUDIO:
                dlnaField.ProfileParameter.ProfileName   = DlnaProfiles.Mp3;
                dlnaField.FlagsParameter.StreamingMode   = true;
                dlnaField.FlagsParameter.InteractiveMode = false;
                dlnaField.FlagsParameter.BackgroundMode  = true;
                break;

            case MediaLibraryHelper.MIMETYPE_VIDEO:
                dlnaField.ProfileParameter.ProfileName   = DlnaProfiles.MpegPsPal;
                dlnaField.FlagsParameter.StreamingMode   = true;
                dlnaField.FlagsParameter.InteractiveMode = false;
                dlnaField.FlagsParameter.BackgroundMode  = true;
                break;

            case MediaLibraryHelper.MIMETYPE_IMAGE:
                dlnaField.ProfileParameter.ProfileName   = DlnaProfiles.JpegLarge;
                dlnaField.FlagsParameter.StreamingMode   = false;
                dlnaField.FlagsParameter.InteractiveMode = true;
                dlnaField.FlagsParameter.BackgroundMode  = true;
                break;
            }
            return(null);
        }
 private static string ConfigureProfile(DlnaForthField dlnaField, MediaItem item, string mediaType)
 {
     //TODO: much better type resolution
     switch(mediaType)
     {
         case MediaLibraryHelper.MIMETYPE_AUDIO:
             dlnaField.ProfileParameter.ProfileName = DlnaProfiles.Mp3;
             dlnaField.FlagsParameter.StreamingMode = true;
             dlnaField.FlagsParameter.InteractiveMode = false;
             dlnaField.FlagsParameter.BackgroundMode = true;
             break;
         case MediaLibraryHelper.MIMETYPE_VIDEO:
             dlnaField.ProfileParameter.ProfileName = DlnaProfiles.MpegPsPal;
             dlnaField.FlagsParameter.StreamingMode = true;
             dlnaField.FlagsParameter.InteractiveMode = false;
             dlnaField.FlagsParameter.BackgroundMode = true;
             break;
         case MediaLibraryHelper.MIMETYPE_IMAGE:
             dlnaField.ProfileParameter.ProfileName = DlnaProfiles.JpegLarge;
             dlnaField.FlagsParameter.StreamingMode = false;
             dlnaField.FlagsParameter.InteractiveMode = true;
             dlnaField.FlagsParameter.BackgroundMode = true;
             break;
     }
     return null;
 }
예제 #3
0
        private static void ConfigureProfile(DlnaForthField dlnaField, DlnaMediaItem dlnaItem, ProtocolInfoFormat infoLevel, bool live)
        {
            if (infoLevel == ProtocolInfoFormat.Simple)
            {
                dlnaField.ProfileParameter.Show    = false;
                dlnaField.OperationsParameter.Show = false;
                dlnaField.FlagsParameter.Show      = false;
                dlnaField.PlaySpeedParameter.Show  = false;

                dlnaField.ProfileParameter.ProfileName = dlnaItem.DlnaProfile;
            }
            else
            {
                dlnaField.ConversionParameter.Show = true;
                if (dlnaItem.IsTranscoded)
                {
                    dlnaField.ConversionParameter.ConvertedContent = true;
                }
                else
                {
                    dlnaField.ConversionParameter.ConvertedContent = false;
                }

                dlnaField.ProfileParameter.Show        = true;
                dlnaField.ProfileParameter.ProfileName = dlnaItem.DlnaProfile;

                if (dlnaItem.IsImage)
                {
                    dlnaField.OperationsParameter.Show = true;
                    dlnaField.OperationsParameter.TimeSeekRangeSupport = false;
                    dlnaField.OperationsParameter.ByteSeekRangeSupport = false;

                    dlnaField.FlagsParameter.Show                      = true;
                    dlnaField.FlagsParameter.SenderPaced               = false;
                    dlnaField.FlagsParameter.TimeBasedSeek             = false;
                    dlnaField.FlagsParameter.ByteBasedSeek             = false;
                    dlnaField.FlagsParameter.PlayerContainer           = false;
                    dlnaField.FlagsParameter.UcdamS0Increasing         = false;
                    dlnaField.FlagsParameter.UcdamSnIncreasing         = false;
                    dlnaField.FlagsParameter.RtspPauseOperation        = false;
                    dlnaField.FlagsParameter.StreamingMode             = false;
                    dlnaField.FlagsParameter.InteractiveMode           = true;
                    dlnaField.FlagsParameter.BackgroundMode            = true;
                    dlnaField.FlagsParameter.HttpConnectionStalling    = false;
                    dlnaField.FlagsParameter.Dlna1Dot5Version          = true;
                    dlnaField.FlagsParameter.LinkProtectedContent      = false;
                    dlnaField.FlagsParameter.CleartextByteFullDataSeek = false;
                    dlnaField.FlagsParameter.CleartextLimitedDataSeek  = false;

                    dlnaField.PlaySpeedParameter.Show = false;
                }
                else if (dlnaItem.IsVideo || dlnaItem.IsAudio)
                {
                    dlnaField.OperationsParameter.Show = true;
                    double duration = dlnaItem?.Metadata?.Duration ?? 0;
                    if (duration > 0 && live == false)
                    {
                        dlnaField.OperationsParameter.TimeSeekRangeSupport = true;
                        dlnaField.OperationsParameter.ByteSeekRangeSupport = true;
                        dlnaField.FlagsParameter.TimeBasedSeek             = true;
                        dlnaField.FlagsParameter.ByteBasedSeek             = true;
                    }
                    else
                    {
                        dlnaField.OperationsParameter.TimeSeekRangeSupport = false;
                        dlnaField.OperationsParameter.ByteSeekRangeSupport = false;
                        dlnaField.FlagsParameter.TimeBasedSeek             = false;
                        dlnaField.FlagsParameter.ByteBasedSeek             = false;
                    }
                    if (live)
                    {
                        dlnaField.FlagsParameter.SenderPaced = true;
                    }
                    else
                    {
                        dlnaField.FlagsParameter.SenderPaced = false;
                    }

                    dlnaField.FlagsParameter.Show              = true;
                    dlnaField.FlagsParameter.SenderPaced       = false;
                    dlnaField.FlagsParameter.PlayerContainer   = false;
                    dlnaField.FlagsParameter.UcdamS0Increasing = false;
                    if (dlnaItem.IsTranscoded == true)
                    {
                        dlnaField.FlagsParameter.UcdamSnIncreasing = true;
                    }
                    else
                    {
                        dlnaField.FlagsParameter.UcdamSnIncreasing = false;
                    }
                    dlnaField.FlagsParameter.RtspPauseOperation        = false;
                    dlnaField.FlagsParameter.StreamingMode             = true;
                    dlnaField.FlagsParameter.InteractiveMode           = false;
                    dlnaField.FlagsParameter.BackgroundMode            = true;
                    dlnaField.FlagsParameter.HttpConnectionStalling    = false;
                    dlnaField.FlagsParameter.Dlna1Dot5Version          = true;
                    dlnaField.FlagsParameter.LinkProtectedContent      = false;
                    dlnaField.FlagsParameter.CleartextByteFullDataSeek = false;
                    dlnaField.FlagsParameter.CleartextLimitedDataSeek  = false;

                    dlnaField.PlaySpeedParameter.Show = false;
                }
            }
        }