After the recording stops the dvr-ms file that is created plays correctly.
And the ability to support this useage scenario is a documented feature of
the SBE so I must be configuring it improperly.
Thanks.
The relevant code (C#) is listed
below. Thanks.
IStreamBufferConfigure3 config =
(IStreamBufferConfigure3)new
StreamBufferConfig();
init = config as IStreamBufferInitialize;
try
{
int result = RegOpenKeyEx(_registryHive,
keyName, 0, STANDARD_RIGHTS_READ | KEY_QUERY_VALUE |
STANDARD_RIGHTS_WRITE, out registryKey);
if (result != 0)
Marshal.ThrowExceptionForHR(result);
hr = init.SetHKEY(registryKey);
DsError.ThrowExceptionForHR(hr);
}
finally
{
if (registryKey != IntPtr.Zero)
{
hr = RegCloseKey(registryKey);
DsError.ThrowExceptionForHR(hr);
registryKey = IntPtr.Zero;
}
}
hr =
config.SetDirectory(Path.GetDirectoryName(target));
DsError.ThrowExceptionForHR(hr);
hr = config.SetNamespace(null);
DsError.ThrowExceptionForHR(hr);
hr = config.SetBackingFileCount(6, 8);
DsError.ThrowExceptionForHR(hr);
hr = config.SetBackingFileDuration((60 * 4));
DsError.ThrowExceptionForHR(hr);
hr = config.SetFFTransitionRates(8, 32);
DsError.ThrowExceptionForHR(hr);
IStreamBufferSink3 sink = (IStreamBufferSink3)new
StreamBufferSink();
IStreamBufferInitialize init2 = sink as IStreamBufferInitialize;
try
{
int result = RegOpenKeyEx(_registryHive,
keyName, 0, STANDARD_RIGHTS_READ | KEY_QUERY_VALUE |
STANDARD_RIGHTS_WRITE, out registryKey);
if (result != 0)
Marshal.ThrowExceptionForHR(result);
hr = init2.SetHKEY(registryKey);
DsError.ThrowExceptionForHR(hr);
}
finally
{
if (registryKey != IntPtr.Zero)
{
hr = RegCloseKey(registryKey);
DsError.ThrowExceptionForHR(hr);
}
}
hr =
sink.LockProfile(Path.Combine(Path.GetDirectoryName(target),
string.Format("TempRec\\{0}.sbe",
Path.GetFileNameWithoutExtension(target))));
DsError.ThrowExceptionForHR(hr);
object objRecorder;
hr = sink.CreateRecorder(target,
RecordingType.Content, out objRecorder);
DsError.ThrowExceptionForHR(hr);
I can load dvr-ms files created by Windows Media Center while they are
recording using graphedit. That's why I thought it was a config issue.
> Or is this not the right place to "get
> expert answers to your technical questions within one business day –
> guaranteed."?
Are referring to MSDN Managed Newsgroup support with the above quote?
Are you posting with your registered MSDN alias? (see the MSDN site for
details)
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
On Mon, 24 Dec 2007 08:51:00 -0800, Andy VT wrote:
> Yes (to both questions). This is the first time I've used this benefit of
> being a MSDN subscriber (been a subscriber for many years), so I wasn't sure
> if I'd screwed up somewhere.
I spent about five minutes poking around the MSDN site trying to find the
sign up for registering the MSDN email (not a well designed site, finally
found it with Google). @discussions.microsoft.com is NOT a valid address
ending for the registered email alias. You need to use the address you
register for it to show up in the MS rep's filter.
I tried to register an alias for my new MSDN subscription and got the
following error:
We were unable to communicate with the Managed Newsgroups registration
system.
However, the alias does seem to be registered.
The alias registration can be found through this link:
https://msdn2.microsoft.com/en-us/subscriptions/manage/default.aspx
Finally, I looked at your first post. Using dshow in .NET is not supported
by MS so I doubt you will get managed newsgroup support for it.
> [ Please trim and quote inline as requested ]
alright.
> I spent about five minutes poking around the MSDN site trying to find the
> sign up for registering the MSDN email (not a well designed site, finally
> found it with Google). @discussions.microsoft.com is NOT a valid address
> ending for the registered email alias. You need to use the address you
> register for it to show up in the MS rep's filter.
When I registered my profile (I used the same URL you specified to do that)
I selected the option to have MSDN hide my real email address, the
@discussions address is probably a manifestation of that.
> Finally, I looked at your first post. Using dshow in .NET is not supported
> by MS so I doubt you will get managed newsgroup support for it.
That's an odd stance for them to take given the COM nature of DShow.
The problem (or perhaps a similar one) doesn't seem to be isolated to .net
(http://groups.google.com/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/f9e2203507df64b8/58cc634cc5879026?lnk=st&q=StreamBufferSink+IStreamBufferConfigure3#58cc634cc5879026).
I can create a c/c++ sample if you think that's the blocking issue here.
> When I registered my profile (I used the same URL you specified to do that)
> I selected the option to have MSDN hide my real email address, the
> @discussions address is probably a manifestation of that.
I recommend you post using a newsreader and use the alias you provided in
the newsgroup sign up screen (it isn't your real email address or the one
with @discussions.microsoft.com).
>> Finally, I looked at your first post. Using dshow in .NET is not supported
>> by MS so I doubt you will get managed newsgroup support for it.
>
> That's an odd stance for them to take given the COM nature of DShow.
I don't know if that is the issue but I would understand it. You're using
an unsupported layer which may be causing the issue so the first thing you
need to eliminate is that layer.
> The problem (or perhaps a similar one) doesn't seem to be isolated to .net
> (http://groups.google.com/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/f9e2203507df64b8/58cc634cc5879026?lnk=st&q=StreamBufferSink+IStreamBufferConfigure3#58cc634cc5879026).
That's some odd looking code ;)
> I can create a c/c++ sample if you think that's the blocking issue here.
I recommend it and I recommend starting a new thread with your MSDN alias.
[ note: I don't use the SBE; that's why I'm not able to address the actual
issue you are having :( ]
> I spent about five minutes poking around the MSDN site trying to find the
> sign up for registering the MSDN email (not a well designed site, finally
> found it with Google). @discussions.microsoft.com is NOT a valid address
> ending for the registered email alias. You need to use the address you
> register for it to show up in the MS rep's filter.
It's valid if you are using the MS web interface, it knows who is who via
the passport account. But who knows how their tracking system really
works.
--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
I think I've figured out the problem, although I am confused by the
solution. I ended up copying the dvr config registry key from a WMC
machine and using that to configure the sink. When it didn't work the
first go (different error), I took a closer look and noticed that the
namespace was set to Global (config.SetNamespace("Global");) which
requires admin rights. Running my application with an administrative
account resolved the original issue.
What's strange is that the WMC services run as Network Service which
doesn't (or at least shouldn't) have admin rights. I'm guessing that
MS must have done some additional config to give the NS account
whatever permissions are required to make the Global setting work. I
wish they had documented that :)
> I think I've figured out the problem, although I am confused by the
> solution. I ended up copying the dvr config registry key from a WMC
> machine and using that to configure the sink. When it didn't work the
> first go (different error), I took a closer look and noticed that the
> namespace was set to Global (config.SetNamespace("Global");) which
> requires admin rights. Running my application with an administrative
> account resolved the original issue.
Thank you for posting your update.
> What's strange is that the WMC services run as Network Service which
> doesn't (or at least shouldn't) have admin rights. I'm guessing that
> MS must have done some additional config to give the NS account
> whatever permissions are required to make the Global setting work. I
> wish they had documented that :)
It's certainly possible. Let's see if your advice helps Andy.