4

I need to implement an architecture where I can push data from AppSink to Appsrc. Now, I can't figure out if it can be done within the same pipeline or I would need two pipelines to achieve this. Considering I am somehow manipulating the data between apppsink and appsrc.

Another thing is, from AppSink I can extract samples using pull-samples, and to AppSrc push-sample or push-buffer can be used to put data. So, is there a way I can generate a buffer of received samples in AppSink explicitly or I should feed sample by sample to the AppSrc?

Please suggest.

Rhythm Chopra
  • 103
  • 3
  • 9
  • So you need to write your custom element instead. – Velkan Apr 12 '18 at 05:58
  • Do you mean what I'm asking can't be achieved with AppSink and AppSrc? – Rhythm Chopra Apr 12 '18 at 07:30
  • And even if I have to, can you head me towards a good reference or tutorial? – Rhythm Chopra Apr 12 '18 at 07:31
  • 1
    What exactly are you trying to do? Why so you need that construct? Perhaps a Pad Probe can do this easier? – Florian Zwoch Apr 13 '18 at 09:31
  • A Sample also has a Buffer. So you would Pull a sample, get the buffer and pass it it to the source. Maybe requires an increased reference on the Buffer Object. Not sure though. – Florian Zwoch Apr 13 '18 at 09:34
  • I'm trying to have a pipeline which will read udp stream at one port and then I need to decode the frames, apply some modifications to the received frame, re-encode it and then forward it to some another port. So to extract frame out of pipeline, where I'll modify the frame, I need AppSink and then to push the modified frame back in pipeline I need AppSrc. Is there any alternate way I can achieve the same? Please suggest – Rhythm Chopra Apr 13 '18 at 12:25
  • So, is it like there is one buffer per sample? (correct me if I'm wrong). And sample do have the buffer, but AppSink has no pull-buffer signal, it only allows pull-sample. – Rhythm Chopra Apr 13 '18 at 12:33
  • 1
    A Buffer is Part of a Sample. A Sample offers more than a Buffer but you Care about the Buffer only. But i suggest to check out pad probes. You can intercept Buffers in your transcoding Pipeline and modify them with these without Using appsrc and appsink. – Florian Zwoch Apr 13 '18 at 15:37
  • Thanks for your response, but the other thing I might bring up here is the computation I need to do over a video frame may involve heavy processing algorithm. So as whole, I'll extract incoming frame, apply algorithm, modify frame and put it back in pipeline. And this needs to be done for every video frame gstreamer receives. Do you think, pad probes could help me achieve this? – Rhythm Chopra Apr 13 '18 at 18:36
  • It wont magically fix your computation demand. As long as you accept your computation latency and set your queue sizes big enough you should be okay. The same applies to the appsrc approach. If your computation ist Not Realtime how can possibly Help you anything in fixing that? – Florian Zwoch Apr 13 '18 at 23:36
  • Well, Thanks for the detailed explanation. As per documentation it seems like it allows modify buffers. I'll try using pad probes and check if it fits my requirements. – Rhythm Chopra Apr 14 '18 at 06:21

0 Answers0