Re: Changing output buffer size in dsp plugin
From: Jim Travis [ms] (jtravis_at_online.microsoft.com)
Date: 08/27/04
- Next message: Jim Travis [ms]: "Re: WMP UI Plugin and media library"
- Previous message: Jim Travis [ms]: "Re: DSP Plugin and threading"
- In reply to: languy: "Changing output buffer size in dsp plugin"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 27 Aug 2004 09:54:07 -0700
ProcessOutput looks like this:
HRESULT ProcessOutput(
DWORD dwFlags,
DWORD cOutputBufferCount,
DMO_OUTPUT_DATA_BUFFER* pOutputBuffers,
DWORD* pdwStatus
);
You can change pOutputBuffers to point to whatever buffers you want. So you
should be able to allocate your own new buffer (IMediaBuffer), copy the data
into it, process it, and return the new buffer to ProcessOutput.
Refer to the DMO documentation for more info:
http://msdn.microsoft.com/library/en-us/dmo/htm/imediaobjectprocessoutput.asp
-- Jim Travis Microsoft Corp. Windows Media Player SDK Download: http://msdn.microsoft.com/library/default.asp?url=/downloads/list/winmedia.asp Latest online: http://msdn.microsoft.com/library/en-us/wmplay10/mmp_sdk/windowsmediaplayer10sdk.asp Please do not send email directly to this alias as this alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. © 2004 Microsoft Corporation. All rights reserved. "languy" <jn@online.stofanet.dk> wrote in message news:OnpBQ00iEHA.1712@TK2MSFTNGP09.phx.gbl... > Hi There, > > I have created a plugin which is able both to increase and decrease the > speed of an audio sample. In addition to this it will have influenze of the > length of the buffer. I.e. if the speed is increased, then the stream will > be shorter and opposite if the the speed is decreased the length of stream > will be longer. If the speed is slowed down it will unfortunately have the > side effect that the output buffer is overwritten - a buffer overrun - > therefore I need to find a way to realloc this output stream so it matches > the actual length of the stream. > > From the MSDN: "The Player allocates both an input buffer and an output > buffer and gives the plug-in access to both buffers." > > What I can understand so far is that both buffers are allocated by the > player before they reach the plugin, which makes it much more complicated to > perform a realloc on them because the plugin doesn't have full control of > all pointers pointing to the buffers. I have already tried a couple of ways > but unfortunately not with a good result. I.e.: > > 1) performing the realloc in the DoProcessOutput > 1.1) both by increasing the existing allocation (realloc) and > destroying/freeing the old and allocating with the new larger size > 2) deallocating and allocating in the AllocateStreamingResources > 2.1) both by increasing the existing allocation (realloc) and > destroying/freeing the old and allocating with the new larger size > 2.2) when allocating, coping all properties from the old buffer into the new > allocated object > > Does any one know a way around this, so it is possible to realloc the > buffers and prevent such a buffer overrun? > > Thanks in regards, > Jess > >
- Next message: Jim Travis [ms]: "Re: WMP UI Plugin and media library"
- Previous message: Jim Travis [ms]: "Re: DSP Plugin and threading"
- In reply to: languy: "Changing output buffer size in dsp plugin"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|