Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2e283d09
Commit
2e283d09
authored
Feb 24, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove tabs, reformat, merge comments.
parent
b6bc6aa6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
93 deletions
+114
-93
dmort.c
dlls/msdmo/dmort.c
+114
-93
No files found.
dlls/msdmo/dmort.c
View file @
2e283d09
...
@@ -32,152 +32,173 @@
...
@@ -32,152 +32,173 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msdmo
);
WINE_DEFAULT_DEBUG_CHANNEL
(
msdmo
);
/***********************************************************************
/***********************************************************************
* MoCreateMediaType (MSDMO.@)
* MoCreateMediaType (MSDMO.@)
*
* Allocate a new media type structure
*/
*/
HRESULT
WINAPI
MoCreateMediaType
(
DMO_MEDIA_TYPE
**
ppmedia
,
DWORD
cbFormat
)
HRESULT
WINAPI
MoCreateMediaType
(
DMO_MEDIA_TYPE
**
ppmedia
,
DWORD
cbFormat
)
{
{
HRESULT
h
r
;
HRESULT
r
;
TRACE
(
"(%p,%lu)
\n
"
,
ppmedia
,
cbFormat
);
TRACE
(
"%p %lu
\n
"
,
ppmedia
,
cbFormat
);
if
(
ppmedia
==
NULL
)
if
(
!
ppmedia
)
return
E_POINTER
;
return
E_POINTER
;
*
ppmedia
=
CoTaskMemAlloc
(
sizeof
(
DMO_MEDIA_TYPE
));
*
ppmedia
=
CoTaskMemAlloc
(
sizeof
(
DMO_MEDIA_TYPE
));
if
(
*
ppmedia
==
NULL
)
if
(
!*
ppmedia
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
hr
=
MoInitMediaType
(
*
ppmedia
,
cbFormat
);
r
=
MoInitMediaType
(
*
ppmedia
,
cbFormat
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
r
))
CoTaskMemFree
(
*
ppmedia
);
{
*
ppmedia
=
NULL
;
CoTaskMemFree
(
*
ppmedia
);
}
*
ppmedia
=
NULL
;
}
return
h
r
;
return
r
;
}
}
/***********************************************************************
/***********************************************************************
* MoInitMediaType (MSDMO.@)
* MoInitMediaType (MSDMO.@)
*
* Initialize media type structure
*/
*/
HRESULT
WINAPI
MoInitMediaType
(
DMO_MEDIA_TYPE
*
pmedia
,
DWORD
cbFormat
)
HRESULT
WINAPI
MoInitMediaType
(
DMO_MEDIA_TYPE
*
pmedia
,
DWORD
cbFormat
)
{
{
TRACE
(
"(%p,%lu)
\n
"
,
pmedia
,
cbFormat
);
TRACE
(
"%p %lu
\n
"
,
pmedia
,
cbFormat
);
if
(
pmedia
==
NULL
)
if
(
!
pmedia
)
return
E_POINTER
;
return
E_POINTER
;
memset
(
pmedia
,
0
,
sizeof
(
DMO_MEDIA_TYPE
));
memset
(
pmedia
,
0
,
sizeof
(
DMO_MEDIA_TYPE
));
if
(
cbFormat
>
0
)
{
if
(
cbFormat
>
0
)
pmedia
->
pbFormat
=
CoTaskMemAlloc
(
cbFormat
);
{
if
(
pmedia
->
pbFormat
==
NULL
)
pmedia
->
pbFormat
=
CoTaskMemAlloc
(
cbFormat
);
return
E_OUTOFMEMORY
;
if
(
!
pmedia
->
pbFormat
)
return
E_OUTOFMEMORY
;
pmedia
->
cbFormat
=
cbFormat
;
pmedia
->
cbFormat
=
cbFormat
;
}
}
return
S_OK
;
return
S_OK
;
}
}
/***********************************************************************
/***********************************************************************
* MoDeleteMediaType (MSDMO.@)
* MoDeleteMediaType (MSDMO.@)
*
* Delete a media type structure
*/
*/
HRESULT
WINAPI
MoDeleteMediaType
(
DMO_MEDIA_TYPE
*
pmedia
)
HRESULT
WINAPI
MoDeleteMediaType
(
DMO_MEDIA_TYPE
*
pmedia
)
{
{
TRACE
(
"(%p)
\n
"
,
pmedia
);
TRACE
(
"%p
\n
"
,
pmedia
);
if
(
pmedia
==
NULL
)
if
(
!
pmedia
)
return
E_POINTER
;
return
E_POINTER
;
MoFreeMediaType
(
pmedia
);
MoFreeMediaType
(
pmedia
);
CoTaskMemFree
(
pmedia
);
CoTaskMemFree
(
pmedia
);
return
S_OK
;
return
S_OK
;
}
}
/***********************************************************************
/***********************************************************************
* MoFreeMediaType (MSDMO.@)
* MoFreeMediaType (MSDMO.@)
*
* Free allocated members of a media type structure
*/
*/
HRESULT
WINAPI
MoFreeMediaType
(
DMO_MEDIA_TYPE
*
pmedia
)
HRESULT
WINAPI
MoFreeMediaType
(
DMO_MEDIA_TYPE
*
pmedia
)
{
{
TRACE
(
"(%p)
\n
"
,
pmedia
);
TRACE
(
"%p
\n
"
,
pmedia
);
if
(
pmedia
==
NULL
)
if
(
!
pmedia
)
return
E_POINTER
;
return
E_POINTER
;
if
(
pmedia
->
pUnk
!=
NULL
)
{
if
(
pmedia
->
pUnk
)
IUnknown_Release
(
pmedia
->
pUnk
);
{
pmedia
->
pUnk
=
NULL
;
IUnknown_Release
(
pmedia
->
pUnk
);
}
pmedia
->
pUnk
=
NULL
;
}
if
(
pmedia
->
pbFormat
!=
NULL
)
{
if
(
pmedia
->
pbFormat
)
CoTaskMemFree
(
pmedia
->
pbFormat
);
{
pmedia
->
pbFormat
=
NULL
;
CoTaskMemFree
(
pmedia
->
pbFormat
);
}
pmedia
->
pbFormat
=
NULL
;
}
return
S_OK
;
return
S_OK
;
}
}
/***********************************************************************
/***********************************************************************
* MoDuplicateMediaType (MSDMO.@)
* MoDuplicateMediaType (MSDMO.@)
*
* Duplicates a media type structure
*/
*/
HRESULT
WINAPI
MoDuplicateMediaType
(
DMO_MEDIA_TYPE
**
ppdst
,
HRESULT
WINAPI
MoDuplicateMediaType
(
DMO_MEDIA_TYPE
**
ppdst
,
const
DMO_MEDIA_TYPE
*
psrc
)
const
DMO_MEDIA_TYPE
*
psrc
)
{
{
HRESULT
h
r
;
HRESULT
r
;
TRACE
(
"(%p,%p)
\n
"
,
ppdst
,
psrc
);
TRACE
(
"%p %p
\n
"
,
ppdst
,
psrc
);
if
(
ppdst
==
NULL
||
psrc
==
NULL
)
if
(
!
ppdst
||
!
psrc
)
return
E_POINTER
;
return
E_POINTER
;
*
ppdst
=
CoTaskMemAlloc
(
sizeof
(
DMO_MEDIA_TYPE
));
*
ppdst
=
CoTaskMemAlloc
(
sizeof
(
DMO_MEDIA_TYPE
));
if
(
*
ppdst
==
NULL
)
if
(
!*
ppdst
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
hr
=
MoCopyMediaType
(
*
ppdst
,
psrc
);
r
=
MoCopyMediaType
(
*
ppdst
,
psrc
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
r
))
MoFreeMediaType
(
*
ppdst
);
{
*
ppdst
=
NULL
;
MoFreeMediaType
(
*
ppdst
);
}
*
ppdst
=
NULL
;
}
return
h
r
;
return
r
;
}
}
/***********************************************************************
/***********************************************************************
* MoCopyMediaType (MSDMO.@)
* MoCopyMediaType (MSDMO.@)
*
* Copy a new media type structure
*/
*/
HRESULT
WINAPI
MoCopyMediaType
(
DMO_MEDIA_TYPE
*
pdst
,
HRESULT
WINAPI
MoCopyMediaType
(
DMO_MEDIA_TYPE
*
pdst
,
const
DMO_MEDIA_TYPE
*
psrc
)
const
DMO_MEDIA_TYPE
*
psrc
)
{
{
TRACE
(
"(%p,%p)
\n
"
,
pdst
,
psrc
);
TRACE
(
"%p %p
\n
"
,
pdst
,
psrc
);
if
(
pdst
==
NULL
||
psrc
==
NULL
)
if
(
!
pdst
||
!
psrc
)
return
E_POINTER
;
return
E_POINTER
;
memcpy
(
&
pdst
->
majortype
,
&
psrc
->
majortype
,
sizeof
(
psrc
->
majortype
));
memcpy
(
&
pdst
->
majortype
,
&
psrc
->
majortype
,
sizeof
(
psrc
->
majortype
));
memcpy
(
&
pdst
->
subtype
,
&
psrc
->
subtype
,
sizeof
(
psrc
->
subtype
));
memcpy
(
&
pdst
->
subtype
,
&
psrc
->
subtype
,
sizeof
(
psrc
->
subtype
));
memcpy
(
&
pdst
->
formattype
,
&
psrc
->
formattype
,
sizeof
(
psrc
->
formattype
));
memcpy
(
&
pdst
->
formattype
,
&
psrc
->
formattype
,
sizeof
(
psrc
->
formattype
));
pdst
->
bFixedSizeSamples
=
psrc
->
bFixedSizeSamples
;
pdst
->
bFixedSizeSamples
=
psrc
->
bFixedSizeSamples
;
pdst
->
bTemporalCompression
=
psrc
->
bTemporalCompression
;
pdst
->
bTemporalCompression
=
psrc
->
bTemporalCompression
;
pdst
->
lSampleSize
=
psrc
->
lSampleSize
;
pdst
->
lSampleSize
=
psrc
->
lSampleSize
;
pdst
->
cbFormat
=
psrc
->
cbFormat
;
pdst
->
cbFormat
=
psrc
->
cbFormat
;
if
(
psrc
->
pbFormat
!=
NULL
&&
psrc
->
cbFormat
>
0
)
{
if
(
psrc
->
pbFormat
&&
psrc
->
cbFormat
>
0
)
pdst
->
pbFormat
=
CoTaskMemAlloc
(
psrc
->
cbFormat
);
{
if
(
pdst
->
pbFormat
==
NULL
)
pdst
->
pbFormat
=
CoTaskMemAlloc
(
psrc
->
cbFormat
);
return
E_OUTOFMEMORY
;
if
(
!
pdst
->
pbFormat
)
return
E_OUTOFMEMORY
;
memcpy
(
pdst
->
pbFormat
,
psrc
->
pbFormat
,
psrc
->
cbFormat
);
}
else
memcpy
(
pdst
->
pbFormat
,
psrc
->
pbFormat
,
psrc
->
cbFormat
);
pdst
->
pbFormat
=
NULL
;
}
else
if
(
psrc
->
pUnk
!=
NULL
)
{
pdst
->
pbFormat
=
NULL
;
pdst
->
pUnk
=
psrc
->
pUnk
;
IUnknown_AddRef
(
pdst
->
pUnk
);
if
(
psrc
->
pUnk
)
}
else
{
pdst
->
pUnk
=
NULL
;
pdst
->
pUnk
=
psrc
->
pUnk
;
IUnknown_AddRef
(
pdst
->
pUnk
);
return
S_OK
;
}
else
pdst
->
pUnk
=
NULL
;
return
S_OK
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment