|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprocessing.core.PImage
codeanticode.gsvideo.GSPlayer
public class GSPlayer
This class makes it possible to load and play generic media content through playbin (not only movies, but also audio files, etc).
Field Summary | |
---|---|
byte[] |
data
|
java.lang.String |
dataCaps
|
Fields inherited from class processing.core.PImage |
---|
format, height, parent, pixels, width |
Fields inherited from interface processing.core.PConstants |
---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
Constructor Summary | |
---|---|
GSPlayer(processing.core.PApplet parent,
java.lang.String filename)
Creates an instance of GSPlayer loading the media file from filename and with fps = 30, assuming that it is a video file . |
|
GSPlayer(processing.core.PApplet parent,
java.lang.String filename,
int type)
Creates an instance of GSPlayer loading the media file from filename and with fps = 30, |
|
GSPlayer(processing.core.PApplet parent,
java.lang.String filename,
int ifps,
int type)
Creates an instance of GSPlayer loading the stream from filename and with fps = ifps. |
Method Summary | |
---|---|
boolean |
available()
Return the true or false depending on whether there is a new frame ready to be read. |
void |
delete()
Releases the gstreamer resources associated to this player object. |
void |
dispose()
Same as delete. |
float |
duration()
Get the full length of the current stream (in seconds). |
int |
frame()
Return the current frame. |
void |
frameRate(int ifps)
Set how often new frames are to be read from the stream. |
java.lang.String |
getFilename()
Returns the text string containing the filename of the media loaded. |
float |
getSourceFrameRate()
Get the original framerate of the source video. |
int |
getSourceHeight()
Get the height of the source video. |
int |
getSourceWidth()
Get the width of the source video. |
void |
goToBeginning()
Goes to the first frame of the stream. |
boolean |
isLooping()
Returns whether the media is looping or not. |
boolean |
isPaused()
Returns whether the media is paused or not. |
boolean |
isPlaying()
Returns whether the media is playing or not. |
void |
jump(float where)
Jump to a specific location (in seconds). |
void |
jump(int frame)
Jump to a specific frame. |
long |
length()
Get the full length of this movie (in frames). |
void |
loop()
Begin playing the stream, with repeat. |
void |
noLoop()
Shut off the repeating loop. |
void |
pause()
Pause the stream at its current time. |
void |
play()
Begin playing the stream, with no repeat. |
void |
read()
Reads the current video frame or data buffer. |
void |
setEventHandlerObject(java.lang.Object obj)
Uses a generic object as handler of the media file. |
void |
speed(float irate)
Set a multiplier for how fast/slow the movie should be run. |
void |
stop()
Stop the stream, and rewind. |
float |
time()
Return the current time in seconds. |
void |
volume(float v)
Change the volume. |
Methods inherited from class processing.core.PImage |
---|
blend, blend, blendColor, clone, copy, copy, filter, filter, get, get, get, getCache, getImage, init, isModified, loadPixels, mask, mask, removeCache, resize, save, set, set, setCache, setModified, setModified, updatePixels, updatePixels |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public byte[] data
public java.lang.String dataCaps
Constructor Detail |
---|
public GSPlayer(processing.core.PApplet parent, java.lang.String filename)
parent
- PAppletfilename
- Stringpublic GSPlayer(processing.core.PApplet parent, java.lang.String filename, int type)
parent
- PAppletfilename
- Stringtype
- intpublic GSPlayer(processing.core.PApplet parent, java.lang.String filename, int ifps, int type)
parent
- PAppletfilename
- Stringifps
- inttype
- intMethod Detail |
---|
public void delete()
public void dispose()
public void setEventHandlerObject(java.lang.Object obj)
public int getSourceWidth()
public int getSourceHeight()
public float getSourceFrameRate()
public void frameRate(int ifps)
int
- ifpsspeed
public void speed(float irate)
float
- iratepublic float duration()
public float time()
public long length()
public int frame()
public void jump(float where)
float
- wherepublic void jump(int frame)
frame
- intpublic boolean available()
public boolean isPlaying()
public boolean isPaused()
public boolean isLooping()
public void play()
public void loop()
public void noLoop()
public void pause()
public void stop()
public void read()
public void goToBeginning()
public void volume(float v)
float
- vpublic java.lang.String getFilename()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |