Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, July 18, 2017 3:25:00 PM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

The attached Visual Studio 2017 project illustrates the use of the LEAD Video Callback filter with the LEADTOOLS 19 PlayCtrl in VB.NET. The callback implementation waits until the user indicates they would like a frame, and saves that frame using the LEADTOOLS 19 .NET RasterCodecs class. This project assumes you have installed the LEADTOOLS Imaging Pro SDK and integrated the LEADTOOLS Multimedia SDK into the existing installation. To run the project, please extract it to the following location:
C:\LEADTOOLS 19\Examples\posts\t12246

Note: If you have changed the default installation location, you will need to update the output path to one of the following:
[LEADTOOLS 19]\Bin\Dotnet4\Win32
[LEADTOOLS 19]\Bin\Dotnet4\x64


The project uses a global instance of the callback implementation:
Code:
Private lmvMyUserCallBk As New CallbackFilterClass()
Private lmvMyCallBk As LMVCallbackLib.ILMVCallback


It sets some defaults in the main form load event:
Code:
lmvMyUserCallBk.codecsEngine = codecs
lmvMyUserCallBk.imageCounter = 1
lmvMyUserCallBk.SaveDirectory = txtSaveDirectory.Text


And then adds the callback filter to the PlayCtrl like this:
Code:
   Private Function insertCallbackFilter() As Boolean
      Dim success As Boolean = False
      Dim nIndex As Integer = -1
      Try
         _playctrl.SelectedVideoProcessors.Add(_playctrl.VideoProcessors.Callback)

         lmvMyCallBk = DirectCast(_playctrl.GetSubObject(PlayObject.SelVideoProcessor), LMVCallbackLib.LMVCallback)

         If lmvMyCallBk IsNot Nothing Then
            lmvMyCallBk.ReceiveProcObj = lmvMyUserCallBk
         End If

         success = True
      Catch addFilterException As Exception
         MessageBox.Show("An error has occured in adding the filter" & vbLf & vbLf & addFilterException.Message)
      End Try

      Return success
   End Function


The basic ILMVUserCallback filter implementation looks like this:
Code:
Friend Class CallbackFilterClass
   Implements ILMVUserCallback

   Public Sub ReceiveProc(ByVal pData As Integer, ByVal lWidth As Integer, ByVal lHeight As Integer, ByVal lBitCount As Integer, ByVal lSize As Integer, ByVal bTopDown As Integer) Implements LMVCallbackLib.ILMVUserCallback.ReceiveProc
   End Sub
End Class


A similar example using C# with the CaptureCtrl can be found here:
HOW TO: Capture to MPEG2 with Video Callback Filter for Stills
File Attachment(s):
VB.NET_PlayerCallback.zip (19kb) downloaded 203 time(s).
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.045 seconds.