avifil32: Move CreateEditableStream() to avoid exporting a helper.
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
165f8d1fff
commit
a0b7eb0d3e
|
@ -1981,44 +1981,6 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
|
|||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CreateEditableStream (AVIFIL32.@)
|
||||
*/
|
||||
HRESULT WINAPI CreateEditableStream(PAVISTREAM *ppEditable, PAVISTREAM pSource)
|
||||
{
|
||||
IAVIEditStream *pEdit = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%p)\n", ppEditable, pSource);
|
||||
|
||||
if (ppEditable == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
*ppEditable = NULL;
|
||||
|
||||
if (pSource != NULL) {
|
||||
hr = IAVIStream_QueryInterface(pSource, &IID_IAVIEditStream,
|
||||
(LPVOID*)&pEdit);
|
||||
if (SUCCEEDED(hr) && pEdit != NULL) {
|
||||
hr = IAVIEditStream_Clone(pEdit, ppEditable);
|
||||
IAVIEditStream_Release(pEdit);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
/* need own implementation of IAVIEditStream */
|
||||
pEdit = AVIFILE_CreateEditStream(pSource);
|
||||
if (pEdit == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
hr = IAVIEditStream_QueryInterface(pEdit, &IID_IAVIStream,
|
||||
(LPVOID*)ppEditable);
|
||||
IAVIEditStream_Release(pEdit);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* EditStreamClone (AVIFIL32.@)
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,6 @@ extern HRESULT AVIFILE_CreateAVIFile(IUnknown *pUnkOuter, REFIID riid, LPVOID *p
|
|||
extern HRESULT AVIFILE_CreateWAVFile(IUnknown *outer_unk, REFIID riid, void **ret_iface) DECLSPEC_HIDDEN;
|
||||
extern HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||
extern HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
|
||||
extern PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream) DECLSPEC_HIDDEN;
|
||||
extern PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pstream) DECLSPEC_HIDDEN;
|
||||
extern PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, const PAVISTREAM *ppStreams) DECLSPEC_HIDDEN;
|
||||
|
||||
|
|
|
@ -70,6 +70,8 @@ struct _IAVIEditStreamImpl {
|
|||
LPBITMAPINFOHEADER lpFrame; /* frame of pCurStream */
|
||||
};
|
||||
|
||||
static IAVIEditStream *AVIFILE_CreateEditStream(IAVIStream *stream);
|
||||
|
||||
static inline IAVIEditStreamImpl *impl_from_IAVIEditStream(IAVIEditStream *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IAVIEditStreamImpl, IAVIEditStream_iface);
|
||||
|
@ -1005,7 +1007,7 @@ static const struct IAVIStreamVtbl ieditstast = {
|
|||
IEditAVIStream_fnSetInfo
|
||||
};
|
||||
|
||||
PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream)
|
||||
static IAVIEditStream *AVIFILE_CreateEditStream(IAVIStream *pstream)
|
||||
{
|
||||
IAVIEditStreamImpl *pedit = NULL;
|
||||
|
||||
|
@ -1021,3 +1023,38 @@ PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream)
|
|||
|
||||
return (PAVIEDITSTREAM)pedit;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CreateEditableStream (AVIFIL32.@)
|
||||
*/
|
||||
HRESULT WINAPI CreateEditableStream(IAVIStream **editable, IAVIStream *src)
|
||||
{
|
||||
IAVIEditStream *edit = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%p)\n", editable, src);
|
||||
|
||||
if (!editable)
|
||||
return AVIERR_BADPARAM;
|
||||
*editable = NULL;
|
||||
|
||||
if (src) {
|
||||
hr = IAVIStream_QueryInterface(src, &IID_IAVIEditStream, (void**)&edit);
|
||||
if (SUCCEEDED(hr) && edit) {
|
||||
hr = IAVIEditStream_Clone(edit, editable);
|
||||
IAVIEditStream_Release(edit);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Need own implementation of IAVIEditStream */
|
||||
edit = AVIFILE_CreateEditStream(src);
|
||||
if (!edit)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
hr = IAVIEditStream_QueryInterface(edit, &IID_IAVIStream, (void**)editable);
|
||||
IAVIEditStream_Release(edit);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue