drastic.mCmdIF
Class VidUtil

java.lang.Object
  extended bydrastic.mCmdIF.VidUtil

public class VidUtil
extends java.lang.Object

Title: VidUtil

Description: QuickClipXO video audio utility structures and functions

Copyright: Copyright © 2003

Company: Drastic Technologies Ltd.
523 The Queensway, Suite 102
Toronto, ON, M8Y 1J7
CANADA
416 255 5636
fax 255 8780
http://www.drastictech.com
engineering@drastictech.com

Version:
1.0
Author:
not attributable

Nested Class Summary
(package private)  class VidUtil.RateScale
          Title: RateScale
 
Field Summary
protected  MEDIACMD Mcmd
           
(package private)  VidUtil.RateScale rateScale
           
 TCXlat tCXlat
           
 
Constructor Summary
VidUtil()
           
 
Method Summary
(package private)  java.lang.String m_strcat(java.lang.String szDest, java.lang.String szValue)
          PORT FROM C++: For Reference Only - Do Not Use Concatinates
 double vidFramesPerSecD(long dwGsVidStandard, long dwRate, long dwScale)
          Number of frames per second for a video standard
 long vidGetSignalFormat(long dwRate, long dwScale, long dwWidth, long dwHeight, boolean fProgressive)
          Returns the nearest signal format for a particular Rate/Scale, size and p/i flag.
 long vidGetSizeFromToken(long dwSize)
          Get a standard size as decimal value (pre shift and mask)
 long vidGetTCType(double ddFrameRate)
          Returns the nearest TC Type for a particular frame rate
 long vidGetTCTypeSignalFormat(long dwGsVidStandard)
          Return a time code type for a particular video standard.
 long vidGetTokenFromSize(long dwSize)
          Get a standard size token from a decimal value (no shift returned)
 long vidImageSize(long dwGsVidStandard, long[] pdwSizeX, long[] pdwSizeY, boolean fFieldSize)
          Standard image sizes for a particular video standard.
 long vidMsPerFrame(long dwGsVidStandard, long dwRate, long dwScale)
          Truncated milliseconds per frame for a vid std
 double vidMsPerFrameD(long dwGsVidStandard, long dwRate, long dwScale)
          Number of milliseconds per frame for a vid std
(package private)  VidUtil.RateScale vidRateScale(long dwGsVidStandard, long pdwRate, long pdwScale)
          Rate and Scale values for supported video standards
 long vidSignalFormatToStr20(long dwGsVidStandard, java.lang.String szDesc)
          PORT FROM C++: For Reference Only - Do Not Use Return a string description of a GS_SIGFORM_xx video standard.
 double vidTCFramesPerSecD(long dwTCType)
          Number of frames per second for a time code type
 long vidTCMsPerFrame(long dwTCType)
          Truncated milliseconds per frame for a time code type
 double vidTCMsPerFrameD(long dwTCType)
          Milliseconds per frame for a time code type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tCXlat

public TCXlat tCXlat

Mcmd

protected MEDIACMD Mcmd

rateScale

VidUtil.RateScale rateScale
Constructor Detail

VidUtil

public VidUtil()
Method Detail

vidRateScale

VidUtil.RateScale vidRateScale(long dwGsVidStandard,
                               long pdwRate,
                               long pdwScale)
Rate and Scale values for supported video standards

Parameters:
dwGsVidStandard - Requested video standard like GS_SIGFORM_NTSC, GS_SIGFORM_NTSC_CCIR, GS_SIGFORM_PAL, GS_SIGFORM_1035i_30X_260M
pdwRate - VVWVIDEO dwRate - 30000, 25, 2997
pdwScale - VVWVIDEO dwScale- 1001, 1, 100
Returns:
0 if rate/scale set, else -1

vidFramesPerSecD

public double vidFramesPerSecD(long dwGsVidStandard,
                               long dwRate,
                               long dwScale)
Number of frames per second for a video standard

Parameters:
dwGsVidStandard - Requested video standard like GS_SIGFORM_NTSC, GS_SIGFORM_NTSC_CCIR, GS_SIGFORM_PAL, GS_SIGFORM_1035i_30X_260M
dwRate - Rate/Scale will override vid standard, set to 0 to ignore
dwScale - Rate/Scale will override vid standard, set to 0 to ignore
Returns:
a floating point frames per second like 29.97xxxxxxx

vidMsPerFrameD

public double vidMsPerFrameD(long dwGsVidStandard,
                             long dwRate,
                             long dwScale)
Number of milliseconds per frame for a vid std

Parameters:
dwGsVidStandard - Requested video standard like GS_SIGFORM_NTSC, GS_SIGFORM_NTSC_CCIR, GS_SIGFORM_PAL, GS_SIGFORM_1035i_30X_260M
dwRate - Rate/Scale will override vid standard, set to 0 to ignore
dwScale - Rate/Scale will override vid standard, set to 0 to ignore
Returns:
floating point ms per frame like 33.3367xxxxx

vidMsPerFrame

public long vidMsPerFrame(long dwGsVidStandard,
                          long dwRate,
                          long dwScale)
Truncated milliseconds per frame for a vid std

Parameters:
dwGsVidStandard - Requested video standard like GS_SIGFORM_NTSC, GS_SIGFORM_NTSC_CCIR, GS_SIGFORM_PAL, GS_SIGFORM_1035i_30X_260M
dwRate - Rate/Scale will override vid standard, set to 0 to ignore
dwScale - Rate/Scale will override vid standard, set to 0 to ignore
Returns:
DWORD ms per frame like 33 or 40

vidTCFramesPerSecD

public double vidTCFramesPerSecD(long dwTCType)
Number of frames per second for a time code type

Parameters:
dwTCType - Requested time code standard like TC2_TCTYPE_FILM, TC2_TCTYPE_NDF, TC2_TCTYPE_DF, TC2_TCTYPE_PAL, TC2_TCTYPE_50, TC2_TCTYPE_5994, TC2_TCTYPE_60, TC2_TCTYPE_NTSCFILM
Returns:
a floating point frames per second like 29.97xxxxxxx

vidGetTCTypeSignalFormat

public long vidGetTCTypeSignalFormat(long dwGsVidStandard)
Return a time code type for a particular video standard. Returns best match, cannot determine DF/NDF or 24/23.98.

Parameters:
dwGsVidStandard - long a GS_SIGFORMFRAMERATE_xxx
Returns:
long a TC2_TCTYPE_xxx

vidTCMsPerFrameD

public double vidTCMsPerFrameD(long dwTCType)
Milliseconds per frame for a time code type

Parameters:
dwTCType - Requested time code standard like TC2_TCTYPE_FILM, TC2_TCTYPE_NDF, TC2_TCTYPE_DF, TC2_TCTYPE_PAL, TC2_TCTYPE_50, TC2_TCTYPE_5994, TC2_TCTYPE_60, TC2_TCTYPE_NTSCFILM
Returns:
floating point ms per frame like 33.3367xxxxx

vidTCMsPerFrame

public long vidTCMsPerFrame(long dwTCType)
Truncated milliseconds per frame for a time code type

Parameters:
dwTCType - Requested time code standard like TC2_TCTYPE_FILM, TC2_TCTYPE_NDF, TC2_TCTYPE_DF, TC2_TCTYPE_PAL, TC2_TCTYPE_50, TC2_TCTYPE_5994, TC2_TCTYPE_60, TC2_TCTYPE_NTSCFILM
Returns:
DWORD ms per frame like 33 or 40

vidGetSizeFromToken

public long vidGetSizeFromToken(long dwSize)
Get a standard size as decimal value (pre shift and mask)

Parameters:
dwSize - long the GS_SIGFORMSIZE_xxx
Returns:
long the numeric value for that flag

vidGetTokenFromSize

public long vidGetTokenFromSize(long dwSize)
Get a standard size token from a decimal value (no shift returned)

Parameters:
dwSize - long The target size
Returns:
long the GS_SIGFORMSIZE_xxx for that size or -1 if error

vidImageSize

public long vidImageSize(long dwGsVidStandard,
                         long[] pdwSizeX,
                         long[] pdwSizeY,
                         boolean fFieldSize)
Standard image sizes for a particular video standard. These are official sizes and do not take into account viewgraphics hd size bug in 1035

Parameters:
dwGsVidStandard - Requested video standard like GS_SIGFORM_NTSC, GS_SIGFORM_NTSC_CCIR, GS_SIGFORM_PAL, GS_SIGFORM_1035i_30X_260M
pdwSizeX - The width of the standard
pdwSizeY - The height of the standard
fFieldSize - Return height of field instead of frame (half for interlaced standards, same for progressive)
Returns:
0 if info returned, else -1

vidGetSignalFormat

public long vidGetSignalFormat(long dwRate,
                               long dwScale,
                               long dwWidth,
                               long dwHeight,
                               boolean fProgressive)
Returns the nearest signal format for a particular Rate/Scale, size and p/i flag.

Parameters:
dwRate - long fps == dwRate / dwScale (eg 25/1 or 30000/1001)
dwScale - long fps == dwRate / dwScale (eg 25/1 or 30000/1001)
dwWidth - long width of the video frame
dwHeight - long height of the videof rame
fProgressive - boolean is is progressive (or segmented frame)
Returns:
long the nearest signal format (GS_SIGFORM_xxx)

vidGetTCType

public long vidGetTCType(double ddFrameRate)
Returns the nearest TC Type for a particular frame rate

Parameters:
ddFrameRate - double standard frames per second like 23.98, 29.97, etc
Returns:
long closes TC2_TCTYPE_

vidSignalFormatToStr20

public long vidSignalFormatToStr20(long dwGsVidStandard,
                                   java.lang.String szDesc)
PORT FROM C++: For Reference Only - Do Not Use Return a string description of a GS_SIGFORM_xx video standard.

Parameters:
dwGsVidStandard - long the GS_SIGFORM_xx value
szDesc - String the string name
Returns:
long 0 or not supported

m_strcat

java.lang.String m_strcat(java.lang.String szDest,
                          java.lang.String szValue)
PORT FROM C++: For Reference Only - Do Not Use Concatinates

Parameters:
szDest - String
szValue - String
Returns:
String