using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Diagnostics;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Api.Playback.Hls
{
///
/// Class BaseHlsService
///
public abstract class BaseHlsService : BaseStreamingService
{
protected BaseHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, ILiveTvManager liveTvManager, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IProcessManager processManager, IMediaSourceManager mediaSourceManager) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, liveTvManager, dlnaManager, subtitleEncoder, deviceManager, processManager, mediaSourceManager)
{
}
///
/// Gets the audio arguments.
///
/// The state.
/// System.String.
protected abstract string GetAudioArguments(StreamState state);
///
/// Gets the video arguments.
///
/// The state.
/// System.String.
protected abstract string GetVideoArguments(StreamState state);
///
/// Gets the segment file extension.
///
/// The state.
/// System.String.
protected abstract string GetSegmentFileExtension(StreamState state);
///
/// Gets the type of the transcoding job.
///
/// The type of the transcoding job.
protected override TranscodingJobType TranscodingJobType
{
get { return TranscodingJobType.Hls; }
}
///
/// Processes the request.
///
/// The request.
/// if set to true [is live].
/// System.Object.
protected object ProcessRequest(StreamRequest request, bool isLive)
{
return ProcessRequestAsync(request, isLive).Result;
}
///
/// Processes the request async.
///
/// The request.
/// if set to true [is live].
/// Task{System.Object}.
/// A video bitrate is required
/// or
/// An audio bitrate is required
private async Task