<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:8.0pt;
        margin-left:0cm;
        line-height:106%;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">We are streaming data from appsrc into a v4l2sink. Therefore, we are using v4l2loopback on /dev/videoX. The camera has a fix resolution of 640x480 and a variable framerate. The framerate is set up at the beginning with
 a library provided by the manufacturer. The data is 16 Bit Gray LE. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The problem is, that Gstreamer always wants to put 33 frame per second into the sink. So, if we choose 60fps, it’s 33fps and if we choose 30fps, it isn’t working. Every value bigger than 33fps is working, but only 33fps
 in real and every value lower than 33 fps is not working at all.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Before this, we already set the framerate and pushed data into a multifilesink or a udpsink with correct frame rate at the end. So, the initialization should not be the problem. Is there anything special to remind working
 with v42sink and v4l2loopback?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">This is from our application, I removed error checks etc:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">cb_need_data (GstElement *</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">appsrc</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">          guint      
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">unused_size</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">          gpointer   
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">user_data</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">{<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  </span>
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">static</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> GstClockTime timestamp = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  GstBuffer *buffer;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  GstFlowReturn ret;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">    <o:p>
</o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  GstMapInfo map;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  eDALProxy640USBErr eReturnCode;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  buffer = gst_buffer_new_and_alloc(IRIMAGE_NBPIXELS*2);
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">//allocate 2 Bytes for every pixel</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  </span>
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">if</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">(gst_buffer_map (buffer, &map, GST_MAP_WRITE)) {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">while</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">true</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">         {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">             eReturnCode = Proxy640USB_GetImage(m_Handle, (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">short</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">unsigned</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">*)map.data, paMeta,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">GETIMAGE_TIMEOUT</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">            
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">if</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"> (eReturnCode == eProxy640USBSuccess)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">                   
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue">break</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">         }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  GST_BUFFER_PTS (buffer) = timestamp;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND, 33);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  timestamp += GST_BUFFER_DURATION (buffer);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  g_signal_emit_by_name (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">appsrc</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"push-buffer"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, buffer, &ret);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  </span>
<span style="font-size:9.5pt;font-family:Consolas;color:black">gst_buffer_unmap(buffer, &map);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;color:black">  </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">gst_buffer_unref(buffer);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">gint main (gint
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">argc</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, gchar *</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">argv</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">[])<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">{<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">sprintf(DEVICE,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"/dev/video0"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// GStreamer</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  GstElement *pipeline, *converter, *videosink, *videosrc, *appsrc;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  gst_init (&</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">argc</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
 &</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:gray">argv</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  loop = g_main_loop_new (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
 FALSE);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// LWIR device</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  m_Handle =
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  eAGCProcessingValue agcVal = eAGCEnhanced;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  eDALProxy640USBErr eReturnCode;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  eReturnCode = Proxy640USB_GetModuleCount(&iCount);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Connect to LWIR</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><br>
eReturnCode = Proxy640USB_ConnectToModule(0, &m_Handle);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Set Processing depending of parameters (NUC/AGC/Shutterless/Framerate)</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  Proxy640USB_SetNUCProcessing(m_Handle, bBP, nuc);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  Proxy640USB_SetShutterLessProcessing(m_Handle, bSL);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  Proxy640USB_SetFloatFeature(m_Handle, efFrameRate, FRAMERATE);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  Proxy640USB_SetAGCProcessing(m_Handle, agcVal);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  Proxy640USB_SetUIntFeature(m_Handle, eiVideoUSBOutActivation, 1);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Setup Pipeline</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  pipeline = gst_pipeline_new (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"LWIR-streamer"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  appsrc = gst_element_factory_make (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"appsrc"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"source"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  videosrc = gst_element_factory_make(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"videotestsrc"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"source"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  converter = gst_element_factory_make (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"videoconvert"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"converter"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  videosink = gst_element_factory_make (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"v4l2sink"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"videosink"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  g_object_set (videosink,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"device"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, DEVICE,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Setting Capabilities</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  g_object_set (G_OBJECT (appsrc),
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"caps"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">        gst_caps_new_simple (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"video/x-raw"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">                    
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"format"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, G_TYPE_STRING,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"GRAY16_LE"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">                    
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"width"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, G_TYPE_INT, IRIMAGE_WIDTH,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">                    
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"height"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, G_TYPE_INT, IRIMAGE_HEIGHT,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">                    
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"framerate"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, GST_TYPE_FRACTION, FRAMERATE, 1,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">                    
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">),
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  gst_bin_add_many (GST_BIN (pipeline), appsrc, converter, videosink,</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  gst_element_link_many (appsrc, converter, videosink,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">// Setup appsrc to cd_need_data</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  g_object_set (G_OBJECT (appsrc),<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"stream-type"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, 0,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"format"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, GST_FORMAT_TIME,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  g_signal_connect (appsrc,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515">"need-data"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">, G_CALLBACK (cb_need_data),
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#6F008A">NULL</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  </span>
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:green">/* play */</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  gst_element_set_state (pipeline, GST_STATE_PLAYING);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal;text-autospace:none">
<span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black">  g_main_loop_run (loop);<o:p></o:p></span></p>
</div>
</body>
</html>