<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.video.libav.devel">
    <title>gmane.comp.video.libav.devel</title>
    <link>http://blog.gmane.org/gmane.comp.video.libav.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27704"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27703"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27702"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27701"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27700"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27699"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27698"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27697"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27696"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27695"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27694"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27693"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27692"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27691"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27690"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27689"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27688"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27687"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27686"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.libav.devel/27685"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27704">
    <title>Re: [PATCH] movenc: Don't write the 'wave' atom or itschild 'enda' for lpcm audio.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27704</link>
    <description>&lt;pre&gt;
even better.

-Justin

&lt;/pre&gt;</description>
    <dc:creator>Justin Ruggles</dc:creator>
    <dc:date>2012-05-25T02:55:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27703">
    <title>[PATCH] movenc: Don't write the 'wave' atom or itschild 'enda' for lpcm audio.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27703</link>
    <description>&lt;pre&gt;It's left over from stsd v0. QuickTime 7 no longer writes 'wave' or 'enda'
when 'lpcm' is the audio tag.
---
 libavformat/movenc.c |   21 +--------------------
 1 files changed, 1 insertions(+), 20 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 35c03dd..fa6e957 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -264,14 +264,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
     return track-&amp;gt;enc-&amp;gt;extradata_size;
 }
 
-static int mov_write_enda_tag(AVIOContext *pb)
-{
-    avio_wb32(pb, 10);
-    ffio_wfourcc(pb, "enda");
-    avio_wb16(pb, 1); /* little endian */
-    return 10;
-}
-
 static void put_descr(AVIOContext *pb, int tag, unsigned int size)
 {
     int i = 3;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -334,14 +326,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
     return update_size(pb, pos);
 }
 
-static int mov_pcm_le_gt16(enum CodecID codec_id)
-{
-    return codec_id == CODEC_ID_PCM_S24LE ||
-           codec_id == CODEC_ID_PCM_S32LE ||
-           codec_id == CODEC_ID_PCM_F32LE ||
-           codec_id == CODEC_ID_PCM_F64LE;
-}
-
 static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = avio_tell(pb);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -403,8 +387,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track)
         ffio_wfourcc(pb, "mp4a");
         avio_wb32(pb, 0);
         mov_write_esds_tag(pb, track);
-    } else if (mov_pcm_le_gt16(track-&amp;gt;enc-&amp;gt;codec_id)) {
-        mov_write_enda_tag(pb);
     } else if (track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_AMR_NB) {
         mov_write_amr_tag(pb, track);
     } else if (track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_AC3) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -641,8 +623,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
         track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_AMR_NB ||
         track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_ALAC ||
         track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_ADPCM_MS ||
-        track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_ADPCM_IMA_WAV ||
-        mov_pcm_le_gt16(track-&amp;gt;enc-&amp;gt;codec_id)))
+        track-&amp;gt;enc-&amp;gt;codec_id == CODEC_ID_ADPCM_IMA_WAV))
         mov_write_wave_tag(pb, track);
     else if(track-&amp;gt;tag == MKTAG('m','p','4','a'))
         mov_write_esds_tag(pb, track);
&lt;/pre&gt;</description>
    <dc:creator>Alex Converse</dc:creator>
    <dc:date>2012-05-25T02:26:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27702">
    <title>Re: [PATCH] vp8: move block coeff arithcoder on stack.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27702</link>
    <description>&lt;pre&gt;Hi,

On Fri, Apr 22, 2011 at 5:49 PM, Ronald S. Bultje &amp;lt;rsbultje-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

Late, but still applicable, I'm pinging this because I'd like to push
it, Alexander OK'ed it so I'll push unless there's objections.

Ronald
&lt;/pre&gt;</description>
    <dc:creator>Ronald S. Bultje</dc:creator>
    <dc:date>2012-05-25T00:41:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27701">
    <title>Re: IGMP v3</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27701</link>
    <description>&lt;pre&gt;

Here's a rebased version. I haven't touched at all yet, it doesn't compile 
on OS X, but seems to compile on Linux. I'll try to have a closer look at 
it later...

// Martin&lt;/pre&gt;</description>
    <dc:creator>Martin Storsjö</dc:creator>
    <dc:date>2012-05-24T21:20:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27700">
    <title>Re: [PATCH 2/2] rtmp: Pass the proper return code in rtmp_handshake</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27700</link>
    <description>&lt;pre&gt;

Pushed these two.

// Martin&lt;/pre&gt;</description>
    <dc:creator>Martin Storsjö</dc:creator>
    <dc:date>2012-05-24T21:15:11</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27699">
    <title>Re: [PATCH 3/3] lavr: add x86-optimized function for mixing 2 to 1 s16p with q8 coeffs</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27699</link>
    <description>&lt;pre&gt;
ping.

-Justin

&lt;/pre&gt;</description>
    <dc:creator>Justin Ruggles</dc:creator>
    <dc:date>2012-05-24T21:09:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27698">
    <title>Re: [PATCH 2/3] lavr: add x86-optimized functions for mixing 2 to 1 s16p with float coeffs</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27698</link>
    <description>&lt;pre&gt;
ping.

-Justin
&lt;/pre&gt;</description>
    <dc:creator>Justin Ruggles</dc:creator>
    <dc:date>2012-05-24T21:09:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27697">
    <title>[PATCH 2/2] avprobe: provide JSON output</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27697</link>
    <description>&lt;pre&gt;JSON usage is quite widespread.
---
 avprobe.c |  110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 110 insertions(+), 0 deletions(-)

diff --git a/avprobe.c b/avprobe.c
index e79bdab..8b2533e 100644
--- a/avprobe.c
+++ b/avprobe.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -35,6 +35,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; const int program_birth_year = 2007;
 static int do_show_format  = 0;
 static AVDictionary *fmt_entries_to_show = NULL;
 static int nb_fmt_entries_to_show;
+static int do_output_json  = 0;
 static int do_show_packets = 0;
 static int do_show_streams = 0;
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -97,6 +98,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef struct {
 
 static AVIOContext *avp_out = NULL;
 static OutputContext octx;
+#define AVP_INDENT() avio_printf(avp_out, "%*c", octx.level * 2, ' ')
 
 /*
  * Default format, INI
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -190,6 +192,96 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void ini_print_string(const char *key, const char *value)
 }
 
 /*
+ * Alternate format, JSON
+ */
+
+static void json_print_header(void)
+{
+    avio_printf(avp_out, "{");
+}
+static void json_print_footer(void)
+{
+    avio_printf(avp_out, "}\n");
+}
+
+static void json_print_array_header(const char *name)
+{
+    if (octx.prefix[octx.level -1].nb_elems)
+        avio_printf(avp_out, ",\n");
+    AVP_INDENT();
+    avio_printf(avp_out, "\"%s\" : ", name);
+    avio_printf(avp_out, "[\n");
+}
+
+static void json_print_array_footer(const char *name)
+{
+    avio_printf(avp_out, "\n");
+    AVP_INDENT();
+    avio_printf(avp_out, "]");
+}
+
+static void json_print_object_header(const char *name)
+{
+    if (octx.prefix[octx.level -1].nb_elems)
+        avio_printf(avp_out, ",\n");
+    AVP_INDENT();
+    if (octx.prefix[octx.level -1].type == OBJECT)
+        avio_printf(avp_out, "\"%s\" : ", name);
+    avio_printf(avp_out, "{\n");
+}
+
+static void json_print_object_footer(const char *name)
+{
+    avio_printf(avp_out, "\n");
+    AVP_INDENT();
+    avio_printf(avp_out, "}");
+}
+
+static void json_print_integer(const char *key, int64_t value)
+{
+    if (octx.prefix[octx.level -1].nb_elems)
+        avio_printf(avp_out, ",\n");
+    AVP_INDENT();
+    avio_printf(avp_out, "\"%s\" : %"PRId64"", key, value);
+}
+
+static void json_escape_print(const char *s)
+{
+    int i = 0;
+    char c = 0;
+
+    while (c = s[i++]) {
+        switch (c) {
+        case '\r': avio_printf(avp_out, "%s", "\\r"); break;
+        case '\n': avio_printf(avp_out, "%s", "\\n"); break;
+        case '\f': avio_printf(avp_out, "%s", "\\f"); break;
+        case '\b': avio_printf(avp_out, "%s", "\\b"); break;
+        case '\t': avio_printf(avp_out, "%s", "\\t"); break;
+        case '\\':
+        case '"' : avio_w8(avp_out, '\\');
+        default:
+            if ((unsigned char)c &amp;lt; 32)
+                avio_printf(avp_out, "\\u00%02x", c &amp;amp; 0xff);
+            else
+                avio_w8(avp_out, c);
+        break;
+        }
+    }
+}
+
+static void json_print_string(const char *key, const char *value)
+{
+    if (octx.prefix[octx.level -1].nb_elems)
+        avio_printf(avp_out, ",\n");
+    AVP_INDENT();
+    avio_w8(avp_out, '\"');
+    json_escape_print(key);
+    avio_printf(avp_out, "\" : \"");
+    json_escape_print(value);
+    avio_w8(avp_out, '\"');
+}
+
+/*
  * Simple Formatter for single entries.
  */
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -653,6 +745,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int opt_format(const char *opt, const char *arg)
     return 0;
 }
 
+static void opt_output_json(void)
+{
+    print_header        = json_print_header;
+    print_footer        = json_print_footer;
+    print_array_header  = json_print_array_header;
+    print_array_footer  = json_print_array_footer;
+    print_object_header = json_print_object_header;
+    print_object_footer = json_print_object_footer;
+
+    print_integer = json_print_integer;
+    print_string  = json_print_string;
+
+}
+
 static int opt_show_format_entry(const char *opt, const char *arg)
 {
     do_show_format = 1;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -713,6 +819,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const OptionDef options[] = {
       "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
     { "pretty", 0, {(void*)&amp;amp;opt_pretty},
       "prettify the format of displayed values, make it more human readable" },
+    { "json", OPT_BOOL, {(void*)&amp;amp;do_output_json}, "output a json document instead of an ini one" },
     { "show_format",  OPT_BOOL, {(void*)&amp;amp;do_show_format} , "show format/container info" },
     { "show_format_entry", HAS_ARG, {(void*)opt_show_format_entry},
       "show a particular entry from the format/container info", "entry" },
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -764,6 +871,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
     if (!avp_out)
         exit(1);
 
+    if (do_output_json)
+        opt_output_json();
+
     avp_header();
     ret = probe_file(input_filename);
     avp_footer();
&lt;/pre&gt;</description>
    <dc:creator>Luca Barbato</dc:creator>
    <dc:date>2012-05-24T19:35:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27696">
    <title>[PATCH 1/2] avprobe: output proper INI format</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27696</link>
    <description>&lt;pre&gt;Make the output valid INI serialization.
---

This time with a bit more structure.

I hope that is what Anton wanted.

 avprobe.c |  520 ++++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 396 insertions(+), 124 deletions(-)

diff --git a/avprobe.c b/avprobe.c
index 6182875..e79bdab 100644
--- a/avprobe.c
+++ b/avprobe.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -64,6 +64,262 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void exit_program(int ret)
     exit(ret);
 }
 
+/*
+ * The output is structured in array and objects that might contain items
+ * Array could require the objects within to not be named.
+ * Object could require the items within to be named.
+ *
+ * For flat representation the name of each section is saved on prefix so it
+ * can be rendered in order to represent nested structures (e.g. array of
+ * objects for the packets list).
+ *
+ * Within an array each element can need an unique identifier or an index.
+ *
+ * Nesting level is accounted separately.
+ */
+
+typedef enum {
+    ARRAY,
+    OBJECT
+} AvpElementType;
+
+typedef struct {
+    const char *name;
+    AvpElementType type;
+    int64_t index;
+    int64_t nb_elems;
+} AvpElement;
+
+typedef struct {
+    AvpElement *prefix;
+    int level;
+} OutputContext;
+
+static AVIOContext *avp_out = NULL;
+static OutputContext octx;
+
+/*
+ * Default format, INI
+ *
+ * - all key and values are utf8
+ * - '.' is the subgroup separator
+ * - newlines and the following characters are escaped
+ * - '\' is the escape character
+ * - '#' is the comment
+ * - '=' is the key/value separators
+ * - ':' is not used but usually parsed as key/value separator
+ */
+
+static void ini_print_header(void)
+{
+    avio_printf(avp_out, "# avprobe output\n\n");
+}
+static void ini_print_footer(void)
+{
+    avio_w8(avp_out, '\n');
+}
+
+static void ini_escape_print(const char *s)
+{
+    int i = 0;
+    char c = 0;
+
+    while (c = s[i++]) {
+        switch (c) {
+        case '\r': avio_printf(avp_out, "%s", "\\r"); break;
+        case '\n': avio_printf(avp_out, "%s", "\\n"); break;
+        case '\f': avio_printf(avp_out, "%s", "\\f"); break;
+        case '\b': avio_printf(avp_out, "%s", "\\b"); break;
+        case '\t': avio_printf(avp_out, "%s", "\\t"); break;
+        case '\\':
+        case '#' :
+        case '=' :
+        case ':' : avio_w8(avp_out, '\\');
+        default:
+            if ((unsigned char)c &amp;lt; 32)
+                avio_printf(avp_out, "\\x00%02x", c &amp;amp; 0xff);
+            else
+                avio_w8(avp_out, c);
+        break;
+        }
+    }
+}
+
+static void ini_print_array_header(const char *name)
+{
+    if (octx.prefix[octx.level -1].nb_elems)
+        avio_printf(avp_out, "\n");
+}
+
+static void ini_print_object_header(const char *name)
+{
+    int i;
+    AvpElement *el = octx.prefix + octx.level -1;
+
+    if (el-&amp;gt;nb_elems)
+        avio_printf(avp_out, "\n");
+
+    avio_printf(avp_out, "[");
+
+    for (i = 1; i &amp;lt; octx.level; i++) {
+        el = octx.prefix + i;
+        avio_printf(avp_out, "%s.", el-&amp;gt;name);
+        if (el-&amp;gt;index &amp;gt;= 0)
+            avio_printf(avp_out, "%"PRId64".", el-&amp;gt;index);
+    }
+
+    avio_printf(avp_out, "%s", name);
+    if (el &amp;amp;&amp;amp; el-&amp;gt;type == ARRAY)
+        avio_printf(avp_out, ".%"PRId64"", el-&amp;gt;nb_elems);
+    avio_printf(avp_out, "]\n");
+}
+
+static void ini_print_integer(const char *key, int64_t value)
+{
+    ini_escape_print(key);
+    avio_printf(avp_out, "=%"PRId64"\n", value);
+}
+
+
+static void ini_print_string(const char *key, const char *value)
+{
+    ini_escape_print(key);
+    avio_printf(avp_out, "=");
+    ini_escape_print(value);
+    avio_w8(avp_out, '\n');
+}
+
+/*
+ * Simple Formatter for single entries.
+ */
+
+static void show_format_entry_integer(const char *key, int64_t value)
+{
+    if (key &amp;amp;&amp;amp; av_dict_get(fmt_entries_to_show, key, NULL, 0)) {
+        if (nb_fmt_entries_to_show &amp;gt; 1)
+            avio_printf(avp_out, "%s=", key);
+        avio_printf(avp_out, "%"PRId64"\n", value);
+    }
+}
+
+static void show_format_entry_string(const char *key, const char *value)
+{
+    if (key &amp;amp;&amp;amp; av_dict_get(fmt_entries_to_show, key, NULL, 0)) {
+        if (nb_fmt_entries_to_show &amp;gt; 1)
+            avio_printf(avp_out, "%s=", key);
+        avio_printf(avp_out, "%s\n", value);
+    }
+}
+
+
+void (*print_header)(void) = ini_print_header;
+void (*print_footer)(void) = ini_print_footer;
+
+void (*print_array_header) (const char *name) = ini_print_array_header;
+void (*print_array_footer) (const char *name);
+void (*print_object_header)(const char *name) = ini_print_object_header;
+void (*print_object_footer)(const char *name);
+
+void (*print_integer) (const char *key, int64_t value)     = ini_print_integer;
+void (*print_string)  (const char *key, const char *value) = ini_print_string;
+
+
+static void avp_group_enter(const char *name, int type)
+{
+    int64_t count = -1;
+
+    octx.prefix =
+        av_realloc(octx.prefix, sizeof(AvpElement) * (octx.level + 1));
+
+    if (!octx.prefix || !name) {
+        fprintf(stderr, "Out of memory\n");
+        exit(1);
+    }
+
+    if (octx.level) {
+        AvpElement *parent = octx.prefix + octx.level -1;
+        if (parent-&amp;gt;type == ARRAY)
+            count = parent-&amp;gt;nb_elems;
+        parent-&amp;gt;nb_elems++;
+    }
+
+    octx.prefix[octx.level++] = (AvpElement){name, type, count, 0};
+}
+
+static void avp_group_leave(void)
+{
+    --octx.level;
+}
+
+static void avp_header(void)
+{
+    if (print_header)
+        print_header();
+    avp_group_enter("root", OBJECT);
+}
+
+static void avp_footer(void)
+{
+    if (print_footer)
+        print_footer();
+    avp_group_leave();
+}
+
+
+static void avp_array_header(const char *name)
+{
+    if (print_array_header)
+        print_array_header(name);
+
+    avp_group_enter(name, ARRAY);
+}
+
+static void avp_array_footer(const char *name)
+{
+    avp_group_leave();
+    if (print_array_footer)
+        print_array_footer(name);
+}
+
+static void avp_object_header(const char *name)
+{
+    if (print_object_header)
+        print_object_header(name);
+
+    avp_group_enter(name, OBJECT);
+}
+
+static void avp_object_footer(const char *name)
+{
+    avp_group_leave();
+    if (print_object_footer)
+        print_object_footer(name);
+}
+
+static void avp_int(const char *key, int64_t value)
+{
+    print_integer(key, value);
+    octx.prefix[octx.level -1].nb_elems++;
+}
+
+static void avp_str(const char *key, const char *value)
+{
+    print_string(key, value);
+    octx.prefix[octx.level -1].nb_elems++;
+}
+
+static void avp_dict(AVDictionary *dict, const char *name)
+{
+    AVDictionaryEntry *entry = NULL;
+    if (!dict)
+        return;
+    avp_object_header(name);
+    while ((entry = av_dict_get(dict, "", entry, AV_DICT_IGNORE_SUFFIX))) {
+        avp_str(entry-&amp;gt;key, entry-&amp;gt;value);
+    }
+    avp_object_footer(name);
+}
+
 static char *value_string(char *buf, int buf_size, double val, const char *unit)
 {
     if (unit == unit_second_str &amp;amp;&amp;amp; use_value_sexagesimal_format) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -90,11 +346,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static char *value_string(char *buf, int buf_size, double val, const char *unit)
             val  /= pow(10, index * 3);
             prefix_string = decimal_unit_prefixes[index];
         }
-
-        snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string,
+        snprintf(buf, buf_size, "%.*f%s%s",
+                 index ? 3 : 0, val,
+                 prefix_string,
                  show_value_unit ? unit : "");
     } else {
-        snprintf(buf, buf_size, "%f %s", val, show_value_unit ? unit : "");
+        snprintf(buf, buf_size, "%f%s", val, show_value_unit ? unit : "");
     }
 
     return buf;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -112,7 +369,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static char *time_value_string(char *buf, int buf_size, int64_t val,
     return buf;
 }
 
-static char *ts_value_string (char *buf, int buf_size, int64_t ts)
+static char *ts_value_string(char *buf, int buf_size, int64_t ts)
 {
     if (ts == AV_NOPTS_VALUE) {
         snprintf(buf, buf_size, "N/A");
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -123,6 +380,21 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static char *ts_value_string (char *buf, int buf_size, int64_t ts)
     return buf;
 }
 
+static char *rational_string(char *buf, int buf_size, const char *sep,
+                             const AVRational *rat)
+{
+    snprintf(buf, buf_size, "%d%s%d", rat-&amp;gt;num, sep, rat-&amp;gt;den);
+    return buf;
+}
+
+static char *tag_string(char *buf, int buf_size, int tag)
+{
+    snprintf(buf, buf_size, "0x%04x", tag);
+    return buf;
+}
+
+
+
 static const char *media_type_string(enum AVMediaType media_type)
 {
     switch (media_type) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -140,25 +412,25 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
     char val_str[128];
     AVStream *st = fmt_ctx-&amp;gt;streams[pkt-&amp;gt;stream_index];
 
-    printf("[PACKET]\n");
-    printf("codec_type=%s\n", media_type_string(st-&amp;gt;codec-&amp;gt;codec_type));
-    printf("stream_index=%d\n", pkt-&amp;gt;stream_index);
-    printf("pts=%s\n", ts_value_string(val_str, sizeof(val_str), pkt-&amp;gt;pts));
-    printf("pts_time=%s\n", time_value_string(val_str, sizeof(val_str),
-                                              pkt-&amp;gt;pts, &amp;amp;st-&amp;gt;time_base));
-    printf("dts=%s\n", ts_value_string(val_str, sizeof(val_str), pkt-&amp;gt;dts));
-    printf("dts_time=%s\n", time_value_string(val_str, sizeof(val_str),
-                                              pkt-&amp;gt;dts, &amp;amp;st-&amp;gt;time_base));
-    printf("duration=%s\n", ts_value_string(val_str, sizeof(val_str),
-                                            pkt-&amp;gt;duration));
-    printf("duration_time=%s\n", time_value_string(val_str, sizeof(val_str),
-                                                   pkt-&amp;gt;duration,
-                                                   &amp;amp;st-&amp;gt;time_base));
-    printf("size=%s\n", value_string(val_str, sizeof(val_str),
-                                     pkt-&amp;gt;size, unit_byte_str));
-    printf("pos=%"PRId64"\n", pkt-&amp;gt;pos);
-    printf("flags=%c\n", pkt-&amp;gt;flags &amp;amp; AV_PKT_FLAG_KEY ? 'K' : '_');
-    printf("[/PACKET]\n");
+    avp_object_header("packet");
+    avp_str("codec_type", media_type_string(st-&amp;gt;codec-&amp;gt;codec_type));
+    avp_int("stream_index", pkt-&amp;gt;stream_index);
+    avp_str("pts", ts_value_string(val_str, sizeof(val_str), pkt-&amp;gt;pts));
+    avp_str("pts_time", time_value_string(val_str, sizeof(val_str),
+                                               pkt-&amp;gt;pts, &amp;amp;st-&amp;gt;time_base));
+    avp_str("dts", ts_value_string(val_str, sizeof(val_str), pkt-&amp;gt;dts));
+    avp_str("dts_time", time_value_string(val_str, sizeof(val_str),
+                                               pkt-&amp;gt;dts, &amp;amp;st-&amp;gt;time_base));
+    avp_str("duration", ts_value_string(val_str, sizeof(val_str),
+                                             pkt-&amp;gt;duration));
+    avp_str("duration_time", time_value_string(val_str, sizeof(val_str),
+                                                    pkt-&amp;gt;duration,
+                                                    &amp;amp;st-&amp;gt;time_base));
+    avp_str("size", value_string(val_str, sizeof(val_str),
+                                      pkt-&amp;gt;size, unit_byte_str));
+    avp_int("pos", pkt-&amp;gt;pos);
+    avp_str("flags", pkt-&amp;gt;flags &amp;amp; AV_PKT_FLAG_KEY ? "K" : "_");
+    avp_object_footer("packet");
 }
 
 static void show_packets(AVFormatContext *fmt_ctx)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -166,9 +438,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void show_packets(AVFormatContext *fmt_ctx)
     AVPacket pkt;
 
     av_init_packet(&amp;amp;pkt);
-
+    avp_array_header("packets");
     while (!av_read_frame(fmt_ctx, &amp;amp;pkt))
         show_packet(fmt_ctx, &amp;amp;pkt);
+    avp_array_footer("packets");
 }
 
 static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -177,138 +450,121 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
     AVCodecContext *dec_ctx;
     AVCodec *dec;
     char val_str[128];
-    AVDictionaryEntry *tag = NULL;
     AVRational display_aspect_ratio;
 
-    printf("[STREAM]\n");
+    avp_object_header("stream");
 
-    printf("index=%d\n", stream-&amp;gt;index);
+    avp_int("index", stream-&amp;gt;index);
 
     if ((dec_ctx = stream-&amp;gt;codec)) {
         if ((dec = dec_ctx-&amp;gt;codec)) {
-            printf("codec_name=%s\n", dec-&amp;gt;name);
-            printf("codec_long_name=%s\n", dec-&amp;gt;long_name);
+            avp_str("codec_name", dec-&amp;gt;name);
+            avp_str("codec_long_name", dec-&amp;gt;long_name);
         } else {
-            printf("codec_name=unknown\n");
+            avp_str("codec_name", "unknown");
         }
 
-        printf("codec_type=%s\n", media_type_string(dec_ctx-&amp;gt;codec_type));
-        printf("codec_time_base=%d/%d\n",
-               dec_ctx-&amp;gt;time_base.num, dec_ctx-&amp;gt;time_base.den);
+        avp_str("codec_type", media_type_string(dec_ctx-&amp;gt;codec_type));
+        avp_str("codec_time_base",
+                     rational_string(val_str, sizeof(val_str),
+                                     "/", &amp;amp;dec_ctx-&amp;gt;time_base));
 
         /* print AVI/FourCC tag */
         av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx-&amp;gt;codec_tag);
-        printf("codec_tag_string=%s\n", val_str);
-        printf("codec_tag=0x%04x\n", dec_ctx-&amp;gt;codec_tag);
+        avp_str("codec_tag_string", val_str);
+        avp_str("codec_tag", tag_string(val_str, sizeof(val_str),
+                                             dec_ctx-&amp;gt;codec_tag));
 
         switch (dec_ctx-&amp;gt;codec_type) {
         case AVMEDIA_TYPE_VIDEO:
-            printf("width=%d\n", dec_ctx-&amp;gt;width);
-            printf("height=%d\n", dec_ctx-&amp;gt;height);
-            printf("has_b_frames=%d\n", dec_ctx-&amp;gt;has_b_frames);
+            avp_int("width", dec_ctx-&amp;gt;width);
+            avp_int("height", dec_ctx-&amp;gt;height);
+            avp_int("has_b_frames", dec_ctx-&amp;gt;has_b_frames);
             if (dec_ctx-&amp;gt;sample_aspect_ratio.num) {
-                printf("sample_aspect_ratio=%d:%d\n",
-                       dec_ctx-&amp;gt;sample_aspect_ratio.num,
-                       dec_ctx-&amp;gt;sample_aspect_ratio.den);
+                avp_str("sample_aspect_ratio",
+                             rational_string(val_str, sizeof(val_str), ":",
+                             &amp;amp;dec_ctx-&amp;gt;sample_aspect_ratio));
                 av_reduce(&amp;amp;display_aspect_ratio.num, &amp;amp;display_aspect_ratio.den,
                           dec_ctx-&amp;gt;width  * dec_ctx-&amp;gt;sample_aspect_ratio.num,
                           dec_ctx-&amp;gt;height * dec_ctx-&amp;gt;sample_aspect_ratio.den,
                           1024*1024);
-                printf("display_aspect_ratio=%d:%d\n",
-                       display_aspect_ratio.num, display_aspect_ratio.den);
+                avp_str("display_aspect_ratio",
+                             rational_string(val_str, sizeof(val_str), ":",
+                             &amp;amp;display_aspect_ratio));
             }
-            printf("pix_fmt=%s\n",
+            avp_str("pix_fmt",
                    dec_ctx-&amp;gt;pix_fmt != PIX_FMT_NONE ? av_pix_fmt_descriptors[dec_ctx-&amp;gt;pix_fmt].name
                                                     : "unknown");
-            printf("level=%d\n", dec_ctx-&amp;gt;level);
+            avp_int("level", dec_ctx-&amp;gt;level);
             break;
 
         case AVMEDIA_TYPE_AUDIO:
-            printf("sample_rate=%s\n", value_string(val_str, sizeof(val_str),
-                                                    dec_ctx-&amp;gt;sample_rate,
-                                                    unit_hertz_str));
-            printf("channels=%d\n", dec_ctx-&amp;gt;channels);
-            printf("bits_per_sample=%d\n",
-                   av_get_bits_per_sample(dec_ctx-&amp;gt;codec_id));
+            avp_str("sample_rate",
+                         value_string(val_str, sizeof(val_str),
+                                      dec_ctx-&amp;gt;sample_rate,
+                                      unit_hertz_str));
+            avp_int("channels", dec_ctx-&amp;gt;channels);
+            avp_int("bits_per_sample",
+                          av_get_bits_per_sample(dec_ctx-&amp;gt;codec_id));
             break;
         }
     } else {
-        printf("codec_type=unknown\n");
+        avp_str("codec_type", "unknown");
     }
 
     if (fmt_ctx-&amp;gt;iformat-&amp;gt;flags &amp;amp; AVFMT_SHOW_IDS)
-        printf("id=0x%x\n", stream-&amp;gt;id);
-    printf("r_frame_rate=%d/%d\n",
-           stream-&amp;gt;r_frame_rate.num, stream-&amp;gt;r_frame_rate.den);
-    printf("avg_frame_rate=%d/%d\n",
-           stream-&amp;gt;avg_frame_rate.num, stream-&amp;gt;avg_frame_rate.den);
-    printf("time_base=%d/%d\n",
-           stream-&amp;gt;time_base.num, stream-&amp;gt;time_base.den);
-    printf("start_time=%s\n",
-           time_value_string(val_str, sizeof(val_str),
+        avp_int("id", stream-&amp;gt;id);
+    avp_str("r_frame_rate",
+                 rational_string(val_str, sizeof(val_str), "/",
+                 &amp;amp;stream-&amp;gt;r_frame_rate));
+    avp_str("avg_frame_rate",
+                 rational_string(val_str, sizeof(val_str), "/",
+                 &amp;amp;stream-&amp;gt;avg_frame_rate));
+    avp_str("time_base",
+                 rational_string(val_str, sizeof(val_str), "/",
+                 &amp;amp;stream-&amp;gt;time_base));
+    avp_str("start_time",
+                 time_value_string(val_str, sizeof(val_str),
                              stream-&amp;gt;start_time, &amp;amp;stream-&amp;gt;time_base));
-    printf("duration=%s\n",
-           time_value_string(val_str, sizeof(val_str),
-                             stream-&amp;gt;duration, &amp;amp;stream-&amp;gt;time_base));
+    avp_str("duration",
+                 time_value_string(val_str, sizeof(val_str),
+                                   stream-&amp;gt;duration, &amp;amp;stream-&amp;gt;time_base));
     if (stream-&amp;gt;nb_frames)
-        printf("nb_frames=%"PRId64"\n", stream-&amp;gt;nb_frames);
-
-    while ((tag = av_dict_get(stream-&amp;gt;metadata, "", tag,
-                              AV_DICT_IGNORE_SUFFIX)))
-        printf("TAG:%s=%s\n", tag-&amp;gt;key, tag-&amp;gt;value);
+        avp_int("nb_frames", stream-&amp;gt;nb_frames);
 
-    printf("[/STREAM]\n");
-}
+    avp_dict(stream-&amp;gt;metadata, "tags");
 
-static void print_format_entry(const char *tag,
-                               const char *val)
-{
-    if (!fmt_entries_to_show) {
-        if (tag) {
-            printf("%s=%s\n", tag, val);
-        } else {
-            printf("%s\n", val);
-        }
-    } else if (tag &amp;amp;&amp;amp; av_dict_get(fmt_entries_to_show, tag, NULL, 0)) {
-        if (nb_fmt_entries_to_show &amp;gt; 1)
-            printf("%s=", tag);
-        printf("%s\n", val);
-    }
+    avp_object_footer("stream");
 }
 
 static void show_format(AVFormatContext *fmt_ctx)
 {
-    AVDictionaryEntry *tag = NULL;
     char val_str[128];
     int64_t size = fmt_ctx-&amp;gt;pb ? avio_size(fmt_ctx-&amp;gt;pb) : -1;
 
-    print_format_entry(NULL, "[FORMAT]");
-    print_format_entry("filename",         fmt_ctx-&amp;gt;filename);
+    avp_object_header("format");
+    avp_str("filename",         fmt_ctx-&amp;gt;filename);
     snprintf(val_str, sizeof(val_str) - 1, "%d", fmt_ctx-&amp;gt;nb_streams);
-    print_format_entry("nb_streams",       val_str);
-    print_format_entry("format_name",      fmt_ctx-&amp;gt;iformat-&amp;gt;name);
-    print_format_entry("format_long_name", fmt_ctx-&amp;gt;iformat-&amp;gt;long_name);
-    print_format_entry("start_time",
+    avp_str("nb_streams",       val_str);
+    avp_str("format_name",      fmt_ctx-&amp;gt;iformat-&amp;gt;name);
+    avp_str("format_long_name", fmt_ctx-&amp;gt;iformat-&amp;gt;long_name);
+    avp_str("start_time",
                        time_value_string(val_str, sizeof(val_str),
                                          fmt_ctx-&amp;gt;start_time, &amp;amp;AV_TIME_BASE_Q));
-    print_format_entry("duration",
+    avp_str("duration",
                        time_value_string(val_str, sizeof(val_str),
                                          fmt_ctx-&amp;gt;duration, &amp;amp;AV_TIME_BASE_Q));
-    print_format_entry("size",
+    avp_str("size",
                        size &amp;gt;= 0 ? value_string(val_str, sizeof(val_str),
                                                 size, unit_byte_str)
                                   : "unknown");
-    print_format_entry("bit_rate",
+    avp_str("bit_rate",
                        value_string(val_str, sizeof(val_str),
                                     fmt_ctx-&amp;gt;bit_rate, unit_bit_per_second_str));
 
-    while ((tag = av_dict_get(fmt_ctx-&amp;gt;metadata, "", tag,
-                              AV_DICT_IGNORE_SUFFIX))) {
-        snprintf(val_str, sizeof(val_str) - 1, "TAG:%s", tag-&amp;gt;key);
-        print_format_entry(val_str, tag-&amp;gt;value);
-    }
+    avp_dict(fmt_ctx-&amp;gt;metadata, "tags");
 
-    print_format_entry(NULL, "[/FORMAT]");
+    avp_object_footer("format");
 }
 
 static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -355,20 +611,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
     return 0;
 }
 
-static void close_input_file(AVFormatContext **ctx_ptr)
-{
-    int i;
-    AVFormatContext *fmt_ctx = *ctx_ptr;
-
-    /* close decoder for each stream */
-    for (i = 0; i &amp;lt; fmt_ctx-&amp;gt;nb_streams; i++) {
-        AVStream *stream = fmt_ctx-&amp;gt;streams[i];
-
-        avcodec_close(stream-&amp;gt;codec);
-    }
-    avformat_close_input(ctx_ptr);
-}
-
 static int probe_file(const char *filename)
 {
     AVFormatContext *fmt_ctx;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -377,17 +619,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int probe_file(const char *filename)
     if ((ret = open_input_file(&amp;amp;fmt_ctx, filename)))
         return ret;
 
-    if (do_show_packets)
-        show_packets(fmt_ctx);
+    if (do_show_format)
+        show_format(fmt_ctx);
 
-    if (do_show_streams)
+    if (do_show_streams) {
+        avp_array_header("streams");
         for (i = 0; i &amp;lt; fmt_ctx-&amp;gt;nb_streams; i++)
             show_stream(fmt_ctx, i);
+        avp_array_footer("streams");
+    }
 
-    if (do_show_format)
-        show_format(fmt_ctx);
+    if (do_show_packets)
+        show_packets(fmt_ctx);
 
-    close_input_file(&amp;amp;fmt_ctx);
+    avformat_close_input(&amp;amp;fmt_ctx);
     return 0;
 }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -412,6 +657,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int opt_show_format_entry(const char *opt, const char *arg)
 {
     do_show_format = 1;
     nb_fmt_entries_to_show++;
+    print_header        = NULL;
+    print_footer        = NULL;
+    print_array_header  = NULL;
+    print_array_footer  = NULL;
+    print_object_header = NULL;
+    print_object_footer = NULL;
+
+    print_integer = show_format_entry_integer;
+    print_string  = show_format_entry_string;
     av_dict_set(&amp;amp;fmt_entries_to_show, arg, "", 0);
     return 0;
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -469,9 +723,21 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const OptionDef options[] = {
     { NULL, },
 };
 
+static int avp_buf_write(void *opaque, uint8_t *buf, int buf_size)
+{
+    printf("%.*s", buf_size, buf);
+    return 0;
+}
+
+#define AVP_BUFFSIZE 4096
+
 int main(int argc, char **argv)
 {
     int ret;
+    uint8_t *buffer = av_malloc(AVP_BUFFSIZE);
+
+    if (!buffer)
+        exit(1);
 
     parse_loglevel(argc, argv, options);
     av_register_all();
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -493,10 +759,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
         exit(1);
     }
 
-    ret = probe_file(input_filename);
+    avp_out = avio_alloc_context(buffer, AVP_BUFFSIZE, 1, NULL, NULL,
+                                 avp_buf_write, NULL);
+    if (!avp_out)
+        exit(1);
 
-    uninit_opts();
-    av_dict_free(&amp;amp;fmt_entries_to_show);
+    avp_header();
+    ret = probe_file(input_filename);
+    avp_footer();
+    avio_flush(avp_out);
+    avio_close(avp_out);
 
     avformat_network_deinit();
 
&lt;/pre&gt;</description>
    <dc:creator>Luca Barbato</dc:creator>
    <dc:date>2012-05-24T19:35:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27695">
    <title>Re: IGMP v3</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27695</link>
    <description>&lt;pre&gt;

Sorry, haven't gotten to this yet.

// Martin
&lt;/pre&gt;</description>
    <dc:creator>Martin Storsjö</dc:creator>
    <dc:date>2012-05-24T19:13:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27694">
    <title>Re: [PATCH] opt: add av_opt_set_bin()</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27694</link>
    <description>&lt;pre&gt;

Looks correct to me. Since this changes public API, you need to document 
it in docs/APIchanges and bump the minor version of libavutil, too.

// Martin
&lt;/pre&gt;</description>
    <dc:creator>Martin Storsjö</dc:creator>
    <dc:date>2012-05-24T19:02:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27693">
    <title>[PATCH] opt: add av_opt_set_bin()</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27693</link>
    <description>&lt;pre&gt;Introduce a new function to set binary data through AVOption
---
 libavutil/opt.c |   28 ++++++++++++++++++++++++++++
 libavutil/opt.h |    1 +
 2 files changed, 29 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7c53024..1bee3a3 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -316,6 +316,34 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
     return set_number(obj, name, val.num, val.den, 1, search_flags);
 }
 
+int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
+{
+    void *target_obj;
+    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &amp;amp;target_obj);
+    uint8_t *ptr;
+    uint8_t **dst;
+    int *lendst;
+
+    if (!o || !target_obj)
+        return AVERROR_OPTION_NOT_FOUND;
+
+    if (o-&amp;gt;type != AV_OPT_TYPE_BINARY)
+        return AVERROR(EINVAL);
+
+    ptr = av_malloc(len);
+    if (!ptr)
+        return AVERROR(ENOMEM);
+
+    dst = (uint8_t **)(((uint8_t *)target_obj) + o-&amp;gt;offset);
+    lendst = (int *)(dst + 1);
+
+    *dst = ptr;
+    *lendst = len;
+    memcpy(ptr, val, len);
+
+    return 0;
+}
+
 #if FF_API_OLD_AVOPTIONS
 /**
  *
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 1954940..8f800fc 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -560,6 +560,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int av_opt_set       (void *obj, const char *name, const char *val, int search_f
 int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
 int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
 int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
+int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
 /**
  * &amp;lt; at &amp;gt;}
  */
&lt;/pre&gt;</description>
    <dc:creator>Samuel Pitoiset</dc:creator>
    <dc:date>2012-05-24T17:10:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27692">
    <title>[PATCH] opt: Add av_opt_set_bin(),a new function which sets binary data via AVOptions</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27692</link>
    <description>&lt;pre&gt;---
 libavutil/opt.c |   28 ++++++++++++++++++++++++++++
 libavutil/opt.h |    1 +
 2 files changed, 29 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7c53024..1bee3a3 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -316,6 +316,34 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
     return set_number(obj, name, val.num, val.den, 1, search_flags);
 }
 
+int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
+{
+    void *target_obj;
+    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &amp;amp;target_obj);
+    uint8_t *ptr;
+    uint8_t **dst;
+    int *lendst;
+
+    if (!o || !target_obj)
+        return AVERROR_OPTION_NOT_FOUND;
+
+    if (o-&amp;gt;type != AV_OPT_TYPE_BINARY)
+        return AVERROR(EINVAL);
+
+    ptr = av_malloc(len);
+    if (!ptr)
+        return AVERROR(ENOMEM);
+
+    dst = (uint8_t **)(((uint8_t *)target_obj) + o-&amp;gt;offset);
+    lendst = (int *)(dst + 1);
+
+    *dst = ptr;
+    *lendst = len;
+    memcpy(ptr, val, len);
+
+    return 0;
+}
+
 #if FF_API_OLD_AVOPTIONS
 /**
  *
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 1954940..8f800fc 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -560,6 +560,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int av_opt_set       (void *obj, const char *name, const char *val, int search_f
 int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
 int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
 int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
+int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
 /**
  * &amp;lt; at &amp;gt;}
  */
&lt;/pre&gt;</description>
    <dc:creator>Samuel Pitoiset</dc:creator>
    <dc:date>2012-05-24T17:07:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27691">
    <title>Re: [PATCH] opt: Add av_opt_set_bin(), a new function which sets binary data via AVOptions</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27691</link>
    <description>&lt;pre&gt;
I need it in order to send custom POST data for implementing rtmpt.




&lt;/pre&gt;</description>
    <dc:creator>Samuel Pitoiset</dc:creator>
    <dc:date>2012-05-24T17:13:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27690">
    <title>Re: [PATCH] opt: Add av_opt_set_bin(), a new function which sets binary data via AVOptions</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27690</link>
    <description>&lt;pre&gt;split the patch subject so it is

opt: add av_opt_set_bin()

Introduce a new function to set binary data through AVOption

Btw, why do you need it?

On 24/05/12 09:54, Samuel Pitoiset wrote:


&lt;/pre&gt;</description>
    <dc:creator>Luca Barbato</dc:creator>
    <dc:date>2012-05-24T17:09:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27689">
    <title>[PATCH] opt: Add av_opt_set_bin(),a new function which sets binary data via AVOptions</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27689</link>
    <description>&lt;pre&gt;---
 libavutil/opt.c |   28 ++++++++++++++++++++++++++++
 libavutil/opt.h |    1 +
 2 files changed, 29 insertions(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7c53024..1bee3a3 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -316,6 +316,34 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
     return set_number(obj, name, val.num, val.den, 1, search_flags);
 }
 
+int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
+{
+    void *target_obj;
+    const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &amp;amp;target_obj);
+    uint8_t *ptr;
+    uint8_t **dst;
+    int *lendst;
+
+    if (!o || !target_obj)
+        return AVERROR_OPTION_NOT_FOUND;
+
+    if (o-&amp;gt;type != AV_OPT_TYPE_BINARY)
+        return AVERROR(EINVAL);
+
+    ptr = av_malloc(len);
+    if (!ptr)
+        return AVERROR(ENOMEM);
+
+    dst = (uint8_t **)(((uint8_t *)target_obj) + o-&amp;gt;offset);
+    lendst = (int *)(dst + 1);
+
+    *dst = ptr;
+    *lendst = len;
+    memcpy(ptr, val, len);
+
+    return 0;
+}
+
 #if FF_API_OLD_AVOPTIONS
 /**
  *
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 1954940..8f800fc 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -560,6 +560,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int av_opt_set       (void *obj, const char *name, const char *val, int search_f
 int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
 int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
 int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
+int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
 /**
  * &amp;lt; at &amp;gt;}
  */
&lt;/pre&gt;</description>
    <dc:creator>Samuel Pitoiset</dc:creator>
    <dc:date>2012-05-24T16:54:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27688">
    <title>Re: [PATCH] imc: some cosmetics</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27688</link>
    <description>&lt;pre&gt;imc: K&amp;amp;R formatting cosmetics

On Wed, May 23, 2012 at 06:59:53PM +0200, Kostya Shishkov wrote:

weird


int *


same


more


Indent the //.

Feel free to push eiththese issues addressed.

Diego
&lt;/pre&gt;</description>
    <dc:creator>Diego Biurrun</dc:creator>
    <dc:date>2012-05-24T16:31:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27687">
    <title>Convert a video</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27687</link>
    <description>&lt;pre&gt;Hello!
I want to change the libavformat/output-example.c to convert a video.
I add a new parameter. (forexample: ./output-example out.flv in.mpg) But
the problem is how to get the information of the file?
I think I need to get it in the variable  AVStream *video_st;
I searched in the source-code, but I couldn't find a way to load the
information.

    for (;;) {
        /* Compute current audio and video time. */
        if (audio_st)
            audio_pts = (double)audio_st-&amp;gt;pts.val * audio_st-&amp;gt;time_base.num
/ audio_st-&amp;gt;time_base.den;
        else
            audio_pts = 0.0;

        if (video_st)
            video_pts = (double)video_st-&amp;gt;pts.val * video_st-&amp;gt;time_base.num
/
                        video_st-&amp;gt;time_base.den;
        else
            video_pts = 0.0;

        if ((!audio_st || audio_pts &amp;gt;= STREAM_DURATION) &amp;amp;&amp;amp;
            (!video_st || video_pts &amp;gt;= STREAM_DURATION))
            break;

        /* write interleaved audio and video frames */
        if (!video_st || (video_st &amp;amp;&amp;amp; audio_st &amp;amp;&amp;amp; audio_pts &amp;lt; video_pts)) {
            write_audio_frame(oc, audio_st);
        } else {
            write_video_frame(oc, video_st);
        }
    }

I hope anybody can help

Thx Bernhard
&lt;/pre&gt;</description>
    <dc:creator>Bernhard Pöchtrager</dc:creator>
    <dc:date>2012-05-24T14:31:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27686">
    <title>Re: IGMP v3</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27686</link>
    <description>&lt;pre&gt;

ping
&lt;/pre&gt;</description>
    <dc:creator>aviad rozenhek</dc:creator>
    <dc:date>2012-05-24T12:45:20</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27685">
    <title>Re: [PATCH 2/2] rtmp: Pass the proper return code in rtmp_handshake</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27685</link>
    <description>&lt;pre&gt;

LGTM

// Martin
&lt;/pre&gt;</description>
    <dc:creator>Martin Storsjö</dc:creator>
    <dc:date>2012-05-24T12:01:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.libav.devel/27684">
    <title>Re: [PATCH 1/2] rtmp: Check return codes of net IO operations</title>
    <link>http://permalink.gmane.org/gmane.comp.video.libav.devel/27684</link>
    <description>&lt;pre&gt;

LGTM

// Martin
&lt;/pre&gt;</description>
    <dc:creator>Martin Storsjö</dc:creator>
    <dc:date>2012-05-24T12:01:42</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.video.libav.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.video.libav.devel</link>
  </textinput>
</rdf:RDF>

