Re: [Lazarus] TMPlayerControl

2015-01-11 Thread Michael Thompson
G'day,

On 11 January 2015 at 11:44, Andrew Haines andrewd...@aol.com wrote:

  I played with this for a few minutes and came up with this:
 MPlayerControl1.OnPlaying has to be assigned for
 MPlayerControl1.Position to work.

Oh.  Yes, I see...   That was by design - it never occurred to me that
someone would want to retrieve the .Position without having .OnPlaying
hooked up.

I put the checks in for FOnPlaying in an attempt to minimise chatter with
mplayer.   In my testing, I observed degraded playback if that chatter was
excessive.  In truth though - excessive was chatter at frequencies
approaching frame by frame querying, not at the frequency Position is
currently updated (twice a second).

Given the current architecture, what I *can't* do is obtain the position
when the user requests it.  I can either constantly query the position
(which is what I currently do when FOnPlaying is assigned) or never ask for
position.

As I see it, we've got 3 options:

1.  Maintain current code
2.  Always request Position from mplayer
3.  Add an Options Flag.  Only request Position if either
optRequestPosition or FOnPLaying assigned.

Now you've raised the issue, I'm not in favour of 1.  2 will introduce
overheads - but as we've seen when FOnPlaying is assigned, those overheads
aren't excessive.  3 preserves my original caution, but perhaps that's
unwarranted.

Now that there's a few items on the TODO list, let me know which you
prefer: 2) or 3) and I'll make the changes.

I'll get the .FullScreen property in at the same time (but sorry Pierre:  I
completely lack the knowledge or time to investigate mplayer working with
GL)

Many thanks for the feedback

Mike
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-11 Thread Andrew Haines

On 01/11/2015 09:57 PM, Michael Thompson wrote:

G'day,

On 11 January 2015 at 11:44, Andrew Haines andrewd...@aol.com 
mailto:andrewd...@aol.com wrote:

 I played with this for a few minutes and came up with this:
 MPlayerControl1.OnPlaying has to be assigned for
 MPlayerControl1.Position to work.

Oh.  Yes, I see...   That was by design - it never occurred to me that 
someone would want to retrieve the .Position without having .OnPlaying 
hooked up.






Given the current architecture, what I *can't* do is obtain the 
position when the user requests it.  I can either constantly query the 
position (which is what I currently do when FOnPlaying is assigned) or 
never ask for position.


As I see it, we've got 3 options:

1.  Maintain current code
2.  Always request Position from mplayer
3.  Add an Options Flag.  Only request Position if either 
optRequestPosition or FOnPLaying assigned.


Now you've raised the issue, I'm not in favour of 1.  2 will introduce 
overheads - but as we've seen when FOnPlaying is assigned, those 
overheads aren't excessive.  3 preserves my original caution, but 
perhaps that's unwarranted.


I'm not really sure it's an issue. My test was very minimal to create a 
fullscreen workaround. I imagine most programs would assign OnPlaying.




Now that there's a few items on the TODO list, let me know which you 
prefer: 2) or 3) and I'll make the changes.



I prefer 2.
3 seems over-engineered. :)

I'll get the .FullScreen property in at the same time (but sorry 
Pierre:  I completely lack the knowledge or time to investigate 
mplayer working with GL)


Many thanks for the feedback


:)

Andrew
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-10 Thread Andrew Haines

On 01/06/2015 08:35 AM, Michael Thompson wrote:
On 6 January 2015 at 17:48, Philippe phili...@quarta.com.br 
mailto:phili...@quarta.com.br wrote:


 fs does not appear in http://wiki.freepascal.org/TMPlayerControl

Correct.  -fs is an input parameter to mplayer.  These aren't 
explicitly covered in the wiki as mplayer documentation covers them 
elsewhere.


 And my question is still about TMPlayerControl, not with MPlayer ...

Well, TMPlayerControl is only a thin wrapper over mplayer, so there's 
significant overlap.


However, to be clear TMPlayerControl does not support fullscreen.  
I've now confirmed your results, and simply adding -fs to StartParam 
is not sufficient.


If you're interested, it looks like the issue is down to the -wid 
parameter (which sets the display window handle).  If I comment out 
the two -wid lines in MPlayerCtrl.pas (line 665, 666), and insert -fs 
instead, then fullscreen works.


No easy workaround available I'm afraid.  Looks like a code change in 
MPlayerCtrl is required implementing a .FullScreen property.   
However, I still can't see how we'd toggle fullscreen, I can only see 
how to either start in FullScreen or in a Window.   And that caveat 
from the mplayer documentation would still hold - not all drivers are 
supported.


Patches welcome :-)




I played with this for a few minutes and came up with this:
MPlayerControl1.OnPlaying has to be assigned for 
MPlayerControl1.Position to work.


procedure TForm1.FullScreenCheckBoxChange(Sender: TObject);
var
  ScreenBounds: types.TRect;
  PlayerPosition: Single;
begin
  PlayerPosition := MPlayerControl1.Position;
  MPlayerControl1.Stop;

  if FullScreenCheckBox.Checked then
  begin
FSForm := TForm.Create(Self); //FSForm is a variable in TForm1
FSForm.BorderStyle:=bsNone;
FSForm.Color:=clBlack;
ScreenBounds := Screen.MonitorFromWindow(Handle).BoundsRect;
with ScreenBounds do
  FSForm.SetBounds(Left, Top, Right - Left, Bottom - Top);
FSForm.Visible:=True;

MPlayerControl1.Parent := FSForm;
  end
  else
  begin
MPlayerControl1.Parent := Self;
FSForm.Free;
  end;

  MPlayerControl1.Play;
  MPlayerControl1.Position := PlayerPosition;
end;

Andrew
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-06 Thread Philippe
 

Em 05.01.2015 23:28, Michael Thompson escreveu: 

 G'day, 
 

-fs does not appear in parameters list ... correct? 
 
 Correct. -fs
does not appear when I call mplayer -input cmdlist. 
 
 I note it
does appear in the following page though: 

http://mplayerhq.hu/DOCS/man/en/mplayer.1.html#GENERAL%20OPTIONS [1] 


 Maybe they're more diligent on updating the web than the cmdlist? 


 I also note there is a get_vo_fullscreen property in the mplayer
-input cmdlist output, which implies a set_vo_fullscreen (though none
is listed) 
 
 And finally I note there's a caveat on the webpage
saying -fs doesn't work with all video drivers... 
 
 Using MPlayer on
Windows, despite no -fs appearing in the above, I can still play video
in full screen passing the -fs parameter. Which means this *should* work
in the Lazarus TMplayerControl control by simply adding -fs to
StartParam. 
 
 How this works in reality though I'm unsure :-) If you
get a chance to experiment, I'd love to know the results. From the
documentation I've found so far, I'm unsure how to toggle FullScreen,
and how to determine which monitor gets the video... 
 
 I also
suspect this conversation is going to veer more into the mplayer arena
than the Lazarus arena, so I'm happy for this continue as a personal
email chain (just reply to me, not to Lazarus). I'll update the wiki
with the outcome 
 
 http://wiki.freepascal.org/TMPlayerControl [2] 


 Mike

 May be I did not expressed me very well ...
 fs does not
appear in http://wiki.freepascal.org/TMPlayerControl And my question
is still about TMPlayerControl, not with MPlayer ... Using
lazaruscomponentsmplayerexamplesFullFeaturedmplay

 quote
 solid;
margin-left:5px; width:100%Philippe
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailma

 

 





Links:
--
[1]
http://mplayerhq.hu/DOCS/man/en/mplayer.1.html#GENERAL%20OPTIONS
[2]
http://wiki.freepascal.org/TMPlayerControl
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-06 Thread Michael Thompson
On 6 January 2015 at 17:48, Philippe phili...@quarta.com.br wrote:

 fs does not appear in http://wiki.freepascal.org/TMPlayerControl

Correct.  -fs is an input parameter to mplayer.  These aren't explicitly
covered in the wiki as mplayer documentation covers them elsewhere.

 And my question is still about TMPlayerControl, not with MPlayer ...

Well, TMPlayerControl is only a thin wrapper over mplayer, so there's
significant overlap.

However, to be clear TMPlayerControl does not support fullscreen.  I've now
confirmed your results, and simply adding -fs to StartParam is not
sufficient.

If you're interested, it looks like the issue is down to the -wid parameter
(which sets the display window handle).  If I comment out the two -wid
lines in MPlayerCtrl.pas (line 665, 666), and insert -fs instead, then
fullscreen works.

No easy workaround available I'm afraid.  Looks like a code change in
MPlayerCtrl is required implementing a .FullScreen property.   However, I
still can't see how we'd toggle fullscreen, I can only see how to either
start in FullScreen or in a Window.   And that caveat from the mplayer
documentation would still hold - not all drivers are supported.

Patches welcome :-)

Mike
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-06 Thread Philippe
 

Em 06.01.2015 11:35, Michael Thompson escreveu: 

 On 6 January
2015 at 17:48, Philippe phili...@quarta.com.br wrote: 
 
 fs does
not appear in http://wiki.freepascal.org/TMPlayerControl [1] 
 

Correct. -fs is an input parameter to mplayer. These aren't explicitly
covered in the wiki as mplayer documentation covers them elsewhere. 


 And my question is still about TMPlayerControl, not with MPlayer
... 
 
 Well, TMPlayerControl is only a thin wrapper over mplayer, so
there's significant overlap. 
 
 However, to be clear TMPlayerControl
does not support fullscreen. I've now confirmed your results, and simply
adding -fs to StartParam is not sufficient. 
 
 If you're interested,
it looks like the issue is down to the -wid parameter (which sets the
display window handle). If I comment out the two -wid lines in
MPlayerCtrl.pas (line 665, 666), and insert -fs instead, then fullscreen
works. 
 
 No easy workaround available I'm afraid. Looks like a code
change in MPlayerCtrl is required implementing a .FullScreen property.
However, I still can't see how we'd toggle fullscreen, I can only see
how to either start in FullScreen or in a Window. And that caveat from
the mplayer documentation would still hold - not all drivers are
supported. 
 
 Patches welcome :-) 
 
 Mike

 I'll comment the 2
lines ... and it should be enough for me!
 thanks a lot Philippe


--
___
Lazarus mailing
list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[2]

 

 

 


Links:
--
[1]
http://wiki.freepascal.org/TMPlayerControl
[2]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-05 Thread Michael Thompson
G'day,

On 5 January 2015 at 23:24, Philippe phili...@quarta.com.br wrote:

  someone may confirm:

 TMPlayerControl does not allow fullscreen option.


When I extended the control last year I did not test full screen - in fact
I didn't even consider it.   So long as MPlayer supports this though, I
can't see that there should be a problem.   I will play with this later
today and get back to you.

Are you on Linux or Windows?  Short term, I'll only have Windows to test
on...

Mike
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TMPlayerControl

2015-01-05 Thread Philippe
 

Em 05.01.2015 20:58, Michael Thompson escreveu: 

 G'day, 
 
 On
5 January 2015 at 23:24, Philippe phili...@quarta.com.br wrote:
 

someone may confirm: 
 
 TMPlayerControl does not allow fullscreen
option.
 
 When I extended the control last year I did not test full
screen - in fact I didn't even consider it. So long as MPlayer supports
this though, I can't see that there should be a problem. I will play
with this later today and get back to you. 
 
 Are you on Linux or
Windows? Short term, I'll only have Windows to test on... 
 
 Mike


Windows.
 -fs does not appear in parameters list ... correct?


--
___
Lazarus mailing
list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/list


 
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TMPlayerControl

2015-01-05 Thread Philippe
 

someone may confirm: 

TMPlayerControl does not allow fullscreen
option. 

Philippe --
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus