Operates a frame's creation
Methods
MFFrameClone
Gets a clone of the frame. See eMFrameClone for more information about clone types. If _fccPixelFormat is not eMFCC_Default and not the original, then video will be copied even for reference frames. Note: If frame is out-of-prcoess, the clone ALSO out-of-process. You should call MFFrameMakeLocal() for such frames.
Syntax
void MFFrameClone( object _pMFFrame, out IMFFrame _ppFrameClone, eMFrameClone _eCloneType, eMFCC _fccPixelFormat )
Parameters
_pMFFrame - source frame object
_ppFrameClone - result frame
_eCloneType - clone's type
_fccPixelFormat - pixel's format
MFFrameCreateFromFile
Creates a frame from a file
Syntax
void MFFrameCreateFromFile( string _bsFileName, out IMFFrame _ppFrame, string _bsPropsList )
Parameters
_bsFileName - path to source file (JPEG, PNG, BMP or TIFF image)
_ppFrame - result frame
_bsPropsList - additional properties
MFFrameCreateFromHBITMAP
Creates a frame from a HBitmap object
Syntax
void MFFrameCreateFromHBITMAP( long _hBitmap, out IMFFrame _ppFrame, string _bsPropsList )
Parameters
_hBitmap - bitmap handle object
_ppFrame - result frame
_bsPropsList - additional properties
MFFrameCreateFromMem
Creates a frame from memory
Syntax
void MFFrameCreateFromMem( ref M_AV_PROPS _pAVProps, long _lpVideo, int _lAudioSamples, long _lpAudio, out IMFFrame _ppFrame, string _bsPropsList )
Parameters
_pAVProps - media properties for a frame
_lpVideo - pointer to video data
_lAudioSamples - number of audio samples
_lpAudio - pointer to audio data
_ppFrame - result frame
_bsPropsList - additional properties to create a frame. For example, a solid color frame can be created with solid_color='Red(255)'
MFFrameCreateFromMemEx
Extended method to create a frame (MFFrame object) from memory
Syntax
void MFFrameCreateFromMemEx( ref M_AV_PROPS _pAVProps, ref MF_VID_PTR _pVideoPtr, int _lAudioSamples, long _lpAudio, out IMFFrame _ppFrame, string _bsPropsList )
Parameters
_pAVProps - media properties
_pVideoPtr - a structure of video pointer
_lAudioSamples - amount of audio samples
_lpAudio - a pointer to audio data
_ppFrame - result MFFrame object
_bsPropsList - additional properties
MFFrameCreateFromTexture
Creates a MFFrame object from D3D texture
Syntax
void MFFrameCreateFromTexture( ref M_AV_PROPS _pAVProps, object _pD3DTexture2D, int _lAudioSamples, long _lpAudio, out IMFFrame _ppFrame, string _bsPropsList )
Parameters
_pAVProps - media propertoes
_pD3DTexture2D - D3D texture object
_lAudioSamples - amount of audio samples
_lpAudio - a pointer to audio data
_ppFrame - result MFFrame object
_bsPropsList - additional properties
MFFrameCreatePlain
Creates a plain (empty) frame
Syntax
void MFFrameCreatePlain( int _cbVideoSize, out IMFFrame _ppFrame )
Parameters
_cbVideoSize - video data size (for empty frame set it to 0)
_ppFrame - result frame object
MFFrameCreateWrapper
Creates frame from object (e.g. WICBitmapLock, D3D9Surface, MediaSample, NSSBuffer - etc) - just keeps a reference to external object and use memory pointer.
Syntax
void MFFrameCreateWrapper( ref M_VID_PROPS _pVidProps, uint _cbVideo, long _lpVideo, object _pObject, out IMFFrame _ppFrame )
Parameters
_pVidProps - video properties
_cbVideo - video data size
_lpVideo - video data pointer in memory
_pObject - wrapper object
_ppFrame - output frame
MFFrameMakeLocal
Makes a local copy of external frame. For interprocess communication. Before use a frame from another process make sure that you call this method.
Syntax
void MFFrameMakeLocal( object _pMFFrame, out IMFFrame _ppFrameLocal, int _bAlwaysClone )
Parameters
_pMFFrame - source frame object
_ppFrameLocal - result frame
_bAlwaysClone - indicates whether will be a frame's clone created