<div dir="ltr">Tim,<div style>Love to use 1.0 but this is eventually for an embedded target so I'm stuck with 0.10.</div><div style><br></div><div style>At any rate, if I don't set the appsrc/appsink caps with gst_app_sink/src_set_caps then I get a GST_MESSAGE_ERROR</div>
<div style>"Error in pipeline: Internal data flow error."</div><div style>That is why I initially started heading down the road of explicitly setting the caps. I like your idea of setting src caps off the first frame but that gives me a pipeline error "Could not negotiate format"</div>
<div style><br></div><div style>But, then I found that even when setting the caps the color channels were mixed up, but your great tip of setting the masks greatly helped.</div><div style>If I set the caps for the appsink (videotestsrc) to this</div>
<div style><div>          "blue_mask", G_TYPE_INT, 65280,</div><div>          "green_mask", G_TYPE_INT, 16711680,</div><div>          "red_mask", G_TYPE_INT, -16777216,</div><div style>And the caps for the appsrc (ximagesink) to this</div>
<div style><div>          "red_mask", G_TYPE_INT, 65280,</div><div>          "green_mask", G_TYPE_INT, 16711680,</div><div>          "blue_mask", G_TYPE_INT, -16777216,</div><div style>I get RGBA on the sink and BGRA on the src.</div>
<div style>What's sorta fascinating/annoying is that ximagesink really wants BGR ordering. If I try to use the RGB ordering from the videotestsrc caps the pipeline bails and says it "Could not negotiate format"</div>
<div style><br></div><div style>So, to summarize, my pipeline works but has BGRA ordering, which is fine but weird. Whoever wrote the ximagesink filter must have been an OpenCV developer ;)</div><div style>-rich</div><div style>
<br></div><div style><br></div><div style><br></div></div></div><div style><br></div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 26, 2013 at 7:37 AM, Tim-Philipp Müller <span dir="ltr"><<a href="mailto:t.i.m@zen.co.uk" target="_blank">t.i.m@zen.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 2013-05-25 at 21:04 -0700, Richard Cagley wrote:<br>
<br>
Hi Richard,<br>
<div class="im"><br>
> Thanks for the hint about endianness. The below gets me BGRA with B<br>
> being the LSB. This mask stuff is confusing. How do I get RGBA? What's<br>
> with the negative sign?<br>
><br>
<br>
</div>Yes, it's all very confusing, that's why we changed it in 1.0 :)<br>
<div class="im"><br>
> caps = gst_caps_new_simple ("video/x-raw-rgb",<br>
>           "endianness", G_TYPE_INT, 4321,<br>
>           "red_mask", G_TYPE_INT, 65280,<br>
>           "green_mask", G_TYPE_INT, 16711680,<br>
>           "blue_mask", G_TYPE_INT, -16777216,<br>
>           "width", G_TYPE_INT, 640,<br>
>           "height", G_TYPE_INT, 480,<br>
>           "framerate", GST_TYPE_FRACTION, 30000, 1001,<br>
>           NULL);<br>
<br>
</div>You may find<br>
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.36/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideo.html#gst-video-format-new-caps" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.36/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideo.html#gst-video-format-new-caps</a> and other utility functions useful. Ignore the negative signs for the mask, it's basically the unsigned integer cast to a signed integer.<br>

<br>
But again, why do you create the caps yourself?<br>
<br>
As I see it, if you're just passing the data through you should be doing<br>
something like this:<br>
<br>
buffer = gst_app_sink_pull_buffer (appsink)<br>
if (first_buffer) {<br>
  gst_app_src_set_caps  (appsrc, GST_BUFFER_CAPS (buffer));<br>
}<br>
gst_app_src_push_buffer (appsrc, buffer);<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888"> -Tim<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Sat, May 25, 2013 at 4:00 PM, Tim-Philipp Müller <<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>><br>
> wrote:<br>
>         On Sat, 2013-05-25 at 15:49 -0700, Richard Cagley wrote:<br>
><br>
>         Hi,<br>
><br>
>         > I'm using videotestsrc and ximagesink and changing the<br>
>         patterns on<br>
>         > videotestsrc and looking at the output. I also have some<br>
>         print<br>
>         > statements to read the raw data pointers.<br>
>         ><br>
>         ><br>
>         > What would cause this? I'm setting the caps like this...<br>
>         ><br>
>         ><br>
>         > caps = gst_caps_new_simple ("video/x-raw-rgb",<br>
>         >           "format", G_TYPE_STRING, "RGB",<br>
><br>
><br>
>         Are you using 1.0 or 0.10 ? Those caps look like a mix of<br>
>         both.<br>
><br>
><br>
>         In 0.10 it's<br>
>         video/x-raw-rgb,endianness=...,{red,blue,green,alpha}_mask=..<br>
><br>
>         In 1.0 it's video/x-raw,format=(string)xyz<br>
><br>
>         Why are you creating the caps yourself anyway? Why not just<br>
>         forward/set<br>
>         the caps you get on the appsink?<br>
><br>
>         Cheers<br>
>          -Tim<br>
><br>
><br>
>         _______________________________________________<br>
>         gstreamer-devel mailing list<br>
>         <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
>         <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
><br>
><br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br></div>