update live stream handling

This commit is contained in:
Luke Pulverenti 2015-03-29 14:31:28 -04:00
parent dd8dd1938a
commit 10b9a865b7
13 changed files with 30 additions and 30 deletions

View file

@ -132,7 +132,7 @@ namespace MediaBrowser.Api
/// Called when [transcode beginning].
/// </summary>
/// <param name="path">The path.</param>
/// <param name="streamId">The stream identifier.</param>
/// <param name="playSessionId">The play session identifier.</param>
/// <param name="transcodingJobId">The transcoding job identifier.</param>
/// <param name="type">The type.</param>
/// <param name="process">The process.</param>
@ -141,7 +141,7 @@ namespace MediaBrowser.Api
/// <param name="cancellationTokenSource">The cancellation token source.</param>
/// <returns>TranscodingJob.</returns>
public TranscodingJob OnTranscodeBeginning(string path,
string streamId,
string playSessionId,
string transcodingJobId,
TranscodingJobType type,
Process process,
@ -160,7 +160,7 @@ namespace MediaBrowser.Api
DeviceId = deviceId,
CancellationTokenSource = cancellationTokenSource,
Id = transcodingJobId,
StreamId = streamId
PlaySessionId = playSessionId
};
_activeTranscodingJobs.Add(job);
@ -324,10 +324,10 @@ namespace MediaBrowser.Api
/// Kills the single transcoding job.
/// </summary>
/// <param name="deviceId">The device id.</param>
/// <param name="streamId">The stream identifier.</param>
/// <param name="playSessionId">The play session identifier.</param>
/// <param name="deleteFiles">The delete files.</param>
/// <returns>Task.</returns>
internal void KillTranscodingJobs(string deviceId, string streamId, Func<string, bool> deleteFiles)
internal void KillTranscodingJobs(string deviceId, string playSessionId, Func<string, bool> deleteFiles)
{
if (string.IsNullOrEmpty(deviceId))
{
@ -338,7 +338,7 @@ namespace MediaBrowser.Api
{
if (string.Equals(deviceId, j.DeviceId, StringComparison.OrdinalIgnoreCase))
{
return string.IsNullOrWhiteSpace(streamId) || string.Equals(streamId, j.StreamId, StringComparison.OrdinalIgnoreCase);
return string.IsNullOrWhiteSpace(playSessionId) || string.Equals(playSessionId, j.PlaySessionId, StringComparison.OrdinalIgnoreCase);
}
return false;
@ -539,10 +539,10 @@ namespace MediaBrowser.Api
public class TranscodingJob
{
/// <summary>
/// Gets or sets the stream identifier.
/// Gets or sets the play session identifier.
/// </summary>
/// <value>The stream identifier.</value>
public string StreamId { get; set; }
/// <value>The play session identifier.</value>
public string PlaySessionId { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>

View file

@ -126,7 +126,7 @@ namespace MediaBrowser.Api.Playback
var data = GetCommandLineArguments("dummy\\dummy", state, false);
data += "-" + (state.Request.DeviceId ?? string.Empty);
data += "-" + (state.Request.StreamId ?? string.Empty);
data += "-" + (state.Request.PlaySessionId ?? string.Empty);
data += "-" + (state.Request.ClientTime ?? string.Empty);
var dataHash = data.GetMD5().ToString("N");
@ -1009,7 +1009,7 @@ namespace MediaBrowser.Api.Playback
}
var transcodingJob = ApiEntryPoint.Instance.OnTranscodeBeginning(outputPath,
state.Request.StreamId,
state.Request.PlaySessionId,
transcodingId,
TranscodingJobType,
process,
@ -1511,7 +1511,7 @@ namespace MediaBrowser.Api.Playback
}
else if (i == 21)
{
request.StreamId = val;
request.PlaySessionId = val;
}
else if (i == 22)
{

View file

@ -160,7 +160,7 @@ namespace MediaBrowser.Api.Playback.Dash
// If the playlist doesn't already exist, startup ffmpeg
try
{
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.StreamId, p => false);
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, p => false);
if (currentTranscodingIndex.HasValue)
{

View file

@ -135,7 +135,7 @@ namespace MediaBrowser.Api.Playback.Hls
// If the playlist doesn't already exist, startup ffmpeg
try
{
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.StreamId, p => false);
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, p => false);
if (currentTranscodingIndex.HasValue)
{

View file

@ -54,8 +54,8 @@ namespace MediaBrowser.Api.Playback.Hls
[ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string DeviceId { get; set; }
[ApiMember(Name = "StreamId", Description = "The stream id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string StreamId { get; set; }
[ApiMember(Name = "PlaySessionId", Description = "The play session id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string PlaySessionId { get; set; }
}
/// <summary>
@ -95,7 +95,7 @@ namespace MediaBrowser.Api.Playback.Hls
public void Delete(StopEncodingProcess request)
{
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.StreamId, path => true);
ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, path => true);
}
/// <summary>

View file

@ -194,7 +194,7 @@ namespace MediaBrowser.Api.Playback
}
else
{
result.StreamId = Guid.NewGuid().ToString("N");
result.PlaySessionId = Guid.NewGuid().ToString("N");
}
return result;

View file

@ -71,7 +71,7 @@ namespace MediaBrowser.Api.Playback
public string Params { get; set; }
public string ClientTime { get; set; }
public string StreamId { get; set; }
public string PlaySessionId { get; set; }
public string LiveStreamId { get; set; }
}

View file

@ -206,8 +206,8 @@ namespace MediaBrowser.Model.Dlna
list.Add(new NameValuePair("Profile", item.VideoProfile ?? string.Empty));
list.Add(new NameValuePair("Cabac", item.Cabac.HasValue ? item.Cabac.Value.ToString() : string.Empty));
string streamId = item.PlaybackInfo == null ? null : item.PlaybackInfo.StreamId;
list.Add(new NameValuePair("StreamId", streamId ?? string.Empty));
string playSessionId = item.PlaybackInfo == null ? null : item.PlaybackInfo.PlaySessionId;
list.Add(new NameValuePair("PlaySessionId", playSessionId ?? string.Empty));
list.Add(new NameValuePair("api_key", accessToken ?? string.Empty));
string liveStreamId = item.MediaSource == null ? null : item.MediaSource.LiveStreamId;

View file

@ -13,10 +13,10 @@ namespace MediaBrowser.Model.MediaInfo
public List<MediaSourceInfo> MediaSources { get; set; }
/// <summary>
/// Gets or sets the stream identifier.
/// Gets or sets the play session identifier.
/// </summary>
/// <value>The stream identifier.</value>
public string StreamId { get; set; }
/// <value>The play session identifier.</value>
public string PlaySessionId { get; set; }
/// <summary>
/// Gets or sets the error code.

View file

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.606</version>
<version>3.0.607</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.606" />
<dependency id="MediaBrowser.Common" version="3.0.607" />
<dependency id="NLog" version="3.2.0.0" />
<dependency id="SimpleInjector" version="2.7.0" />
</dependencies>

View file

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.606</version>
<version>3.0.607</version>
<title>MediaBrowser.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View file

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Model.Signed</id>
<version>3.0.606</version>
<version>3.0.607</version>
<title>MediaBrowser.Model - Signed Edition</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View file

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.606</version>
<version>3.0.607</version>
<title>Media Browser.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.606" />
<dependency id="MediaBrowser.Common" version="3.0.607" />
</dependencies>
</metadata>
<files>