Skip to content

Commit

Permalink
Merge pull request #143 from neilcsmith-net/clocktime
Browse files Browse the repository at this point in the history
Use long in place of ClockTime
  • Loading branch information
neilcsmith-net committed Feb 22, 2019
2 parents a5a2fb0 + 90a3ef9 commit d097354
Show file tree
Hide file tree
Showing 28 changed files with 254 additions and 438 deletions.
34 changes: 14 additions & 20 deletions src/org/freedesktop/gstreamer/Buffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,20 @@ public void unmap() {
* timestamp when the buffer should be decoded and is usually monotonically
* increasing.
*
* @return a ClockTime representing the timestamp or {@link ClockTime#NONE}
* @return a long representing the timestamp or {@link ClockTime#NONE}
* when the timestamp is not known or relevant.
*/
@Deprecated
public ClockTime getDecodeTimestamp() {
return (ClockTime) this.struct.readField("dts");
public long getDecodeTimestamp() {
return (long) this.struct.readField("dts");
}

/**
* Set the decode timestamp of the Buffer
*
* @param val a ClockTime representing the timestamp or
* @param val a long representing the timestamp or
* {@link ClockTime#NONE} when the timestamp is not known or relevant.
*/
@Deprecated
public void setDecodeTimestamp(ClockTime val) {
public void setDecodeTimestamp(long val) {
this.struct.writeField("dts", val);
}

Expand All @@ -143,22 +141,20 @@ public void setDecodeTimestamp(ClockTime val) {
* timestamp when the buffer content should be presented to the user and is
* not always monotonically increasing.
*
* @return a ClockTime representing the timestamp or {@link ClockTime#NONE}
* @return a long representing the timestamp or {@link ClockTime#NONE}
* when the timestamp is not known or relevant.
*/
@Deprecated
public ClockTime getPresentationTimestamp() {
return (ClockTime) this.struct.readField("pts");
public long getPresentationTimestamp() {
return (long) this.struct.readField("pts");
}

/**
* Set the presentation timestamp of the Buffer
*
* @param val a ClockTime representing the timestamp or
* @param val a long representing the timestamp or
* {@link ClockTime#NONE} when the timestamp is not known or relevant.
*/
@Deprecated
public void setPresentationTimestamp(ClockTime val) {
public void setPresentationTimestamp(long val) {
this.struct.writeField("pts", val);
}

Expand All @@ -168,19 +164,17 @@ public void setPresentationTimestamp(ClockTime val) {
* @return a ClockTime representing the timestamp or {@link ClockTime#NONE}
* when the timestamp is not known or relevant.
*/
@Deprecated
public ClockTime getDuration() {
return (ClockTime) this.struct.readField("duration");
public long getDuration() {
return (long) this.struct.readField("duration");
}

/**
* Set the duration of this buffer.
*
* @param val a ClockTime representing the duration or
* @param val a long representing the duration or
* {@link ClockTime#NONE} when the timestamp is not known or relevant.
*/
@Deprecated
public void setDuration(ClockTime val) {
public void setDuration(long val) {
this.struct.writeField("duration", val);
}

Expand Down
24 changes: 8 additions & 16 deletions src/org/freedesktop/gstreamer/Clock.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ public Clock(Initializer init) {
* @param resolution the new resolution of the clock.
* @return the new resolution of the clock.
*/
@Deprecated
public ClockTime setResolution(ClockTime resolution) {
public long setResolution(long resolution) {
return GSTCLOCK_API.gst_clock_set_resolution(this, resolution);
}

Expand All @@ -120,8 +119,7 @@ public ClockTime setResolution(ClockTime resolution) {
*
* @return the resolution of the clock in nanoseconds.
*/
@Deprecated
public ClockTime getResolution() {
public long getResolution() {
return GSTCLOCK_API.gst_clock_get_resolution(this);
}

Expand All @@ -135,8 +133,7 @@ public ClockTime getResolution() {
* @return the time of the clock. Or {@link ClockTime#NONE} when
* given incorrect input.
*/
@Deprecated
public ClockTime getTime() {
public long getTime() {
return GSTCLOCK_API.gst_clock_get_time(this);
}
/**
Expand All @@ -147,8 +144,7 @@ public ClockTime getTime() {
*
* @return the internal time of the clock. Or {@link ClockTime#NONE} when given wrong input.
*/
@Deprecated
public ClockTime getInternalTime() {
public long getInternalTime() {
return GSTCLOCK_API.gst_clock_get_internal_time(this);
}

Expand Down Expand Up @@ -195,8 +191,7 @@ public boolean setMaster(Clock master) {
* @param rateNumerator the numerator of the rate of the clock relative to its internal time
* @param rateDenominator the denominator of the rate of the clock
*/
@Deprecated
public void getCalibration(ClockTime internal, ClockTime external, ClockTime rateNumerator, ClockTime rateDenominator) {
public void getCalibration(long internal, long external, long rateNumerator, long rateDenominator) {
GSTCLOCK_API.gst_clock_set_calibration(this, internal, external, rateNumerator, rateDenominator);
}

Expand Down Expand Up @@ -229,8 +224,7 @@ public void getCalibration(ClockTime internal, ClockTime external, ClockTime rat
* @param rateNumerator the numerator of the rate of the clock relative to its internal time
* @param rateDenominator the denominator of the rate of the clock
*/
@Deprecated
public void setCalibration(ClockTime internal, ClockTime external, ClockTime rateNumerator, ClockTime rateDenominator) {
public void setCalibration(long internal, long external, long rateNumerator, long rateDenominator) {
GSTCLOCK_API.gst_clock_set_calibration(this, internal, external, rateNumerator, rateDenominator);
}

Expand All @@ -243,8 +237,7 @@ public void setCalibration(ClockTime internal, ClockTime external, ClockTime rat
* @param time The requested time
* @return A {@link ClockID} that can be used to request the time notification.
*/
@Deprecated
public ClockID newSingleShotID(ClockTime time) {
public ClockID newSingleShotID(long time) {
return GSTCLOCK_API.gst_clock_new_single_shot_id(this, time);
}

Expand All @@ -259,8 +252,7 @@ public ClockID newSingleShotID(ClockTime time) {
* @param interval The requested interval.
* @return A {@link ClockID} that can be used to request the time notification.
*/
@Deprecated
public ClockID newPeriodicID(ClockTime startTime, ClockTime interval) {
public ClockID newPeriodicID(long startTime, long interval) {
return GSTCLOCK_API.gst_clock_new_periodic_id(this, startTime, interval);
}
}
4 changes: 2 additions & 2 deletions src/org/freedesktop/gstreamer/ClockID.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public void unschedule() {
*
* @return The time of this clock id.
*/
@Deprecated
public ClockTime getTime() {
public long getTime() {
return GSTCLOCK_API.gst_clock_id_get_time(this);
}

Expand All @@ -76,6 +75,7 @@ public ClockTime getTime() {
* @param other The other ClockID to compare to
* @return negative value if a < b; zero if a = b; positive value if a > b
*/
@Override
public int compareTo(ClockID other) {
return GSTCLOCK_API.gst_clock_id_compare_func(this, other);
}
Expand Down
Loading

0 comments on commit d097354

Please sign in to comment.