1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>glimagesink: GStreamer Base Plugins 1.0 Plugins Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-base Elements"> 9<link rel="prev" href="gst-plugins-base-plugins-glimagesinkelement.html" title="glimagesinkelement"> 10<link rel="next" href="gst-plugins-base-plugins-glmixerbin.html" title="glmixerbin"> 11<meta name="generator" content="GTK-Doc V1.28 (XML mode)"> 12<link rel="stylesheet" href="style.css" type="text/css"> 13</head> 14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#gst-plugins-base-plugins-glimagesink.description" class="shortcut">Description</a></span> 19</td> 20<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 21<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 22<td><a accesskey="p" href="gst-plugins-base-plugins-glimagesinkelement.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 23<td><a accesskey="n" href="gst-plugins-base-plugins-glmixerbin.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 24</tr></table> 25<div class="refentry"> 26<a name="gst-plugins-base-plugins-glimagesink"></a><div class="titlepage"></div> 27<div class="refnamediv"><table width="100%"><tr> 28<td valign="top"> 29<h2><span class="refentrytitle"><a name="gst-plugins-base-plugins-glimagesink.top_of_page"></a>glimagesink</span></h2> 30<p>glimagesink</p> 31</td> 32<td class="gallery_image" valign="top" align="right"></td> 33</tr></table></div> 34<div class="refsect1"> 35<a name="gst-plugins-base-plugins-glimagesink.description"></a><h2>Description</h2> 36<p>glimagesink renders video frames to a drawable on a local or remote 37display using OpenGL. This element can receive a Window ID from the 38application through the VideoOverlay interface and will then render video 39frames in this drawable. 40If no Window ID was provided by the application, the element will 41create its own internal window and render into it.</p> 42<p>See the <a href="../html/GstGLDisplay.html#GstGLDisplay-struct"><span class="type">GstGLDisplay</span></a> documentation for a list of environment variables that 43can override window/platform detection.</p> 44<div class="refsect3"> 45<a name="id-1.2.55.3.4"></a><h4>Scaling</h4> 46<p>Depends on the driver, OpenGL handles hardware accelerated 47scaling of video frames. This means that the element will just accept 48incoming video frames no matter their geometry and will then put them to the 49drawable scaling them on the fly. Using the <a class="link" href="gst-plugins-base-plugins-glimagesinkelement.html#GstGLImageSink--force-aspect-ratio" title="The “force-aspect-ratio” property"><span class="type">“force-aspect-ratio”</span></a> 50property it is possible to enforce scaling with a constant aspect ratio, 51which means drawing black borders around the video frame.</p> 52</div> 53<div class="refsect3"> 54<a name="id-1.2.55.3.5"></a><h4>Events</h4> 55<p>Through the gl thread, glimagesink handle some events coming from the drawable 56to manage its appearance even when the data is not flowing (GST_STATE_PAUSED). 57That means that even when the element is paused, it will receive expose events 58from the drawable and draw the latest frame with correct borders/aspect-ratio.</p> 59</div> 60<div class="refsect3"> 61<a name="id-1.2.55.3.6"></a><h4>Examples</h4> 62<div class="informalexample"> 63 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 64 <tbody> 65 <tr> 66 <td class="listing_lines" align="right"><pre>1</pre></td> 67 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v videotestsrc <span class="gtkdoc opt">!</span> video<span class="gtkdoc opt">/</span>x<span class="gtkdoc opt">-</span>raw <span class="gtkdoc opt">!</span> glimagesink</pre></td> 68 </tr> 69 </tbody> 70 </table> 71</div> 72 73<p> A pipeline to test hardware scaling. 74No special opengl extension is used in this pipeline, that's why it should work 75with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3.</p> 76<div class="informalexample"> 77 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 78 <tbody> 79 <tr> 80 <td class="listing_lines" align="right"><pre>1</pre></td> 81 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v videotestsrc <span class="gtkdoc opt">!</span> video<span class="gtkdoc opt">/</span>x<span class="gtkdoc opt">-</span>raw<span class="gtkdoc opt">,</span>format<span class="gtkdoc opt">=</span>I420 <span class="gtkdoc opt">!</span> glimagesink</pre></td> 82 </tr> 83 </tbody> 84 </table> 85</div> 86 87<p> A pipeline to test hardware scaling and hardware colorspace conversion. 88When your driver supports GLSL (OpenGL Shading Language needs OpenGL >= 2.1), 89the 4 following format YUY2, UYVY, I420, YV12 and AYUV are converted to RGB32 90through some fragment shaders and using one framebuffer (FBO extension OpenGL >= 1.4). 91If your driver does not support GLSL but supports MESA_YCbCr extension then 92the you can use YUY2 and UYVY. In this case the colorspace conversion is automatically 93made when loading the texture and therefore no framebuffer is used.</p> 94<div class="informalexample"> 95 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 96 <tbody> 97 <tr> 98 <td class="listing_lines" align="right"><pre>1</pre></td> 99 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v gltestsrc <span class="gtkdoc opt">!</span> glimagesink</pre></td> 100 </tr> 101 </tbody> 102 </table> 103</div> 104 105<p> A pipeline 100% OpenGL. 106No special opengl extension is used in this pipeline, that's why it should work 107with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3.</p> 108<div class="informalexample"> 109 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 110 <tbody> 111 <tr> 112 <td class="listing_lines" align="right"><pre>1</pre></td> 113 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>plugins<span class="gtkdoc opt">-</span>bas<span class="gtkdoc opt">/</span>tests<span class="gtkdoc opt">/</span>examples<span class="gtkdoc opt">/</span>gl<span class="gtkdoc opt">/</span>generic<span class="gtkdoc opt">/</span>cube</pre></td> 114 </tr> 115 </tbody> 116 </table> 117</div> 118 119<p> The graphic FPS scene can be greater than the input video FPS. 120The graphic scene can be written from a client code through the 121two glfilterapp properties.</p> 122</div> 123<div class="refsynopsisdiv"> 124<h2>Synopsis</h2> 125<div class="refsect2"> 126<a name="id-1.2.55.3.7.1"></a><h3>Element Information</h3> 127<div class="variablelist"><table border="0" class="variablelist"> 128<colgroup> 129<col align="left" valign="top"> 130<col> 131</colgroup> 132<tbody> 133<tr> 134<td><p><span class="term">plugin</span></p></td> 135<td> 136 <a class="link" href="gst-plugins-base-plugins-plugin-opengl.html#plugin-opengl">opengl</a> 137 </td> 138</tr> 139<tr> 140<td><p><span class="term">author</span></p></td> 141<td>Matthew Waters <matthew@centricular.com></td> 142</tr> 143<tr> 144<td><p><span class="term">class</span></p></td> 145<td>Sink/Video</td> 146</tr> 147</tbody> 148</table></div> 149</div> 150<hr> 151<div class="refsect2"> 152<a name="id-1.2.55.3.7.2"></a><h3>Element Pads</h3> 153<div class="variablelist"><table border="0" class="variablelist"> 154<colgroup> 155<col align="left" valign="top"> 156<col> 157</colgroup> 158<tbody> 159<tr> 160<td><p><span class="term">name</span></p></td> 161<td>sink</td> 162</tr> 163<tr> 164<td><p><span class="term">direction</span></p></td> 165<td>sink</td> 166</tr> 167<tr> 168<td><p><span class="term">presence</span></p></td> 169<td>always</td> 170</tr> 171<tr> 172<td><p><span class="term">details</span></p></td> 173<td>video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 174</tr> 175<tr> 176<td><p><span class="term"></span></p></td> 177<td> video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 178</tr> 179<tr> 180<td><p><span class="term"></span></p></td> 181<td> video/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 182</tr> 183<tr> 184<td><p><span class="term"></span></p></td> 185<td> video/x-raw(meta:GstVideoGLTextureUploadMeta, meta:GstVideoOverlayComposition), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 186</tr> 187<tr> 188<td><p><span class="term"></span></p></td> 189<td> video/x-raw(memory:GLMemory), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 190</tr> 191<tr> 192<td><p><span class="term"></span></p></td> 193<td> video/x-raw(memory:DMABuf), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 194</tr> 195<tr> 196<td><p><span class="term"></span></p></td> 197<td> video/x-raw, format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 198</tr> 199<tr> 200<td><p><span class="term"></span></p></td> 201<td> video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> 202</tr> 203</tbody> 204</table></div> 205</div> 206</div> 207</div> 208<div class="refsect1"> 209<a name="gst-plugins-base-plugins-glimagesink.functions_details"></a><h2>Functions</h2> 210<p></p> 211</div> 212<div class="refsect1"> 213<a name="gst-plugins-base-plugins-glimagesink.other_details"></a><h2>Types and Values</h2> 214</div> 215</div> 216<div class="footer"> 217<hr>Generated by GTK-Doc V1.28</div> 218</body> 219</html>