Skip to content

Commit

Permalink
Update Video
Browse files Browse the repository at this point in the history
Обновление алгоритма
  • Loading branch information
konvikkor committed Dec 7, 2018
1 parent ed1d980 commit 0892ce3
Show file tree
Hide file tree
Showing 3 changed files with 656 additions and 558 deletions.
6 changes: 5 additions & 1 deletion uTestMain.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ object Form1: TForm1
Font.Style = []
OldCreateOrder = False
PopupMenu = PopupMenu1
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object PageControl1: TPageControl
Expand Down Expand Up @@ -120,13 +121,16 @@ object Form1: TForm1
Caption = 'Play'
OnClick = Play1Click
end
object EST1: TMenuItem
Caption = 'TEST'
OnClick = EST1Click
end
end
object OpenDialog1: TOpenDialog
Left = 176
Top = 48
end
object Timer1: TTimer
OnTimer = Timer1Timer
Left = 132
Top = 40
end
Expand Down
52 changes: 24 additions & 28 deletions uTestMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,29 @@ TForm1 = class(TForm)
TrayIcon1: TTrayIcon;
TaskDialog1: TTaskDialog;
Play1: TMenuItem;
EST1: TMenuItem;
procedure Open1Click(Sender: TObject);
procedure DecodePak1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure EST1Click(Sender: TObject);
procedure Play1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
var MediaDecoder:TMediaDecoder;
var MediaMainCore:TMediaMainCore;
var MediaVideo:TMediaVideo;
Media:TMediaDecoder;
end;

var
Form1: TForm1;
MediaDisplay:TMediaDisplay;

implementation

{$R *.dfm}

procedure TForm1.DecodePak1Click(Sender: TObject);
var i,j:integer;
begin
if not Assigned(MediaDecoder) then exit;
if not Assigned(MediaMainCore) then exit;
if not Assigned(MediaVideo) then exit;
{i:=1;
try
repeat
Expand Down Expand Up @@ -108,34 +105,33 @@ procedure TForm1.DecodePak1Click(Sender: TObject);
Memo3.Lines.EndUpdate; *}
end;

procedure TForm1.EST1Click(Sender: TObject);
begin
Media.ReadPacked;
Media.DecodeVideo;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
MediaDisplay:=TMediaDisplay.Create(TabSheet2);
MediaDisplay.Parent:=TabSheet2;
MediaDisplay.Align:=alClient;
end;

procedure TForm1.Open1Click(Sender: TObject);
var i:Integer;
begin
if not OpenDialog1.Execute then Exit;
if not Assigned(MediaDecoder) then MediaDecoder:=TMediaDecoder.Create(self);
if not Assigned(MediaMainCore) then begin
MediaMainCore:=TMediaMainCore.Create;
MediaDecoder.MediaCore:=MediaMainCore;
end;
if Assigned(MediaMainCore) then MediaMainCore.CloseFile;
MediaMainCore.OpenFile(OpenDialog1.FileName);
Memo1.Lines.Add(OpenDialog1.FileName);
Memo1.Lines.Add(MediaDecoder.GetStatus);
if not Assigned(Media) then Media:=TMediaDecoder.Create
else Media.CloseFile;
Media.OpenFile(OpenDialog1.FileName);
Media.Display:=MediaDisplay;
end;

procedure TForm1.Play1Click(Sender: TObject);
begin
MediaDecoder.Play;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if not Assigned(MediaDecoder) then exit;
{StatusBar1.Panels[0].Text:='AVStream:'+IntToStr(TMP.AVStream.Count);
StatusBar1.Panels[1].Text:='VPacket:'+IntToStr(TMP.VideoPacket.Count);
StatusBar1.Panels[2].Text:='VFrame:'+IntToStr(TMP.VideoFrame.Count);
StatusBar1.Panels[3].Text:='APacket:'+IntToStr(TMP.AudioPacket.Count);
StatusBar1.Panels[4].Text:='GlobalTime:'+IntToStr(TMP.GetGlobalTime);}
if not Assigned(Media) then exit;
Media.Start;
end;

end.
Loading

0 comments on commit 0892ce3

Please sign in to comment.