Merge lp://qastaging/~mixxxdevelopers/mixxx/features_m4a_win7 into lp://qastaging/mixxx/1.10

Proposed by William Good
Status: Merged
Merged at revision: 2881
Proposed branch: lp://qastaging/~mixxxdevelopers/mixxx/features_m4a_win7
Merge into: lp://qastaging/mixxx/1.10
Diff against target: 741 lines (+664/-2)
6 files modified
mixxx/SConstruct (+1/-0)
mixxx/build/depends.py (+1/-2)
mixxx/build/features.py (+34/-0)
mixxx/src/soundsourcemediafoundation.cpp (+551/-0)
mixxx/src/soundsourcemediafoundation.h (+67/-0)
mixxx/src/soundsourceproxy.cpp (+10/-0)
To merge this branch: bzr merge lp://qastaging/~mixxxdevelopers/mixxx/features_m4a_win7
Reviewer Review Type Date Requested Status
William Good Disapprove
Sean M. Pappalardo Needs Resubmitting
Review via email: mp+67111@code.qastaging.launchpad.net

Description of the change

Implements MP4/AAC decoding using Media Foundation with MS-provided AAC decoder in Windows 7+, and Vista/Server 2008 with KB2117917.

RJ mentioned merging this into release-1.10 so I'm proposing the merge to that branch. The decoder has tested stable for me, although it doesn't seem particularly fast, unfortunately (this seems to be a deficiency of Media Foundation -- although if anyone spots performance issues in the soundsource, I'd be interested). Build with mediafoundation=1 to enable. Windows SDK 7 is required, although it's installable on Vista.

To post a comment you must log in.
Revision history for this message
William Good (bkgood) wrote :

I missed this last night so I'll reply here:
[00:42] <Pegasus_RPG> just for my own knowledge, what would it take to make it a plugin?
Not much, it's a few build system changes and adding a handful of plugin metadata-providing statics.

[00:48] <Pegasus_RPG> (we could even pack in the Vista platform upgrade and auto-install that if needed)
It's a 5MB update for i386 and 12MB for x86-64, quite large.

Also, reminder to myself:
[00:32] <Pegasus_RPG> ok. Also, can you change the path to the SDK to use a variable? A bunch get set in the build env.
[00:33] <Pegasus_RPG> I'm not sure what they are though
[00:33] <Pegasus_RPG> check setenv.bat
[00:33] <Pegasus_RPG> something like %SDKPATH%
[00:38] <bkgood> Pegasus_RPG: %MSSdk% seems to point in the right direction, is there a more standard one?
[00:38] <bkgood> (that's in my SetEnv.cmd file)
[00:38] <Pegasus_RPG> I don't know. That sounds good

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Let me first formally say here: thank you for your work on this, Bill!

Yeah, I saw the update sizes after I said that. We can (and should) provide a pop-up box with links to the updates when ppl click on the M4A build/plugin on the downloads page (like we did for PortAudio on Ubuntu 8.04.)

Also, I strongly recommend making this a plugin rather than a separate build for supportability and less confusion. That way, no matter where people get Mixxx, they can just download the plugin (and the OS update if needed) and they're good to go. And we can even ship the plugin with Mixxx (if it's legal to do so and it will just silently not load or do nothing on a system that doesn't have the OS support.)

2846. By William Good

Addressed some issues brought up in review; lengthened filename buffer to maximum allowed by Windows (was probably too short previously).

2847. By William Good

Use Windows SDK path from environment.

2848. By William Good

Clean up description for build a bit

Revision history for this message
William Good (bkgood) wrote :

I've pushed a branch (lp:~mixxxdevelopers/mixxx/features_m4a_win7_plugin) with the necessary changes to make this a plugin if that's really want we want to do, and fixed that fixed-path in the build script.

Revision history for this message
William Good (bkgood) wrote :

And for my last bit of spam for the moment, soundsource plugins allocate a array of cstrings which are then filled and returned to the caller (SoundSourceProxy), which then owns the memory and must free it; this is how plugins communicate the file name extensions of the respective file types they support. I tried using the plugin I built with my branch with the 1.9 distribution (figured I could post a link to it to mixxx-devel for people to try out) and it's failing because of this malloc/free across dll boundaries (different msvcrt versions linked between mixxx.exe and soundsourcemediafoundation.dll). IMO the plugin API needs to be modified such that it frees its own memory (and stupid stuff like this is why I don't really want to deal with plugins).

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Yick...well IIRC the whole plugin system was knocked out very quickly by Albert in an effort to get M4A support to users as quickly as possible, so there's probably room for improvement. Mind filing a bug for that?

In the meantime, I can build the plugin for 1.9 since I did the main Mixxx binary. Just let me know.

Revision history for this message
William Good (bkgood) wrote :

Hey Sean- yeah, if you wouldn't mind building the plugin to match the 1.9 msvcrt links, I'd appreciate it. I'm thinking we're still a bit out from 1.10 so maybe we could push this on 1.9 (forum and ml I guess) users and see if there are any bugs in the code needing quashed before it gets put in a release.

Thanks!

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Hrm, Mfreadwrite.lib is not in the Windows 6.0 (Vista) SDK (the one I use for 1.9.x) so I can't build the plugin for 1.9. I guess this will have to wait until 1.10.

Bill: Doesn't Media Foundation allow us to use WMA and other kinds of file types in addition to M4A? If so, how much work would be involved in adding all of them that we don't currently support? What about just WMA/ASF?

We still need an official decision on whether or not to do this as a plugin. So the questions are:
1) Can we legally distribute the MediaFoundation-using binary without cost or restriction?
2) Will a Mixxx binary that has it built-in (as opposed to a plugin) still run fine (just without M4A/WMA support) on systems without the required system libraries, such as Windows 2000 & XP?

If the answer to both is yes, and RJ has no issues, I'd say let's go ahead and merge this for 1.10.

Revision history for this message
William Good (bkgood) wrote :

Note to self : look into dynamic load of the mf DLL. I'll reply in full when
I'm not on my phone.
On Oct 4, 2011 8:57 AM, "Sean M. Pappalardo" <email address hidden> wrote:
> Hrm, Mfreadwrite.lib is not in the Windows 6.0 (Vista) SDK (the one I use
for 1.9.x) so I can't build the plugin for 1.9. I guess this will have to
wait until 1.10.
>
> Bill: Doesn't Media Foundation allow us to use WMA and other kinds of file
types in addition to M4A? If so, how much work would be involved in adding
all of them that we don't currently support? What about just WMA/ASF?
>
> We still need an official decision on whether or not to do this as a
plugin. So the questions are:
> 1) Can we legally distribute the MediaFoundation-using binary without cost
or restriction?
> 2) Will a Mixxx binary that has it built-in (as opposed to a plugin) still
run fine (just without M4A/WMA support) on systems without the required
system libraries, such as Windows 2000 & XP?
>
> If the answer to both is yes, and RJ has no issues, I'd say let's go ahead
and merge this for 1.10.
> --
>
https://code.launchpad.net/~mixxxdevelopers/mixxx/features_m4a_win7/+merge/67111
> Your team Mixxx Development Team is requested to review the proposed merge
of lp:~mixxxdevelopers/mixxx/features_m4a_win7 into lp:mixxx/1.10.

Revision history for this message
William Good (bkgood) wrote :

> Bill: Doesn't Media Foundation allow us to use WMA and other kinds of file types in addition to M4A? If so, how much work would be involved in adding all of them that we don't currently support? What about just WMA/ASF?

Media Foundation supports: http://msdn.microsoft.com/en-us/library/windows/desktop/dd757927(v=vs.85).aspx. It would have the same minimum requirements as the AAC/m4a functionality because all systems having the necessary SourceReader interface also have the AAC decoder (and vice versa). I don't think the amount of work would be overwhelming but as we don't even have a wishlist bug for wma support I don't know that it's worth the time.

> 1) Can we legally distribute the MediaFoundation-using binary without cost or restriction?

Yes, it's the same situation as the Core Audio SoundSource. We're just calling an OS interface. They've paid for the AAC codec.

> 2) Will a Mixxx binary that has it built-in (as opposed to a plugin) still run fine (just without M4A/WMA support) on systems without the required system libraries, such as Windows 2000 & XP?

In short, no. Vista/2008 without the "Platform Update Supplement" and earlier versions of Windows will fail at run-time linking because they're missing either Media Foundation itself or the SourceReader interface. If a system were to exist with the SourceReader interface but not have the AAC decoder, Mixxx would run and simply fail to decode AAC, although I'm not aware of any situations in which this can occur.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Then we have to do this as a plugin since we support Windows 2000 and up. (MANY of our users are on XP.) So maybe void this merge request and submit one on the plugin branch.

review: Needs Resubmitting
Revision history for this message
William Good (bkgood) wrote :
review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: