Author Topic: DreamMovie  (Read 51700 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
DreamMovie
« on: December 15, 2016, 02:07:56 pm »
Coming soon...

Based on the same concept than DreamScene, but using a video rather than OpenGL visual plugins.

Screen shot:



DreamMovie playing OBLIVION.
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #1 on: December 18, 2016, 03:54:17 pm »
I am working on a new version of ZMP that would be based on Media Foundation rather than DirectShow (deprecated since VISTA).

Being written in 64-bit, it will be able to use the same codec than the Windows 10 built-in "Movie and TV" player

...
« Last Edit: August 04, 2017, 05:59:00 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #2 on: December 25, 2016, 05:52:10 pm »
Here is the first WIP of ZMF64, for test purpose.

The small rotary gauge is to zoom in/out when playing video.

To play media, use either drag and drop from the Windows Explorer, of press on the (>) button when there is no media playing.
To check playing from an internet URL, you can use one of your own or the default one that is shown the first time you try it.

Parameters are saved into the temporary folder, under the name ZMFPLAY64.cfg.

Note: Because ZMF64 is using Media Foundation rather than DirectShow, it won't run on OS prior to VISTA.

If you couldn't hear the audio track when playing a MKV movie, this is probably because audio is using DTS, this is something currently not supported by Windows 10.


Playing Video:




Playing Audio:





Feedback wanted please!

...
« Last Edit: December 25, 2016, 06:07:27 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #3 on: December 26, 2016, 05:57:38 pm »
More info on 64-bit Win 7 Ult Sp1 / GTX 550Ti: (non-localized LCID 1033 installation)

-- Adding http://www.objreader.com to Trusted Zone doesn't help in either Admin or User mode; cannot connect with error # 0x8007007B
-- When in Admin mode, cannot drag and drop any video or audio file from Explorer, but can open them via Open File dialog
-- When in User mode, can both drag and drop audio and video files and load them via Open File
-- Initial character in URL text box, once entered and saved into the config file, always appears different and always comes from non-ASCII part of the font (umlauts, accents, pseudo-gfx glyphs and the like). Connection cannot be established either way. Can't check config file for possible undue localization because can't find it. IMHO it should be put in the same folder at least at this debugging stage.

64-bit Win 7 Ult Sp1 / Radeon R7 240: (non-localized LCID 1033 installation)

Exact same behavior and error codes as above

64-bit Win 10 Pro Anniversary / geForce 8600 GTS: (Russian locale w/ full US English extra language pack)

-- http://www.objreader.com cannot be added to Trusted Zone because Win 10 trusts only https connections, which objreader.com doesn't provide
-- Config file saves URLs correctly but it doesn't help;  cannot connect with error # 0xC00D001A
-- Exact same Admin and User drag and drop/load behavior as under Win 7 above


In all the test cases, the quality of video and audio is superb. Regarding net connection, does the app allow for longer ping delays? The server is probably stationed physically somewhere in your study or bedroom, so you never notice the delay that other, more distant, users may experience in the meantime. :)
« Last Edit: December 26, 2016, 06:00:39 pm by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #4 on: December 26, 2016, 10:02:07 pm »
Apart from revising the skDialogInput() code proper that does seem to be unstable if not buggy, I'd suggest using the following mods everywhere where SETBIN and PROP are typedef'ed:

Code: [Select]
#pragma pack(push,1) // NB!
struct SETBIN {
    DWORD soundvolume; // NB!
    WCHAR URL[MAX_PATH];
};

struct PROP {
    HWND            hMain;
    MFPlayer2*      pPlayer;
    HWND            hGDImage;
    HWND            hVideo;
    HWND            hFrame;
    HWND            hPlay_On;
    HWND            hPlay_Off;
    HWND            hMute;
    //HWND            hMute_Off;
    HWND            hSeekbar;
    HWND            hVolume;
    MFTIME          duration;

    BOOL            bSeeking;
    BOOL            bMediaLoaded;
    HINSTANCE       instance;
    long            mediatype;
    BOOL            updateseekbar;
    BOOL            usewinlift;

    BOOL            animSlider; // To let us know if the MAIN timer must be used to move the slider
    SETBIN          bin;        // To store the preferences

    DWORD ImageTick;
    DWORD UseSpeed;
    WCHAR filename[MAX_PATH];
};
#pragma pack(pop) // NB!

The problem is, it's generally not the best idea to use TCHAR buffers in the middle of structures with C-language default alignment rather than at their ends. Prefer to use explicitly tight-packed structures in such cases if you can't avoid them. For example, if you don't do it, wcscpy_s() wouldn't be able to find the beginning of gP.bin.URL either, if you would try to copy gP.bin.URL to szFile directly rather than via skDialogInput().
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #5 on: December 26, 2016, 10:13:12 pm »
When downloaded from the net inside a zipped folder rather than directly in a zip, EXEs, DLLs and CHMs don't get flagged and/or blocked as potentially dangerous. Such are the mysteries of NTFS' undocumented features. ;)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #6 on: December 27, 2016, 03:17:55 pm »
Mike--

Do you know why this procedure run fine when called in an EXE,
and would fail on MoveMemory when used from inside a DLL

Code: [Select]
void TRIMSPACE(OUT WCHAR* ss) {
    long L = (long) wcslen(ss);
    if (L) {
        long right = L, left = -1, rightdone = 0, leftdone = 0, start = 0, last = L;
        for (long K = 0; K < L; K++) {
            right--;
            if (!rightdone) {
                if (ss[right] == L' ') { ss[right] = L'\0'; last--; } else { rightdone = -1; }
            }
            if (!leftdone) {
                if (ss[K] != L' ') { start = K; leftdone = -1; }
            }
        }
        if (start > -1) {
            WCHAR* ps = ss;
            MoveMemory(ss, ps + start, (last - start) * sizeof(WCHAR));
        }
        right = (last-start);
        if (right > 0) {
            for (long K = right; K < L; K++) { ss[K] = L'\0'; }
        }
    }
}
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #7 on: December 27, 2016, 03:58:48 pm »
Patrice,

What optimization options have you selected for the EXE and DLL? Are they similar? I noticed ZMF64 favors small size (/O1); this seriously affects code and data structure alignment!

If you're still having difficulties with MoveMemory (or wcscpy_s, for that matter), try to compile your code without optimization (/Od) or with speed optimization (/O2) rather than size optimization.

These settings can be found in your Project Properties...->Configuration Properties->C/C++->Optimization.

Hope this helps... ???
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #8 on: December 28, 2016, 10:30:17 am »
Mike--

Here is the new build, as usual please remove the attachment once you have it.

New point in this build.

- New UI skin theme.
- Added custom tooltip color in WinLIFT.
- Several new functions inside of Tools.h (including DetectProcess, to work around a mutex problem, and to allow only one instance running).
- Enforced buffer protection for the data shared between the EXE and the WinLIFT skDialogInput.
- Many changes inside of Main.cpp.

I was unable to reproduce the problem you had when using OnFileOpen to select a media file.
However i should shut down the animation when selecting a video from OnFileOpen (not done yet).

And here is the new UI when playing a video.



...
« Last Edit: December 28, 2016, 03:13:19 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #9 on: December 28, 2016, 03:26:17 pm »
First off, congrats: net URLs are now working faultlessly everywhere! :)

64-bit Win 10 Pro Anniversary / geForce 8600 GTS: (Russian locale w/ full US English extra language pack)

-- URLs, drag-and-drops (D&D), and Open File are working as expected, except
-- D&D is totally inoperative when the app is run As Admin. Nothing happens on its screen though the cursor changes to NWSE as if it were hovering over the animated torus.

64-bit Win 7 Ult Sp1 / Radeon / nVidia: (non-localized LCID 1033 installation)

-- URLs are working as expected;
-- half of my videos are mute though I do have full 32-/64-bit CCCP installed following your advice. Interestingly, all of them are playing back their sound just fine under Win 10 even though it doesn't have any extra codecs installed. All my other video players (I have 6 of them including one Winmm/mciSendString based implementation written in FBSL) play back sound without problems under both Win 7's;
-- your MX5.mp4 plays back fine from its URL but crashes the app when D&D'ed or loaded via Open File As User, or loaded via Open File As Admin (D&D is impossible at all when As Admin). Other videos run OK when D&D'ed (As User only) and loaded via Open File.


Quote
And here is the new UI when playing a video.

Moi, je like cherry red skinning very much. Can you design a skin that would imitate an old casino/cabaret scene with dim lights, cherry red curtains, royale gold/pale red wallpaper and wooden plank floor? It would be a killer if you could also animate the curtains to slide open before the video or sound animation starts, and slide back close after it's over... :)
« Last Edit: December 28, 2016, 03:43:18 pm by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #10 on: December 28, 2016, 04:59:53 pm »
Mike--

Along the years, i wrote several 32-bit VIDEO player, that were all based on the {deprecated} DirectShow API.

Starting with this new 64-bit version i switched to the same API used by the Windows 8-10 "Movie and TV" player,
aka Media Foundation.
But with that one, all CCCP or other codecs pack are a NoNo (for security reasons).
The main problem is when playing matroska MKV movies, because most of them are using a DTS audio track that is currently not supported by Windows.
(They said they have plans to support DTS in the future, but it is not a high rank priority).

>> D&D is totally inoperative when the app is run As Admin.
I am totaly unable to reproduce this behavior by myself.
Please try to add a zTrace inside of this code section, to see what happens.
Code: [Select]
    case WM_DROPFILES:
        hfInfo = HDROP(wParam);
        nRet = DragQueryFile(hfInfo, 0xFFFFFFFF, NULL, 0);
        if (nRet > 0) {
            nRet = DragQueryFile(hfInfo, 0, szFile, MAX_PATH);
        }
        DragFinish(hfInfo);
        SetForegroundWindow(hWnd);
        if (wcslen(szFile)) {
            gP.mediatype = MediaCheckExtension(szFile);
            if (gP.mediatype) { // MEDIA_VIDEO = 1, MEDIA_AUDIO = 2
                // Open the media file.
                nRet = PlayMediaFile(hWnd, szFile);
            }
        }
        break;

Thank you!


>>Can you design a skin that would imitate an...
I plan to move all the GUI inside of the gP.hGDImage, meaning that everything would be possible.
But they are already built-in WinLIFT features, that would let you change the image background on the fly, by clicking with either the left or right mouse onto the top left icon.

In order to do this, you must unlock the
'"BACKGROUNDPATH,      C:\Users\Public\Pictures\Sample Pictures", inside of the skin .sks file,
or to add a new folder named "background" into the EXE folder.
However, make first a copy of the DreamSkin\CTLBACK.png, because it will be overwritten by the new selected one. :)

...

Added:
See the background.zip attachment
« Last Edit: December 28, 2016, 05:19:44 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #11 on: December 28, 2016, 07:49:17 pm »
Why thanks a lot of course Patrice, :)

But what I had in mind was something a little more elaborate/classy, like this (though still deeper/darker red and with animated curtains, which would clearly require some extra programmatic effort):




Re: DD/CCCP/MKV/MF/x64/etc.

Hehe, not only have you deprecated XP and 32 bits entirely, but you also seem to be dropping your support for Vista and especially Win 7 that's going to be around till at least 2025. You're definitely running not only before the cart full of passengers but also ahead of the horse that's pulling that cart forward. :)

Tell you what: Russians have a legend, and actually even a classical opera, telling that in the years of "la Bérésina" I'm sure you're aware of, a squad of French troops summoned a Russian hunter/pathfinder called Ivan Sousanine to show them the way in the local forests to track down a bunch of local guerrillas (not gorillas!) that used to terrorize the aggressor. With his life at stake, he had nothing else but agree. But as it turned out in the long run, it wasn't his life he was after but rather the lives of his French enemies. He circled them round and round the forests till they all froze to death -- it was winter time then.

Now the history seems to be playing similar tricks on us but the other way round: a French master Sousanine is circling a Russian speaking slave around a forest of obvious and evident incompatibilities from which there's no known way out. ;D


Re: zTrace

I'll come back with my results a little later, perhaps even tomorrow. I'm currently under XP with a little work to do. OK?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #12 on: December 28, 2016, 08:11:48 pm »
This kind of red curtain was probably from the Soviet time. We also had this kind of movie theater here in France by the fifties.  :D

You know what, i keep using my 32-bit MovieBox.exe that was written in PB, anf if ever i couldn't play a movie with it, then i resort on VLC ;)

However this new project was more a kind of challenge for me, and an easy way to have both audio and video into the same application using only the current OS API. (I started from an horrible example provided with the latest Windows SDK, named  MFPlayer2)

But you know what, Media Foundation has been now superseded by Media Session, go figure !!!  ::)

...
« Last Edit: December 28, 2016, 08:38:22 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: DreamMovie
« Reply #13 on: December 28, 2016, 08:25:54 pm »
Oh,

You don't really have to go that far in space and time, Patrice. That's how your Moulin Rouge scene is currently looking just a few blocks away from you:  ;D

Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: DreamMovie
« Reply #14 on: December 28, 2016, 08:39:39 pm »
The Bollywood kitch style :o

See the red curtain i provide with my PhotoComposer application.
Very easy to add the open/close curtain effect to that one.

« Last Edit: December 28, 2016, 09:02:07 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)