Oracle interMedia Audio, Image, and Video Java Classes User's Guide and Reference
Release 8.1.7

Part Number A85374-01

Library

Product

Contents

Index

Go to previous page Go to next page

5
ORDVideo Reference Information

interMedia Java Classes describes the ORDVideo object type, which supports the storage and management of video data.

Methods invoked at the ORDVideo level that are handed off for processing to the database source plug-in or database format plug-in have byte[ ] ctx[ ] as a context parameter. In cases where a client system is connecting to a database server, the space for the parameter is created by the client (in the reference examples, 4000 bytes of space), but the content of the context parameter is generated by the server. The context parameter is passed from the client to the server for the processing of context information.


Note:

In the current release, not all source plug-ins or format plug-ins will use or generate the context parameter, but if you include the parameter as previously described, your application should work with any current or future source plug-ins or format plug-ins. 


See Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

5.1 Prerequisites

You will need to include the following import statements in your Java file in order to run interMedia methods:

import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
import oracle.sql.*;
import oracle.ord.im.*;

The examples in this reference chapter are based on the assumption that the following operations have already been performed:

For examples of making a connection and populating a local object, see Section 2.3.2.

5.2 Reference Information

This section presents reference information on the methods that operate on ORDVideo objects.


checkProperties( )

Format

public boolean checkProperties(byte[ ] ctx[ ])

Description

Checks if the properties stored in the object attributes of the application ORDVideo object are consistent with the values stored in the application BLOB data.

Parameters

ctx[ ]

The format plug-in context information. It is set to NULL if there is no context information.

Return Value

This method returns TRUE if the attribute values stored in the object attributes are the same as the properties stored in the BLOB data; FALSE otherwise.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
if(vidObj.checkProperties(ctx))
     System.out.println("checkProperties successful");

where:


clearLocal( )

Format

public void clearLocal( )

Description

Clears the source local field of the application ORDVideo object.

Parameters

None.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.clearLocal( );


closeSource( )

Format

public int closeSource(byte[ ] ctx[ ])

Description

Closes the file source of the application ORDVideo object.

Parameters

ctx[ ]

The source plug-in context information. It is set to NULL if there is no context information.

Return Value

This method returns 0 if the operation is successful, or an integer greater than 0 in case of failure.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
int i = vidObj.closeSource(ctx);
if(i == 0)
     System.out.println("closeSource successful");

where:


deleteContent( )

Format

public void deleteContent( )

Description

Deletes the media data in the application ORDVideo object.

Parameters

None.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.deleteContent( );

export( )

Format

public void export (byte[ ] ctx[ ], String sourceType, String sourceLocation, String sourceName)

Description

Exports the data from the application ORDVideo object to the location specified in the parameters. The location is of the form:

sourceType://sourceLocation/sourceName

This method will work only if you are running Oracle8i database server release 8.1.7 or later.

See Chapter 4 of Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

Parameters

ctx[ ]

The source plug-in context information. It is set to NULL if there is no context information.

sourceType

The source type to which the content will be exported.

sourceLocation

The source location to which the content will be exported.

sourceName

The source name to which the content will be exported.

Return Value

None.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
vidObj.export(ctx,"FILE","VIDEODIR","complete.dat");

where:


getAllAttributes( )

Format

public CLOB getAllAttributes(byte[ ] ctx[ ])

Description

Gets all the attributes from the application ORDVideo object and puts them in a CLOB.

Parameters

ctx[ ]

The format plug-in context information. It is set to NULL if there is no context information.

Return Value

This method returns a CLOB that contains the attribute values of the ORDVideo object.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
CLOB attributes = vidObj.getAllAttributes(ctx);

where:


getAttribute( )

Format

public String getAttribute(byte[ ] ctx[ ], String name)

Description

Gets the value of a specified attribute from the application ORDVideo object as a String.

Parameters

ctx[ ]

The format plug-in context information. It is set to NULL if there is no context information.

name

The name of the attribute to get.

Return Value

This method returns the value of the specified attribute, as a String.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
String attribute = vidObj.getAttribute(ctx, video_duration);

where:


getBFILE( )

Format

public oracle.sql.BFILE getBFILE( )

Description

Gets the BFILE attribute of the application ORDVideo object.

Parameters

None.

Return Value

This method returns the BFILE.

Exceptions

java.sql.SQLException

Example

BFILE videoBFILE = vidObj.getBFILE( );


getBitRate( )

Format

public int getBitRate( )

Description

Gets the bit rate of the application ORDVideo object, in bits per second.

Parameters

None.

Return Value

This method returns the bit rate of the ORDVideo object.

Exceptions

java.sql.SQLException

Example

int bitRate = vidObj.getBitRate( );


getComments( )

Format

public oracle.sql.CLOB getComments( )

Description

Gets the comments from the application ORDVideo object and loads them into a CLOB.

Parameters

None.

Return Value

This method returns a CLOB that contains the comments from the ORDVideo object.

Exceptions

java.sql.SQLException

Example

CLOB comments = vidObj.getComments( );


getCompressionType( )

Format

public String getCompressionType( )

Description

Gets the compression type of the application ORDVideo object as a String.

Parameters

None.

Return Value

This method returns the compression type of the ORDVideo object, as a String.

Exceptions

java.sql.SQLException

Example

String compressionType = vidObj.getCompressionType( );


getContent( )

Format

public oracle.sql.BLOB getContent( )

Description

Gets the LOB locator from the application ORDVideo object.

Parameters

None.

Return Value

This method returns the LOB locator of the application object.

Exceptions

java.sql.SQLException

Example

BLOB localContent = vidObj.getContent( );


getContentInLob( )

Format

public BLOB getContentInLob(byte[ ] ctx[ ], String mimetype[ ], String format[ ])

Description

Gets the content of the application ORDVideo object and puts it in a BLOB.

Parameters

ctx[ ]

The source plug-in context information. It is set to NULL if there is no context information.

mimetype[ ]

The MIME type of the content returned, stored in mimetype[0]

format[ ]

The format of the content returned, stored in format[0].

Return Value

This method returns the LOB content in another LOB locator.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
String mimeType[ ] = new String[1];
mimeType[0] = "audio/x-aiff"
String format[ ] = new String[1];
format[0] = "AIFF"
BLOB localContent = vidObj.getContentInLob(ctx,mimeType,format);

where:


getContentLength( )

Format

public int getContentLength( )

Description

Gets the content length of the media data in the application ORDVideo object.

Parameters

None.

Return Value

This method returns the content length of the media data.

Exceptions

java.sql.SQLException

Example

int contentLength = vidObj.getContentLength( );


getContentLength(byte[ ])

Format

public int getContentLength(byte[ ] ctx[ ])

Description

Gets the content length of the media data in the application ORDVideo object.

Parameters

ctx[ ]

The source plug-in context information. It is set to NULL if there is no context information.

Return Value

This method returns the content length of the media data.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
int contentLength = vidObj.getContentLength(ctx);

where:


getDataInByteArray( )

Format

public byte[ ] getDataInByteArray( )

Description

Gets data from the LOB locator of the application ORDVideo object and puts it in a local byte array.

Parameters

None.

Return Value

This method returns the byte array from which the data will be read.

Exceptions

java.sql.SQLException

java.io.IOException

java.lang.OutOfMemoryError

Example

byte[ ] byteArr = vidObj.getDataInByteArray( );


getDataInFile( )

Format

public boolean getDataInFile(String filename)

Description

Gets data from the LOB locator of the application ORDVideo object and puts it in a local file.

Parameters

filename

The name of the file into which the data will be loaded.

Return Value

This method returns TRUE if loading is successful; FALSE otherwise.

Exceptions

java.sql.SQLException

java.io.IOException

Example

boolean load = vidObj.getDataInFile("output1.dat");
if(load)
     System.out.println("getDataInFile completed successfully");
else
     System.out.println("Error in getDataInFile");

where:


getDataInStream( )

Format

public InputStream getDataInStream( )

Description

Gets data from the LOB locator of the application ORDVideo object and puts it in a local input stream.

Parameters

None.

Return Value

This method returns the input stream from which the data will be read.

Exceptions

java.sql.SQLException

Example

InputStream inpStream = vidObj.getDataInStream( );


getDescription( )

Format

public String getDescription( )

Description

Gets the description attribute of the application ORDVideo object.

Parameters

None.

Return Value

This method returns the description attribute as a String.

Exceptions

java.sql.SQLException

Example

String description = vidObj.getDescription( );


getFormat( )

Format

public String getFormat( )

Description

Gets the format attribute of the application ORDVideo object as a String.

Parameters

None.

Return Value

This method returns the format attribute as a String.

Exceptions

java.sql.SQLException

Example

String format = vidObj.getFormat( );


getFrameRate( )

Format

public int getFrameRate( )

Description

Get the frame rate in the application ORDVideo object, in frames per second.

Parameters

None.

Return Value

This method returns the frame rate of the ORDVideo object, as an integer.

Exceptions

java.sql.SQLException

Example

int frameRate = vidObj.getFrameRate( );


getFrameResolution( )

Format

public int getFrameResolution( )

Description

Gets the frame resolution of the application ORDVideo object, in pixels per inch.

Parameters

None.

Return Value

This method returns the frame resolution of the ORDVideo object.

Exceptions

java.sql.SQLException

Example

int frameResolution = vidObj.getFrameResolution( );


getHeight( )

Format

public int getHeight( )

Description

Gets the height of the application ORDVideo object.

Parameters

None.

Return Value

This method returns the height of the ORDVideo object.

Exceptions

java.sql.SQLException

Example

int height = vidObj.getHeight( );


getMimeType( )

Format

public String getMimeType( )

Description

Gets the MIME type of the application ORDVideo object as a String.

Parameters

None.

Return Value

This method returns the MIME type of the ORDVideo object, as a String.

Exceptions

java.sql.SQLException

Example

String mimeType = vidObj.gtMimeType( );


getNumberOfColors( )

Format

public int getNumberOfColors( )

Description

Gets the number of colors in the application ORDVideo object.

Parameters

None.

Return Value

This method returns the number of colors in the ORDVideo object, as an integer.

Exceptions

java.sql.SQLException

Example

int numberOfColors = vidObj.getNumberOfColors( );


getNumberOfFrames( )

Format

public int getNumberOfFrames( )

Description

Gets the number of frames in the application ORDVideo object.

Parameters

None.

Return Value

This method returns the number of frames in the ORDVideo object, as an integer.

Exceptions

java.sql.SQLException

Example

int numberOfFrames = vidObj.getNumberOfFrames( );


getSource( )

Format

public String getSource( )

Description

Gets the application ORDVideo object source information, including the source location, name, and type.

Parameters

None.

Return Value

This method returns a String containing the object source information.

Exceptions

java.sql.SQLException

Example

String source = viObj.getSource( );


getSourceLocation( )

Format

public String getSourceLocation( )

Description

Gets the application ORDVideo object source location as a String.

Parameters

None.

Return Value

This method returns a String containing the object source location.

Exceptions

java.sql.SQLException

Example

String location = vidObj.getSourceLocation( );


getSourceName( )

Format

public String getSourceName( )

Description

Gets the application ORDVideo object source name as a String.

Parameters

None.

Return Value

This method returns a String containing the object source name.

Exceptions

java.sql.SQLException

Example

String name = vidObj.getSourceName( );


getSourceType( )

Format

public String getSourceType( )

Description

Gets the application ORDVideo object source location as a String.

Parameters

None.

Return Value

This method returns a String containing the object source type.

Exceptions

java.sql.SQLException

Example

String type = vidObj.getSourceType( );


getUpdateTime( )

Format

public java.sql.Timestamp getUpdateTime( )

Description

Gets a Timestamp object that contains information on when the application ORDVideo object was most recently updated.

Parameters

None.

Return Value

This method returns a Timestamp object that contains the time of the most recent update.

Exceptions

java.sql.SQLException

Example

Timestamp time = audObj.getUpdateTime( );


getVideoDuration( )

Format

public int getVideoDuration( )

Description

Gets the video duration of the application ORDVideo object.

Parameters

None.

Return Value

This method returns the video duration of the ORDVideo object.

Exceptions

java.sql.SQLException

Example

int videoDuration = vidObj.getVideoDuration( );


getWidth( )

Format

public int getWidth( )

Description

Gets the width of the application ORDVideo object.

Parameters

None.

Return Value

This method returns the width of the ORDVideo object.

Exceptions

java.sql.SQLException

Example

int width = vidObj.getWidth( );


importData( )

Format

public void importData(byte[ ] ctx[ ])

Description

Imports data from an external source into the application ORDVideo object.

The srcType, srcLocation, and srcName attributes must all be defined for this method to work.

Parameters

ctx[ ]

The source plug-in context information. It is set to NULL if there is no context information.

Return Value

None.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
vidObj.importData(ctx);

where:


importFrom( )

Format

public void importFrom(byte[ ] ctx[ ], String sourceType, String sourceLocation, String sourceName)

Description

Imports data from an external source into the application ORDVideo object. The location of the external source is of the form:

sourceType://sourceLocation/sourceName

Parameters

ctx[ ]

The source plug-in context information. See Chapter 4 of Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

sourceType

The source type from which the data will be imported.

sourceLocation

The source location from which the data will be imported.

sourceName

The source name from which the data will be imported.

Return Value

None.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
vidObj.importFrom(ctx,"FILE","VIDEODIR","testvid.dat");

where:


isLocal( )

Format

public boolean isLocal( )

Description

Checks if the application ORDVideo object local attribute is set.

Parameters

None.

Return Value

This method returns TRUE if the ORDVideo object local attribute is set; FALSE otherwise.

Exceptions

java.sql.SQLException

Example

if(vidObj.isLocal( ))
     System.out.println("local attribute is set to true");
else
     System.out.println("lcoal attribute is set to false");


loadDataFromByteArray( )

Format

public boolean loadDataFromByteArray(byte[ ] byteArr)

Description

Loads data from the local byte buffer into the database ORDVideo object LOB locator and into the application object. It also calls setLocal( ), which sets the local field of the application ORDVideo object, but not the database object, and setUpdateTime(null), which sets the updateTime attribute to the SYSDATE of the database server.

Parameters

byteArr

The name of the local byte array from which to load data.

Return Value

This method returns TRUE if loading is successful; FALSE otherwise.

Exceptions

java.sql.SQLException

java.io.IOException

Example

byte[ ] data = new byte[32000];
FileInputStream fStream = new FileInputStream("testvid.dat");
fStream.read(data,0,32300);
boolean success = vidObj.loadDataFromByteArray(data);
if(success)
     System.out.println("loadDataFromByteArray was successful");
else
     System.out.println("loadDataFromByteArray was unsuccessful");

where:


loadDataFromFile( )

Format

public boolean loadDataFromFile(String filename)

Description

Loads data from the local file buffer into the database ORDVideo object LOB locator and into the application object. It also calls setLocal( ), which sets the local field of the application ORDVideo object, but not the database object, and setUpdateTime(null), which sets the updateTime attribute to the SYSDATE of the database server.

Parameters

filename

The name of the local file from which to load data.

Return Value

This method returns TRUE if loading is successful; FALSE otherwise.

Exceptions

java.sql.SQLException

java.io.IOException

Example

vidObj.loadDataFromFile("testvid.dat");

where:


loadDataFromInputStream( )

Format

public boolean loadDataFromInputStream(InputStream inpStream)

Description

Loads data from the local input stream into the database ORDVideo object LOB locator and into the application object. It also calls setLocal( ), which sets the local field of the application ORDVideo object, but not the database object, and setUpdateTime(null), which sets the updateTime attribute to the SYSDATE of the database server.

Parameters

inpStream

The name of the local input stream from which to load data.

Return Value

This method returns TRUE if loading is successful; FALSE otherwise.

Exceptions

java.sql.SQLException

java.io.IOException

Example

FileInputStream fStream = new FileInputStream("testvid.dat");
vidObj.loadDataFromInputStream(fStream);

where:


openSource( )

Format

public int openSource(byte[ ] userarg, byte[ ] ctx[ ])

Description

Opens the file source of the application ORDVideo object.

Parameters

userarg

Permission-related parameters that are supplied by the user, such as READONLY. These may be used by user-defined source plug-ins.

ctx[ ]

The parameter for passing the context information of the caller. See Chapter 4 of Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

Return Value

This method returns 0 if the operation is successful, or an integer greater than 0 in case of failure.

Exceptions

java.lang.Exception

Example

byte[ ] userarg = new byte[4000];
byte[ ] ctx[ ] = new byte[4000][1];
int i = audObj.openSource(userarg,ctx);
if(i == 0)
     System.out.println("openSource successful");
else
     System.out.println("openSource unsuccessful");

where:


OrdVideo( )

Format

public OrdVideo( )

Description

Creates an ORDVideo object.

This method is the default ORDVideo constructor.

Parameters

None.

Return Value

None.

Exceptions

None.

Example

None.


processSourceCommand( )

Format

public byte[ ] processSourceCommand(byte[ ] ctx[ ], String command, String args, byte[ ] result[ ])

Description

Processes the specified command on the application ORDVideo object by calling the database processSourceCommand( ) method.

Parameters

ctx[ ]

The source plug-in context information. See Chapter 4 of Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

command

The command to be executed.

args

The arguments of the command to be executed.

result[ ]

The results of the command.

Return Value

This method returns the results of executing the command.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
String command;
String arguments;
byte[ ] result;
//assign a command value to command
//assign any arguments to args
byte[ ] commandResults = vidObj.processSourceCommand(ctx,command,
     arguments,result);

where:


processVideoCommand( )

Format

public byte[ ] processVideoCommand(byte[ ] ctx[ ], String command, String args, byte[ ] result[ ])

Description

Processes the specified command on the application ORDVideo object by calling the database processVideoCommand( ) method.

Parameters

ctx[ ]

The format plug-in context information. It is set to NULL if there is no context information.

command

The command to be executed.

args

The arguments of the command to be executed.

result[ ]

The results of the command.

Return Value

This method returns the results of executing the command.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1]
String command;
String arguments;
byte[ ] result;
//assign a command value to command
//assign any arguments to args
byte[ ] commandResults = vidObj.processVideoCommand(ctx,command,
     arguments,result);

where:


readFromSource( )

Format

public int readFromSource(byte[ ] ctx[ ], int startpos, int numbytes, byte[ ] buffer)

Description

Reads data from the comments field of the application ORDVideo object.

Parameters

ctx[ ]

The source plug-in context information. See Chapter 4 of Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

startpos

The initial position in the comments field.

numbytes

The number of bytes to be read.

buffer

The buffer into which the content will be read.

Return Value

This method returns the number of bytes read.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
byte[ ] commentBuffer = new byte[12];
int i = vidObj.readFromSource(ctx,0,12,commentBuffer);

where:


setBitRate( )

Format

public void setBitRate(int bitRate)

Description

Sets the bit rate of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

bitRate

The bit rate to be set in the ORDVideo object, in bits per second.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setBitRate(1500);

where:


setComments( )

Format

public void setComments(oracle.sql.CLOB comments)

Description

Sets the comments in the application ORDVideo object.

The comments attribute is reserved for use by interMedia. You can set your own value, but it could be overwritten by interMedia Annotator.

Parameters

comments

A CLOB that contains comments for the ORDVideo object.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setComments(commentsData);

where:


setCompressionType( )

Format

public void setCompressionType(String CompressionType)

Description

Sets the compression type of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

CompressionType

The compression type of the ORDVideo object, as a String.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setCompressionType("Cinepak");

where:


setDescription( )

Format

public void setDescription(String description)

Description

Sets the description attribute of the application ORDVideo object.

Parameters

description

A String that describes the contents of the ORDVideo object.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setDescription("My video file");

where:


setFrameRate( )

Format

public void setFrameRate(int frameRate)

Description

Sets the frame rate of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

frameRate

The frame rate to be set in the ORDVideo object, in frames per second.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setFrameRate(5);

where:


setFrameResolution( )

Format

public void setFrameResolution(int frameResolution)

Description

Sets the frame resolution of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

frameResolution

The frame resolution to be set in the ORDVideo object.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setFrameResolution(4);

where:


setFormat( )

Format

public void setFormat(String format)

Description

Sets the format attribute of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

format

The format of the contents of the ORDVideo object, as a String.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setFormat("MOOV");

where:


setHeight( )

Format

public void setHeight(int height)

Description

Sets the height of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

height

The height of the ORDVideo object, in pixels.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setHeight(24);

where:


setKnownAttributes( )

Format

public void setKnownAttributes(String knownformat, String knownwidth, String knownheight,
int knownframeresolution, int knownframerate, int knownvideoduration,
int knownnumberofframes, String knowncompressiontype,
int knownnumberofcolors, int knownbitrate

Description

Sets the known attributes of the application ORDVideo object.

setProperties( ) will automatically set these attributes; use this method only if you are not using setProperties( ). Also, this method will set only the attribute values; it does not change the media file itself.

Parameters

knownformat

The video data format.

knownwidth

The video width.

knownheight

The video height.

knownframeresolution

The frame resolution.

knownframerate

The frame rate.

knownvideoduration

The video duration.

knownnumberofframes

The number of frames.

knowncompressiontype

The compression type.

knownnumberofcolors

The number of colors.

knownbitrate

The bit rate.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setKnownAttributes("MOOV",1,2,4,5,20,8,"Cinepak",256,1500);

where:


setLocal( )

Format

public void setLocal( )

Description

Sets the source local field of the application ORDVideo object.

Parameters

None.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setLocal( );


setMimeType( )

Format

public void setMimeType(String MimeType)

Description

Sets the MIME type of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

MimeType

The MIME type of the contents of the ORDVideo object, as a String.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setMimeType("video/avi");

where:


setNumberOfColors( )

Format

public void setNumberOfColors(int numberOfColors)

Description

Sets the number of colors in the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

numberOfColors

The number of colors to be set in the ORDVideo object.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setNumberOfColors(256);

where:


setNumberOfFrames( )

Format

public void setNumberOfFrames(int numberOfFrames)

Description

Sets the number of frames in the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

numberOfFrames

The number of frames to be set in the ORDVideo object.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setNumberOfFrames(8);

where:


setProperties(byte[ ][ ])

Format

public void setProperties(byte[ ] ctx[ ])

Description

Reads the video data, extract the attributes, and sets the properties in the application ORDVideo object.

The properties to be set include format, frame size, frame resolution, frame rate, video duration, number of frames, compression type, number of colors, and bit rate.

Parameters

ctx[ ]

The format plug-in context information. It is set to NULL if there is no context information.

Return Value

None.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
vidObj.setProperties(ctx);

where:


setProperties(byte[ ][ ], boolean)

Format

public void setProperties(byte[ ] ctx[ ], boolean setComments)

Description

Reads the video data, extract the attributes, and sets the properties in the application ORDVideo object.

The properties to be set include format, frame size, frame resolution, frame rate, video duration, number of frames, compression type, number of colors, and bit rate.

Parameters

ctx[ ]

The format plug-in context information. It is set to NULL if there is no context information.

setComments

A Boolean value to determine whether or not to set the comments in the ORDAudio object. If TRUE, the comments field is populated with a set of format and application properties of the audio object in XML. If FALSE, the comments field remains unpopulated. The default value is FALSE.

Return Value

None.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
vidObj.setProperties(ctx,true);

where:


setSource( )

Format

public void setSource(String sourceType, String sourceLocation, String sourceName)

Description

Sets the application ORDVideo object source information.

Parameters

sourceType

The type of the source.

sourceLocation

The location of the source.

sourceName

The name of the source.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setSource("LOCAL","VIDEODIR","video.dat");

where:


setUpdateTime( )

Format

public void setUpdateTime(java.sql.Timestamp currentTime)

Description

Sets the update time in the application ORDVideo object to the current time.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

currentTime

The current time, which will be set in the ORDVideo object. This value should be NULL; the method will then use the SYSDATE of the database server.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setUpdateTime(null);

setVideoDuration( )

Format

public void setVideoDuration(int videoDuration)

Description

Sets the video duration of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

videoDuration

The video duration of the ORDVideo object.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setVideoDuration(20);

where:


setWidth( )

Format

public void setWidth(int width)

Description

Sets the width of the application ORDVideo object.

setProperties( ) will automatically set this attribute; use this method only if you are not using setProperties( ). Also, this method will set only the attribute value; it does not change the media file itself.

Parameters

width

The width value to be set, in pixels.

Return Value

None.

Exceptions

java.sql.SQLException

Example

vidObj.setWidth(24);

where:


trimSource( )

Format

public int trimSource(byte[ ] ctx[ ], int newLen)

Description

Trims the application ORDVideo file source to the given length.

Parameters

ctx[ ]

The source plug-in context information. It is set to NULL if there is no context information.

newLen

The length to which the source will be trimmed.

Return Value

This method returns 0 if the operation is successful, or an integer greater than 0 in case of failure.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
int i = vidObj.trimSource(ctx,10);
if (i == 0)
     System.out.println("trimSource successful");
else
     System.out.println("trimSource unsuccessful");

where:


writeToSource( )

Format

public int writeToSource(byte[ ] ctx[ ], int startpos, int numbytes, byte[ ] buffer)

Description

Writes data to the comments field of the application ORDVideo object.

Parameters

ctx[ ]

The source plug-in context information. See Chapter 4 of Oracle8i interMedia Audio, Image, and Video User's Guide and Reference for more information.

startpos

The initial position in the comments field.

numbytes

The number of bytes to be written.

buffer

The buffer containing the content to be written.

Return Value

This method returns the number of bytes written.

Exceptions

java.sql.SQLException

Example

byte[ ] ctx[ ] = new byte[4000][1];
byte[ ] data = new byte[20];
//populate data with 20 bytes of content
int i = vidObj.writeToSource(ctx,1,20,data);

where:


Go to previous page Go to next page
Oracle
Copyright © 2000 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index