Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#9

AW: DirectX9 Header für 64Bit

  Alt 17. Sep 2018, 22:31
Geht immer noch nicht wirklich.
1 Fehler in VMR7 Renderer funktioniert in 32Bit aber nicht in 64Bit

Fehler!
COM Error 0x80040227, The operation could not be performed because the filter is in the wrong state.
oder
COM Error 0x80040227, Der Vorgang konnte nicht ausgeführt werden, da der Filterstatus falsch ist.'

Delphi-Quellcode:
function TVMR7.SetBitmapFromImage(Image_: TBitmap; nAlpha: word; bitmapRect: TRECT): BOOL;
var
  hr: HRESULT;
  nRect: VMR9NormalizedRect;
  sRect, dRect: TRECT;
begin
  result := false;

  if (VMR7MixerBitmap = nil) then
  begin
       m_ErrorDescription := ReportError('Can''t set bitmap, no VMR7MixerBitmap', E_FAIL);
    exit;
  end;

  if Image_ = nil then
  begin
    alphaBitmap7.dwFlags := VMRBITMAP_DISABLE;
    hr := VMR7MixerBitmap.SetAlphaBitmap(alphaBitmap7);
    result := (SUCCEEDED(hr));
    if result then
      bIsOverlayImage := false;
    exit;
  end;

  // Accept only 32bit ARGB or 24bit RGB formatted image
  if (Image_.PixelFormat <> pf32bit) and (Image_.PixelFormat <> pf24bit) then
  begin
       m_ErrorDescription := ReportError('not a supported bitmap format', E_FAIL);
    exit;
  end;

  if not PrepareDDSurface(Image_, bitmapRect) then
    exit;

  if FAILED(m_pWindowless.GetVideoPosition(sRect, dRect)) then
    exit;

  nRect := NormalizeRect(sRect, bitmapRect);
  alphaBitmap7.dwFlags    := VMRBITMAP_ENTIREDDS;
  alphaBitmap7.hdc            := 0;
  alphaBitmap7.pDDS         := m_pDDSurface;
  alphaBitmap7.rDest.top   := nRect.top;
  alphaBitmap7.rDest.left := nRect.left;
  alphaBitmap7.rDest.bottom := nRect.bottom;
  alphaBitmap7.rDest.right    := nRect.right;
  alphaBitmap7.fAlpha       := nAlpha / 255.0;
  alphaBitmap7.clrSrcKey   := 0;

  // SHOW the bitmap
  hr := VMR7MixerBitmap.SetAlphaBitmap(alphaBitmap7); // Fehler nur unter 64Bit

  m_pWindowless.RepaintVideo(m_hMediaWindow, m_hMediaDC);
  result := (SUCCEEDED(hr));
  if result then
    bIsOverlayImage := true;
end;
getestet mit meinen und den direkten Headern von Emba /rtl/win
Der Video Renderer meldet keine Fehler (Filme spielen gut ab) nur das mit dem Overlay Bitmap will nicht.

gruss

Geändert von EWeiss (17. Sep 2018 um 23:25 Uhr)
  Mit Zitat antworten Zitat