Difference between revisions of "Unit Codec"

From Ultibo.org
Jump to: navigation, search
 
(31 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo Codec interface unit'''
+
'''Ultibo Codec Interface unit'''
 
+
''To be documented''
+
  
 
=== Constants ===
 
=== Constants ===
Line 25: Line 23:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''Codec device type constants''' <code> CODEC_TYPE_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Codec device type''' <code> CODEC_TYPE_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 36: Line 34:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''Codec device state constants''' <code> CODEC_STATE_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Codec device state''' <code> CODEC_STATE_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 50: Line 48:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''Codec device flag constants''' <code> CODEC_FLAG_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Codec device flag''' <code> CODEC_FLAG_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 61: Line 59:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''Codec logging constants''' <code> CODEC_LOG_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Codec logging''' <code> CODEC_LOG_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 70: Line 68:
 
| <code>CODEC_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 
| <code>CODEC_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 
| Codec informational messages, such as a device being attached or detached
 
| Codec informational messages, such as a device being attached or detached
 +
|-
 +
| <code>CODEC_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code>
 +
| Codec warning messages
 
|-
 
|-
 
| <code>CODEC_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
 
| <code>CODEC_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
Line 87: Line 88:
 
'''Codec properties'''
 
'''Codec properties'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
<pre style="border: 0; padding-bottom:0px;">PCodecProperties = ^TCodecProperties;
+
<code>PCodecProperties = ^TCodecProperties;</code>
TCodecProperties = record</pre>
+
 
 +
<code>TCodecProperties = record</code>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 103: Line 105:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>TCodecEnumerate = function(Codec:PCodecDevice;Data:Pointer):LongWord;</code>
+
| <code>TCodecEnumerate = function(Codec:PCodecDevice; Data:Pointer):LongWord;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 112: Line 114:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>TCodecNotification = function(Device:PDevice;Data:Pointer;Notification:LongWord):LongWord;</code>
+
| <code>TCodecNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
  
'''Codec device properties'''
+
'''Codec device get properties'''
  
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>TCodecDeviceProperties = function(Codec:PCodecDevice;Properties:PCodecProperties):LongWord;</code>
+
| <code>TCodecDeviceGetProperties = function(Codec:PCodecDevice; Properties:PCodecProperties):LongWord;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 128: Line 130:
 
'''Codec device'''
 
'''Codec device'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
<pre style="border: 1; padding-bottom:0px;">PCodecDevice = ^TCodecDevice;
+
<code>PCodecDevice = ^TCodecDevice;</code>
TCodecDevice = record</pre>
+
 
 +
<code>TCodecDevice = record</code>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 145: Line 148:
 
|-
 
|-
 
| <code>CodecState:LongWord;</code>
 
| <code>CodecState:LongWord;</code>
| Codec dveice state (eg CODEC_STATE_ENABLED)
+
| Codec device state (eg CODEC_STATE_ENABLED)
 
|-
 
|-
| <code>DeviceProperties:TCodecDeviceProperties;</code>
+
| <code>DeviceGetProperties:TCodecDeviceGetProperties;</code>
| A Device specific DeviceProperties method implementing the standard Codec device interface (Or nil if the default method is suitable)
+
| A Device specific DeviceGetProperties method implementing the standard Codec device interface (Or nil if the default method is suitable)
 
|-
 
|-
 
|colspan="2"|''Driver Properties''
 
|colspan="2"|''Driver Properties''
Line 179: Line 182:
 
|-
 
|-
 
| <code>CODEC_DEFAULT_LOG_LEVEL:LongWord = CODEC_LOG_LEVEL_DEBUG;</code>
 
| <code>CODEC_DEFAULT_LOG_LEVEL:LongWord = CODEC_LOG_LEVEL_DEBUG;</code>
| style="width: 65%;"|Minimum level for Codec messages. Only messages with level greater than or equal to this will be printed.
+
| style="width: 40%;"|Minimum level for Codec messages. Only messages with level greater than or equal to this will be printed.
 
|-
 
|-
 
|}
 
|}
Line 185: Line 188:
 
|-
 
|-
 
| <code>CODEC_LOG_ENABLED:Boolean;</code>
 
| <code>CODEC_LOG_ENABLED:Boolean;</code>
| style="width: 65%;"|
+
| style="width: 40%;"|
 
|-
 
|-
 
|}
 
|}
Line 202: Line 205:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Called only during system startup
 
| Called only during system startup
 
|-
 
|-
Line 212: Line 215:
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function CodecDeviceProperties(Codec:PCodecDevice; Properties:PCodecProperties):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function CodecDeviceGetProperties(Codec:PCodecDevice; Properties:PCodecProperties):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the properties for the specified Codec device</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the properties for the specified Codec device</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Codec'''
+
! Codec
 
| The Codec device to get properties from
 
| The Codec device to get properties from
 
|-
 
|-
! '''Properties'''
+
! Properties
 
| Pointer to a TCodecProperties structure to fill in
 
| Pointer to a TCodecProperties structure to fill in
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 235: Line 238:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new Codec device entry or nil if Codec device could not be created
 
| Pointer to new Codec device entry or nil if Codec device could not be created
 
|-
 
|-
Line 247: Line 250:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size in bytes to allocate for new Codec device (Including the Codec device entry)
 
| Size in bytes to allocate for new Codec device (Including the Codec device entry)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new Codec device entry or nil if Codec device could not be created
 
| Pointer to new Codec device entry or nil if Codec device could not be created
 
|-
 
|-
Line 262: Line 265:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 274: Line 277:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 286: Line 289:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 298: Line 301:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 310: Line 313:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 322: Line 325:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 334: Line 337:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 346: Line 349:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 356: Line 359:
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function CodecGetCount:LongWord; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function CodecGetCount:LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Codec device count</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Codec device count</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 368: Line 371:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function CodecDeviceGetDefault:PCodecDevice; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function CodecDeviceGetDefault:PCodecDevice;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default Codec device</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default Codec device</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 385: Line 388:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 397: Line 400:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 409: Line 412:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 421: Line 424:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure CodecLogWarn(Codec:PCodecDevice; const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 433: Line 448:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 445: Line 460:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Latest revision as of 04:03, 15 December 2022

Return to Unit Reference


Description


Ultibo Codec Interface unit

Constants



[Expand]
Codec specific constants CODEC_*


[Expand]
Codec device type CODEC_TYPE_*


[Expand]
Codec device state CODEC_STATE_*


[Expand]
Codec device flag CODEC_FLAG_*


[Expand]
Codec logging CODEC_LOG_*


Type definitions



Codec properties

[Expand]

PCodecProperties = ^TCodecProperties;

TCodecProperties = record

Codec enumeration callback

TCodecEnumerate = function(Codec:PCodecDevice; Data:Pointer):LongWord;

Codec notification callback

TCodecNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;

Codec device get properties

TCodecDeviceGetProperties = function(Codec:PCodecDevice; Properties:PCodecProperties):LongWord;

Codec device

[Expand]

PCodecDevice = ^TCodecDevice;

TCodecDevice = record


Public variables



Codec logging

CODEC_DEFAULT_LOG_LEVEL:LongWord = CODEC_LOG_LEVEL_DEBUG; Minimum level for Codec messages. Only messages with level greater than or equal to this will be printed.
CODEC_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

[Expand]
procedure CodecInit;
Description: Initialize the Codec unit and Codec device table


Codec device functions

[Expand]
function CodecDeviceGetProperties(Codec:PCodecDevice; Properties:PCodecProperties):LongWord;
Description: Get the properties for the specified Codec device


[Expand]
function CodecDeviceCreate:PCodecDevice;
Description: Create a new Codec device entry


[Expand]
function CodecDeviceCreateEx(Size:LongWord):PCodecDevice;
Description: Create a new Codec device entry


[Expand]
function CodecDeviceDestroy(Codec:PCodecDevice):LongWord;
Description: Destroy an existing Codec device entry


[Expand]
function CodecDeviceRegister(Codec:PCodecDevice):LongWord;
Description: Register a new Codec device in the Codec device table


[Expand]
function CodecDeviceDeregister(Codec:PCodecDevice):LongWord;
Description: Deregister an Codec device from the Codec device table


[Expand]
function CodecDeviceFind(CodecId:LongWord):PCodecDevice;
Description: To be documented


[Expand]
function CodecDeviceFindByName(const Name:String):PCodecDevice; inline;
Description: To be documented


[Expand]
function CodecDeviceFindByDescription(const Description:String):PCodecDevice; inline;
Description: To be documented


[Expand]
function CodecDeviceEnumerate(Callback:TCodecEnumerate; Data:Pointer):LongWord;
Description: To be documented


[Expand]
function CodecDeviceNotification(Codec:PCodecDevice; Callback:TCodecNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented


Codec helper functions

[Expand]
function CodecGetCount:LongWord;
Description: Get the current Codec device count


[Expand]
function CodecDeviceGetDefault:PCodecDevice;
Description: Get the current default Codec device


[Expand]
function CodecDeviceSetDefault(Codec:PCodecDevice):LongWord; 
Description: Set the current default Codec device


[Expand]
function CodecDeviceCheck(Codec:PCodecDevice):PCodecDevice;
Description: Check if the supplied Codec device is in the Codec device table


[Expand]
procedure CodecLog(Level:LongWord; Codec:PCodecDevice; const AText:String);
Description: To be documented


[Expand]
procedure CodecLogInfo(Codec:PCodecDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure CodecLogWarn(Codec:PCodecDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure CodecLogError(Codec:PCodecDevice; const AText:String); inline;
Description: To be documented


[Expand]
procedure CodecLogDebug(Codec:PCodecDevice; const AText:String); inline;
Description: To be documented


Return to Unit Reference