Retrieves the preferred media source handler's GUID set using the SetPreferredMediaSourceHandler method.
public virtual string GetPreferredMediaSourceHandler(
PreferredMediaSourceHandler MediaSourceHandlerType
)
Public Overridable Function GetPreferredMediaSourceHandler( _
ByVal MediaSourceHandlerType As PreferredMediaSourceHandler _
) As String
public:
virtual String^ GetPreferredMediaSourceHandler(
PreferredMediaSourceHandler MediaSourceHandlerType
)
MediaSourceHandlerType
A PreferredMediaSourceHandler enumeration value specifying the desired media source handler type
A string containing a media source handler's GUID.
This method can be used to determine whether a preferred media source handler has been set by SetPreferredMediaSourceHandler. It will return NULL (if no preferred media source handler has been set) or a GUID indicating the preferred media source handler. This GUID uniquely identifies the media source handler. Every media format has a registered media source handler(s) who are responsible of creating a media source for this media type.
For example, the GUID for the LEAD MPEG2 Transport Media Source Handler is: EFE626C3-0A2C-49FA-8A01-3768B559B6DA
A list of display names for common media source handlers can be found in Constants.PreferredMediaSourceHandlers.
Please see SetPreferredMediaSourceHandler for more information on media source handler display names.
using Leadtools;
using Leadtools.MediaFoundation;
using LeadtoolsMediaFoundationExamples.Fixtures;
public bool _result = false;
public ConvertCtrlForm _form = new ConvertCtrlForm();
public void ConverterPreferredMediaSourceHandlersExample()
{
ConvertCtrl convertCtrl = _form.ConvertCtrl;
try
{
// set the preferred MPEG2Transport media source handler to the LEAD default (which is the LEAD MPEG2 Transport Media Source handler)
convertCtrl.SetPreferredMediaSourceHandler(PreferredMediaSourceHandler.MPEG2Transport, Constants.PreferredMediaSourceHandlers.LEADDefault);
// the default MPEG2Transport media source should be the LEAD MPEG2 Transport Media Source handler now
_result = (string.Compare(convertCtrl.GetPreferredMediaSourceHandler(PreferredMediaSourceHandler.MPEG2Transport),
Constants.PreferredMediaSourceHandlers.MPEG2Program, true) == 0);
}
catch (Exception)
{
_result = false;
}
}
Imports Leadtools
Imports Leadtools.MediaFoundation
Imports LeadtoolsMediaFoundationExamples.Fixtures
Public _result As Boolean = False
Public _form As ConvertCtrlForm = New ConvertCtrlForm()
Public Sub ConverterPreferredMediaSourceHandlersExample()
Try
' reference the forms capture control
Dim convertCtrl As ConvertCtrl = _form.ConvertCtrl
' set the preferred MPEG2Transport media source handler to the LEAD default (which is the LEAD MPEG2 Transport Media Source handler)
convertCtrl.SetPreferredMediaSourceHandler(PreferredMediaSourceHandler.MPEG2Transport,
Leadtools.MediaFoundation.Constants.PreferredMediaSourceHandlers.LEADDefault)
' the default MPEG2Transport media source should be the LEAD MPEG2 Transport Media Source handler now
_result = (String.Compare(convertCtrl.GetPreferredMediaSourceHandler(PreferredMediaSourceHandler.MPEG2Transport),
Leadtools.MediaFoundation.Constants.PreferredMediaSourceHandlers.MPEG2Transport, True) = 0)
Catch e1 As Exception
_result = False
End Try
End Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document