public class SampleCount extends Object
| Constructor and Description |
|---|
SampleCount(long samples,
Timebase rate) |
| Modifier and Type | Method and Description |
|---|---|
SampleCount |
add(SampleCount that) |
SampleCount |
addPrecise(SampleCount that) |
boolean |
equals(Object o) |
Timebase |
getRate() |
long |
getSamples() |
long |
getSamples(Timebase newRate)
Returns the number of samples represented by this SampleCount, converted to
newRate.This method can lose precision if the samples cannot be precisely represented. |
long |
getSamplesPrecise(Timebase newRate)
Returns the number of samples represented by this SampleCount, converted to
newRate. |
double |
getSeconds()
Compute the duration of this sample count in seconds
The intention of this method is to be used for presentation, rather than accurate computation so it does not warn about resampling errors |
int |
hashCode() |
static SampleCount |
parseVidispine(String countAndRate)
Deprecated.
|
SampleCount |
resample(Timebase newRate)
Resample this sample count to another rate
|
static SampleCount |
seconds(Timebase rate,
long seconds) |
SampleCount |
subtract(SampleCount that) |
SampleCount |
subtractPrecise(SampleCount that) |
String |
toFfmpegString()
Returns the sample count in FFmpeg's time-based duration format.
|
String |
toString()
Encode the SampleCount as
samples@[str_timebase|nom[:denom]] (e.g. |
String |
toVidispineString()
Deprecated.
|
static SampleCount |
valueOf(String countAndRate)
Parse a sample count & timebase as
samples@[str_timebase|nom[:denom]]
N.B. |
public SampleCount(long samples,
Timebase rate)
public SampleCount resample(Timebase newRate)
newRate - public SampleCount add(SampleCount that)
public SampleCount addPrecise(SampleCount that) throws ResamplingException
ResamplingExceptionpublic SampleCount subtract(SampleCount that)
public SampleCount subtractPrecise(SampleCount that) throws ResamplingException
that - the sample count to subtractResamplingException - if the delta cannot be expressed without losing accuracypublic Timebase getRate()
public long getSamples()
public long getSamples(Timebase newRate)
newRate.getSamplesPrecise for
lossless-or-exception resamplingnewRate - public long getSamplesPrecise(Timebase newRate) throws ResamplingException
newRate. If precision would be
lost
this method throws an exceptionTimebase.resamplePrecise for lossless-or-exception resamplingnewRate - ResamplingException - if precision would be lost by the resamplepublic String toString()
samples@[str_timebase|nom[:denom]] (e.g. 124222@44100, 400@30000:1001)public String toFfmpegString()
Timecode.toFfmpegString()@Deprecated public static SampleCount parseVidispine(String countAndRate)
countAndRate - A sample count and a time base. The syntax is {number of samples}@{textual representation of time base} 124222@44100,
400@30000:1001, 400@NTSCpublic static SampleCount valueOf(String countAndRate)
samples@[str_timebase|nom[:denom]]
N.B. This does NOT consider the case where only a sample count is specified: it MUST include a timebasecountAndRate - A sample count and a time base. The syntax is {number of samples}@{textual representation of time base} 124222@44100,
400@30000:1001, 400@NTSCpublic static SampleCount seconds(Timebase rate, long seconds)
@Deprecated public String toVidispineString()
public double getSeconds()
Copyright © 2016. All rights reserved.