Java Doc for VideoControl.java in  » 6.0-JDK-Modules » j2me » javax » microedition » media » control » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » javax.microedition.media.control 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.microedition.media.control.VideoControl

All known Subclasses:   com.sun.mmedia.AWTVideoRenderer,  com.sun.mmedia.MIDPVideoRenderer,  com.sun.mmedia.DirectVideo,
VideoControl
public interface VideoControl extends GUIControl(Code)
VideoControl controls the display of video. A Player which supports the playback of video must provide a VideoControl via its getControl and getControls method.


Field Summary
 intUSE_DIRECT_VIDEO
     This defines a mode on how the video is displayed. It is used in conjunction with initDisplayMode.

USE_DIRECT_VIDEO mode can only be used on platforms with LCDUI support.

When USE_DIRECT_VIDEO is specified for initDisplayMode, the arg argument must not be null and must be a javax.microedition.lcdui.Canvas or a subclass of it. In this mode, the video is directly rendered onto the canvas.



Method Summary
 intgetDisplayHeight()
     Return the actual height of the current render video.
 intgetDisplayWidth()
     Return the actual width of the current render video.
 intgetDisplayX()
     Return the X-coordinate of the video with respect to the GUI object where the video is displayed.
 intgetDisplayY()
     Return the Y-coordinate of the video with respective to the GUI object where the video is displayed.
 byte[]getSnapshot(String imageType)
     Get a snapshot of the displayed content.
 intgetSourceHeight()
     Return the height of the source video.
 intgetSourceWidth()
     Return the width of the source video.
 ObjectinitDisplayMode(int mode, Object arg)
     Initialize the mode on how the video is displayed. This method must be called before video can be displayed.

Two modes are defined:

On platforms with LCDUI support, both modes must be supported.
Parameters:
  mode - The video mode that determines how video isdisplayed.
 voidsetDisplayFullScreen(boolean fullScreenMode)
     Set the size of the render region for the video clip to be fullscreen.
 voidsetDisplayLocation(int x, int y)
     Set the location of the video with respect to the canvas where the video is displayed.
 voidsetDisplaySize(int width, int height)
     Resize the video image.

If the video mode is set to USE_DIRECT_VIDEO, setting the size of the video will not affect the size of the GUI object that the video is displayed.

 voidsetVisible(boolean visible)
     Show or hide the video.

If USE_GUI_PRIMITIVE is set, the video by default is shown when the GUI primitive is displayed. If USE_DIRECT_VIDEO is set, the video by default is not shown when the canvas is displayed until setVisible(true) is called.


Field Detail
USE_DIRECT_VIDEO
int USE_DIRECT_VIDEO(Code)
This defines a mode on how the video is displayed. It is used in conjunction with initDisplayMode.

USE_DIRECT_VIDEO mode can only be used on platforms with LCDUI support.

When USE_DIRECT_VIDEO is specified for initDisplayMode, the arg argument must not be null and must be a javax.microedition.lcdui.Canvas or a subclass of it. In this mode, the video is directly rendered onto the canvas. The region where the video is rendered can be set by the setDisplayLocation method. By default, the location is (0, 0). Drawing any graphics or rendering other video at the same region on the canvas may not be supported.

initDisplayMode returns null in this mode.

Here is one sample usage scenario:

 
 javax.microedition.lcdui.Canvas canvas;
 // canvas must be created before being used in the following code.
 try {
 Player p = Manager.createPlayer("http://mymachine/abc.mpg");
 p.realize();
 VideoControl vc;
 if ((vc = (VideoControl)p.getControl("VideoControl")) != null) {
 vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, canvas);
 vc.setVisible(true);
 }
 p.start();
 } catch (MediaException pe) {
 } catch (IOException ioe) {
 }
 
 

Value 1 is assigned to USE_DIRECT_VIDEO.






Method Detail
getDisplayHeight
int getDisplayHeight()(Code)
Return the actual height of the current render video. height of the display video
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.



getDisplayWidth
int getDisplayWidth()(Code)
Return the actual width of the current render video. width of the display video
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.



getDisplayX
int getDisplayX()(Code)
Return the X-coordinate of the video with respect to the GUI object where the video is displayed. The coordinate is specified in pixel values relative to the upper left hand corner of the GUI object.

The return value is undefined if initDisplayMode has not been called. the X-coordinate of the video.




getDisplayY
int getDisplayY()(Code)
Return the Y-coordinate of the video with respective to the GUI object where the video is displayed. The coordinate is specified in pixel values relative to the upper left hand corner of the GUI object.

The return value is undefined if initDisplayMode has not been called. the Y-coordinate of the video.




getSnapshot
byte[] getSnapshot(String imageType) throws MediaException(Code)
Get a snapshot of the displayed content. Features and format of the captured image are specified by imageType. Supported formats can be queried from System.getProperty with video.snapshot.encodings as the key. The first format in the supported list is the default capture format.
Parameters:
  imageType - Format and resolution of the returned image.If null is given, the default capture format is used. image as a byte array in required format.
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.
exception:
  MediaException - Thrown if the requested format is not supported or the Player does not supportsnapshots.
exception:
  SecurityException - Thrown if the caller doesnot have the security permission to take the snapshot.



getSourceHeight
int getSourceHeight()(Code)
Return the height of the source video. The height must be a positive number. the height of the source video



getSourceWidth
int getSourceWidth()(Code)
Return the width of the source video. The width must be a positive number. the width of the source video



initDisplayMode
Object initDisplayMode(int mode, Object arg)(Code)
Initialize the mode on how the video is displayed. This method must be called before video can be displayed.

Two modes are defined:

On platforms with LCDUI support, both modes must be supported.
Parameters:
  mode - The video mode that determines how video isdisplayed. It can be USE_GUI_PRIMITIVE,USE_DIRECT_VIDEO or an implementation-specific mode.
Parameters:
  arg - The exact semantics of this argument isspecified in the respective mode definitions. The exact semantics and type of the object returnedare specified in the respective mode definitions.
exception:
  IllegalStateException - Thrown if initDisplayMode is called again after it has previously been called successfully.
exception:
  IllegalArgumentException - Thrown ifthe mode or arg argument is invalid. mode must beUSE_GUI_PRIMITIVE, USE_DIRECT_VIDEO, or a custom modesupported by this implementation.arg must conform to the conditions defined by the respective mode definitions. Refer to the mode definitions for the required typeof arg.



setDisplayFullScreen
void setDisplayFullScreen(boolean fullScreenMode) throws MediaException(Code)
Set the size of the render region for the video clip to be fullscreen. It is left up to the underlying implementation how fullscreen mode is implemented and what actual dimensions constitutes fullscreen. This is useful when the application does not know the actual width and height dimensions that are needed to make setDisplaySize(width, height) go to fullscreen mode. For example, on a device with a 400 pixel wide by 200 pixel high screen, a video clip that is 50 pixels wide by 100 pixels high in fullscreen mode may be 100 pixels wide by 200 pixels high if the underlying implementation wants to preserve the aspect ratio. In this case, an exception is not thrown.
Parameters:
  fullScreenMode - Indicates whether or not to render in full screen mode
exception:
  MediaException - Thrown if resizing to full screen sizeis not supported.
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.



setDisplayLocation
void setDisplayLocation(int x, int y)(Code)
Set the location of the video with respect to the canvas where the video is displayed.

This method only works when the USE_DIRECT_VIDEO mode is set. In USE_GUI_PRIMITIVE mode, this call will be ignored.

The location is specified in pixel values relative to the upper left hand corner of the GUI object.

By default, video appears at location (0,0).

The location can be given in negative values or can be greater than the actual size of the canvas. When that happens, the video should be clipped to the boundaries of the canvas.
Parameters:
  x - The x coordinate (in pixels) of the video location.
Parameters:
  y - The y coordinate (in pixels) of the video location.
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.




setDisplaySize
void setDisplaySize(int width, int height) throws MediaException(Code)
Resize the video image.

If the video mode is set to USE_DIRECT_VIDEO, setting the size of the video will not affect the size of the GUI object that the video is displayed. If the video is scaled to beyond the size of the GUI object, the video will be clipped.

If the video mode is set to USE_GUI_PRIMITIVE, Scaling the video will also scale the GUI object.

The actual scaling algorithm is left up to the underlying implementation. If the dimensions of the requested display size are smaller than the dimensions of the video clip, some implementations may choose to merely clip the video while other implementations may resize the video.

If the dimensions of the requested display size are bigger than the dimensions of the video clip, some implementations may resize the video while others may leave the video clip in the original size and just enlarge the display region. It is left up to the implementation where the video clip is placed in the display region in this instance (i.e., it can be in the center of the window or in a corner of the window).
Parameters:
  width - Desired width (in pixels) of the display window
Parameters:
  height - Desired height (in pixels) of the display window
exception:
  IllegalArgumentException - Thrown if thegiven width and height arenon-positive values.
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.
exception:
  MediaException - Thrown if resizing is not supported orthe operation failed due to hardware or software limitations.




setVisible
void setVisible(boolean visible)(Code)
Show or hide the video.

If USE_GUI_PRIMITIVE is set, the video by default is shown when the GUI primitive is displayed. If USE_DIRECT_VIDEO is set, the video by default is not shown when the canvas is displayed until setVisible(true) is called. If the canvas is removed from the screen, the video will not be displayed.
Parameters:
  visible - Show the video if true, hide it otherwise.
exception:
  IllegalStateException - Thrown if initDisplayMode has not been called.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.