First Quality of Manifest Filter, indicates the first quality bitrate for HLS
예제 #1
0
        /// <summary>
        /// Asynchronously creates new StreamingFilter.
        /// </summary>
        /// <param name="name">filter name</param>
        /// <param name="timeRange">filter boundaries</param>
        /// <param name="trackConditions">filter track conditions</param>
        /// <param name="firstQuality">first quality</param>
        /// <returns>The task to create the filter.</returns>
        public Task <IStreamingAssetFilter> CreateAsync(
            string name,
            PresentationTimeRange timeRange,
            IList <FilterTrackSelectStatement> trackConditions,
            FirstQuality firstQuality = null)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            AssetFilterData filter = new AssetFilterData(_parentAsset.Id, name, timeRange, trackConditions, firstQuality);

            filter.SetMediaContext(MediaContext);

            IMediaDataServiceContext dataContext = MediaContext.MediaServicesClassFactory.CreateDataServiceContext();

            dataContext.AddObject(AssetFilterSet, filter);

            MediaRetryPolicy retryPolicy = MediaContext.MediaServicesClassFactory.GetSaveChangesRetryPolicy(dataContext as IRetryPolicyAdapter);

            return(retryPolicy.ExecuteAsync(() => dataContext.SaveChangesAsync(filter))
                   .ContinueWith <IStreamingAssetFilter>(
                       t =>
            {
                t.ThrowIfFaulted();
                return (AssetFilterData)t.Result.AsyncState;
            },
                       TaskContinuationOptions.ExecuteSynchronously));
        }
예제 #2
0
 /// <summary>
 /// Creates new Filter
 /// </summary>
 /// <param name="name">filter name</param>
 /// <param name="timeRange">streaming time range</param>
 /// <param name="trackConditions">filter track conditions</param>
 /// <param name="firstQuality">first quality</param>
 /// <returns>The created filter.</returns>
 public IStreamingAssetFilter Create(
     string name,
     PresentationTimeRange timeRange,
     IList <FilterTrackSelectStatement> trackConditions,
     FirstQuality firstQuality = null)
 {
     return(AsyncHelper.Wait(CreateAsync(name, timeRange, trackConditions, firstQuality)));
 }
        public FirstQualityData(FirstQuality firstQuality)
        {
            if (firstQuality == null)
            {
                throw new ArgumentNullException("firstQuality");
            }

            Bitrate = firstQuality.Bitrate;
        }
예제 #4
0
        public FirstQualityData(FirstQuality firstQuality)
        {
            if (firstQuality == null)
            {
                throw new ArgumentNullException("firstQuality");
            }

            Bitrate = firstQuality.Bitrate;
        }
 public AssetFilterData(
     string parentAssetId,
     string name, 
     PresentationTimeRange timeRange,
     IList<FilterTrackSelectStatement> trackConditions,
     FirstQuality firstQuality = null)
     : base(name, timeRange, trackConditions, firstQuality)
 {
     ParentAssetId = parentAssetId;
     Id = String.Empty;
     ResourceSetName = AssetFilterBaseCollection.AssetFilterSet;
 }
 public AssetFilterData(
     string parentAssetId,
     string name,
     PresentationTimeRange timeRange,
     IList <FilterTrackSelectStatement> trackConditions,
     FirstQuality firstQuality = null)
     : base(name, timeRange, trackConditions, firstQuality)
 {
     ParentAssetId   = parentAssetId;
     Id              = String.Empty;
     ResourceSetName = AssetFilterBaseCollection.AssetFilterSet;
 }
예제 #7
0
        public StreamingFilterData(
            string name,
            PresentationTimeRange timeRange,
            IList <FilterTrackSelectStatement> trackConditions,
            FirstQuality firstQuality = null)
        {
            Name                  = name;
            FirstQuality          = firstQuality != null ? new FirstQualityData(firstQuality) : null;
            PresentationTimeRange = timeRange != null
                ? new PresentationTimeRangeData(timeRange)
                : new PresentationTimeRangeData();
            Tracks = trackConditions != null
                ? trackConditions.Select(track => new FilterTrackSelectStatementData(track)).ToList()
                : new List <FilterTrackSelectStatementData>();

            ResourceSetName = StreamingFilterBaseCollection.FilterSet;
        }