ImageGear for C and C++ on Linux v18.8 - Updated
IG_mult_open_FD
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multimedia Functions > IG_mult_open_FD

This function creates a multimedia instance from a file descriptor.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_mult_open_FD(
        AT_INT fd, 
        LPHIGMULT lphMult
);

Arguments:

Name Type Description
fd AT_INT File descriptor.
lphMult LPHIGMULT Handle to multimedia instance.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
/* Get a multimedia file's duration using a file descriptor */
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGMULT hMult;          /* Multimedia instance handle */
LPCSTR szFile;          /* Name of file to open */
HANDLE fd;              /* File descriptor */
AT_UINT numFrames;      /* Total number of frames in file */
AT_UINT duration;       /* Duration of file in milliseconds */
fd = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
nErrcount = IG_mult_open_FD(fd, &hMult);
nErrcount = IG_mult_duration_get(hMult, &numFrames, &duration);
nErrcount = IG_mult_close(hMult);
CloseHandle(fd);

Remarks:

The file descriptor and contents must remain accessible until the multimedia instance is closed.