procedure TForm7.PlayTHIS(Sender: TObject; This :
String);
begin
if FGVideo.Active
then begin
Form7.FGVideo.Stop;
Form7.FGVideo.Active := False;
Form7.FGVideo.ClearGraph;
Form7.DCVISPluginRenderer1.Plugins.SetAudiofilter(
nil);
Form7.FgVideo.DisconnectFilters;
end;
if not Form7.FGVideo.Active
then Form7.FGVideo.Active := True;
Form7.FGVideo.ClearGraph;
Sleep(100);
try
Errorcode := Form7.FGVideo.RenderFile(this);
//////////////// HIER IST WOHL DAS PROBLEM IRGENDWIE
CodecError := GetEventCodeDef(Errorcode);
if (CodecError = '
')
OR ( CodecError = '
')
then CodecError := '
No AV File';
if (Errorcode = 0000)
OR (Errorcode = S_OK)
OR (Errorcode = VFW_S_PARTIAL_RENDER)
OR (Errorcode = VFW_S_AUDIO_NOT_RENDERED)
OR (Errorcode = VFW_S_DUPLICATE_NAME)
OR (Errorcode = VFW_S_VIDEO_NOT_RENDERED)
then begin //alles ok
try
if VisualsMR
then Form7.DCVISPluginRenderer1.Plugins.SetAudiofilter(Form7.FGDSFilter
as IBaseFilter);
except
//Plugins Problem
end;
try
Form7.FGVideo.Play;
Playing := True;
except
//Trying to Play Error
Working := False;
StopALL;
Exit;
end;
end
else begin
//CodecFehler
ErrorDesc := '
Unbekannter Fehler';
Case Errorcode
of
E_ABORT : ErrorDesc := '
Operation aborted';
E_FAIL : ErrorDesc := '
Failure';
E_INVALIDARG : ErrorDesc := '
Argument is invalid';
E_OUTOFMEMORY : ErrorDesc := '
Insufficient memory';
E_POINTER : ErrorDesc := '
Null pointer argument';
VFW_E_CANNOT_CONNECT : ErrorDesc := '
No combination of intermediate filters could be found to make the connection';
VFW_E_CANNOT_LOAD_SOURCE_FILTER : ErrorDesc := '
The source filter for this file could not be loaded';
VFW_E_CANNOT_RENDER : ErrorDesc := '
No combination of filters could be found to render the stream';
VFW_E_INVALID_FILE_FORMAT : ErrorDesc := '
The file format is invalid';
VFW_E_NOT_FOUND : ErrorDesc := '
An object or name was not found';
VFW_E_UNKNOWN_FILE_TYPE : ErrorDesc := '
The media type of this file is not recognized';
VFW_E_UNSUPPORTED_STREAM : ErrorDesc := '
Cannot play back the file: the format is not supported';
end;
Errorcode := 0001;
Working := False;
StopALL;
Exit;
end;
except
//Renderfile Error oder System überlastet
Errorcode := 0001;
Working := False;
StopALL;
Exit;
end;
end;
//ALLES OK Player läuft
if (Errorcode = 0000)
OR (Errorcode = S_OK)
OR (Errorcode = VFW_S_PARTIAL_RENDER)
OR (Errorcode = VFW_S_AUDIO_NOT_RENDERED)
OR (Errorcode = VFW_S_DUPLICATE_NAME)
OR (Errorcode = VFW_S_VIDEO_NOT_RENDERED)
then begin
deskdisplay.Label2.Caption := '
Jetzt läuft:';
TrackCounter := TrackCounter +1;
Form7.PlayTime.Enabled := True;
REMOVE := False;
Playing := True;
end;
end
end;