How to read array of strings from GstStructure during caps negotiation?

Baby Octopus jagadishkamathk at gmail.com
Wed Aug 31 08:59:55 UTC 2016


On Wed, Aug 31, 2016 at 12:27 PM, Sebastian Dröge-3 [via GStreamer-devel] <
ml-node+s966125n4679299h36 at n4.nabble.com> wrote:

> On Tue, 2016-08-30 at 04:05 -0700, Baby Octopus wrote:
>
> > Hi,
> >
> > When my allowed caps in aac encoder has array of stream-formats i.e.,
> > stream-format={raw,adts},  gst_structure_get_string() returns NULL
> >
> > But when it is a scalar i.e,
> > stream-format={raw} it returns non NULL
> >
> > My question is how to read array of strings in GstStructure? I see a
> > bug in faac encoder due to this in following lines
> >     if ((str = gst_structure_get_string (s, "stream-format"))) {
> >       if (strcmp (str, "adts") == 0) {
> >         GST_DEBUG_OBJECT (faac, "use ADTS format for output");
> >         faac->outputformat = 1;
> >       } else if (strcmp (str, "raw") == 0) {
> >         GST_DEBUG_OBJECT (faac, "use RAW format for output");
> >         faac->outputformat = 0;
> >       } else {
> >         GST_DEBUG_OBJECT (faac, "unknown stream-format: %s", str);
> >         faac->outputformat = 0;
> >       }
> >     }
> Those lines only support a single string, no array. I assume the caps
> are fixated before that already so that only a single string is left.
>
I don't think we can assume that. Can we? When the encoder and the muxer
support multiple stream-formats, its upto the encoder to decide
which stream-format to choose. Isn't it?


>
> For handling these arrays, check the gst_value_list_*() API.
> Note that you don't want the gst_value_array_*() API here.
>

Thank you very much. Let me try this

>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4679299&i=0>
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> *signature.asc* (949 bytes) Download Attachment
> <http://gstreamer-devel.966125.n4.nabble.com/attachment/4679299/0/signature.asc>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://gstreamer-devel.966125.n4.nabble.com/How-to-read-
> array-of-strings-from-GstStructure-during-caps-
> negotiation-tp4679288p4679299.html
> To unsubscribe from How to read array of strings from GstStructure during
> caps negotiation?, click here
> <http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4679288&code=amFnYWRpc2hrYW1hdGhrQGdtYWlsLmNvbXw0Njc5Mjg4fC0yNDIzMzk5Mjc=>
> .
> NAML
> <http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-read-array-of-strings-from-GstStructure-during-caps-negotiation-tp4679288p4679309.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160831/7898dc40/attachment.html>


More information about the gstreamer-devel mailing list