By Jeremiah Morrill on
1/29/2011 5:03 PM
Because I cannot suffer DNN any longer, I have moved my blog here: http://jeremiahmorrill.com/
I'll leave this blog up for historical reasons!
Thanks,
-Jer
|
By Jeremiah Morrill on
9/23/2010 11:57 PM
(*Desktop Silverlight for Windows) There haven’t been too many articles written about the rendering subsystems of WPF and Silverlight, at least not in great detail. This leaves room for quite a bit of speculation and leads to some turf war augments between some Silverlight and WPF developers. I want to document (brain barf) at least what I have gathered from qualified sources, observations, educated guesses and plain old snooping around public symbols. I did not acquire knowledge of any of this...
Read More »
|
By Jeremiah Morrill on
7/7/2010 10:59 AM
I’ve been meaning to make a big article on this project, but time is so tight lately. So forgive this short post.
Using the no-com-registration hack (this is NOT a security issue AT ALL), I made a Silverlight video encoder (OOB+E) application. It can capture audio/video and encode to a WMV file for upload to YouTube. It can also host the...
Read More »
|
By Jeremiah Morrill on
2/4/2010 7:18 PM
WARNING: Information and code here can easily be abused. Please do not use it as a crutch in application planning, but more for utter despair or experimentation. Thus I wrote this blog post from that perspective.'
Double WARNING:
This code is antiquated. I will release an updated version during or after Mix’10. Also having blog issues, so email me if you want the code. jeremiah.morrill at the gmail.
Silverlight 4 + OOB + Elevated Trust gives us the ability to use COM. ...
Read More »
|
By Jeremiah Morrill on
1/12/2010 10:38 PM
No matter how you feel about Silverlight 4’s COM interop, it does add an escape hatch out the sandbox when you are running an out-of-browser application. I don’t see many .NET folks getting excited about having to wipe off the dust on their C++ compiler and learn COM all over again for the first time.
Here I want to show a way of making a COM object in pure desktop .NET and using it from Silverlight. This stuff has been around since the dawn of .NET, but it may be a little more obscure to...
Read More »
|
By Jeremiah Morrill on
12/20/2009 7:06 PM
...
Read More »
|
By Jeremiah Morrill on
12/6/2009 12:21 AM
This one isn’t for the faint of heart, but if you are a Direct3D guru and always wanted some more low level access…here is a good start. This hack does a overwrites IDirect3DSwapChain9::Present method in memory to hook into the call WPF makes. In that hook, I also pull out the IDirect3DDevice9 pointer.
What can we do with this? Well for one, it would be possible to render WPF to a texture in a Direct3D scene. You can also fiddle with the WPF rendering process. And if you are really tricky,...
Read More »
|
By Jeremiah Morrill on
11/27/2009 11:22 AM
For...
Read More »
|
By Jeremiah Morrill on
10/19/2009 1:57 PM
About a month or...
Read More »
|
By Jeremiah Morrill on
10/13/2009 12:16 PM
This...
Read More »
|
By Jeremiah Morrill on
10/10/2009 7:36 PM
MVVM has been a trending topic lately. And why shouldn’t it be? People want to build great WPF/SL applications and want guidance on how to build them using the framework’s strengths. If you are anything like me, you started your WPF/SL career, learning the framework classes and hierarchy. You learned XAML, triggers, storyboards and animations. You even hobbled together something that looked mind blowing, but the code was a monstrosity. Where do you go from here? How do you leverage all this separation...
Read More »
|
By Jeremiah Morrill on
10/4/2009 10:57 PM
The code in the WPF portion of WPF Mediakit was starting to get a little spahgetti-ish. This was mostly do to me trying to handle as many usages of this control as possible and also dealing with the async nature of MediaKit. It has to support the XAML parser and code-behind. But what if you had properties set in a certain order in the xaml, but you put them in another order and everything breaks? What if you set the source property and start playing in code-behind, then you put it in the visual...
Read More »
|
By Jeremiah Morrill on
9/29/2009 10:30 PM
I haven’t had much time the last few months, but in my spare minutes I’ve been doing some work with the MediaKit. Mostly to solve some very outstanding issues and annoyances. The biggest one was a reported memory leak and another was a problem with reentrancy of the message pump. Both were somewhat related. Both had to be fixed. Why would you want to dump the leak MediaElement for something that leaked just as bad or worse?
Reentrancy? What? In the WPF MediaKit, I was using a new WPF...
Read More »
|
By Jeremiah Morrill on
9/9/2009 2:01 AM
Ever since I’ve installed Windows 7, it seems as if hardware video acceleration no longer works. In WPF MediaKit, wmv HD files that used 8% CPU in Vista are now running at 35% - 45%. This is a quad core too!
I doubled checked the graph and I confirmed that the wmv DirectShow filter was sending NV12 samples to the renderer! After scouring the internet, I found something that worked for me (not saying it will for you!) and now my wmv files are back where they should be, ~8% again.
Here...
Read More »
|
By Jeremiah Morrill on
8/7/2009 10:04 AM
I had to write a rebuttal to this post. It’s not up there yet, so here it is now:
Although you have pointed out some valid grievances with SL we may agree upon, I think overall we have a large disparity in our opinions.
1.) Text being selectable in a browser comes from the browser's historical utility of being a document browser, not an application...
Read More »
|
By Jeremiah Morrill on
8/6/2009 3:44 PM
Silverlight does not come with an Unloaded event like it’s big brother WPF. Here is a very simple behavior that adds support for it.
A Blend user simply has to supply the target method name and the target method context (Control or DataContext) and the method will be executed when the control has been removed from the visual tree.
using System;using System.Reflection;using System.Windows;using System.Windows.Controls;using System.Windows.Interactivity;using System.Windows.Media; namespace...
Read More »
|
By Jeremiah Morrill on
4/5/2009 10:21 PM

I've created a new custom behavior for WPF that allows for a glass like effect. Essentially you can place this behavior on any Visual, point to to a target visual and give it an effect and it will create an effect that looks like a piece of glass was placed over the screen. You pretty much can make your own Aero effects within your application. . .
Usage is simple. The following XAML will create a similar...
Read More »
|
By Jeremiah Morrill on
4/3/2009 1:06 PM
Microsoft's Karl Shifflett and Jaime Rodriguez are packing up and hitting the road to teach the masses how to make great business applications using WPF. Best of all they teach you how to leverage WPF the most along with the M-V-VM pattern. To top it off, if you tell them I sent ya, you'll get in free! No joke!
http://blogs.msdn.com/jaimer/archive/2009/04/01/announcing-the-using-wpf-to-build-lob-applications-training-tour.aspx
...
Read More »
|
By Jeremiah Morrill on
3/9/2009 7:43 AM
Josh Smith has recently uploaded a collection of 3D WPF controls called Thriple. If you've ever had the itch to add some 3D sexiness to your WPF app, but didn't know where to start, or couldn't justify the learning curve.look no further! At the moment Thriple comes with some high quality controls that are highly configurable so they should fit any visual style. ...
Read More »
|
By Jeremiah Morrill on
3/9/2009 4:27 AM
In case anyone had trouble compiling the new EVR renderer in media kit, I have included the binaries in the release section of the WPF MediaKit. The sample application is set to use the EVR and this may be Vista only at the moment. -Jer
|
By Jeremiah Morrill on
3/6/2009 12:35 AM
1.) http://wpfmediakit.codeplex.com
2.)
MediaKit:MediaUriElement x:Name="mediaPlayer"
Width="Auto"
Height="Auto"
LoadedBehavior="Play"
UnloadedBehavior="Close"
PreferedPositionFormat="Frame"
Volume="1"
Stretch="Uniform"
VideoRenderer="EnhancedVideoRenderer" />...
Read More »
|
By Jeremiah Morrill on
3/5/2009 4:50 AM
I have uploaded the EVR enabled WPF MediaKit to Codeplex. This is only a test build at the moment. To enable the MediaUriPlayer to use the EVR, just add "USE_EVR_PRESENTER" to the conditional compilation symbols of the WPFMediaKit project. The project is setup to compile both 32 and 64bit native code and the WPF MediaKit automatically loads the correct dll based on its environment.
A couple notes on this build. I have...
Read More »
|
By Jeremiah Morrill on
3/4/2009 2:59 AM
I gave up on a pure C# EVR presenter. But I now have a working EVR custom presenter, in all C++. I still have some more work to do on it, but it's the first step in having MediaFoundation support for WPF. I am committed to supporting Any CPU builds, so I'm building in the code to automatically use the correct native library based on the the bitage of the process. Further more, you shall not have to register any COM.
One bug that I'll leave for later is the custom EVR presenter can really...
Read More »
|
By Jeremiah Morrill on
3/1/2009 7:26 PM
Jaimie has posted about a handful of interesting threads from Microsoft's internal forums. The most interesting is about the MediaElement and memory leaks. It surely is worth a look-see if you are heavily invested into the MediaElement. -Jer
|
By Jeremiah Morrill on
2/5/2009 7:20 AM
It was a difficult decision to make, but I have made the jump over to freelance. I have had a wonderful experience with my last employer over the last few years, but going out on my own is something I've had an itch to do for more than a while. I will miss my old peeps, but being a telecommuter, they will not be any further than they were last week... an instant message away. :)
So what exactly am I doing? Well for one, I think "freelance" is a bad way to represent my situation. I have...
Read More »
|
By Jeremiah Morrill on
2/2/2009 12:48 AM
The DVDPlayerElement got a big overhaul. Hopefully it supports XP now. I am without an XP box, so somebody will have to tell me. It should now build the graph off your default DVD decoder. It also now has DVDDirectory dependency property so you can set the path of the DVD (ie D:\VIDEO_TS) so you can play a DVD off the harddrive. Let me know how it works: http://codeplex.com/WPFMediaKit -Jer
|
By Jeremiah Morrill on
2/1/2009 8:27 PM
A blog reader pointed out (Thanks Evan!) to me that the VMR9 and EVR (sometimes), will automatically scale the color for HD TV, which are pixel values 16-235. This is not a setting you can adjust and is actually done in the GPU driver. There are some registry hacks for some video drivers, but there is nothing consistent. I have created a new [bool] dependency property called DeeperColor. When set to true, it will apply a pixel shader that will scale the color back to 0-255. This gives the picture...
Read More »
|
By Jeremiah Morrill on
1/22/2009 8:44 PM
I'm having many issues with how .NET handles COM objects while writing this EVR custom presenter. I'm getting around it by writing my own COM wrapper for the 'trouble making' COM objects (most notibly IMFSample). Here is the base class for the custom COM wrapper I am going to use. It's a bit more boiler plate, but it will be well worth it :).
abstract public class Unknown
{
private readonly IntPtr m_comPointer;
private delegate int AddRefDelegate(IntPtr comPointer);
...
Read More »
|
By Jeremiah Morrill on
1/22/2009 1:09 AM
Wooo! I managed to render one (and just one) frame from my EVR custom presenter into WPF! There is still much to do and figure out. But this is really my first milestone.

Read More »
|
By Jeremiah Morrill on
1/15/2009 1:42 AM
I have been spending my free time, looking on how to support MediaFoundation and the EVR in the WPF MediaKit. MediaFoundation in Vista is pretty incomplete, used mostly for protected media path stuff like Blu-Ray. MediaFoundation will finally play a big part in multimedia in Windows 7. It will be able to play most popular media formats right out of the box. Step one (the most important step) is to make an EVR custom presenter. Of course I want to be done in all C# and this is where all my problems...
Read More »
|