[Gambas-user] gb.media: No display of videos in Gambas controls
Benoît Minisini
g4mba5 at gmail.com
Wed May 1 14:11:17 CEST 2019
Le 29/04/2019 à 19:26, Claus Dietrich a écrit :
> Hi
>
> I am running Linux Mint 19 Mate with VirtualBox on a Windows Host with
> all host and guest additions installed. Tests with GStreamer in a
> terminal showed, that only /autovideosink/ works as video-sink in this
> environment (xvimagesink or ximagesink don't work) . The working
> GStreamer pipeline was successfully rebuilt in Gambas 3.13.0 with
> gb.media as follows:
>
> ' Gambas class file
>
> Public pl As MediaPipeline
> Public dr As DrawingArea
>
> Public Sub Form_Open()
>
> Dim src, snk As MediaControl
> Dim ftr1, ftr2 As MediaFilter
>
> With dr = New DrawingArea(Me)
> .X = 10
> .Y = 10
> .W = 640
> .H = 480
> .Background = Color.Black
> End With
>
> FMain.width = dr.w + 20
>
> pl = New MediaPipeline
>
> ' 'With webcam
> ' src = New MediaControl(pl, "v4l2src")
> ' src["device"] = "/dev/video0"
> ' ftr1 = New MediaFilter(pl, "jpegdec")
> ' ftr2 = New MediaFilter(pl,
> "video/x-raw,width=640,height=480,framerate=15/1")
> ' snk = New MediaControl(pl, "autovideosink")
> ' src.LinkTo(ftr1)
> ' ftr1.Linkto(ftr2)
> ' ftr2.LinkTo(snk)
>
> 'With test source
> src = New MediaControl(pl, "videotestsrc")
> snk = New MediaControl(pl, "autovideosink")
> src.LinkTo(snk)
>
> 'pl.SetWindow(dr)
>
> End
>
> Public Sub Button1_Click()
>
> pl.pause
> pl.Play()
>
> End
>
> Public Sub Button2_Click()
>
> pl.pause
> pl.close
> pl.stop
>
> End
>
> The problem: When I am trying with the above out-commented command line
> "pl.SetWindow(dr)" to display the video in a Gambas control, Gambas
> throws the error "Not supported on this control". Earlier examples found
> in the Web showed, that this was working with Drawing Areas. Did this
> function went lost? Is there anything wrong in my program?
>
> Claus
>
The SetWindow() method works only on elements that implement the
GStreamer vide overlay interface. MediaPipeline does not.
Regards,
--
Benoît Minisini
More information about the User
mailing list