locked
VideoProcessBlt, where sample rects partially extend beyond main window. How do I get auto clipping? RRS feed

  • Question

  • If I call VideoProcessBlt, where the rect for the sample (I only have one sample) is totally inside main window, I have no problem.

     

    If the rect partially extends beyond any edge, there is no auto clipping, I get a E_INVALIDARG return on call.

    How do I get auto clipping?

     

    Tuesday, March 29, 2011 7:01 PM

All replies

  •  //
     // Initialize sub stream video sample.
     //
     samples[1] = samples[0];
    
     // DXVA2_VideoProcess_SubStreamsExtended
     samples[1].SampleFormat = samples[0].SampleFormat;
    
     // DXVA2_VideoProcess_SubStreams
     samples[1].SampleFormat.SampleFormat = DXVA2_SampleSubStream;
    
     samples[1].SrcSurface = g_pSubStream;
    
     samples[1].SrcRect = VIDEO_SUB_RECT;
    
     samples[1].DstRect = ssdest; 
    
     if (!UpdateSubStream())
     {
      return FALSE;
     }
    
     if (g_TargetWidthPercent < 100 || g_TargetHeightPercent < 100)
     {
      hr = g_pD3DD9->ColorFill(g_pD3DRT, NULL, D3DCOLOR_XRGB(0, 0, 0));
    
      if (FAILED(hr))
      {
       DBGMSG((TEXT("ColorFill failed with error 0x%x.\n"), hr));
      }
     }
    
     hr = g_pDXVAVPD->VideoProcessBlt(g_pD3DRT,
              &blt,
              samples,
              SUB_STREAM_COUNT + 1,
              NULL);
    
    



    code snippet

    if ssdest

    samples[1].DstRect = ssdest; 

    is within boundary, then g_pDXVAVPD->VideoProcessBlt(...) succeeds, otherwise it fails with: hr=E_INVALIDARG.


    Tuesday, March 29, 2011 7:03 PM