using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
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, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer)
: base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer)
{
}
///
/// 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