Example #1
0
        /// <summary>
        /// Parse the section.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containg the DSMCC data.</param>
        /// <param name="mpeg2Header">The MPEG2 header for the section.</param>
        public void Process(byte[] byteData, Mpeg2ExtendedHeader mpeg2Header)
        {
            DSMCCHeader dsmccHeader = new DSMCCHeader();
            dsmccHeader.Process(byteData, mpeg2Header);

            dsmccMessage = DSMCCMessage.CreateInstance(dsmccHeader, byteData);
        }
Example #2
0
        /// <summary>
        /// Create an instance of a DSMCC message.
        /// </summary>
        /// <param name="dsmccHeader">The header of the message.</param>
        /// <param name="byteData">The MPEG2 data block that contains the message.</param>
        /// <returns>An instance of the appropriate DSMCC message class.</returns>
        public static DSMCCMessage CreateInstance(DSMCCHeader dsmccHeader, byte[] byteData)
        {
            DSMCCMessage dsmccMessage;

            switch (dsmccHeader.MessageID)
            {
            case DSMCCDownloadDataBlock.MessageIDDownloadDataBlock:
                dsmccMessage = new DSMCCDownloadDataBlock(dsmccHeader);
                break;

            case DSMCCDownloadInfoIndication.MessageIDDownloadInfoIndication:
                dsmccMessage = new DSMCCDownloadInfoIndication(dsmccHeader);
                break;

            case DSMCCDownloadServerInitiate.MessageIDDownloadServerInitiate:
                dsmccMessage = new DSMCCDownloadServerInitiate(dsmccHeader);
                break;

            case DSMCCDownloadCancel.MessageIDDownloadCancel:
                dsmccMessage = new DSMCCDownloadCancel(dsmccHeader);
                break;

            default:
                throw (new ArgumentException("The DSMCC message ID is out of range"));
            }

            dsmccMessage.Process(byteData, dsmccHeader.Index);

            return(dsmccMessage);
        }
Example #3
0
        /// <summary>
        /// Create an instance of a DSMCC message.
        /// </summary>
        /// <param name="dsmccHeader">The header of the message.</param>
        /// <param name="byteData">The MPEG2 data block that contains the message.</param>
        /// <returns>An instance of the appropriate DSMCC message class.</returns>
        public static DSMCCMessage CreateInstance(DSMCCHeader dsmccHeader, byte[] byteData)
        {
            DSMCCMessage dsmccMessage;

            switch (dsmccHeader.MessageID)
            {
                case DSMCCDownloadDataBlock.MessageIDDownloadDataBlock:
                    dsmccMessage = new DSMCCDownloadDataBlock(dsmccHeader);
                    break;
                case DSMCCDownloadInfoIndication.MessageIDDownloadInfoIndication:
                    dsmccMessage = new DSMCCDownloadInfoIndication(dsmccHeader);
                    break;
                case DSMCCDownloadServerInitiate.MessageIDDownloadServerInitiate:
                    dsmccMessage = new DSMCCDownloadServerInitiate(dsmccHeader);
                    break;
                case DSMCCDownloadCancel.MessageIDDownloadCancel:
                    dsmccMessage = new DSMCCDownloadCancel(dsmccHeader);
                    break;
                default:
                    throw (new ArgumentException("The DSMCC message ID is out of range"));
            }

            dsmccMessage.Process(byteData, dsmccHeader.Index);

            return (dsmccMessage);
        }
Example #4
0
        /// <summary>
        /// Parse the section.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containg the DSMCC data.</param>
        /// <param name="mpeg2Header">The MPEG2 header for the section.</param>
        public void Process(byte[] byteData, Mpeg2ExtendedHeader mpeg2Header)
        {
            DSMCCHeader dsmccHeader = new DSMCCHeader();

            dsmccHeader.Process(byteData, mpeg2Header);

            dsmccMessage = DSMCCMessage.CreateInstance(dsmccHeader, byteData);
        }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadDataBlock.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadDataBlock(DSMCCHeader dsmccHeader) : base(dsmccHeader)
 {
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadCancel message.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadCancel(DSMCCHeader dsmccHeader)
     : base(dsmccHeader)
 {
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadDataBlock.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadDataBlock(DSMCCHeader dsmccHeader)
     : base(dsmccHeader)
 {
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadInfoIndication class.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadInfoIndication(DSMCCHeader dsmccHeader) : base(dsmccHeader)
 {
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadInfoIndication class.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadInfoIndication(DSMCCHeader dsmccHeader)
     : base(dsmccHeader)
 {
 }
Example #10
0
 /// <summary>
 /// Initialize a new instance of the DSMCCMessage class.
 /// </summary>
 /// <param name="dsmccHeader">The header of the message.</param>
 public DSMCCMessage(DSMCCHeader dsmccHeader)
 {
     this.dsmccHeader = dsmccHeader;
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadCancel message.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadCancel(DSMCCHeader dsmccHeader) : base(dsmccHeader)
 {
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadServerInitiate message.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadServerInitiate(DSMCCHeader dsmccHeader) : base(dsmccHeader)
 {
 }
 /// <summary>
 /// Initialize a new instance of the DSMCCDownloadServerInitiate message.
 /// </summary>
 /// <param name="dsmccHeader">The DSMCC header that preceedes the message.</param>
 public DSMCCDownloadServerInitiate(DSMCCHeader dsmccHeader)
     : base(dsmccHeader)
 {
 }
Example #14
0
 /// <summary>
 /// Initialize a new instance of the DSMCCMessage class.
 /// </summary>
 /// <param name="dsmccHeader">The header of the message.</param>
 public DSMCCMessage(DSMCCHeader dsmccHeader)
 {
     this.dsmccHeader = dsmccHeader;
 }