本文整理汇总了C#中IPipe.Subscribe方法的典型用法代码示例。如果您正苦于以下问题:C# IPipe.Subscribe方法的具体用法?C# IPipe.Subscribe怎么用?C# IPipe.Subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPipe
的用法示例。
在下文中一共展示了IPipe.Subscribe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public override void Start()
{
lock (this.SyncRoot)
{
IConsumerService consumerManager = this.Scope.GetService(typeof(IConsumerService)) as IConsumerService;
try
{
//_videoCodecFactory = new VideoCodecFactory();
_videoCodecFactory = this.Scope.GetService(typeof(VideoCodecFactory)) as VideoCodecFactory;
_checkVideoCodec = true;
}
catch (Exception ex)
{
log.Warn("No video codec factory available.", ex);
}
_firstPacketTime = _audioTime = _videoTime = _dataTime = -1;
_connMsgOut = consumerManager.GetConsumerOutput(this);
_connMsgOut.Subscribe(this, null);
_recordPipe = new InMemoryPushPushPipe();
#if !(NET_1_1)
Dictionary<string, object> recordParameterMap = new Dictionary<string, object>();
#else
Hashtable recordParameterMap = new Hashtable();
#endif
// Clear record flag
recordParameterMap.Add("record", null);
_recordPipe.Subscribe(this as IProvider, recordParameterMap);
_recording = false;
_recordingFilename = null;
this.CodecInfo = new StreamCodecInfo();
_closed = false;
_bytesReceived = 0;
_creationTime = System.Environment.TickCount;
}
}
示例2: Start
/// <summary>
/// Starts the server-side stream.
/// </summary>
public override void Start()
{
if (_state != State.UNINIT)
throw new NotSupportedException("State " + _state + " not valid to start");
if (_items.Count == 0)
throw new NotSupportedException("At least one item should be specified to start");
if (_publishedName == null)
throw new NotSupportedException("A published name is needed to start");
// publish this server-side stream
IProviderService providerService = this.Scope.GetService(typeof(IProviderService)) as IProviderService;
providerService.RegisterBroadcastStream(this.Scope, _publishedName, this);
_recordPipe = new InMemoryPushPushPipe();
#if !(NET_1_1)
Dictionary<string, object> recordParamMap = new Dictionary<string, object>();
#else
Hashtable recordParamMap = new Hashtable();
#endif
recordParamMap.Add("record", null);
_recordPipe.Subscribe((IProvider)this, recordParamMap);
_recordingFilename = null;
_schedulingService = this.Scope.GetService(typeof(ISchedulingService)) as ISchedulingService;
_state = State.STOPPED;
_currentItemIndex = -1;
NextItem();
}