DirectDrawSink loses its link and goes to the NULL state

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

DirectDrawSink loses its link and goes to the NULL state

I am writing a player, which is able to play sound from a separate file.
I do this the following way.
1. Create directdrawsink instance. My player is the ActiveX component, and I have to embed its window into another application. So, I create this element before and set its window ID.

2. create playbin2, attach signal handler and bus watch, analyze messages and decide on them, which streams are present. I also set its "video-sink" property.

3. If video or audio is missing, post an application message with the small flag, that video (or audio) is missing.

4. Bus watch catches this message, destroys the playbin2 instance, creates an empty pipeline, puts two uridecodebins there and also two more bins, vbin and abin, containing, respectively, queue2, ffmpegcolorspace, videoscale and already existing videosink; and audioconver, audioresample, and autoaudiosink.

Bin creation is happening in the no-more-pads handler.

The code, creating bins is like the following.


Then I create ghostpad for the bin and link it with the uridecodebin.

The problem is: all elements are linked immediately after creation: pipeline fragment, player1.png (140kb), original dot is:

But after some time videosink unlinks and goes to the NULL state. Why??

fragment of the pipeline after some time, player-2.png (123kb),
original dot:

I would like to avoid recreation of the video-sink, as it contains a frame, and this will cause image flickering.