Skip Headers

Oracle® interMedia Reference
10g Release 1 (10.1)

Part Number B10829-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Static Methods Unique to the ORDVideo Object Type Relational Interface

This section presents reference information on the interMedia static methods unique to the ORDVideo relational interface.

The relational interface adds interMedia support to video data stored in BLOBs and BFILEs rather than in the ORDVideo object type. The following interface is defined in the ordvspec.sql file:

.
.
.
  -- Static Methods for the relational interface
  STATIC PROCEDURE export(ctx             IN OUT RAW,
                          local_data      IN BLOB,
                          source_type     IN VARCHAR2,
                          source_location IN VARCHAR2,
                          source_name     IN VARCHAR2),
  --
  STATIC PROCEDURE importFrom(ctx             IN OUT RAW,
                              local_data      IN OUT NOCOPY BLOB,
                              source_type     IN VARCHAR2,
                              source_location IN VARCHAR2,
                              source_name     IN VARCHAR2),
 --
  STATIC PROCEDURE importFrom(ctx             IN OUT RAW,
                              local_data      IN OUT NOCOPY BLOB,
                              source_type     IN VARCHAR2,
                              source_location IN VARCHAR2,
                              source_name     IN VARCHAR2,
                              format          OUT VARCHAR2,
                              mime_type       OUT VARCHAR2),
  --
  STATIC PROCEDURE getProperties(ctx            IN OUT RAW,
                                 videoBlob      IN BLOB,
                                 attributes     IN OUT NOCOPY CLOB,
                                 format         IN VARCHAR2),
  --
  STATIC PROCEDURE getProperties(ctx              IN OUT RAW,
                                 videoBlob        IN BLOB,
                                 attributes       IN OUT NOCOPY CLOB,
                                 mimeType         OUT VARCHAR2,
                                 format           IN OUT VARCHAR2,
                                 width            OUT INTEGER,
                                 height           OUT INTEGER,
                                 frameResolution  OUT INTEGER,
                                 frameRate        OUT INTEGER,
                                 videoDuration    OUT INTEGER,
                                 numberOfFrames   OUT INTEGER,
                                 compressionType  OUT VARCHAR2,
                                 numberOfColors   OUT INTEGER,
                                 bitRate          OUT INTEGER),

 --
  STATIC PROCEDURE getProperties(ctx            IN OUT RAW,
                                 videoBfile     IN OUT NOCOPY BFILE,
                                 attributes     IN OUT NOCOPY CLOB,
                                 format         IN VARCHAR2),
  --
  STATIC PROCEDURE getProperties(ctx              IN OUT RAW,
                                 videoBfile       IN OUT NOCOPY BFILE,
                                 attributes       IN OUT NOCOPY CLOB,
                                 mimeType         OUT VARCHAR2,
                                 format           IN OUT VARCHAR2,
                                 width            OUT INTEGER,
                                 height           OUT INTEGER,
                                 frameResolution  OUT INTEGER,
                                 frameRate        OUT INTEGER,
                                 videoDuration    OUT INTEGER,
                                 numberOfFrames   OUT INTEGER,
                                 compressionType  OUT VARCHAR2,
                                 numberOfColors   OUT INTEGER,
                                 bitRate          OUT INTEGER),
.
.
.

Example Video Table Definition

The methods described in this section show examples based on a test video table TVID. Refer to the TVID table definition that follows when reading through the examples:


TVID Table Definition
CREATE TABLE tvid(n NUMBER, 
                  vid BLOB,
                  attributes CLOB,
                  mimetype VARCHAR2(4000),
                  format VARCHAR2(31),
                  width INTEGER,
                  height INTEGER,
                  frameresolution INTEGER,
                  framerate INTEGER,
                  videoduration INTEGER,
                  numberofframes INTEGER,
                  compressiontype VARCHAR2(4000),
                  numberofcolors INTEGER,
                  bitrate INTEGER)
STORAGE (INITIAL 100K NEXT 100K PCTINCREASE 0);

INSERT INTO tvid VALUES(1, EMPTY_BLOB(), EMPTY_CLOB(), NULL, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO tvid VALUES(2, EMPTY_BLOB(), EMPTY_CLOB(), NULL, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
COMMIT;

getProperties( ) for BLOBs

Format

getProperties(ctx IN OUT RAW,

videoBlob IN BLOB,

attributes IN OUT NOCOPY CLOB,

format IN VARCHAR2);

Description

Reads the video BLOB data to get the values of the media attributes for supported formats, and then stores them in the input CLOB. This method populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

videoBlob

The video data represented as a BLOB.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the video BLOB data in XML form.

format

The format of the video data. If a non-NULL value is specified, then the format plug-in for this format type is invoked.

Usage Notes

None.

Pragmas

None.

Exceptions

ORDVideoExceptions.VIDEO_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the video plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

Examples

Get the property information for known video attributes:

DECLARE
  vid_attrib CLOB;
  ctx RAW(64) :=NULL;
  vid_data BLOB;
  vid_format VARCHAR2(31) := NULL;
BEGIN
  SELECT vid, attributes INTO vid_data, vid_attrib FROM tvid WHERE N = 1 FOR UPDATE;
  ORDSYS.ORDVideo.getProperties(ctx, vid_data, vid_attrib, vid_format);

  DBMS_OUTPUT.put_line('Size of XML Annotations ' ||
                   TO_CHAR(DBMS_LOB.GETLENGTH(vid_attrib)));
  UPDATE tvid SET vid=vid_data, attributes=vid_attrib WHERE N=1;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
  RAISE;
END;
/


getProperties( ) (all attributes) for BLOBs

Format

getProperties(ctx IN OUT RAW,

videoBlob IN BLOB,

attributes IN OUT NOCOPY CLOB,

mimeType OUT VARCHAR2,

format IN OUT VARCHAR2

width OUT INTEGER,

height OUT INTEGER,

frameResolution OUT INTEGER,

frameRate OUT INTEGER,

videoDuration OUT INTEGER,

numberOfFrames OUT INTEGER,

compressionType OUT VARCHAR2,

numberOfColors OUT INTEGER,

bitRate OUT INTEGER);

Description

Reads the video BLOB data to get the values of the media attributes for supported formats, and then stores them in the input CLOB and returns them as explicit parameters. This method gets the properties for the following attributes of the video data: MIME type, format, frame size, frame resolution, frame rate, video duration, number of frames, compression type, number of colors, and bit rate. It populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

videoBlob

The video data represented as a BLOB.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the video BLOB data in XML form.

mimeType

The MIME type of the video data.

format

The format of the video data. If a non-NULL value is specified, then the format plug-in for this format type is invoked. If specified as NULL, the format of the video data is returned.

width

The width of the frame in pixels of the video data.

height

The height of the frame in pixels of the video data.

frameResolution

The number of pixels per inch of frames in the video data.

frameRate

The number of frames per second at which the video data was recorded.

videoDuration

The total time required to play the video data.

numberOfFrames

The total number of frames in the video data.

compressionType

The compression type of the video data.

numberOfColors

The number of colors in the video data.

bitRate

The bit rate in the video data.

Usage Notes

If a property cannot be extracted from the media source, then the respective parameter is set to NULL.

Pragmas

None.

Exceptions

ORDVideoExceptions.VIDEO_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the video plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

Examples

Get the property information for known video attributes:

DECLARE
  vid_attrib        CLOB;
  ctx               RAW(64) :=NULL;
  vid_data          BLOB;
  mimeType          VARCHAR2(80);
  format            VARCHAR2(32);
  width             NUMBER;
  height            NUMBER;
  frameResolution   NUMBER;
  frameRate         NUMBER;
  videoDuration     NUMBER;
  numberOfFrames    NUMBER;
  compressionType   VARCHAR2(160);
  numberOfColors    NUMBER;
  bitRate           NUMBER;
BEGIN
  SELECT vid, attributes, mimetype, format, width, height, frameresolution, framerate,
         videoduration, numberofframes, compressiontype, numberofcolors, bitrate INTO
         vid_data, vid_attrib, mimeType, format, width, height, frameResolution,
         frameRate, videoDuration, numberOfFrames, compressionType, numberOfColors,
         bitRate FROM tvid WHERE N = 1 FOR UPDATE;

  ORDSYS.ORDVideo.getProperties(ctx, vid_data, vid_attrib, mimeType, format, 
          width, height, frameResolution, frameRate,
          videoDuration, numberOfFrames, compressionType, numberOfColors, bitRate);

  DBMS_OUTPUT.put_line('Size of XML Annotations ' ||
                   TO_CHAR(DBMS_LOB.GETLENGTH(vid_attrib)));
  DBMS_OUTPUT.put_line('mimeType: ' || mimeType );
  DBMS_OUTPUT.put_line('format: ' || format );
  DBMS_OUTPUT.put_line('width: ' || width );
  DBMS_OUTPUT.put_line('height: ' || height );
  DBMS_OUTPUT.put_line('frameResolution: ' || frameResolution );
  DBMS_OUTPUT.put_line('frameRate: ' || frameRate );
  DBMS_OUTPUT.put_line('videoDuration: ' || videoDuration );
  DBMS_OUTPUT.put_line('numberOfFrames: ' || numberOfFrames );
  DBMS_OUTPUT.put_line('compressionType: ' || compressionType );
  DBMS_OUTPUT.put_line('numberOfColors: ' || numberOfColors );
  DBMS_OUTPUT.put_line('bitRate: ' || bitRate );
  UPDATE tvid SET 
        vid=vid_data, 
        attributes=vid_attrib, 
        mimetype=mimeType, 
        format=format, 
        width=width, 
        height=height, 
        frameresolution=frameResolution, 
        framerate=frameRate, 
        videoduration=videoDuration, 
        numberofframes=numberOfFrames, 
        compressiontype=compressionType, 
        numberofcolors=numberOfColors, 
        bitrate=bitRate 
     WHERE N=1;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
  RAISE;
END;
/


getProperties( ) for BFILEs

Format

getProperties(ctx IN OUT RAW,

videoBfile IN OUT NOCOPY BFILE,

attributes IN OUT NOCOPY CLOB,

format IN VARCHAR2);

Description

Reads the video BFILE data to get the values of the media attributes for supported formats, and then stores them in the input CLOB. This method populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

videoBfile

The video data represented as a BFILE.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the video BFILE data in XML form.

format

The format of the video data. If a non-NULL value is specified, then the format plug-in for this format type is invoked.

Usage Notes

None.

Pragmas

None.

Exceptions

ORDVideoExceptions.VIDEO_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the video plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

Examples

Get the property information for known video attributes:

DECLARE
  vid_attrib CLOB;
  ctx RAW(64) :=NULL;
  vid_data BFILE := BFILENAME('VIDEODIR','testvid.dat');
  vid_format VARCHAR2(160) := NULL;
BEGIN
  DBMS_LOB.CREATETEMPORARY(vid_attrib, FALSE, DBMS_LOB.CALL);
  ORDSYS.ORDVideo.getProperties(ctx, vid_data, vid_attrib, vid_format);

  DBMS_OUTPUT.put_line('Size of XML Annotations ' ||
                   TO_CHAR(DBMS_LOB.GETLENGTH(vid_attrib)));
EXCEPTION
  WHEN OTHERS THEN
  RAISE;
END;
/

getProperties( ) (all attributes) for BFILEs

Format

getProperties(ctx IN OUT RAW,

videoBfile IN OUT NOCOPY BFILE,

attributes IN OUT NOCOPY CLOB,

mimeType OUT VARCHAR2,

format IN OUT VARCHAR2,

width OUT INTEGER,

height OUT INTEGER,

frameResolution OUT INTEGER,

frameRate OUT INTEGER,

videoDuration OUT INTEGER,

numberOfFrames OUT INTEGER,

compressionType OUT VARCHAR2,

numberOfColors OUT INTEGER,

bitRate OUT INTEGER);

Description

Reads the video BFILE data to get the values of the media attributes for supported formats, and then stores them in the input CLOB and returns them as explicit parameters. This method gets the properties for the following attributes of the video data: MIME type, format, frame size, frame resolution, frame rate, video duration, number of frames, compression type, number of colors, and bit rate. It populates the CLOB with an extensive set of format and application properties in XML form.

Parameters

ctx

The format plug-in context information.

videoBfile

The video data represented as a BFILE.

attributes

The CLOB to hold the XML attribute information generated by the getProperties( ) method. This CLOB is populated with an extensive set of format and application properties of the video BFILE data in XML form.

mimeType

The MIME type of the video data.

format

The format of the video data. If a non-NULL value is specified, then the format plug-in for this format type is invoked. If specified as NULL, the format of the video data is returned.

width

The width of the frame in pixels of the video data.

height

The height of the frame in pixels of the video data.

frameResolution

The number of pixels per inch of frames in the video data.

frameRate

The number of frames per second at which the video data was recorded.

videoDuration

The total time required to play the video data.

numberOfFrames

The total number of frames in the video data.

compressionType

The compression type of the video data.

numberOfColors

The number of colors in the video data.

bitRate

The bit rate in the video data.

Usage Notes

If a property cannot be extracted from the media source, then the respective parameter is set to NULL.

Pragmas

None.

Exceptions

ORDVideoExceptions.VIDEO_PLUGIN_EXCEPTION

This exception is raised if you call the getProperties( ) method and the video plug-in raises an exception.

ORDSourceExceptions.EMPTY_SOURCE

This exception is raised when the value of the source.local attribute is 1 or 0 (TRUE), but the value of the source.localData attribute is NULL.

Examples

Get the property information for known video attributes:

DECLARE
  vid_attrib        CLOB;
  ctx               RAW(64) :=NULL;
  vid_data          BFILE := BFILENAME('VIDEODIR','testvid.dat');
  mimeType          VARCHAR2(80);
  format            VARCHAR2(32) := NULL;
  width             NUMBER;
  height            NUMBER;
  frameResolution   NUMBER;
  frameRate         NUMBER;
  videoDuration     NUMBER;
  numberOfFrames    NUMBER;
  compressionType   VARCHAR2(160);
  numberOfColors    NUMBER;
  bitRate           NUMBER;
BEGIN
  DBMS_LOB.CREATETEMPORARY(vid_attrib, FALSE, DBMS_LOB.CALL);

  ORDSYS.ORDVideo.getProperties(ctx, vid_data, vid_attrib, mimeType, format, 
          width, height, frameResolution, frameRate,
          videoDuration, numberOfFrames, compressionType, numberOfColors, bitRate);

  DBMS_OUTPUT.put_line('Size of XML Annotations ' ||
                   TO_CHAR(DBMS_LOB.GETLENGTH(vid_attrib)));
  DBMS_OUTPUT.put_line('mimeType: ' || mimeType );
  DBMS_OUTPUT.put_line('format: ' || format );
  DBMS_OUTPUT.put_line('width: ' || width );
  DBMS_OUTPUT.put_line('height: ' || height );
  DBMS_OUTPUT.put_line('frameResolution: ' || frameResolution );
  DBMS_OUTPUT.put_line('frameRate: ' || frameRate );
  DBMS_OUTPUT.put_line('videoDuration: ' || videoDuration );
  DBMS_OUTPUT.put_line('numberOfFrames: ' || numberOfFrames );
  DBMS_OUTPUT.put_line('compressionType: ' || compressionType );
  DBMS_OUTPUT.put_line('numberOfColors: ' || numberOfColors );
  DBMS_OUTPUT.put_line('bitRate: ' || bitRate );
EXCEPTION
  WHEN OTHERS THEN
  RAISE;
END;
/