MFFrameCreateFromMem Method (MFFactoryClass)
media properties for a frame
pointer to video data
number of audio samples
pointer to audio data
result frame
additional properties to create a frame. For example, a solid color frame can be created with solid_color='Red(255)'
Creates a frame from memory
Syntax
Public Overridable Sub MFFrameCreateFromMem( _
   ByRef _pAVProps As M_AV_PROPS, _
   ByVal _lpVideo As Long, _
   ByVal _lAudioSamples As Integer, _
   ByVal _lpAudio As Long, _
   ByRef _ppFrame As IMFFrame, _
   ByVal _bsPropsList As String _
) 
public virtual void MFFrameCreateFromMem( 
   ref M_AV_PROPS _pAVProps,
   long _lpVideo,
   int _lAudioSamples,
   long _lpAudio,
   out IMFFrame _ppFrame,
   string _bsPropsList
)
public procedure MFFrameCreateFromMem( 
   var  _pAVProps: M_AV_PROPS;
    _lpVideo: Int64;
    _lAudioSamples: Integer;
    _lpAudio: Int64;
   Out  _ppFrame: IMFFrame;
    _bsPropsList: String
); virtual; 
public: virtual void MFFrameCreateFromMem( 
   ref M_AV_PROPS _pAVProps,
   long _lpVideo,
   int _lAudioSamples,
   long _lpAudio,
   [PARAMFLAG::Out] IMFFrame* _ppFrame,
   BSTR* _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)'
Example

Here is an example of how to send a frame to a preview:

m_objPreview = new MFPreviewClass();
//Configure preview
m_objPreview.PreviewWindowSet("", panelPreview.Handle.ToInt32());
m_objPreview.PreviewEnable("", 1, 1);
M_AV_PROPS m_avProps = new M_AV_PROPS(); // set video format for conversion
m_avProps.vidProps.eVideoFormat = eMVideoFormat.eMVF_HD1080_5994i;
MFFrame pFrame = null;
// Get next frame or frame by position
MFFactoryClass factory = new MFFactoryClass();
MFFrame frame;
factory.MFFrameCreateFromMem(ref m_avProps, pointerToVideo, _lAudioSamples, pointerToAudio, out frame);
m_objPreview.ReceiverFramePut(frame, -1, ""); // show the frame on preview
See Also

Reference

MFFactoryClass Class
MFFactoryClass Members