<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Video Render in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850684#M6505</link>
    <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Is there some sample code or a step by step guide available that implements a windows video render (DX or GDI)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Bale&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 13 Feb 2008 15:06:01 GMT</pubDate>
    <dc:creator>bale</dc:creator>
    <dc:date>2008-02-13T15:06:01Z</dc:date>
    <item>
      <title>Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850684#M6505</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Is there some sample code or a step by step guide available that implements a windows video render (DX or GDI)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Bale&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Feb 2008 15:06:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850684#M6505</guid>
      <dc:creator>bale</dc:creator>
      <dc:date>2008-02-13T15:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850685#M6506</link>
      <description>When you say "implements" do you mean uses an existing IPP/UMC video renderer? Or write a new one from the ground up? If you mean the former, simple_player.cpp calls AVSync, which itself is a layer that abstracts access to different decoders and renderers. You can compile simple_player.cpp in debug mode, then step through it and observe what it does. The code examples in umc-manual.pdf tend to not quite run when copied verbatim. If all of the above fails, I can post a sample use of video decoder that works for me.&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Feb 2008 15:21:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850685#M6506</guid>
      <dc:creator>franknatoli</dc:creator>
      <dc:date>2008-02-14T15:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850686#M6507</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes, I mean use the GDIRenderer to display video on the screen. I had not seen AVSync in the code, but I'll have a look through the sampleplayer code.&lt;BR /&gt;&lt;BR /&gt;Out of interest, when you wrote your decoder, did you use AVSync also or could you use the GDI/DX renderer directly?? Which would you recommend?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Bale&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Feb 2008 18:21:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850686#M6507</guid>
      <dc:creator>bale</dc:creator>
      <dc:date>2008-02-14T18:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850687#M6508</link>
      <description>I did not use AVSync because, as far as I can tell, AVSync having &lt;I&gt;zero&lt;/I&gt; documentation in umc-manual.pdf, there is no individual frame display control. You let it run, and a dedicated thread takes over until you say stop. My particular development context is multiple streams on multiple MDI child windows, so I need finer control than AVSync permits.&lt;BR /&gt;&lt;BR /&gt;I'm afraid my efforts to use GDIVideoRender came to nought. I decided to coerce the VideoData object produced by decoder GetFrame to deliver RGB32 bitmaps and I handled that data with my own OnPaint code.&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Feb 2008 21:00:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850687#M6508</guid>
      <dc:creator>franknatoli</dc:creator>
      <dc:date>2008-02-14T21:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850688#M6509</link>
      <description>&lt;BR /&gt;Yes, that is what I am resigned to do (display bitmaps). It is a pity that the GDIRenderer isn't better documented/supported as windows display can be a little messy...&lt;BR /&gt;&lt;BR /&gt;Regarding your display, what form does the video have to be in for the bitmap? At the moment, I have aYUV420 frame outputted from the decoder, and I use the ippiYUV420ToRGB_8u_P3(yuvArray, rgbArray, roiSize); function to convert it to RGB data. If I then try to create a bitmap and display it, the colours are incorrect. The command to create the bitmap I use is:&lt;BR /&gt;&lt;BR /&gt;Bitmap* newBitmap = new Bitmap(width, height , width, PixelFormat32bppRGB, (BYTE*)rgbBuffer);&lt;BR /&gt;&lt;BR /&gt;I am not sure where I am going wrong, but I guess it is one of three places: &lt;BR /&gt;(1) The Intel IPP RGB format that I convert to (currently RGB). &lt;BR /&gt;(2) The 'stride' of the Bitmap (currently set to be the video width), or &lt;BR /&gt;(3) The PixelFormat (currently set to PixelFormat32bppRGB).&lt;BR /&gt;&lt;BR /&gt;I have played around with all 3 of these settings, but cannot seem to get correct video. What settings have you got for these?? &lt;BR /&gt;&lt;BR /&gt;Thanks for your help so far,&lt;BR /&gt;&lt;BR /&gt;Bale&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Feb 2008 15:32:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850688#M6509</guid>
      <dc:creator>bale</dc:creator>
      <dc:date>2008-02-18T15:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850689#M6510</link>
      <description>Ah, there is a much simpler solution. When you Init your VideoData object, make the third argument the mode that corresponds to your video hardware, e.g.:&lt;BR /&gt;&lt;BR /&gt; //-------------------------------------------------------------------------&lt;BR /&gt; // initialize VideoOutput object&lt;BR /&gt; //-------------------------------------------------------------------------&lt;BR /&gt; UMC::VideoData videoOut;&lt;BR /&gt; umcResult = videoOut.SetAlignment(1);&lt;BR /&gt; if (umcResult != UMC::UMC_OK)&lt;BR /&gt; {&lt;BR /&gt;  str.Format("VideeoThread %s VideoData::SetAlignment failure %d", (LPCTSTR)m_strStreamPath, umcResult);&lt;BR /&gt;  AfxMessageBox(str);&lt;BR /&gt;  decoder-&amp;gt;Reset();&lt;BR /&gt;  decoder-&amp;gt;Close();&lt;BR /&gt;  splitter-&amp;gt;Stop();&lt;BR /&gt;  splitter-&amp;gt;Close();&lt;BR /&gt;  reader.Close();&lt;BR /&gt;  return;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; umcResult = videoOut.Init(&lt;BR /&gt;  videoTrackInfo-&amp;gt;clip_info.width,&lt;BR /&gt;  videoTrackInfo-&amp;gt;clip_info.height,&lt;BR /&gt;  UMC::RGB32); // formerly videoTrackInfo-&amp;gt;color_format&lt;BR /&gt; if (umcResult != UMC::UMC_OK)&lt;BR /&gt; {&lt;BR /&gt;  str.Format("VideoThread %s VideoData::Init failure %d", (LPCTSTR)m_strStreamPath, umcResult);&lt;BR /&gt;  AfxMessageBox(str);&lt;BR /&gt;  decoder-&amp;gt;Reset();&lt;BR /&gt;  decoder-&amp;gt;Close();&lt;BR /&gt;  splitter-&amp;gt;Stop();&lt;BR /&gt;  splitter-&amp;gt;Close();&lt;BR /&gt;  reader.Close();&lt;BR /&gt;  return;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; size_t videoSize = videoTrackInfo-&amp;gt;clip_info.width * videoTrackInfo-&amp;gt;clip_info.height * 4;&lt;BR /&gt; Ipp8u *lpVideo = (Ipp8u*)new BYTE[videoSize];&lt;BR /&gt; if (!lpVideo)&lt;BR /&gt; {&lt;BR /&gt;  AfxMessageBox("Memory allocation failure");&lt;BR /&gt;  videoOut.Close();&lt;BR /&gt;  decoder-&amp;gt;Reset();&lt;BR /&gt;  decoder-&amp;gt;Close();&lt;BR /&gt;  splitter-&amp;gt;Stop();&lt;BR /&gt;  splitter-&amp;gt;Close();&lt;BR /&gt;  reader.Close();&lt;BR /&gt;  return;&lt;BR /&gt; }&lt;BR /&gt; umcResult = videoOut.SetBufferPointer(lpVideo, videoSize);&lt;BR /&gt; if (umcResult != UMC::UMC_OK)&lt;BR /&gt; {&lt;BR /&gt;  str.Format("VideoThread %s VideoData::SetBufferPointer failure %d", (LPCTSTR)m_strStreamPath, umcResult);&lt;BR /&gt;  AfxMessageBox(str);&lt;BR /&gt;  videoOut.Close();&lt;BR /&gt;  decoder-&amp;gt;Reset();&lt;BR /&gt;  decoder-&amp;gt;Close();&lt;BR /&gt;  spl
itter-&amp;gt;Stop();&lt;BR /&gt;  splitter-&amp;gt;Close();&lt;BR /&gt;  reader.Close();&lt;BR /&gt;  return;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; videoOut.SetDataSize(0);&lt;BR /&gt;&lt;BR /&gt;Then when you call GetFrame, you'll indeed get video frames in RGB32, no fuss, no muss, no need to fiddle with YUV conversion, e.g.:&lt;BR /&gt;&lt;BR /&gt;  // get video data from the splitter&lt;BR /&gt;  UMC::MediaData videoIn;&lt;BR /&gt;  umcResult = splitter-&amp;gt;GetNextData(&amp;amp;videoIn, videoTrack);&lt;BR /&gt;  ...&lt;BR /&gt;  // if call to GetNextData was entirely successful then pass MediaData input to GetFrame&lt;BR /&gt;  if (umcResult == UMC::UMC_OK)&lt;BR /&gt;   umcResult = decoder-&amp;gt;GetFrame(&amp;amp;videoIn, &amp;amp;videoOut);&lt;BR /&gt;  // if call to GetNextData was not entirely successful then pass NULL input to GetFrame&lt;BR /&gt;  else&lt;BR /&gt;   umcResult = decoder-&amp;gt;GetFrame(NULL, &amp;amp;videoOut);&lt;BR /&gt;   ...&lt;BR /&gt;   struct UMC::VideoData::PlaneInfo planeInfo;&lt;BR /&gt;   for (int plane = 0; plane &amp;lt; videoOut.GetNumPlanes(); plane++)&lt;BR /&gt;   {&lt;BR /&gt;    videoOut.GetPlaneInfo(&amp;amp;planeInfo, plane);&lt;BR /&gt;    TRACE("VideoThread %s plane %d m_pPlane 0x%08X width %d height %d iSampleSize %d iSamples %d iBitDepth %d nPitch %d nOffset 0x%X nMemSize %u
",&lt;BR /&gt;     (LPCTSTR)m_strStreamPath,&lt;BR /&gt;     plane,&lt;BR /&gt;     planeInfo.m_pPlane,&lt;BR /&gt;     planeInfo.m_ippSize.width,&lt;BR /&gt;     planeInfo.m_ippSize.height,&lt;BR /&gt;     planeInfo.m_iSampleSize,&lt;BR /&gt;     planeInfo.m_iSamples,&lt;BR /&gt;     planeInfo.m_iBitDepth,&lt;BR /&gt;     planeInfo.m_nPitch,&lt;BR /&gt;     planeInfo.m_nOffset,&lt;BR /&gt;     planeInfo.m_nMemSize);&lt;BR /&gt;&lt;BR /&gt;    // if first plane then pass planar data to view&lt;BR /&gt;  
  if (plane == 0)&lt;BR /&gt;    {&lt;BR /&gt;     // if size of video frame has changed&lt;BR /&gt;     if (m_lpFrameData &amp;amp;&amp;amp;&lt;BR /&gt;      (planeInfo.m_ippSize.width != m_nFrameWidth || planeInfo.m_ippSize.height != m_nFrameHeight))&lt;BR /&gt;     {&lt;BR /&gt;      delete m_lpFrameData;&lt;BR /&gt;      m_lpFrameData = NULL;&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;     // if video frame not allocated&lt;BR /&gt;     if (!m_lpFrameData)&lt;BR /&gt;     {&lt;BR /&gt;      // check that memory size as expected&lt;BR /&gt;      if (planeInfo.m_nMemSize != planeInfo.m_ippSize.width * planeInfo.m_ippSize.height * 4)&lt;BR /&gt;      {&lt;BR /&gt;       str.Format("VideoThread %s m_nMemsize actual %u expected %u",&lt;BR /&gt;        (LPCTSTR)m_strStreamPath, planeInfo.m_nMemSize, planeInfo.m_ippSize.width * planeInfo.m_ippSize.height);&lt;BR /&gt;       AfxMessageBox(str);&lt;BR /&gt;       videoOut.Close();&lt;BR /&gt;       decoder-&amp;gt;Reset();&lt;BR /&gt;       decoder-&amp;gt;Close();&lt;BR /&gt;       splitter-&amp;gt;Stop();&lt;BR /&gt;       splitter-&amp;gt;Close();&lt;BR /&gt;       reader.Close();&lt;BR /&gt;  &amp;amp;nbs
p;     return;&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;      // save parameters&lt;BR /&gt;      m_nFrameWidth = planeInfo.m_ippSize.width;&lt;BR /&gt;      m_nFrameHeight = planeInfo.m_ippSize.height;&lt;BR /&gt;&lt;BR /&gt;      // allocate frame buffer&lt;BR /&gt;      m_lpFrameData = new BYTE[planeInfo.m_ippSize.width * planeInfo.m_ippSize.height * 4];&lt;BR /&gt;      if (!m_lpFrameData)&lt;BR /&gt;      {&lt;BR /&gt;       AfxMessageBox("Memory allocation failure");&lt;BR /&gt;       videoOut.Close();&lt;BR /&gt;       decoder-&amp;gt;Reset();&lt;BR /&gt;       decoder-&amp;gt;Close();&lt;BR /&gt;       splitter-&amp;gt;Stop();&lt;BR /&gt;       splitter-&amp;gt;Close();&lt;BR /&gt;       reader.Close();&lt;BR /&gt;       return;&lt;BR /&gt;      }&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;     // copy video frame data&lt;BR /&gt;     memcpy(m_lpFrameData, planeInfo.m_pPlane, planeInfo.m_nMemSize);&lt;BR /&gt;&lt;BR /&gt;     // repaint view&lt;BR /&gt;     Invalidate(m_bErase);&lt;BR /&gt;&lt;BR /&gt;Then in your OnPaint, which is triggered by the Invalidate, all you need to do is:&lt;BR /&gt;&lt;BR /&gt; DWORD dwVideoBitsPerPixel = dc.GetDeviceCaps(BITSPIXEL);&lt;BR /&gt;&lt;BR /&gt; if (m_lpBitmap)&amp;lt;
br&amp;gt; {&lt;BR /&gt;  // if CBitmap dimensions has changed since last allocated&lt;BR /&gt;  if (m_nBitmapWidth != m_nFrameWidth ||&lt;BR /&gt;   m_nBitmapHeight != m_nFrameHeight)&lt;BR /&gt;  {&lt;BR /&gt;   m_lpBitmap-&amp;gt;DeleteObject();&lt;BR /&gt;   m_lpBitmap-&amp;gt;CreateBitmap(m_nFrameWidth, m_nFrameHeight, 1, dwVideoBitsPerPixel, NULL);&lt;BR /&gt;   m_nBitmapWidth = m_nFrameWidth;&lt;BR /&gt;   m_nBitmapHeight = m_nFrameHeight;&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt; // if CBitmap object not already allocated&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt;  m_lpBitmap = new CBitmap();&lt;BR /&gt;  m_lpBitmap-&amp;gt;CreateBitmap(m_nFrameWidth, m_nFrameHeight, 1, dwVideoBitsPerPixel, NULL);&lt;BR /&gt;  m_nBitmapWidth = m_nFrameWidth;&lt;BR /&gt;  m_nBitmapHeight = m_nFrameHeight;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // copy frame bitmap into GDI bitmap&lt;BR /&gt; m_lpBitmap-&amp;gt;SetBitmapBits(m_nBitmapWidth * m_nBitmapHeight * dwVideoBitsPerPixel &amp;gt;&amp;gt; 3, m_lpFrameData);&lt;BR /&gt; CDC dcMem;&lt;BR /&gt; dcMem.CreateCompatibleDC(&amp;amp;dc);&lt;BR /&gt; CBitmap *BitmapOld = dcMem.SelectObject(m_lpBitmap);&lt;BR /&gt; dc.BitBlt(0, 0, m_nBitmapWidth, m_nBitmapHeight, &amp;amp;dcMem, 0, 0, SRCCOPY);&lt;BR /&gt; dcMem.SelectObject(BitmapOld);&lt;BR /&gt; dcMem.DeleteDC();&lt;BR /&gt;&lt;BR /&gt;If the above is not clear, let me know, I'll attach the complete source.&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Feb 2008 16:01:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850689#M6510</guid>
      <dc:creator>franknatoli</dc:creator>
      <dc:date>2008-02-18T16:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Video Render</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850690#M6511</link>
      <description>&lt;BR /&gt;Thanks again for the reply.&lt;BR /&gt;&lt;BR /&gt;Unfortunately, I need to be able to read both YUV and RGB data for display, so I will have to use either the IPP color space converters or write one of my own (for YUV, for the RGB I can do as you indicated). &lt;BR /&gt;&lt;BR /&gt;Could you send the source to balebrennan@gmail.com if you can? I am not really used to windows programming (Bitmaps, handles etc) and would like to play around with it to see if I can figure it out.&lt;BR /&gt;&lt;BR /&gt;Thanks for all your help!&lt;BR /&gt;&lt;BR /&gt;Bale&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Feb 2008 18:26:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Video-Render/m-p/850690#M6511</guid>
      <dc:creator>bale</dc:creator>
      <dc:date>2008-02-18T18:26:07Z</dc:date>
    </item>
  </channel>
</rss>

