예제 #1
0
        public TeletextReceiver(ITeletextSource source, IDVBTeletextDecoder ttxtDecoder)
        {
            assert(source != null, "Source is null");
            assert(ttxtDecoder != null, "Decoder is null");
            ServiceRegistration.Get <ILogger>().Debug("Setting up teletext receiver ... ");
            _eventCallback       = new TeletextEventCallback(OnEvent);
            _packetCallback      = new TeletextPacketCallback(OnTSPacket);
            _serviceInfoCallback = new TeletextServiceInfoCallback(OnServiceInfo);

            // tell the tsreader's teletext source interface to deliver ts packets to us
            // and to inform us on resets
            ServiceRegistration.Get <ILogger>().Debug("Setting up callbacks with ITeletextSource");
            source.SetTeletextTSPacketCallback(Marshal.GetFunctionPointerForDelegate(_packetCallback));
            source.SetTeletextEventCallback(Marshal.GetFunctionPointerForDelegate(_eventCallback));
            source.SetTeletextServiceInfoCallback(Marshal.GetFunctionPointerForDelegate(_serviceInfoCallback));

            //tsPackets = new Queue<Packet>();

            ServiceRegistration.Get <ILogger>().Debug("Setting up ttxtdecoder and pes decoder");
            this._ttxtDecoder = ttxtDecoder;
            _pesDecoder       = new PESDecoder(OnPesPacket);
            ServiceRegistration.Get <ILogger>().Debug("Done setting up teletext receiver ... ");
        }
예제 #2
0
    public TeletextReceiver(ITeletextSource source, IDVBTeletextDecoder ttxtDecoder)
    {
      assert(source != null, "Source is null");
      assert(ttxtDecoder != null, "Decoder is null");
      ServiceRegistration.Get<ILogger>().Debug("Setting up teletext receiver ... ");
      _eventCallback = new TeletextEventCallback(OnEvent);
      _packetCallback = new TeletextPacketCallback(OnTSPacket);
      _serviceInfoCallback = new TeletextServiceInfoCallback(OnServiceInfo);

      // tell the tsreader's teletext source interface to deliver ts packets to us
      // and to inform us on resets
      ServiceRegistration.Get<ILogger>().Debug("Setting up callbacks with ITeletextSource");
      source.SetTeletextTSPacketCallback(Marshal.GetFunctionPointerForDelegate(_packetCallback));
      source.SetTeletextEventCallback(Marshal.GetFunctionPointerForDelegate(_eventCallback));
      source.SetTeletextServiceInfoCallback(Marshal.GetFunctionPointerForDelegate(_serviceInfoCallback));

      //tsPackets = new Queue<Packet>();

      ServiceRegistration.Get<ILogger>().Debug("Setting up ttxtdecoder and pes decoder");
      this._ttxtDecoder = ttxtDecoder;
      _pesDecoder = new PESDecoder(OnPesPacket);
      ServiceRegistration.Get<ILogger>().Debug("Done setting up teletext receiver ... ");
    }