IWMEncSource.GetSourcePlugin
The GetSourcePlugin method retrieves the source plug-in associated with the source stream.
Syntax
object IWMEncSource.GetSourcePlugin();
Parameters
This method takes no parameters.
Return Values
This method returns an Object type, which contains the source plug-in.
Remarks
You can use this method to retrieve the source plug-ins when you are using HTML as a source (as shown in the following example), or when controlling a digital device.
Example Code
using WMEncoderLib;
try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();
// Retrieve the source group collection and add a source group.
IWMEncSourceGroupCollection SrcGrpColl;
IWMEncSourceGroup SrcGrp;
SrcGrpColl = Encoder.SourceGroupCollection;
SrcGrp = SrcGrpColl.Add("SG_1");
// Add an audio, video, and HTML source.
IWMEncSource SrcAud;
IWMEncVideoSource SrcVid;
IWMEncSource SrcHTML;
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
SrcVid = (IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
SrcHTML = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_FILETRANSFER);
// Use the default audio and video devices.
SrcAud.SetInput("Default_Audio_Device", "Device", "");
SrcVid.SetInput("Default_Video_Device", "Device", "");
// The HTML scheme is FileTransfer, and the resource string is not used.
SrcHTML.SetInput("Placeholdertext", "FileTransfer", "");
// Set the HTML stream to repeat.
SrcHTML.Repeat = true;
// Continue configuring the encoding session, including the profile and
// and broadcast settings.
// Start encoding.
Encoder.Start();
// Retrieve the file transfer plug-in from the HTML source.
object pUnkFileSrcPlugin;
pUnkFileSrcPlugin = SrcHTML.GetSourcePlugin();
IWMEncFileTransferSource FileTransSrc;
object FileTransSrc = (IWMEncFileTransferSource)pUnkFileSrcPlugin;;
// Create a file set, add HTML content, and then send it.
IWMEncFileSet FileSet;
FileSet = FileTransSrc.Add();
FileSet.Add("C:\\HTML\\image.jpg", "https://YourWebSite/image.jpg");
FileTransSrc.Send(FileSet);
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also