Copying ltmmMediaType Attributes and Data Example for Visual Basic
The following code demonstrates how to copy a media type's attributes and data to another media type.
'
' CopyMediaTypeAttributes
' copies data and attributes from one media type to another
' Dest - destination media type
' Source - source media type
'
Sub CopyMediaTypeAttributes(Dest As ltmmMediaType, Source As ltmmMediaType)
' any format data
If Source.FormatSize > 0 Then
' yes, then copy away
Dest.SetFormatData Source.FormatSize, Source.GetFormatData (Source.FormatSize)
Else
' no, just set the dest to zero
Dest.FormatSize = 0
End If
' copy type
Dest.Type = Source.Type
' copy subtype
Dest.Subtype = Source.Subtype
' copy formattype
Dest.FormatType = Source.FormatType
' copy fixedsizesamples
Dest.FixedSizeSamples = Source.FixedSizeSamples
' copy temporalcompression
Dest.TemporalCompression = Source.TemporalCompression
' copy samplesize
Dest.SampleSize = Source.SampleSize
End Sub