Difference between revisions of "Unit Video"

From Ultibo.org
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo Video interface unit'''
+
'''Ultibo Video Interface unit'''
  
 
This unit provides both the Video device interface and the generic USB video device driver.
 
This unit provides both the Video device interface and the generic USB video device driver.
Line 70: Line 70:
 
| <code>VIDEO_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 
| <code>VIDEO_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 
| Video informational messages, such as a device being attached or detached
 
| Video informational messages, such as a device being attached or detached
 +
|-
 +
| <code>VIDEO_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code>
 +
| Video warning messages
 
|-
 
|-
 
| <code>VIDEO_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
 
| <code>VIDEO_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
Line 208: Line 211:
 
{| 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 223: Line 226:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Video'''
+
! Video
 
| The Video device to get properties from
 
| The Video device to get properties from
 
|-
 
|-
! '''Properties'''
+
! Properties
 
| Pointer to a TVideoProperties structure to fill in
 
| Pointer to a TVideoProperties 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 241: Line 244:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new Video device entry or nil if Video device could not be created
 
| Pointer to new Video device entry or nil if Video device could not be created
 
|-
 
|-
Line 253: Line 256:
 
{| 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 Video device (Including the Video device entry)
 
| Size in bytes to allocate for new Video device (Including the Video device entry)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Pointer to new Video device entry or nil if Video device could not be created
 
| Pointer to new Video device entry or nil if Video device could not be created
 
|-
 
|-
Line 268: Line 271:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 280: Line 283:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 292: Line 295:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 304: Line 307:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 316: Line 319:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 328: Line 331:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 340: Line 343:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 352: Line 355:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 362: Line 365:
  
 
<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 VideoGetCount:LongWord; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function VideoGetCount:LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Video device count</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Video 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 374: Line 377:
 
<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 VideoDeviceGetDefault:PVideoDevice; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function VideoDeviceGetDefault:PVideoDevice;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default Video device</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default Video 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 391: Line 394:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 403: Line 406:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 415: Line 418:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 427: Line 430:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 433: Line 436:
 
</div></div>
 
</div></div>
 
<br />  
 
<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 VideoLogWarn(Video:PVideoDevice; 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
 +
|-
 +
|}
 +
</div></div>
 +
<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;">procedure VideoLogError(Video:PVideoDevice; const AText:String); inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">procedure VideoLogError(Video:PVideoDevice; const AText:String); inline;</pre>
Line 439: Line 454:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 451: Line 466:
 
{| 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 02:32, 15 December 2022

Return to Unit Reference


Description


Ultibo Video Interface unit

This unit provides both the Video device interface and the generic USB video device driver.

Constants



Video specific constants VIDEO_*
VIDEO_NAME_PREFIX = 'Video'; Name prefix for Video Devices


Video device types VIDEO_TYPE_*
VIDEO_TYPE_NONE = 0;  


Video device states VIDEO_STATE_*
VIDEO_STATE_DISABLED = 0;  
VIDEO_STATE_ENABLED = 1;  


Video device flags VIDEO_FLAG_*
VIDEO_FLAG_NONE = $00000000;  


Video logging VIDEO_LOG_*
VIDEO_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG; Video debugging messages
VIDEO_LOG_LEVEL_INFO = LOG_LEVEL_INFO; Video informational messages, such as a device being attached or detached
VIDEO_LOG_LEVEL_WARN = LOG_LEVEL_WARN; Video warning messages
VIDEO_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR; Video error messages
VIDEO_LOG_LEVEL_NONE = LOG_LEVEL_NONE; No Video messages


Type definitions



Video properties

PVideoProperties = ^TVideoProperties;

TVideoProperties = record

Flags:LongWord; Device flags (eg VIDEO_FLAG_????)

Video enumeration callback

TVideoEnumerate = function(Video:PVideoDevice; Data:Pointer):LongWord;

Video notification callback

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

Video device get properties

TVideoDeviceGetProperties = function(Video:PVideoDevice; Properties:PVideoProperties):LongWord;

Video device

PVideoDevice = ^TVideoDevice;

TVideoDevice = record

Device Properties
Device:TDevice; The Device entry for this Video device
Video Properties
VideoId:LongWord; Unique Id of this Video device in the Video device table
VideoState:LongWord; Video device state (eg VIDEO_STATE_ENABLED)
DeviceGetProperties:TVideoDeviceGetProperties; A Device specific DeviceGetProperties method implementing the standard Video device interface (Or nil if the default method is suitable)
Statistics Properties
 
Driver Properties
Lock:TMutexHandle; Device lock
Properties:TVideoProperties; Device properties
Internal Properties
Prev:PVideoDevice; Previous entry in Video device table
Next:PVideoDevice; Next entry in Video device table


Public variables



Video logging

VIDEO_DEFAULT_LOG_LEVEL:LongWord = VIDEO_LOG_LEVEL_DEBUG; Minimum level for Video messages. Only messages with level greater than or equal to this will be printed.
VIDEO_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

procedure VideoInit;
Description: Initialize the Video unit and Video device table
Note Called only during system startup


Video device functions

function VideoDeviceGetProperties(Video:PVideoDevice; Properties:PVideoProperties):LongWord;
Description: Get the properties for the specified Video device
Video The Video device to get properties from
Properties Pointer to a TVideoProperties structure to fill in
Return ERROR_SUCCESS if completed or another error code on failure


function VideoDeviceCreate:PVideoDevice;
Description: Create a new Video device entry
Return Pointer to new Video device entry or nil if Video device could not be created


function VideoDeviceCreateEx(Size:LongWord):PVideoDevice;
Description: Create a new Video device entry
Size Size in bytes to allocate for new Video device (Including the Video device entry)
Return Pointer to new Video device entry or nil if Video device could not be created


function VideoDeviceDestroy(Video:PVideoDevice):LongWord;
Description: Destroy an existing Video device entry
Note None documented


function VideoDeviceRegister(Video:PVideoDevice):LongWord;
Description: Register a new Video device in the Video device table
Note None documented


function VideoDeviceDeregister(Video:PVideoDevice):LongWord;
Description: Deregister a Video device from the Video device table
Note None documented


function VideoDeviceFind(VideoId:LongWord):PVideoDevice;
Description: To be documented
Note None documented


function VideoDeviceFindByName(const Name:String):PVideoDevice; inline;
Description: To be documented
Note None documented


function VideoDeviceFindByDescription(const Description:String):PVideoDevice; inline;
Description: To be documented
Note None documented


function VideoDeviceEnumerate(Callback:TVideoEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


function VideoDeviceNotification(Video:PVideoDevice; Callback:TVideoNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note None documented


Video helper functions

function VideoGetCount:LongWord;
Description: Get the current Video device count
Note None documented


function VideoDeviceGetDefault:PVideoDevice;
Description: Get the current default Video device
Note None documented


function VideoDeviceSetDefault(Video:PVideoDevice):LongWord;
Description: Set the current default Video device
Note None documented


function VideoDeviceCheck(Video:PVideoDevice):PVideoDevice;
Description: Check if the supplied Video device is in the Video device table
Note None documented


procedure VideoLog(Level:LongWord; Video:PVideoDevice; const AText:String);
Description: To be documented
Note None documented


procedure VideoLogInfo(Video:PVideoDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure VideoLogWarn(Video:PVideoDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure VideoLogError(Video:PVideoDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure VideoLogDebug(Video:PVideoDevice; const AText:String); inline;
Description: To be documented
Note None documented


Return to Unit Reference