Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-01

TMPlayerControl

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Thompson
to Philippe

G'day,

Philippe wrote 5 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150106/20cfeac7/attachment.html>

Reply by email

Philippe
to Michael Thompson
Michael Thompson wrote
G'day, On
Philippe 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?

Reply by email

Michael Thompson
to Philippe

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

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

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150106/48e34026/attachment.html>

Reply by email

Philippe
to Michael Thompson
Michael Thompson wrote
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]

Show quoted text 6 lines
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

Show quoted text 7 lines
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

http://lists.lazarus.freepascal.org/mailma

Show quoted text 5 lines

Links:
------
[1]
http://mplayerhq.hu/DOCS/man/en/mplayer.1.html#GENERAL%20OPTIONS [2]
http://wiki.freepascal.org/TMPlayerControl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150106/df2048da/attachment.html>

Reply by email

Michael Thompson
to Philippe
Philippe wrote

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150106/0ebe46c7/attachment.html>

Reply by email

Philippe
to Michael Thompson
Michael Thompson wrote
On 6 January
Philippe 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.

Show quoted text 6 lines
Patches welcome :-) Mike I'll comment the 2

lines ... and it should be enough for me!
thanks a lot Philippe

Reply by email

Andrew Haines
to Michael Thompson: Correct. -fs is an input parameter to mplayer. These aren't explicitly covered in the…
Michael Thompson wrote 32 lines
On 6 January 2015 at 17:48, Philippe < <mailto:>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150110/2ab6b5c3/attachment.html>

Reply by email

Michael Thompson
to Andrew Haines

G'day,

Andrew Haines 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150112/e7cb2c37/attachment.html>

Reply by email

Andrew Haines
to Michael Thompson
Michael Thompson wrote 30 lines
G'day, On 11 January 2015 at 11:44, Andrew Haines < <mailto:>> 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. :)

Show quoted text 6 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150111/264294f8/attachment-0001.html>

Reply by email