Riccardo Cagnasso
Riccardo Cagnasso

Reputation: 470

Gstreamer custom videosink for playbin

I'm trying to create a custom videosink for playbin in gstreamer 1.6.3

The final idea is to have some videomixer inside the videosink to be able to do.. stuff.

At the moment i would like to simply create a custom Bin that incapsulates a videosink.

The relevant parts of the code at the moment are:

def get_videomix_bin(self):
    mix_bin = Gst.Bin.new('sink')

    sink = Gst.ElementFactory.make('glimagesink')
    gp = Gst.GhostPad.new('vs', sink.get_static_pad('sink'))
    mix_bin.add(sink)

    mix_bin.add_pad(gp)

    return mix_bin


def get_pipeline(self, videosink):
    """A basic playbin pipeline pipeline"""
    self.pipeline = Gst.ElementFactory.make('playbin')
    videosink = self.get_videomix_bin()

    self.pipeline.set_property('video-sink', videosink)

    self.fireEvent('pipeline-created')

This code is part of a bigger software that I cannot post whole. But if i comment out the self.pipeline.set_property('video-sink', videosink) part, it works, so i tend to think that the problem is somwhere there.

It... well it basically don't work. The pipeline won't start.

At GST_DEBUG=2 i get this warning

0:00:00.758103367 15560 0x7f81000050a0 WARN            uridecodebin gsturidecodebin.c:939:unknown_type_cb:<uridecodebin0> warning: No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3.1, profile=(string)main, codec_data=(buffer)014d401fffe1001c674d401fe8802802dd80b501010140000003004000000c83c60c448001000468ebaf20, width=(int)1280, height=(int)720, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true'.

Upvotes: 0

Views: 1326

Answers (1)

Sebastian Dr&#246;ge
Sebastian Dr&#246;ge

Reputation: 2143

You have to call the ghostpad on the videosink bin "sink", not "vs". The pad names are part of the API, and sink elements are expected to have a pad called "sink".

Upvotes: 2

Related Questions