mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-23 09:07:02 +01:00
update legacy hd homerun support
This commit is contained in:
@@ -596,6 +596,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||
else
|
||||
{
|
||||
var mediaSource = GetMediaSource(info, hdhrId, channelInfo, profile);
|
||||
//var modelInfo = await GetModelInfo(info, false, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return new HdHomerunHttpStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost);
|
||||
//return new HdHomerunUdpStream(mediaSource, streamId, new HdHomerunChannelCommands(hdhomerunChannel.Number), modelInfo.TunerCount, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost, _socketFactory, _networkManager);
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||
{
|
||||
var channelMsg = CreateSetMessage(i, command.Item1, command.Item2, _lockkey.Value);
|
||||
await tcpClient.SendAsync(channelMsg, channelMsg.Length, ipEndPoint, cancellationToken).ConfigureAwait(false);
|
||||
await tcpClient.ReceiveAsync(cancellationToken).ConfigureAwait(false);
|
||||
response = await tcpClient.ReceiveAsync(cancellationToken).ConfigureAwait(false);
|
||||
// parse response to make sure it worked
|
||||
if (!ParseReturnMessage(response.Buffer, response.ReceivedBytes, out returnVal))
|
||||
{
|
||||
@@ -172,6 +172,29 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ChangeChannel(IHdHomerunChannelCommands commands, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!_lockkey.HasValue)
|
||||
return;
|
||||
|
||||
using (var tcpClient = _socketFactory.CreateTcpSocket(_remoteIp, HdHomeRunPort))
|
||||
{
|
||||
var commandList = commands.GetCommands();
|
||||
foreach (Tuple<string, string> command in commandList)
|
||||
{
|
||||
var channelMsg = CreateSetMessage(_activeTuner, command.Item1, command.Item2, _lockkey.Value);
|
||||
await tcpClient.SendAsync(channelMsg, channelMsg.Length, new IpEndPointInfo(_remoteIp, HdHomeRunPort), cancellationToken).ConfigureAwait(false);
|
||||
var response = await tcpClient.ReceiveAsync(cancellationToken).ConfigureAwait(false);
|
||||
// parse response to make sure it worked
|
||||
string returnVal;
|
||||
if (!ParseReturnMessage(response.Buffer, response.ReceivedBytes, out returnVal))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task StopStreaming()
|
||||
{
|
||||
if (!_lockkey.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user