@@ -54,7 +54,7 @@ public class Movie extends PImage implements PConstants {
5454 public static String [] supportedProtocols = { "http" };
5555 public float frameRate ;
5656 public String filename ;
57- public PlayBin2 playBin ;
57+ public PlayBin2 playbin ;
5858
5959 protected boolean playing = false ;
6060 protected boolean paused = false ;
@@ -103,11 +103,11 @@ public Movie(PApplet parent, String filename) {
103103 * Disposes all the native resources associated to this movie.
104104 */
105105 public void dispose () {
106- if (playBin != null ) {
106+ if (playbin != null ) {
107107 try {
108- if (playBin .isPlaying ()) {
109- playBin .stop ();
110- playBin .getState ();
108+ if (playbin .isPlaying ()) {
109+ playbin .stop ();
110+ playbin .getState ();
111111 }
112112 } catch (Exception e ) {
113113 e .printStackTrace ();
@@ -129,8 +129,8 @@ public void dispose() {
129129 natSink = null ;
130130 }
131131
132- playBin .dispose ();
133- playBin = null ;
132+ playbin .dispose ();
133+ playbin = null ;
134134 }
135135 }
136136
@@ -168,11 +168,11 @@ public void frameRate(float ifps) {
168168 float f = (0 < ifps && 0 < frameRate ) ? ifps / frameRate : 1 ;
169169
170170 if (playing ) {
171- playBin .pause ();
172- playBin .getState ();
171+ playbin .pause ();
172+ playbin .getState ();
173173 }
174174
175- long t = playBin .queryPosition (TimeUnit .NANOSECONDS );
175+ long t = playbin .queryPosition (TimeUnit .NANOSECONDS );
176176
177177 boolean res ;
178178 long start , stop ;
@@ -184,24 +184,24 @@ public void frameRate(float ifps) {
184184 stop = t ;
185185 }
186186
187- res = playBin .seek (rate * f , Format .TIME , SeekFlags .FLUSH ,
187+ res = playbin .seek (rate * f , Format .TIME , SeekFlags .FLUSH ,
188188 SeekType .SET , start , SeekType .SET , stop );
189- playBin .getState ();
189+ playbin .getState ();
190190
191191 if (!res ) {
192192 PGraphics .showWarning ("Seek operation failed." );
193193 }
194194
195195 if (playing ) {
196- playBin .play ();
196+ playbin .play ();
197197 }
198198
199199 frameRate = ifps ;
200200
201201 // getState() will wait until any async state change
202202 // (like seek in this case) has completed
203203 seeking = true ;
204- playBin .getState ();
204+ playbin .getState ();
205205 seeking = false ;
206206 }
207207
@@ -245,8 +245,8 @@ public void speed(float irate) {
245245 * @usage web_application
246246 */
247247 public float duration () {
248- float sec = playBin .queryDuration ().toSeconds ();
249- float nanosec = playBin .queryDuration ().getNanoSeconds ();
248+ float sec = playbin .queryDuration ().toSeconds ();
249+ float nanosec = playbin .queryDuration ().getNanoSeconds ();
250250 return sec + Video .nanoSecToSecFrac (nanosec );
251251 }
252252
@@ -263,8 +263,8 @@ public float duration() {
263263 * @usage web_application
264264 */
265265 public float time () {
266- float sec = playBin .queryPosition ().toSeconds ();
267- float nanosec = playBin .queryPosition ().getNanoSeconds ();
266+ float sec = playbin .queryPosition ().toSeconds ();
267+ float nanosec = playbin .queryPosition ().getNanoSeconds ();
268268 return sec + Video .nanoSecToSecFrac (nanosec );
269269 }
270270
@@ -298,7 +298,7 @@ public void jump(float where) {
298298 boolean res ;
299299 long pos = Video .secToNanoLong (where );
300300
301- res = playBin .seek (1.0 , Format .TIME , SeekFlags .FLUSH ,
301+ res = playbin .seek (1.0 , Format .TIME , SeekFlags .FLUSH ,
302302 SeekType .SET , pos , SeekType .NONE , -1 );
303303
304304 if (!res ) {
@@ -308,7 +308,7 @@ public void jump(float where) {
308308 // getState() will wait until any async state change
309309 // (like seek in this case) has completed
310310 seeking = true ;
311- playBin .getState ();
311+ playbin .getState ();
312312 seeking = false ;
313313 }
314314
@@ -347,8 +347,8 @@ public void play() {
347347
348348 playing = true ;
349349 paused = false ;
350- playBin .play ();
351- playBin .getState ();
350+ playbin .play ();
351+ playbin .getState ();
352352 }
353353
354354
@@ -412,8 +412,8 @@ public void pause() {
412412
413413 playing = false ;
414414 paused = true ;
415- playBin .pause ();
416- playBin .getState ();
415+ playbin .pause ();
416+ playbin .getState ();
417417 }
418418
419419
@@ -440,8 +440,8 @@ public void stop() {
440440 playing = false ;
441441 }
442442 paused = false ;
443- playBin .stop ();
444- playBin .getState ();
443+ playbin .stop ();
444+ playbin .getState ();
445445 }
446446
447447
@@ -463,7 +463,7 @@ public synchronized void read() {
463463 }
464464 if (volume < 0 ) {
465465 // Idem for volume
466- volume = (float )playBin .getVolume ();
466+ volume = (float )playbin .getVolume ();
467467 }
468468
469469 if (useBufferSink ) { // The native buffer from gstreamer is copied to the buffer sink.
@@ -522,7 +522,7 @@ public synchronized void read() {
522522 */
523523 public void volume (float v ) {
524524 if (playing && PApplet .abs (volume - v ) > 0.001f ) {
525- playBin .setVolume (v );
525+ playbin .setVolume (v );
526526 volume = v ;
527527 }
528528 }
@@ -535,7 +535,7 @@ public void volume(float v) {
535535
536536 protected void initGStreamer (PApplet parent , String filename ) {
537537 this .parent = parent ;
538- playBin = null ;
538+ playbin = null ;
539539
540540 File file ;
541541
@@ -549,34 +549,34 @@ protected void initGStreamer(PApplet parent, String filename) {
549549 // which is less fun, so this will crap out.
550550 file = new File (parent .dataPath (filename ));
551551 if (file .exists ()) {
552- playBin = new PlayBin2 ("Movie Player" );
553- playBin .setInputFile (file );
552+ playbin = new PlayBin2 ("Movie Player" );
553+ playbin .setInputFile (file );
554554 }
555555 } catch (Exception e ) {
556556 } // ignored
557557
558558 // read from a file just hanging out in the local folder.
559559 // this might happen when the video library is used with some
560560 // other application, or the person enters a full path name
561- if (playBin == null ) {
561+ if (playbin == null ) {
562562 try {
563563 file = new File (filename );
564564 if (file .exists ()) {
565- playBin = new PlayBin2 ("Movie Player" );
566- playBin .setInputFile (file );
565+ playbin = new PlayBin2 ("Movie Player" );
566+ playbin .setInputFile (file );
567567 }
568568 } catch (Exception e ) {
569569 e .printStackTrace ();
570570 }
571571 }
572572
573- if (playBin == null ) {
573+ if (playbin == null ) {
574574 // Try network read...
575575 for (int i = 0 ; i < supportedProtocols .length ; i ++) {
576576 if (filename .startsWith (supportedProtocols [i ] + "://" )) {
577577 try {
578- playBin = new PlayBin2 ("Movie Player" );
579- playBin .setURI (URI .create (filename ));
578+ playbin = new PlayBin2 ("Movie Player" );
579+ playbin .setURI (URI .create (filename ));
580580 break ;
581581 } catch (Exception e ) {
582582 e .printStackTrace ();
@@ -589,7 +589,7 @@ protected void initGStreamer(PApplet parent, String filename) {
589589 // doing it three times (or whatever) for each of the cases above.
590590 }
591591
592- if (playBin == null ) {
592+ if (playbin == null ) {
593593 parent .die ("Could not load movie file " + filename , null );
594594 }
595595
@@ -652,7 +652,7 @@ public void bufferFrame(int w, int h, Buffer buffer) {
652652 });
653653
654654 natSink .setAutoDisposeBuffer (false );
655- playBin .setVideoSink (natSink );
655+ playbin .setVideoSink (natSink );
656656 // The setVideoSink() method sets the videoSink as a property of the PlayBin,
657657 // which increments the refcount of the videoSink element. Disposing here once
658658 // to decrement the refcount.
@@ -667,15 +667,15 @@ public void rgbFrame(int w, int h, IntBuffer buffer) {
667667
668668 // Setting direct buffer passing in the video sink.
669669 rgbSink .setPassDirectBuffer (Video .passDirectBuffer );
670- playBin .setVideoSink (rgbSink );
670+ playbin .setVideoSink (rgbSink );
671671 // The setVideoSink() method sets the videoSink as a property of the PlayBin,
672672 // which increments the refcount of the videoSink element. Disposing here once
673673 // to decrement the refcount.
674674 rgbSink .dispose ();
675675 }
676676
677677 // Creating bus to handle end-of-stream event.
678- Bus bus = playBin .getBus ();
678+ Bus bus = playbin .getBus ();
679679 bus .connect (new Bus .EOS () {
680680 public void endOfStream (GstObject element ) {
681681 eosEvent ();
@@ -777,7 +777,7 @@ protected void eosEvent() {
777777 * @return int
778778 */
779779 protected int getSourceHeight () {
780- Dimension dim = playBin .getVideoSize ();
780+ Dimension dim = playbin .getVideoSize ();
781781 if (dim != null ) {
782782 return dim .height ;
783783 } else {
@@ -793,7 +793,7 @@ protected int getSourceHeight() {
793793 * @return float
794794 */
795795 protected float getSourceFrameRate () {
796- return (float )playBin .getVideoSinkFrameRate ();
796+ return (float )playbin .getVideoSinkFrameRate ();
797797 }
798798
799799
@@ -804,7 +804,7 @@ protected float getSourceFrameRate() {
804804 * @return int
805805 */
806806 protected int getSourceWidth () {
807- Dimension dim = playBin .getVideoSize ();
807+ Dimension dim = playbin .getVideoSize ();
808808 if (dim != null ) {
809809 return dim .width ;
810810 } else {
0 commit comments