MCL Source Code - Delphi Part, Programmer's Manual

 

About MCL Source Code - Delphi Part

Delphi part of MCL Source Code consist of more then 60,000 lines of source code written in Delphi and assembler. This code unifies libraries in C part, adds extra file formats, dialogs, image manipulation functions, audio functions, file collection routines and format conversion functions. It also contains helper and general-purpose units that extend available VCL, string, math, graphics and audio functions.

 

Included in the Delphi Part

Multimedia formats supported:

  • AVI - Windows Audio Video Interleaved
  • BMP - Windows Device Independent Bitmap, 8/15/24/32bit
  • FLC - Autodesk FLIC/FLIC-Pro, 8bit
  • GIF - Graphics Interchange Format (read only)
  • PCX - Zsoft Paintbrush, 8/24bit
  • PNM - Portable Image, 8/15/24bit
  • RAS - Sun Raster Image, 8/24/32bit
  • RGB - Silicon Graphics Image, 8/24/32bit
  • TGA - Truevision Targa, 8/15/24/32bit
  • WAV - Windows Wave Sound

Image filters / manipulations:

  • Color Correction
    • Brightness
    • Contrast
    • Gamma Correction
    • Hue
    • Saturation
    • Solarize
    • Swap RB
    • White Balance
  • Sharpen/Blur
    • Blur
    • Chaos
    • Edge Enhance
    • Find Edges
    • Pixelize
    • Sharpen
    • Soften
    • Trace Contour
  • Geometry
    • Crop
    • Deinterlace
    • Flip Horizontally
    • Flip Vertically
    • Rotate
    • Resize
    • Resample
  • Mixing
    • Insert
    • Blend
    • Transparent
    • Average
  • Color Conversion
    • Convert Color Depth
    • Remap
  • Transition Effects
    • Crossfade
    • Pixelize
    • Push
    • Slide
    • Slide Corners
    • Wipe
    • Wipe Lines
    • Zoom

High level multimedia functions:

  • Conversion from one format to another (support for several formats rarely found in other libraries)
  • Adding audio to video
  • Extracting video or audio from a movie
  • Converting images to video
  • Decompiling video back to separate images
  • Changing frame rate with or without changing the video speed
  • Speeding up / slowing down video
  • Resizing video proportionally or disproportionally
  • Cropping unwanted borders around the picture
  • Quick rotation for 90, 180 or 270 degrees
  • Source video can be loaded from disk or generated directly in memory
  • Functions for low level function on certain file formats
  • Custom image processing
  • Custom audio processing
  • Creating 8-bit color palette
  • Transition effects for multiple video sources

Helper units contain additional functionality. Description of all the folders:

  • mcl - Source code and precompiled DLL of MCL
  • mcl\doc - The same help files available in commercial MCL package
  • mcl\include - header files for Delphi, Visual-C, Visual Basic, Borland-C and GCC including import libraries and scripts to generate these libraries
  • mcl\example - The same examples for various development tools that comes with commercial MCL package
  • ro - Code for supporting multimedia file formats and image manipulations with accompanying low level functions on files and data
  • ze - VCL extras, shell, disk, string and helper image functions
  • bh - File format dialogs dialogs

 

Compiling

MCL DLL is already precompiled, but if you make changes to Delphi code you'll need to recompile.

To compile Delphi code load the project file MCL.DPR into Delphi 7 or compatible. Alternatively, you can use DCC32.EXE command-line compiler.

Conditional defines that are present in the shipped project file "mcl.dpr":

  • DEF_DEBUG - Enables debugging information to be displayed at program start and exit.
  • DEF_MCL_DVL - Should always be defined when compiling MCL itself, but not when including "mcldef.pas" in other projects (directly, without the DLL).
  • DEF_MPEGLA_ENABLE - Enables support for MPEG-2 video decoding/encoding and MPEG-4 video encoding. Note that you must get a separate license for products you create with MCL (MCL Source Code) that use MPEG-2 encoding. The library itself doesn't need any special licenses because it's an intermediate product, but end-user products need a license from MPEG-2 patent holders to legally use this video format.
  • DEF_WMLA_ENABLE - Enables support for Window Media Video encoding and Window Media Audio encoding. Note that you must get a separate license for products you create with MCL (MCL Source Code) that use Windows Media encoding. The library itself doesn't need any special licenses because it's an intermediate product, but end-user products need a license from Microsoft to legally use this formats.

 

Usage

MCL consists of several DLLs (dynamic-link libraries). Your application must "see" them before it can use them. A DLL is visible to an application if:

  • It is copied to the same folder as the application
  • It is copied to Windows or Windows\System folder
  • It is in folder that is added to the PATH variable in AUTOEXEC.BAT (don't forget to restart Windows after changing AUTOEXEC.BAT)

The only MCL library file really required is mcl.dll, located in the mcl folder. However, that file has support for only a few multimedia formats. Most of the formats are supported through additional DLLs. These DLLs are present in mclsource\c\_DLL_ folder, so you should add that folder to the PATH environment variable. To support all available formats, copy all the DLLs from the above mentioned folders to your application's folder. Or make them visible by using the PATH variable. These DLLs should also be distributed with your application.

If C libraries have been changed and their version updated, new include files will be generated in mclsource\c\_DELPHI_INCLUDE_ folder. For the Delphi code to recognize the updated DLL names, you must copy the .inc files from the above mentioned folder to the mclsource\mcl\ro folder. Just overwrite the old .inc files. This is necessary only if the file name of any of the C DLLs is changed. For example, if you change the name of the Ogg Vorbis library from "libogg-1.0.0.dll" to "libogg-1.0.1.dll".

 

Gromada.com