AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TFilterGraph in einer DLL

Ein Thema von calibra301 · begonnen am 2. Nov 2012 · letzter Beitrag vom 3. Nov 2012
 
calibra301

Registriert seit: 20. Mär 2009
109 Beiträge
 
Delphi XE8 Professional
 
#6

AW: TFilterGraph in einer DLL

  Alt 2. Nov 2012, 11:04
Leider auch ne Niete.

Hier mal alles:
Delphi-Quellcode:
library MyVideo;

uses
  ShareMem ,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,DSPack,dsutil,DirectShow9,ExtCtrls;


var
 FilterGraph : TFilterGraph;
 Videowindow : TVideowindow;
 Videoform:TForm;

function PlayVideo:Boolean; stdcall;
begin

  Videoform:=TForm.Create(nil);
  Videoform.Left:=100; //Mon.Left - Videoform.Monitor.Left;
  Videoform.Top :=100; // Mon.Top - Videoform.Monitor.Top;
  Videoform.Width := 256;//screen.Monitors[0].Width;
  Videoform.Height:= 256;//screen.Monitors[0].height;
  Videoform.BorderStyle:=bsnone;
  Videoform.Color:=clblack;
  Videoform.Visible:=true;

  FilterGraph := TFilterGraph.Create(nil);
  FilterGraph.Mode := gmNormal;
  FilterGraph.Name := 'FilterGraph';

  VideoWindow := TVideoWindow.Create(nil);
  VideoWindow.Parent := Videoform;
  VideoWindow.Left := 10;
  VideoWindow.Top := 10;
  VideoWindow.FilterGraph := FilterGraph;
  VideoWindow.Name := 'form1';
  VideoWindow.VMROptions.Mode := vmrWindowed;
  VideoWindow.Visible := true;

  VideoWindow.FilterGraph := FilterGraph;
  VideoWindow.FilterGraph.Active := false;
  VideoWindow.FilterGraph.AutoCreate := false;
  VideoWindow.FilterGraph.GraphEdit := false;
  VideoWindow.FilterGraph.Mode := gmNormal;
  VideoWindow.FullScreen := false;
  VideoWindow.Mode := vmNormal;

  FilterGraph.ClearGraph;
  FilterGraph.Active := false;
  FilterGraph.Active := true;
  FilterGraph.RenderFile('C:\Test.avi');
  FilterGraph.Play;

  PlayVideo:=true;
end;


exports
  PlayVideo;
begin

end.

Aufruf:
Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

  procedure PlayVideo; external 'Project1.dll'

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
 PlayVideo;
end;

Wie gesagt...als Form-Anwendung tuts der Code (mit **.create(self) );

Gruss
Guido
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:47 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz