private void InitializeData(UInt32 playoutId, UInt64 timelinePosition)
        {
            _key = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.UpdateTimelineRequest);

            // for now we are going with a FIXED-length schema where we do not have any of the variable-length AcspTimelineExtension involved
            _packLength = new AcspBerLength(36);  // RequestId(4), PlayoutId(4), TimelinePosition(8), RateNumerator(8), RateDenominator(8), ExtensionCount(4)

            _requestId = new AcspRequestId();

            ConvertPlayoutIdToByteArray(playoutId);

            ConvertTimelinePositionToByteArray(timelinePosition);

            // UInt64 numerator = 24;  // assuming a default edit rate of 24:1 for the default constructor
            UInt64 numerator = 25;  // TEMPORARILY overriding the edit unit for a specific test scenario

            ConvertRateNumeratorToByteArray(numerator);

            UInt64 denominator = 1; // assuming a default edit rate of 24:1 for the default constructor

            ConvertRateDenominatorToByteArray(denominator);

            UInt32 extensionCount = 0;  // assuming zero extension counts in this vanilla implementation

            ConvertExtensionCountToByteArray(extensionCount);
        }
        private void InitializeData(String inputUrl, UInt32 inputId)
        {
            _key = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.SetRplLocationRequest);

            // Calculate required length of the value part of the packArray
            // which is 4 bytes for RequestId, 4 bytes for PlayoutId, and a
            // variable amount for the length of the ResourceUrl

            int length = 4 + 4 + inputUrl.Length;

            _packLength = new AcspBerLength(length);

            // Generate the new RequestId
            _requestId = new AcspRequestId();

            // Set the Playout ID
            _playoutId = BitConverter.GetBytes(inputId);
            if (BitConverter.IsLittleEndian)
            {
                Array.Reverse(_playoutId);
            }

            // Set the Resource URL
            // Note that per SMPTE 430-10:2010, this field is supposed to be of type "URL", which may be different than expected UTF8
            _resourceUrl = Encoding.UTF8.GetBytes(inputUrl);
        }
Пример #3
0
        private void InitializeAnnounceRequestData()
        {
            _key               = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.AnnounceRequest);
            _requestId         = new AcspRequestId();
            _currentTime       = DateTimeOffset.UtcNow;
            _currentEpochTime  = _currentTime.ToUnixTimeSeconds();
            _deviceDescription = "Proludio AcsListener Test Device Description";

            _valueLength = _deviceDescription.Length + 4 + 8;
            _packLength  = new AcspBerLength(_valueLength);
        }
Пример #4
0
        private void InitializeData(UInt32 leaseDurationSeconds)
        {
            _key        = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.GetNewLeaseRequest);
            _packLength = new AcspBerLength(8); // 4 bytes for RequestId, 4 bytes for LeaseDuration
            _requestId  = new AcspRequestId();

            _leaseDuration = BitConverter.GetBytes(leaseDurationSeconds);
            if (BitConverter.IsLittleEndian)
            {
                Array.Reverse(_leaseDuration);
            }
        }
        private void InitializeData(bool outputMode)
        {
            _key        = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.SetOutputModeRequest);
            _packLength = new AcspBerLength(5);  // 4 bytes for RequestId, 1 byte for OutputMode
            _requestId  = new AcspRequestId();

            int temp = 0;

            if (outputMode == true)
            {
                temp = 1;
            }
            _outputMode = (Byte)temp;
        }
Пример #6
0
        /// <summary>
        /// Constructor for a standard Acsp Response Header object.  Takes the standard 20 bytes
        /// comprised of 16 bytes for the Pack Key, and 4 bytes for the BER length item.
        /// </summary>
        /// <param name="inputArray"> 20 byte array comprising 16 bytes for Pack Key, and 4 bytes for BER length</param>
        ///
        public AcspResponseHeader(Byte[] inputArray)
        {
            if (inputArray.Length != 20)
            {
                throw new IndexOutOfRangeException("Error: expecting 20-byte input");
            }

            Byte[] keyArray    = new Byte[16];
            Byte[] lengthArray = new Byte[4];

            Array.Copy(inputArray, 0, keyArray, 0, keyArray.Length);                     // Copy first 16 bytes of inputArray in to keyArray
            Array.Copy(inputArray, keyArray.Length, lengthArray, 0, lengthArray.Length); // Copy last 4 bytes of inputArray in to lengthArray

            _key        = new AcspPackKey(keyArray);
            _packLength = new AcspBerLength(lengthArray);
        }
 private void InitializeData()
 {
     _key        = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.TerminateLeaseRequest);
     _packLength = new AcspBerLength(4);
     _requestId  = new AcspRequestId();
 }
Пример #8
0
 private void InitializeData()
 {
     _key        = new AcspPackKey(Byte12Data.GoodRequest, Byte13NodeNames.GetStatusRequest);
     _packLength = new AcspBerLength(4);  // 4 bytes for the RequestId
     _requestId  = new AcspRequestId();
 }