Example #1
0
 public static StringBuilder AppendIf(this StringBuilder b, string key, StreamSpecifier value)
 {
     if (value != default(StreamSpecifier))
     {
         b.Append(key).Append(' ').Append(value).Append(' ');
     }
     return(b);
 }
Example #2
0
        public void SelectStreamsTest()
        {
            var target = new FfprobeArgs();

            Assert.True(target.SelectStreams.IsEmpty);

            var value = new StreamSpecifier(FfmpegStreamType.Video, 0);

            target.SelectStreams = value;
            Assert.Equal(value, target.SelectStreams);
            Assert.Equal("-select_streams V:0", target.ToString());
        }
Example #3
0
        protected unsafe void SetValue(StreamSpecifier value, [CallerMemberName] string property = null)
        {
            var p = GetPropertyIndex(property);

            if (value == default(StreamSpecifier))
            {
                RemoveValue(p);
            }
            else
            {
                SetValue(p, (short)sizeof(StreamSpecifier), (byte *)&value);
            }
        }
Example #4
0
        public static StringBuilder AppendIfStream(this StringBuilder b, string key, string streamSpecifier, StreamSpecifier value)
        {
            if (value != default(StreamSpecifier))
            {
                b.Append(key);
                if (!string.IsNullOrEmpty(streamSpecifier))
                {
                    b.Append(':');
                    b.Append(streamSpecifier);
                }

                b.Append(' ');
                b.Append(value);
                b.Append(' ');
            }

            return(b);
        }