<div>Hi, Time</div>
<div>&nbsp;</div>
<div>Thank you for your valuable inforamtion.</div>
<div>As your suggestion, we want to support 2d_sub_buffer<span lang="EN-US" style="FONT-SIZE: 10.5pt"> , it will be more meanful if the idea could be accepted by opensource experts, so could you help review the idea and feasibility&nbsp;in advance.
</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt"></span>&nbsp;</div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt">See this figure,&nbsp;we just want to render display 2d_sub_buffer (x, y, w, h), which&nbsp;is located inside transferd buffer.</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt"></span>&nbsp;</div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt">Note: 2d_sub_buffer&nbsp;is based on the original buffer, they are sharing memory and without memcpy. Here sub buffer just used to notify the sub area, no new buffer is created.
</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt"></span>&nbsp;</div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt">Problem is how to negotiate with render where is the effective area.</span></div>
<div><font face="Arial" size="1"><span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><img height="124" src="cid:image001.jpg@01C7C474.1EF34BA0" width="214"></span></font></div>
<div><br>New caps area is &quot;<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
2d_sud_buffer</span>&quot;, if render do not detect such area, it will do as usual to ensure compatibility, and render display the whole area.</div>
<div>&nbsp;</div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
2d_sud_buffer </span>structure is&nbsp;as following, same as GstVideoRectangle.</div>
<div>&nbsp;</div>
<div>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">typedef struct _2d_sud_buffer 2d_sud_buffer;</font></span></p></div>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">/**</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;</span>* 2d_sud_buffer:</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;</span>* @x: X coordinate of 2d-sud-buffer&#39;s top-left point</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;</span>* @y: Y coordinate of 2d-sud-buffer &#39;s top-left point</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;</span>* @w: width of the 2d-sud-buffer</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;</span>* @h: height of the 2d-sud-buffer</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp;</span>*</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">*/</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">struct _2d_sud_buffer {</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp; </span>gint x;</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp; </span>gint y;</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp; </span>gint w;</font></span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span style="mso-spacerun: yes">&nbsp; </span>gint h;</font></span></p>
<div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">};</font></span></div>
<div class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"></font></span>&nbsp;</div>
<div>Option 1:</div>
<div>Just send address of the 2d_sub_buffer by G_TYPE_INT.</div>
<div>In render set_capas function, we re-construct this structure by <span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
(2d_sub_buffer *) priv.</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
</span>&nbsp;</div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
Option 2:</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
Add one field in caps, such as G_TYPE_2D_SUB_BUFFER.</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
transmitter caps:</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
gst_caps_new_simple (&quot;video/x-raw-yuv&quot;, <br>&nbsp;&nbsp;&quot;format&quot;, GST_TYPE_FOURCC, GST_MAKE_FOURCC (&#39;Y&#39;, &#39;V&#39;, &#39;1&#39;, &#39;2&#39;), <br>&nbsp;&nbsp;&quot;width&quot;, G_TYPE_INT, frameWidth, <br>&nbsp;&nbsp;&quot;height&quot;, G_TYPE_INT, frameHeight, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&quot;framerate&quot;, GST_TYPE_FRACTION, num, den,<br>&nbsp;<strong>&nbsp;&quot;2d_sub_buffer&quot;, <font face="Times New Roman">G_TYPE_2D_SUB_BUFFER, </font>x, y, w, h,<br></strong>&nbsp;&nbsp;NULL);</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
</span>&nbsp;</div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
reciver set_caps:</span></div>
<div><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: &#39;Times New Roman&#39;; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
if ((value = gst_structure_get_value (str, &quot;2d_sub_buffer&quot;))) {<br>&nbsp;&nbsp;&nbsp;rect.x = gst_value_get_2d_sub_buffer_x(value);<br>&nbsp;&nbsp;&nbsp;rect.y = gst_value_get_2d_sub_buffer_y(value);<br>&nbsp;&nbsp;&nbsp;rect.w = gst_value_get_2d_sub_buffer_w(value);
<br>&nbsp;&nbsp;&nbsp;rect.h = gst_value_get_2d_sub_buffer_h(value);<br>&nbsp;&nbsp;}</span></div>
<div><br>&nbsp;If use option 2, Gstvalue.c and Gststructure.c need add&nbsp;a patch.</div>
<div><span class="type"></span>&nbsp;</div>
<div><span class="type">Could you give some suggestions.</span></div>
<div><span class="type">Waiting for your instructions.</span></div>
<div><span class="type"></span>&nbsp;</div>
<div><span class="type">Thanks.</span></div>
<div><span class="type"></span>&nbsp;</div>
<div><span class="type"></span>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 7/5/07, <b class="gmail_sendername">Tim Müller</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:t.i.m@zen.co.uk" target="_blank">t.i.m@zen.co.uk</a>&gt; wrote:
</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Thu, 2007-07-05 at 21:11 +0800, zhangfei gao wrote:<br><br>&gt; I am really wandering whether GStreamer supports transfering buffer 
<br>&gt; with padding or stride.<br>&gt; How to send information to post element that only pats of buffer is<br>&gt; effective.<br>&gt; Does caps negotiations support this function.<br>&gt;<br>&gt; If gstreamer can not support this feature, one aditional memcpy can 
<br>&gt; not be saved, which may down 3~4fps.<br><br>Unfortunately, GStreamer does not support this yet.&nbsp;&nbsp;Strides and row<br>padding for the various formats in GStreamer are mostly implicit at the<br>moment.&nbsp;&nbsp;Border padding/cropping isn&#39;t defined/used at all.&nbsp;&nbsp;It&#39;s 
<br>something we want to fix though, it&#39;s just that no one has gotten around<br>to actually doing it yet.<br><br>You are of course free to create your own video/x-raw-my-yuv format<br>which has additional parameters like that, but obviously that would only 
<br>work for GStreamer pipelines (or parts thereof) that consist only of<br>elements you have written and not any of the stock GStreamer elements.<br><br>Cheers<br>-Tim<br><br><br><br>------------------------------------------------------------------------- 
<br>This SF.net email is sponsored by DB2 Express<br>Download DB2 Express C - the FREE version of DB2 express and take<br>control of your XML. No limits. Just data. Click to get it now.<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sourceforge.net/powerbar/db2/" target="_blank">
http://sourceforge.net/powerbar/db2/</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">
gstreamer-devel@lists.sourceforge.net</a> <br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
</a><br></blockquote></div><br>