|
|
@ -31,8 +31,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|
|
|
private readonly MulticastStream _multicastStream;
|
|
|
|
private readonly MulticastStream _multicastStream;
|
|
|
|
private readonly string _channelUrl;
|
|
|
|
private readonly string _channelUrl;
|
|
|
|
private readonly int _numTuners;
|
|
|
|
private readonly int _numTuners;
|
|
|
|
|
|
|
|
private readonly INetworkManager _networkManager;
|
|
|
|
|
|
|
|
|
|
|
|
public LegacyHdHomerunLiveStream(MediaSourceInfo mediaSource, string originalStreamId, string channelUrl, int numTuners, IFileSystem fileSystem, IHttpClient httpClient, ILogger logger, IServerApplicationPaths appPaths, IServerApplicationHost appHost, ISocketFactory socketFactory)
|
|
|
|
public LegacyHdHomerunLiveStream(MediaSourceInfo mediaSource, string originalStreamId, string channelUrl, int numTuners, IFileSystem fileSystem, IHttpClient httpClient, ILogger logger, IServerApplicationPaths appPaths, IServerApplicationHost appHost, ISocketFactory socketFactory, INetworkManager networkManager)
|
|
|
|
: base(mediaSource)
|
|
|
|
: base(mediaSource)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_fileSystem = fileSystem;
|
|
|
|
_fileSystem = fileSystem;
|
|
|
@ -41,6 +42,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|
|
|
_appPaths = appPaths;
|
|
|
|
_appPaths = appPaths;
|
|
|
|
_appHost = appHost;
|
|
|
|
_appHost = appHost;
|
|
|
|
_socketFactory = socketFactory;
|
|
|
|
_socketFactory = socketFactory;
|
|
|
|
|
|
|
|
_networkManager = networkManager;
|
|
|
|
OriginalStreamId = originalStreamId;
|
|
|
|
OriginalStreamId = originalStreamId;
|
|
|
|
_multicastStream = new MulticastStream(_logger);
|
|
|
|
_multicastStream = new MulticastStream(_logger);
|
|
|
|
_channelUrl = channelUrl;
|
|
|
|
_channelUrl = channelUrl;
|
|
|
@ -53,15 +55,14 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|
|
|
|
|
|
|
|
|
|
|
var mediaSource = OriginalMediaSource;
|
|
|
|
var mediaSource = OriginalMediaSource;
|
|
|
|
|
|
|
|
|
|
|
|
var splitString = mediaSource.Path.Split('_');
|
|
|
|
var uri = new Uri(mediaSource.Path);
|
|
|
|
var remoteIp = splitString[0];
|
|
|
|
var localPort = _networkManager.GetRandomUnusedUdpPort();
|
|
|
|
var localPort = Convert.ToInt32(splitString[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.Info("Opening Legacy HDHR Live stream from {0}", remoteIp);
|
|
|
|
_logger.Info("Opening Legacy HDHR Live stream from {0}", uri.Host);
|
|
|
|
|
|
|
|
|
|
|
|
var taskCompletionSource = new TaskCompletionSource<bool>();
|
|
|
|
var taskCompletionSource = new TaskCompletionSource<bool>();
|
|
|
|
|
|
|
|
|
|
|
|
StartStreaming(remoteIp, localPort, taskCompletionSource, _liveStreamCancellationTokenSource.Token);
|
|
|
|
StartStreaming(uri.Host, localPort, taskCompletionSource, _liveStreamCancellationTokenSource.Token);
|
|
|
|
|
|
|
|
|
|
|
|
//OpenedMediaSource.Protocol = MediaProtocol.File;
|
|
|
|
//OpenedMediaSource.Protocol = MediaProtocol.File;
|
|
|
|
//OpenedMediaSource.Path = tempFile;
|
|
|
|
//OpenedMediaSource.Path = tempFile;
|
|
|
|