示例#1
0
        /// <summary>
        /// Get the <seealso cref="Image.SourceIdentity()"/> for the recording.
        /// </summary>
        /// <param name="counters"> to search within. </param>
        /// <param name="counterId"> for the active recording. </param>
        /// <returns> <seealso cref="Image.SourceIdentity()"/> for the recording or null if not found. </returns>
        public static string GetSourceIdentity(CountersReader counters, int counterId)
        {
            IDirectBuffer buffer = counters.MetaDataBuffer;

            if (counters.GetCounterState(counterId) == RECORD_ALLOCATED &&
                counters.GetCounterTypeId(counterId) == RECORDING_POSITION_TYPE_ID)
            {
                int recordOffset = MetaDataOffset(counterId);
                return(buffer.GetStringAscii(recordOffset + KEY_OFFSET + SOURCE_IDENTITY_LENGTH_OFFSET));
            }

            return(null);
        }