Sign in to follow this  
Followers 0
trancexx

DirectShow player

38 posts in this topic

#1 ·  Posted (edited)

If you have been going thru AutoItObject files ever, you have probably noticed script called DirectShow.au3. That's minimalistic player made to utilize DirectX technology.

Here's a version of that script (or the other way around) with much more features. This script will take advantage of some new features of Windows 7 system.

Windows 7 specific interfaces:

  • ITaskbarList3
  • ICustomDestinationList
Other used interfaces:

  • IGraphBuilder
  • IMediaControl
  • IMediaEventEx
  • IVideoWindow
  • IMediaPosition
  • IBasicAudio
  • IBasicVideo
  • ISequentialStream
  • IObjectCollection
  • IShellLink
  • IPropertyStore
  • IObjectArray
  • IMMDeviceEnumerator
  • IMMDevice
  • IAudioEndpointVolume
  • IAudioMeterInformation
  • IBaseFilter
  • IFileSourceFilter
  • IEnumPins

Script (needed images are inline as PNGs):

DirectShow_Player.au3

Btw, ITaskbarList3 was already covered by wraithdu and Beege, don't miss their examples here and here. One more thanks to them.

...oh, and AutoItObject is here. You would need 1.2.2.0 version.

edit: new script

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites



Very cool. Awesome job!;)

Share this post


Link to post
Share on other sites

Awesomeness defined.

An angel have come to earth!

;)

On a sidenote, it refuses to play my flv file (it shouldn't, it plays in MPC-HC and WMP). _RenderFile returns @error = 1.

How would I go on with finding out why?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Workaround could be to use AddSourceFilter method and what comes afterwards, in that case.

Just looked at a posted code and I see that I've left _AddTaskbarButtons outside _WM_TASKBUTT_CREATED function. It should really be in otherwise one could end up without taskbar buttons.

Maybe I'll update the attachment.

edit: forum was down yesterday?

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Great stuff trancexx! :)

But the aspect ratio for images is not working properly. ;)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Great stuff trancexx! :)

But the aspect ratio for images is not working properly. ;)

Br,

UEZ

Not properly how? ;)

I haven't added "keep aspect ratio" option. There is only "Fit window" and "Original size". Are you saying that those aren't working properly?

I've made an update. Corrected _AddTaskbarButtons issue and added few more comments for those who would be interested in seeing how is something done in the script.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

If you load an image with e.g. 1944x1296 (3:2), your script displays it with a fixed windows size (530x600) which looks distorted.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

If you load an image with e.g. 1944x1296 (3:2), your script displays it with a fixed windows size (530x600) which looks distorted.

Br,

UEZ

Yes, I see. It means I should keep aspect ratio in case rendered doesn't fit into the rendering area.

Ok, that makes sense. Will see how to implement that. Thank you.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

In line 606 ($aCall = $oBasicVideo.GetVideoSize(0, 0)) you can get the image dimension in $aCall[1] and $aCall[2]. With that information

you can resize you window appropriately.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

It's little lower, inside _SetSize function.

I'm bending the image, not the GUI, if it would require to take most of the desktop area. Complete control of the win station is the most important thing, the way I see it.

Btw, how's jumplist hanging?

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Cool player.

What is about additional option of it - "Capturing a Window Screen Shot" ?

Trick to enable this option was discussed here ():

http://www.codeproject.com/kb/dialog/screencap.aspx

Thank you

:graduated:


The point of world view

Share this post


Link to post
Share on other sites

This is sooo cool!

Really nice work. Exceptional!

Share this post


Link to post
Share on other sites

I've made an update to show some new things that are available with AutoItObject 1.2.2.0. If you go thru the code you will see there is no use of DLLCall function. This is because it's replaced with, so called, DLL-objects to call functions from desired DLLs. Also variant data type is used (byref even) with IPropertyStore, usage of few new interfaces added to be able to have VU-meter control (or whatever that is) and so on...

Btw, these new interfaces are the same that are used for setting volume level for the system on vista and above - master volume.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Ah, that should replace my plugin quite nicely then. Odd feeling when something you've created becomes obsolete...

Share this post


Link to post
Share on other sites

Ah, that should replace my plugin quite nicely then. Odd feeling when something you've created becomes obsolete...

Yes, but you see I forgot to give you deserved credit. Your code was consulted.

I'll make a remark in the code for the next time I update the script.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Sweet, thanks. Always appreciated :x

Share this post


Link to post
Share on other sites

Wow I cant belive I missed this example! This is really great Trancexx. Its demonstrates so much. Its really going to help me a lot! Thank you very much!Posted Image

Share this post


Link to post
Share on other sites

Can not play MPG video format!

Share this post


Link to post
Share on other sites

Looking through some of the code.. wow. Some (seemingly simple) things are so complicated, but you handle them very well.

I added a call to '_UnregisterExtension()' in the _Quit() function though, because I don't want a script player permanently added to my registry, even if its pretty cool.

Share this post


Link to post
Share on other sites

I have it pinned to the taskbar and if I unregister I can't use it from the jumplist.

...Glad that you managed through the code.

I've added one more function to load files alternately using manual PIN manipulation enumerated with IEnumPins when GraphBuilder.RenderFile would fail. @AdmiralAlkex, would you mind trying it now for that flv? I can play "problematic" mp3 files here now.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0