[Gambas-user] Video from Class feeds a DrawingArea problem

Gianluigi bagonergi at ...626...
Thu Aug 10 22:49:36 CEST 2017


http://gambas.8142.n7.nabble.com/Video-from-Class-feeds-a-DrawingArea-problem-td59987.html

Hi Ingo,
I think you can solve the problem with this code [0][1] from Vuott
Gambas-it.org member.
If you want, you can also join our Forum and ask questions in English.

[0]----------------code in FMain:

Public vc As VideoClass


Public Sub Button1_Click()

 vc = New VideoClass

 vc.drwArea.Refresh()

End

[1]----------------code in VideoClass.class:

Public hPipe As MediaPipeline
Public hSource As MediaControl
Public hSink As MediaControl
Public hdrwVideo As DrawingArea
Property {drwArea} As DrawingArea


Public Sub _new()

 With hdrwVideo = New DrawingArea(fmain)
   .X = 0
   .Y = 0
   .W = FMain.W
   .H = 400
   .Background = Color.Transparent
 End With

  hPipe = New MediaPipeline As "hPipe"

  hSource = New MediaControl(hPipe, "v4l2src")
  hSource["device"] = "/dev/video......"
  hSink = New MediaControl(hPipe, "xvimagesink")
  hSource.LinkTo(hSink)

  hSink.SetWindow(hdrwVideo)
  hPipe.Play()

End

Private Function drwArea_Read() As DrawingArea

  Return hdrwVideo

End

Private Sub drwArea_Write(Value As DrawingArea)

  hdrwVideo = Value

  hSink.SetWindow(hdrwVideo)

End
----------------------------------end code.

Regards
Gianluigi



More information about the User mailing list