<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Hi,</DIV>
<DIV>I'm quite interested in the topic about adding extra data to buffers. I'm currently working on a project where I have to analyse video frames, extract some piece of info out of it (like detection of features), and perform some overlaying of these data over the video frame.</DIV>
<DIV>That is, I absolutely needed to pass some information along with each buffer... And these information are not size-invariant : for example, the data are 'number of detected features + ROI for each feature' (and other stuff...), so it changes from frame to frame. </DIV>
<DIV>So I could not put it into caps or tags, I had to find a way to solve the issue.</DIV>
<DIV>&nbsp;</DIV>
<DIV>What I did (the easiest but not prettiest... but I lacked time) is develop an input plugin that takes a common x-raw-rgb type flow as input. It analyses the frame, and then creates an output buffer that contains the frame data and my own specific data. It is sent to src pad as 'ANY' type (because the size of my buffer is no longer coherent with raw-rgb caps).</DIV>
<DIV>Then my next plugin will take that as input. Knowing the length of each field, I extract the original frame, my data, and perform some overlaying on my frame. Finally, I send again a 'raw-rgb' on the src pad, to be linked to a directdrawsink:</DIV>
<DIV>&nbsp;</DIV>
<DIV>gst-inspect filesrc location=myfile.avi ! decodebin ! ffmpegcolorspace ! myvideo_analyser ! myvideo_overlay ! ffmpegcolorspace ! directdrawsink</DIV>
<DIV>&nbsp;</DIV>
<DIV>That's the 'easy' way, but it is not very nice-looking, nor 'generic' (e.g. I cannot use my specific data with other base gstreamer plugins).</DIV>
<DIV>I was thinking once of splitting my original buffer frame and my data over 2 distincts output pads. But then again for my data I cannot do much (it has to by 'ANY' type, unless I create a new specific mime which I don't know how to do)... Sending events with my data for each buffer doesn't look safe. I've done some other work where events where not received synchronously (ie sent event1, buffer1, event2, buffer2 but received event1, buffer1, buffer2, event2...).</DIV>
<DIV>The idea of adding a GstStructure (or something similar) inside a GstBuffer seems to be the most interesting thing, at least with regard to my own experience. Would be null for general case, and user-filled for... user purpose.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards,</DIV>
<DIV>Albert</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></div><br>
      

      <hr size="1"> 
Ne gardez plus qu'une seule adresse mail ! <a href="http://fr.rd.yahoo.com/mail/mail_taglines/trueswitch/*http://www.trueswitch.com/yahoo-fr/">Copiez vos mails</a> vers Yahoo! Mail </body></html>