|
@@ -603,8 +603,12 @@ end;
|
|
|
|
|
|
procedure TCustomVLCMediaPlayer.SetAspectRatio(AValue: String);
|
|
procedure TCustomVLCMediaPlayer.SetAspectRatio(AValue: String);
|
|
|
|
|
|
|
|
+var
|
|
|
|
+ A : AnsiString;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
- libvlc_video_set_aspect_ratio(Instance,Pcchar(PChar(AValue)));
|
|
|
|
|
|
+ A:=AValue;
|
|
|
|
+ libvlc_video_set_aspect_ratio(Instance,Pcchar(PAnsiChar(A)));
|
|
end;
|
|
end;
|
|
|
|
|
|
function TCustomVLCMediaPlayer.GetAudioMuted: Boolean;
|
|
function TCustomVLCMediaPlayer.GetAudioMuted: Boolean;
|
|
@@ -619,13 +623,15 @@ function TCustomVLCMediaPlayer.GetAspectRatio: String;
|
|
|
|
|
|
Var
|
|
Var
|
|
P : Pcchar;
|
|
P : Pcchar;
|
|
|
|
+ S : AnsiString;
|
|
|
|
|
|
begin
|
|
begin
|
|
P:=libvlc_video_get_aspect_ratio(Instance);
|
|
P:=libvlc_video_get_aspect_ratio(Instance);
|
|
if (P<>Nil) then
|
|
if (P<>Nil) then
|
|
- Result:=StrPas(PChar(P))
|
|
|
|
|
|
+ S:=StrPas(PAnsiChar(P))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TCustomVLCMediaPlayer.GetAudioTrack: Integer;
|
|
function TCustomVLCMediaPlayer.GetAudioTrack: Integer;
|
|
@@ -740,8 +746,10 @@ function TCustomVLCMediaPlayer.GetAudioTrackDescriptions(AIndex: Integer): Strin
|
|
|
|
|
|
var
|
|
var
|
|
t : plibvlc_track_description_t;
|
|
t : plibvlc_track_description_t;
|
|
|
|
+ S : AnsiString;
|
|
|
|
|
|
begin
|
|
begin
|
|
|
|
+ S:='';
|
|
Result := '';
|
|
Result := '';
|
|
If (AIndex>=0) And Assigned(FInstance) then
|
|
If (AIndex>=0) And Assigned(FInstance) then
|
|
begin
|
|
begin
|
|
@@ -752,8 +760,9 @@ begin
|
|
t:=t^.p_next;
|
|
t:=t^.p_next;
|
|
end;
|
|
end;
|
|
If Assigned(t) and Assigned(t^.psz_name) then
|
|
If Assigned(t) and Assigned(t^.psz_name) then
|
|
- Result:=StrPas(PChar(t^.psz_name));
|
|
|
|
|
|
+ S:=StrPas(PAnsiChar(t^.psz_name));
|
|
end;
|
|
end;
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TCustomVLCMediaPlayer.GetChannel: Integer;
|
|
function TCustomVLCMediaPlayer.GetChannel: Integer;
|
|
@@ -1080,11 +1089,11 @@ procedure TCustomVLCMediaPlayer.DoOnError;
|
|
|
|
|
|
Var
|
|
Var
|
|
P : pcchar;
|
|
P : pcchar;
|
|
- E : String;
|
|
|
|
|
|
+ E : AnsiString;
|
|
begin
|
|
begin
|
|
p:=libvlc_errmsg();
|
|
p:=libvlc_errmsg();
|
|
if p<>Nil then
|
|
if p<>Nil then
|
|
- E:=StrPas(PChar(P))
|
|
|
|
|
|
+ E:=StrPas(PAnsiChar(P))
|
|
else
|
|
else
|
|
E:='';
|
|
E:='';
|
|
If Assigned(FOnError) then
|
|
If Assigned(FOnError) then
|
|
@@ -1130,13 +1139,13 @@ end;
|
|
procedure TCustomVLCMediaPlayer.DoOnSnapshot(Const AFileName : PCChar);
|
|
procedure TCustomVLCMediaPlayer.DoOnSnapshot(Const AFileName : PCChar);
|
|
|
|
|
|
Var
|
|
Var
|
|
- S :String;
|
|
|
|
|
|
+ S :AnsiString;
|
|
|
|
|
|
begin
|
|
begin
|
|
If Assigned(FOnSnapshot) then
|
|
If Assigned(FOnSnapshot) then
|
|
begin
|
|
begin
|
|
if Assigned(AFileName) then
|
|
if Assigned(AFileName) then
|
|
- S:=StrPas(PChar(AFileName))
|
|
|
|
|
|
+ S:=StrPas(PAnsiChar(AFileName))
|
|
else
|
|
else
|
|
S:='';
|
|
S:='';
|
|
FOnSnapShot(Self,S);
|
|
FOnSnapShot(Self,S);
|
|
@@ -1301,11 +1310,14 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
function TCustomVLCMediaPlayer.Snapshot(const AFileName: String; AWidth,
|
|
function TCustomVLCMediaPlayer.Snapshot(const AFileName: String; AWidth,
|
|
- AHeight: Cardinal): Boolean;
|
|
|
|
|
|
+ AHeight: Cardinal): Boolean;
|
|
|
|
+var
|
|
|
|
+ FN : AnsiString;
|
|
begin
|
|
begin
|
|
Result:=Assigned(FInstance);
|
|
Result:=Assigned(FInstance);
|
|
|
|
+ FN:=AFileName;
|
|
If Result then
|
|
If Result then
|
|
- Result:=libvlc_video_take_snapshot(FInstance,0,PCChar(PChar(AFileName)),AWidth,AHeight)=0;
|
|
|
|
|
|
+ Result:=libvlc_video_take_snapshot(FInstance,0,PCChar(PAnsiChar(FN)),AWidth,AHeight)=0;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TCustomVLCMediaPlayer.GetVideoSize(var AWidth, AHeight: Cardinal
|
|
function TCustomVLCMediaPlayer.GetVideoSize(var AWidth, AHeight: Cardinal
|
|
@@ -1402,25 +1414,30 @@ function TVLCMediaItem.GetMD(AMeta : libvlc_meta_t): String;
|
|
|
|
|
|
Var
|
|
Var
|
|
P : PCChar;
|
|
P : PCChar;
|
|
|
|
+ S : AnsiString;
|
|
|
|
|
|
begin
|
|
begin
|
|
P:=libvlc_media_get_meta(Instance,AMeta);
|
|
P:=libvlc_media_get_meta(Instance,AMeta);
|
|
|
|
+ S:='';
|
|
if (P<>Nil) then
|
|
if (P<>Nil) then
|
|
- Result:=StrPas(PChar(p))
|
|
|
|
|
|
+ S:=StrPas(PAnsiChar(p))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVLCMediaItem.GetMRL: String;
|
|
function TVLCMediaItem.GetMRL: String;
|
|
Var
|
|
Var
|
|
P : PCChar;
|
|
P : PCChar;
|
|
-
|
|
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
|
|
+ S:='';
|
|
P:=libvlc_media_get_mrl(Instance);
|
|
P:=libvlc_media_get_mrl(Instance);
|
|
if (P<>Nil) then
|
|
if (P<>Nil) then
|
|
- Result:=StrPas(PChar(p))
|
|
|
|
|
|
+ S:=StrPas(PAnsiChar(p))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVLCMediaItem.GetParsed: Boolean;
|
|
function TVLCMediaItem.GetParsed: Boolean;
|
|
@@ -1436,12 +1453,15 @@ end;
|
|
procedure TVLCMediaItem.SetDIM(AValue: TDeinterlaceMode);
|
|
procedure TVLCMediaItem.SetDIM(AValue: TDeinterlaceMode);
|
|
|
|
|
|
Const
|
|
Const
|
|
- DMS : Array[TDeinterlaceMode] of string
|
|
|
|
- = ('blend', 'discard', 'bob', 'linear', 'mean', 'x', 'yadif', 'yadif2x');
|
|
|
|
|
|
+ DMS : Array[TDeinterlaceMode] of AnsiString
|
|
|
|
+ = ('blend', 'discard', 'bob', 'linear', 'mean', 'x', 'yadif', 'yadif2x');
|
|
|
|
+Var
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
if (FDIM=AValue) then Exit;
|
|
if (FDIM=AValue) then Exit;
|
|
FDIM:=AValue;
|
|
FDIM:=AValue;
|
|
- libvlc_media_add_option(Instance, PCChar(PChar('deinterlace-mode='+DMS[AValue])));
|
|
|
|
|
|
+ S:='deinterlace-mode='+DMS[AValue];
|
|
|
|
+ libvlc_media_add_option(Instance, PCChar(PAnsiChar(S)));
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.SetFD(AValue: Integer);
|
|
procedure TVLCMediaItem.SetFD(AValue: Integer);
|
|
@@ -1456,20 +1476,28 @@ end;
|
|
procedure TVLCMediaItem.SetFSS(AValue: TSNapshotFormat);
|
|
procedure TVLCMediaItem.SetFSS(AValue: TSNapshotFormat);
|
|
|
|
|
|
Const
|
|
Const
|
|
- ssfs : Array[TSnapShotFormat] of string = ('png','jpg');
|
|
|
|
|
|
+ ssfs : Array[TSnapShotFormat] of AnsiString = ('png','jpg');
|
|
|
|
|
|
|
|
+var
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
if FSS=AValue then Exit;
|
|
if FSS=AValue then Exit;
|
|
FSS:=AValue;
|
|
FSS:=AValue;
|
|
- libvlc_media_add_option(Instance, PCChar(PChar('no-snapshot-preview')));
|
|
|
|
- libvlc_media_add_option(instance, PCChar(PChar('snapshot-format=' + SSFS[aValue])));
|
|
|
|
|
|
+ S:='no-snapshot-preview';
|
|
|
|
+ libvlc_media_add_option(Instance, PCChar(PAnsiChar(S)));
|
|
|
|
+ S:='snapshot-format=' + SSFS[aValue];
|
|
|
|
+ libvlc_media_add_option(instance, PCChar(PAnsiChar(S)));
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.SetM(AIndex: Integer; AValue: Boolean);
|
|
procedure TVLCMediaItem.SetM(AIndex: Integer; AValue: Boolean);
|
|
|
|
|
|
|
|
+Var
|
|
|
|
+ S : AnsiString;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
FOpts[AIndex]:=AValue;
|
|
FOpts[AIndex]:=AValue;
|
|
- libvlc_media_add_option(FInstance,PcChar(PChar(GetBoolOpt(AIndex,AValue))));
|
|
|
|
|
|
+ S:=GetBoolOpt(AIndex,AValue);
|
|
|
|
+ libvlc_media_add_option(FInstance,PcChar(PAnsiChar(S)));
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVLCMediaItem.GetBoolOpt(AIndex: Integer; AValue: Boolean): String;
|
|
function TVLCMediaItem.GetBoolOpt(AIndex: Integer; AValue: Boolean): String;
|
|
@@ -1486,23 +1514,37 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.SetMD(AMeta : libvlc_meta_t; AValue: String);
|
|
procedure TVLCMediaItem.SetMD(AMeta : libvlc_meta_t; AValue: String);
|
|
|
|
+
|
|
|
|
+Var
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
- libvlc_media_set_meta(Instance,AMeta,Pcchar(PChar(AValue)));
|
|
|
|
|
|
+ S:=AValue;
|
|
|
|
+ libvlc_media_set_meta(Instance,AMeta,Pcchar(PAnsiChar(S)));
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.SetMRL(AValue: String);
|
|
procedure TVLCMediaItem.SetMRL(AValue: String);
|
|
|
|
+
|
|
|
|
+Var
|
|
|
|
+ S : AnsiString;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
- Finstance:=libvlc_media_new_location(GetVLC.Instance,PCChar(AValue));
|
|
|
|
|
|
+ S:=AValue;
|
|
|
|
+ Finstance:=libvlc_media_new_location(GetVLC.Instance,PCChar(S));
|
|
If (FInstance=Nil) then
|
|
If (FInstance=Nil) then
|
|
Raise EVLC.CreateFmt('Failed to create media item from MRL : "%s"',[AValue]);
|
|
Raise EVLC.CreateFmt('Failed to create media item from MRL : "%s"',[AValue]);
|
|
RegisterInstance;
|
|
RegisterInstance;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.SetPath(AValue: String);
|
|
procedure TVLCMediaItem.SetPath(AValue: String);
|
|
|
|
+
|
|
|
|
+Var
|
|
|
|
+ S : AnsiString;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
if FPath=AValue then Exit;
|
|
if FPath=AValue then Exit;
|
|
FPath:=AValue;
|
|
FPath:=AValue;
|
|
- FInstance:=libvlc_media_new_path(GetVLC.Instance,PCChar(AValue));
|
|
|
|
|
|
+ S:=FPath;
|
|
|
|
+ FInstance:=libvlc_media_new_path(GetVLC.Instance,PCChar(S));
|
|
if (FInstance=Nil) then
|
|
if (FInstance=Nil) then
|
|
Raise EVLC.CreateFmt('Failed to create media item from path : "%s"',[AValue]);
|
|
Raise EVLC.CreateFmt('Failed to create media item from path : "%s"',[AValue]);
|
|
RegisterInstance;
|
|
RegisterInstance;
|
|
@@ -1598,8 +1640,13 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.AddOption(const AValue: String);
|
|
procedure TVLCMediaItem.AddOption(const AValue: String);
|
|
|
|
+
|
|
|
|
+Var
|
|
|
|
+ S : AnsiString;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
- libvlc_media_add_option(Instance,PCChar(PChar(AValue)));
|
|
|
|
|
|
+ S:=AValue;
|
|
|
|
+ libvlc_media_add_option(Instance,PCChar(PAnsiChar(S)));
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCMediaItem.Parse;
|
|
procedure TVLCMediaItem.Parse;
|
|
@@ -1636,13 +1683,14 @@ function TVLCLibrary.GetLastError: String;
|
|
|
|
|
|
Var
|
|
Var
|
|
P : PCChar;
|
|
P : PCChar;
|
|
-
|
|
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
P:=libvlc_errmsg();
|
|
P:=libvlc_errmsg();
|
|
if Assigned(P) then
|
|
if Assigned(P) then
|
|
- Result := StrPas(PChar(P))
|
|
|
|
|
|
+ S := StrPas(PAnsiChar(P))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVLCLibrary.GetI: Boolean;
|
|
function TVLCLibrary.GetI: Boolean;
|
|
@@ -1653,38 +1701,41 @@ end;
|
|
function TVLCLibrary.GetVersion: String;
|
|
function TVLCLibrary.GetVersion: String;
|
|
Var
|
|
Var
|
|
P : PCChar;
|
|
P : PCChar;
|
|
-
|
|
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
P:=libvlc_get_version();
|
|
P:=libvlc_get_version();
|
|
if Assigned(P) then
|
|
if Assigned(P) then
|
|
- Result := StrPas(PChar(P))
|
|
|
|
|
|
+ S := StrPas(PAnsiChar(P))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVLCLibrary.GetCompiler: String;
|
|
function TVLCLibrary.GetCompiler: String;
|
|
Var
|
|
Var
|
|
P : PCChar;
|
|
P : PCChar;
|
|
-
|
|
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
P:=libvlc_get_compiler();
|
|
P:=libvlc_get_compiler();
|
|
if Assigned(P) then
|
|
if Assigned(P) then
|
|
- Result := StrPas(PChar(P))
|
|
|
|
|
|
+ S := StrPas(PAnsiChar(P))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVLCLibrary.GetChangeSet: String;
|
|
function TVLCLibrary.GetChangeSet: String;
|
|
|
|
|
|
Var
|
|
Var
|
|
P : PCChar;
|
|
P : PCChar;
|
|
-
|
|
|
|
|
|
+ S : AnsiString;
|
|
begin
|
|
begin
|
|
P:=libvlc_get_changeset();
|
|
P:=libvlc_get_changeset();
|
|
if Assigned(P) then
|
|
if Assigned(P) then
|
|
- Result := StrPas(PChar(P))
|
|
|
|
|
|
+ S := StrPas(PAnsiChar(P))
|
|
else
|
|
else
|
|
- Result:='';
|
|
|
|
|
|
+ S:='';
|
|
|
|
+ Result:=S;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TVLCLibrary.SetLibraryPath(const AValue: String);
|
|
procedure TVLCLibrary.SetLibraryPath(const AValue: String);
|
|
@@ -1709,11 +1760,11 @@ begin
|
|
LibraryArgs.add('--no-video-title-show');
|
|
LibraryArgs.add('--no-video-title-show');
|
|
SetLength(cArgs,LibraryArgs.Count+2);
|
|
SetLength(cArgs,LibraryArgs.Count+2);
|
|
SetLength(Args,LibraryArgs.Count+1);
|
|
SetLength(Args,LibraryArgs.Count+1);
|
|
- cargs[0] := PChar(FLibraryPath);
|
|
|
|
|
|
+ cargs[0] := PAnsiChar(FLibraryPath);
|
|
For I:=0 to LibraryArgs.Count-1 do
|
|
For I:=0 to LibraryArgs.Count-1 do
|
|
begin
|
|
begin
|
|
Args[i]:=LibraryArgs[i];
|
|
Args[i]:=LibraryArgs[i];
|
|
- CArgs[i+1]:=PChar(Args[i]);
|
|
|
|
|
|
+ CArgs[i+1]:=PAnsiChar(Args[i]);
|
|
end;
|
|
end;
|
|
argc:=Length(CArgs);
|
|
argc:=Length(CArgs);
|
|
cargs[argc-1] := NIL;
|
|
cargs[argc-1] := NIL;
|