The MediaLink class represents the link between two MediaControl objects and is only used in the GetLink(…) method of the MediaControl class. This class cannot be created.
The MediaLink class only has these four relevant properties:
Property | Data type | Description |
---|---|---|
Input | String | Returns the name of the other side of the link if it is an input. |
Output | String | Returns the name of the other side of the link if it is an output. |
Name | String | Returns the name of the link. |
Peer | MediaControl | Returns the MediaControl on the other side of the link. |
Table 23.9.5.1.1 : Properties of the MediaLink class
Figure 23.9.5.1.1: MediaPipeline with links
The MediaControls are linked in the following source code section in lines 11 and 12. Lines 25 to 46 then show how you can read and display information about the mcConvert control:
[1] Private mpPipeline As MediaPipeline [2] Private mcSource As MediaControl [3] Private mcConvert As MediaControl [4] Private mcSink As MediaControl [5] [6] Public Sub CreateAndPlayPipeline() [7] [8] Dim i As Integer [9] Dim hInputs As String[] [10] Dim hOutputs As String[] [11] [12] mpPipeline = New MediaPipeline As "hPipeline" [13] [14] mcSource = New MediaControl(mpPipeline, "uridecodebin") [15] '-- ["uri"] is a property of the MediaControl 'mcsource' or the Gstreamer element 'uridecodebin'. [16] mcSource["uri"] = ComboBox1.Text [17] mcConvert = New MediaControl(mpPipeline, "audioconvert") [18] mcSink = New MediaControl(mpPipeline, "autoaudiosink") [19] [20] mcSource.LinkLaterTo(mcConvert) [21] mcConvert.LinkTo(mcSink) [22] [23] mpPipeline.Play() [24] [25] hInputs = mcConvert.Inputs [26] For i = 0 To hInputs.Max [27] Print "mcConvert-Input: "; i; hInputs[i] [28] Next [29] hOutputs = mcConvert.Outputs [30] For i = 0 To hOutputs.Max [31] Print "mcConvert-Output: "; i; hOutputs[i] [32] NexthOutputs[i] [33] Next [34] [35] Print "\nMediaLink parameters around the mcConvert input:" [36] Print "------------------------------------------------" [37] Print "Type of mcConvert input: "; mcConvert.GetLink("sink").Name [38] Print "Name of mcConvert MediaControl of other side :"; mcConvert.GetLink("sink").Peer.Name [39] Print "Name of output of other side of mcConvert: "; mcConvert.GetLink("sink").Output [40] [41] [42] Print "\nMediaLink parameters around the mcConvert output:" [43] Print "-------------------------------------------------" [44] Print "Type of mcConvert output: "; mcConvert.GetLink("src").Name [45] Print "Name of mcConvert MediaControl of other side: "; mcConvert.GetLink("src").Peer.Name [46] Print "Name of input of other side of mcConvert: "; mcConvert.GetLink("src").Input
This is the output in the console of the IDE:
mcConvert-Input: 0 sink mcConvert-Output: 0 src MediaLink parameters around the mcConvert input: ------------------------------------------------ Type of mcConvert input: sink Name of mcConvert MediaControl of other side: uridecodebin0 Name of output of other side of mcConvert: src_0 MediaLink parameters around the mcConvert output: ------------------------------------------------- Type of mcConvert output: src Name of mcConvert MediaControl of other side: autoaudiosink0 Name of input of other side of mcConvert: sink