GStreamer Daemon - Response Format: Difference between revisions

From RidgeRun Developer Wiki
(Created page with " { "code" : 0, "description" : "Success", "response" : { "properties" : [ { "name" : "name", "value" : "\"p\"",...")
 
No edit summary
Line 1: Line 1:
== Gstd Response Format==
Gstd receives the commands, arguments, events and retrieve an answer in raw JSON.
== What is JSON? ==
JSON that means "JavaScript Object Notation" is a lightweight data-interchange format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types. [http://www.json.org/ json]
Forms:
* Object: is an unordered set of name/value pairs that begins with "{"  and ends with "}".
* Each name is followed by colon ":" (colon).
* Names or values pairs: are separated by comma "," .
== Example==
The JSON raw output:


  {
  {
Line 68: Line 82:
  }
  }
  }
  }
In this case, it corresponds a JSON output for creates a pipeline.

Revision as of 15:17, 10 July 2017

Gstd Response Format

Gstd receives the commands, arguments, events and retrieve an answer in raw JSON.

What is JSON?

JSON that means "JavaScript Object Notation" is a lightweight data-interchange format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types. json

Forms:

* Object: is an unordered set of name/value pairs that begins with "{"  and ends with "}". 
* Each name is followed by colon ":" (colon). 
* Names or values pairs: are separated by comma "," .

Example

The JSON raw output:

{
  "code" : 0,
  "description" : "Success",
  "response" : {
    "properties" : [
        {
            "name" : "name",
            "value" : "\"p\"",
            "param_spec" : {
                "blurb" : "The name of the current Gstd session",
                "type" : "gchararray",
                "access" : "((GstdParamFlags) READ | 234)",
                "construct" : false
            }
        },
        {
            "name" : "description",
            "value" : "\"videotestsrc is-live=true pattern=ball ! x264enc ! mp4mux ! filesink location=/tmp/video.mp4\"",
            "param_spec" : {
                "blurb" : "The gst-launch like pipeline description",
                "type" : "gchararray",
                "access" : "((GstdParamFlags) READ | 234)",
                "construct" : false
            }
        },
        {
            "name" : "elements",
            "value" : "((GstdList*) 0x7f2954046d90)",
            "param_spec" : {
                "blurb" : "The elements in the pipeline",
                "type" : "GstdList",
                "access" : "((GstdParamFlags) READ | 224)",
                "construct" : false
            }
        },
        {
            "name" : "bus",
            "value" : "((GstdPipelineBus*) 0x7f2958003200)",
            "param_spec" : {
                "blurb" : "The bus callback for this element",
                "type" : "GstdPipelineBus",
                "access" : "((GstdParamFlags) READ | 224)",
                "construct" : false
            }
        },
        {
            "name" : "state",
            "value" : "((GstdState*) 0x7f2958003120)",
            "param_spec" : {
                "blurb" : "The state of the pipeline",
                "type" : "GstdState",
                "access" : "((GstdParamFlags) READ | UPDATE | 226)",
                "construct" : false
            }
        },
        {
            "name" : "event",
            "value" : "((GstdEventHandler*) 0x7f2954003700)",
            "param_spec" : {
                "blurb" : "The event handler of the pipeline",
                "type" : "GstdEventHandler",
                "access" : "((GstdParamFlags) READ | 224)",
                "construct" : false
            }
        }
    ]
}
}

In this case, it corresponds a JSON output for creates a pipeline.