Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

can't access dvr-ms files while recording

8 views
Skip to first unread message

Andy VT

unread,
Dec 17, 2007, 10:31:00 AM12/17/07
to
I'm using the Streambuffer Engine (StreamBufferSink) to create dvr-ms files
in my application, but the StreamBufferSource is unable to load the file for
playback while it's recording. The error indicates that another process has
the file locked.

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);

gregc

unread,
Dec 17, 2007, 11:19:24 AM12/17/07
to
The code for the creating the recording looks fine. Where are you
getting the error that another process has the file locked?

Andy VT

unread,
Dec 17, 2007, 11:42:03 AM12/17/07
to
when I try to load the dvr-ms file for playback. I've tried using graphedit
and a simple application that uses a graphbuilder to render the file.

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.

Andy VT

unread,
Dec 22, 2007, 10:42:00 PM12/22/07
to
Is the SBE not supported anymore? Or is this not the right place to "get
expert answers to your technical questions within one business day –
guaranteed."?

The March Hare [MVP]

unread,
Dec 24, 2007, 10:02:30 AM12/24/07
to
On Sat, 22 Dec 2007 19:42:00 -0800, Andy VT wrote:

> 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

Andy VT

unread,
Dec 24, 2007, 11:51:00 AM12/24/07
to
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.

The March Hare [MVP]

unread,
Dec 24, 2007, 1:16:45 PM12/24/07
to
[ Please trim and quote inline as requested ]

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.

Andy VT

unread,
Dec 24, 2007, 1:43:02 PM12/24/07
to
"The March Hare [MVP]" wrote:

> [ 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.

The March Hare [MVP]

unread,
Dec 24, 2007, 3:50:56 PM12/24/07
to
On Mon, 24 Dec 2007 10:43:02 -0800, Andy VT wrote:

> 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.

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 :( ]

Chris P.

unread,
Dec 26, 2007, 10:56:20 AM12/26/07
to
On Mon, 24 Dec 2007 11:16:45 -0700, The March Hare [MVP] wrote:

> 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]

babgvant

unread,
Dec 27, 2007, 9:27:49 AM12/27/07
to
> > 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.
>

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 :)

The March Hare [MVP]

unread,
Dec 28, 2007, 11:52:52 AM12/28/07
to
On Thu, 27 Dec 2007 06:27:49 -0800 (PST), babgvant wrote:

> 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.

0 new messages