Пример #1
0
 /// <summary>
 ///     Creates an instance of <see cref="InfoFrameAudio" />.
 /// </summary>
 /// <param name="codec">The audio coding type (codec)</param>
 /// <param name="codecExtension">The audio codec from codec extension</param>
 /// <param name="sampleSize">The audio sample size (depth)</param>
 /// <param name="sampleRate">The audio sample rate (sampling frequency)</param>
 /// <param name="channelCount">The number of audio channels</param>
 /// <param name="channelAllocation">The audio channel allocation (speaker placements)</param>
 /// <param name="isDownMixProhibited">A value indicating if down-mix is prohibited</param>
 /// <param name="lfePlaybackLevel">The Low Frequency Effects playback level value</param>
 /// <param name="levelShift">The audio level shift value</param>
 public InfoFrameAudio(
     InfoFrameAudioCodec codec,
     InfoFrameAudioExtendedCodec codecExtension,
     InfoFrameAudioSampleSize sampleSize,
     InfoFrameAudioSampleRate sampleRate,
     InfoFrameAudioChannelCount channelCount,
     InfoFrameAudioChannelAllocation channelAllocation,
     InfoFrameBoolean isDownMixProhibited,
     InfoFrameAudioLFEPlaybackLevel lfePlaybackLevel,
     InfoFrameAudioLevelShift levelShift
     )
 {
     _WordAt0 = 0u
                .SetBits(0, 5, (uint)codec)
                .SetBits(5, 6, (uint)codecExtension)
                .SetBits(11, 3, (uint)sampleSize)
                .SetBits(14, 4, (uint)sampleRate)
                .SetBits(18, 4, (uint)channelCount)
                .SetBits(22, 9, (uint)channelAllocation);
     _WordAt4 = 0u
                .SetBits(0, 2, (uint)isDownMixProhibited)
                .SetBits(2, 3, (uint)lfePlaybackLevel)
                .SetBits(5, 5, (uint)levelShift);
     _WordAt8  = 0;
     _ByteAt12 = 0;
 }
Пример #2
0
        /// <summary>
        ///     Creates an instance of <see cref="InfoFrameVideo" />.
        /// </summary>
        /// <param name="videoIdentificationCode">The video identification code (VIC)</param>
        /// <param name="pixelRepetition">The video pixel repetition</param>
        /// <param name="colorFormat">The video color format</param>
        /// <param name="colorimetry">The video color space</param>
        /// <param name="extendedColorimetry">The extended video color space</param>
        /// <param name="rgbQuantization">The RGB quantization configuration</param>
        /// <param name="yccQuantization">The YCC quantization configuration</param>
        /// <param name="contentMode">The video content mode</param>
        /// <param name="contentType">The video content type</param>
        /// <param name="scanInfo">The video scan information</param>
        /// <param name="isActiveFormatInfoPresent">A value indicating if the active format information is present</param>
        /// <param name="activeFormatAspectRatio">The active format aspect ratio</param>
        /// <param name="pictureAspectRatio">The picture aspect ratio</param>
        /// <param name="nonUniformPictureScaling">The non uniform picture scaling direction</param>
        /// <param name="barInfo">The video bar information</param>
        /// <param name="topBar">The top bar value if not auto and present; otherwise null</param>
        /// <param name="bottomBar">The bottom bar value if not auto and present; otherwise null</param>
        /// <param name="leftBar">The left bar value if not auto and present; otherwise null</param>
        /// <param name="rightBar">The right bar value if not auto and present; otherwise null</param>
        public InfoFrameVideo(
            byte videoIdentificationCode,
            InfoFrameVideoPixelRepetition pixelRepetition,
            InfoFrameVideoColorFormat colorFormat,
            InfoFrameVideoColorimetry colorimetry,
            InfoFrameVideoExtendedColorimetry extendedColorimetry,
            InfoFrameVideoRGBQuantization rgbQuantization,
            InfoFrameVideoYCCQuantization yccQuantization,
            InfoFrameVideoITC contentMode,
            InfoFrameVideoContentType contentType,
            InfoFrameVideoScanInfo scanInfo,
            InfoFrameBoolean isActiveFormatInfoPresent,
            InfoFrameVideoAspectRatioActivePortion activeFormatAspectRatio,
            InfoFrameVideoAspectRatioCodedFrame pictureAspectRatio,
            InfoFrameVideoNonUniformPictureScaling nonUniformPictureScaling,
            InfoFrameVideoBarData barInfo,
            uint?topBar,
            uint?bottomBar,
            uint?leftBar,
            uint?rightBar
            )
        {
            _WordAt0 = 0u
                       .SetBits(0, 8, videoIdentificationCode)
                       .SetBits(8, 5, (uint)pixelRepetition)
                       .SetBits(13, 3, (uint)colorFormat)
                       .SetBits(16, 3, (uint)colorimetry)
                       .SetBits(19, 4, (uint)extendedColorimetry)
                       .SetBits(23, 3, (uint)rgbQuantization)
                       .SetBits(26, 3, (uint)yccQuantization)
                       .SetBits(29, 2, (uint)contentMode);

            _WordAt4 = 0u
                       .SetBits(0, 3, (uint)contentType)
                       .SetBits(3, 3, (uint)scanInfo)
                       .SetBits(6, 2, (uint)isActiveFormatInfoPresent)
                       .SetBits(8, 5, (uint)activeFormatAspectRatio)
                       .SetBits(13, 3, (uint)pictureAspectRatio)
                       .SetBits(16, 3, (uint)nonUniformPictureScaling)
                       .SetBits(19, 3, (uint)barInfo);

            _WordAt8  = topBar == null ? 0x1FFFF : 0u.SetBits(0, 17, topBar.Value);
            _WordAt12 = bottomBar == null ? 0x1FFFF : 0u.SetBits(0, 17, bottomBar.Value);
            _WordAt16 = leftBar == null ? 0x1FFFF : 0u.SetBits(0, 17, leftBar.Value);
            _WordAt20 = rightBar == null ? 0x1FFFF : 0u.SetBits(0, 17, rightBar.Value);
        }
Пример #3
0
 /// <summary>
 ///     Creates an instance of <see cref="InfoFrameProperty" />.
 /// </summary>
 /// <param name="mode">The info-frame operation mode</param>
 /// <param name="isBlackListed">A value indicating if this display (monitor) is blacklisted</param>
 public InfoFrameProperty(InfoFramePropertyMode mode, InfoFrameBoolean isBlackListed)
 {
     _Word = 0u
             .SetBits(0, 4, (uint)mode)
             .SetBits(4, 2, (uint)isBlackListed);
 }