|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionI am starting out multiple articles that will describe parts of how to use DirectShow.Net. Using the codePlease create a filtergraph first. This part of code is placed behind your .renderstream function.
'************************************* video procamp *********************************************
'new setup mixer control
Dim f_VideoMixerControl As IVMRMixerControl9 = CType(f_VideoMixingRenderer, IVMRMixerControl9)
DsError.ThrowExceptionForHR(hr)
'new setup procamp control
Dim f_VideoMixerProcampControl As VMR9ProcAmpControl
f_VideoMixerProcampControl.dwSize = Marshal.SizeOf(f_VideoMixerProcampControl)
f_VideoMixerProcampControl.dwFlags = 0
hr = f_VideoMixerControl.GetProcAmpControl(0, f_VideoMixerProcampControl)
DsError.ThrowExceptionForHR(hr)
If (f_VideoMixerProcampControl.dwFlags And VMR9ProcAmpControlFlags.Brightness) > 0 Then
Debug.WriteLine("brightness")
End If
If (f_VideoMixerProcampControl.dwFlags And VMR9ProcAmpControlFlags.Contrast) > 0 Then
Debug.WriteLine("constrast")
End If
If (f_VideoMixerProcampControl.dwFlags And VMR9ProcAmpControlFlags.Hue) > 0 Then
Debug.WriteLine("hue")
End If
If (f_VideoMixerProcampControl.dwFlags And VMR9ProcAmpControlFlags.Mask) > 0 Then
Debug.WriteLine("mask")
End If
If (f_VideoMixerProcampControl.dwFlags And VMR9ProcAmpControlFlags.None) > 0 Then
Debug.WriteLine("none")
End If
If (f_VideoMixerProcampControl.dwFlags And VMR9ProcAmpControlFlags.Saturation) > 0 Then
Debug.WriteLine("saturation")
End If
'get procamp control range for brightness
Dim f_VideoMixerProcampRange As VMR9ProcAmpControlRange
f_VideoMixerProcampRange.dwProperty = VMR9ProcAmpControlFlags.Brightness
f_VideoMixerProcampRange.dwSize = Marshal.SizeOf(f_VideoMixerProcampRange)
hr = f_VideoMixerControl.GetProcAmpControlRange(0,f_VideoMixerProcampRange)
DsError.ThrowExceptionForHR(hr)
'set the brightness in ProcAmp , tell that the size has changed
Dim brightpos As Double = 0.1
f_VideoMixerProcampControl.Brightness = CSng(f_VideoMixerProcampRange.MinValue + brightpos * (f_VideoMixerProcampRange.MaxValue - f_VideoMixerProcampRange.MinValue))
'set the new value in ProcAmp to the videomixercontrol
f_VideoMixerProcampControl.dwSize = Marshal.SizeOf(f_VideoMixerProcampControl)
hr = f_VideoMixerControl.SetProcAmpControl(0, f_VideoMixerProcampControl)
DsError.ThrowExceptionForHR(hr)
Points of InterestIt took me 2 years to learn vb.net , half year to learn directshow . and half a day to do ProcAmp. You have to go and read about every command i used if you are a newbie to this. HistoryTis is the first version of this code..
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||