Beispiel #1
0
 public Builder(String uri, TrackInfo trackInfo, EncryptionData encryptionData, bool hasDiscontinuity, MapInfo mapInfo, ByteRange byteRange)
 {
     mUri              = uri;
     mTrackInfo        = trackInfo;
     mEncryptionData   = encryptionData;
     mHasDiscontinuity = hasDiscontinuity;
     mMapInfo          = mapInfo;
     mByteRange        = byteRange;
 }
Beispiel #2
0
 private TrackData(String uri, TrackInfo trackInfo, EncryptionData encryptionData, String programDateTime, bool hasDiscontinuity, MapInfo mapInfo, ByteRange byteRange)
 {
     mUri              = uri;
     mTrackInfo        = trackInfo;
     mEncryptionData   = encryptionData;
     mProgramDateTime  = programDateTime;
     mHasDiscontinuity = hasDiscontinuity;
     mMapInfo          = mapInfo;
     mByteRange        = byteRange;
 }
Beispiel #3
0
        public override bool Equals(Object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }
            ByteRange byteRange = (ByteRange)o;

            return(mSubRangeLength == byteRange.mSubRangeLength &&
                   object.Equals(mOffset, byteRange.mOffset));
        }
        private static void writeByteRange(TagWriter tagWriter, ByteRange byteRange)
        {
            String value;

            if (byteRange.getOffset() != null)
            {
                value = byteRange.getSubRangeLength().ToString()
                        + '@' + byteRange.getOffset().ToString();
            }
            else
            {
                value = byteRange.getSubRangeLength().ToString();
            }

            tagWriter.writeTag(Constants.EXT_X_BYTERANGE_TAG, value);
        }
Beispiel #5
0
        public void testEXT_X_BYTERANGE()
        {
            IExtTagParser handler        = MediaPlaylistLineParser.EXT_X_BYTERANGE;
            String        tag            = Constants.EXT_X_BYTERANGE_TAG;
            long          subRangeLength = 350;
            long          offset         = 70L;

            String line = "#" + tag + ":" + subRangeLength + "@" + offset;

            Assert.Equal(tag, handler.getTag());
            handler.parse(line, mParseState);
            ByteRange byteRange = mParseState.getMedia().byteRange;

            Assert.Equal(subRangeLength, byteRange.getSubRangeLength());
            Assert.Equal(offset, byteRange.getOffset());
        }
                public String write(MapInfo attributes)
                {
                    ByteRange byteRange = attributes.getByteRange();
                    String    value;

                    if (byteRange.hasOffset())
                    {
                        value = byteRange.getSubRangeLength().ToString()
                                + '@' + byteRange.getOffset().ToString();
                    }
                    else
                    {
                        value = byteRange.getSubRangeLength().ToString();
                    }

                    return(WriteUtil.writeQuotedString(value));
                }
Beispiel #7
0
 public Builder withByteRange(ByteRange byteRange)
 {
     this.mByteRange = byteRange;
     return(this);
 }
Beispiel #8
0
 public Builder(String uri, ByteRange byteRange)
 {
     this.mUri       = uri;
     this.mByteRange = byteRange;
 }
Beispiel #9
0
 public MapInfo(String uri, ByteRange byteRange)
 {
     this.uri       = uri;
     this.byteRange = byteRange;
 }