Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e09a47c4
Commit
e09a47c4
authored
Feb 06, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qedit/samplegrabber: Use strmbase media type helpers.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d11b31fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
29 deletions
+21
-29
samplegrabber.c
dlls/qedit/samplegrabber.c
+21
-29
No files found.
dlls/qedit/samplegrabber.c
View file @
e09a47c4
...
@@ -84,7 +84,7 @@ static void SampleGrabber_cleanup(SG_Impl *This)
...
@@ -84,7 +84,7 @@ static void SampleGrabber_cleanup(SG_Impl *This)
IMemAllocator_Release
(
This
->
allocator
);
IMemAllocator_Release
(
This
->
allocator
);
if
(
This
->
grabberIface
)
if
(
This
->
grabberIface
)
ISampleGrabberCB_Release
(
This
->
grabberIface
);
ISampleGrabberCB_Release
(
This
->
grabberIface
);
CoTaskMemFree
(
This
->
filter_mt
.
pbForma
t
);
FreeMediaType
(
&
This
->
filter_m
t
);
CoTaskMemFree
(
This
->
bufferData
);
CoTaskMemFree
(
This
->
bufferData
);
if
(
This
->
seekthru_unk
)
if
(
This
->
seekthru_unk
)
IUnknown_Release
(
This
->
seekthru_unk
);
IUnknown_Release
(
This
->
seekthru_unk
);
...
@@ -225,44 +225,36 @@ SampleGrabber_ISampleGrabber_SetOneShot(ISampleGrabber *iface, BOOL oneShot)
...
@@ -225,44 +225,36 @@ SampleGrabber_ISampleGrabber_SetOneShot(ISampleGrabber *iface, BOOL oneShot)
}
}
/* ISampleGrabber */
/* ISampleGrabber */
static
HRESULT
WINAPI
static
HRESULT
WINAPI
SampleGrabber_ISampleGrabber_SetMediaType
(
ISampleGrabber
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
SampleGrabber_ISampleGrabber_SetMediaType
(
ISampleGrabber
*
iface
,
const
AM_MEDIA_TYPE
*
type
)
{
{
SG_Impl
*
This
=
impl_from_ISampleGrabber
(
iface
);
SG_Impl
*
filter
=
impl_from_ISampleGrabber
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
type
);
if
(
!
type
)
TRACE
(
"filter %p, mt %p.
\n
"
,
filter
,
mt
);
strmbase_dump_media_type
(
mt
);
if
(
!
mt
)
return
E_POINTER
;
return
E_POINTER
;
TRACE
(
"Media type: %s/%s ssize: %u format: %s (%u bytes)
\n
"
,
debugstr_guid
(
&
type
->
majortype
),
debugstr_guid
(
&
type
->
subtype
),
FreeMediaType
(
&
filter
->
filter_mt
);
type
->
lSampleSize
,
CopyMediaType
(
&
filter
->
filter_mt
,
mt
);
debugstr_guid
(
&
type
->
formattype
),
type
->
cbFormat
);
CoTaskMemFree
(
This
->
filter_mt
.
pbFormat
);
This
->
filter_mt
=
*
type
;
This
->
filter_mt
.
pUnk
=
NULL
;
if
(
type
->
cbFormat
)
{
This
->
filter_mt
.
pbFormat
=
CoTaskMemAlloc
(
type
->
cbFormat
);
CopyMemory
(
This
->
filter_mt
.
pbFormat
,
type
->
pbFormat
,
type
->
cbFormat
);
}
else
This
->
filter_mt
.
pbFormat
=
NULL
;
return
S_OK
;
return
S_OK
;
}
}
/* ISampleGrabber */
/* ISampleGrabber */
static
HRESULT
WINAPI
static
HRESULT
WINAPI
SampleGrabber_ISampleGrabber_GetConnectedMediaType
(
ISampleGrabber
*
iface
,
AM_MEDIA_TYPE
*
type
)
SampleGrabber_ISampleGrabber_GetConnectedMediaType
(
ISampleGrabber
*
iface
,
AM_MEDIA_TYPE
*
mt
)
{
{
SG_Impl
*
This
=
impl_from_ISampleGrabber
(
iface
);
SG_Impl
*
filter
=
impl_from_ISampleGrabber
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
type
);
if
(
!
type
)
TRACE
(
"filter %p, mt %p.
\n
"
,
filter
,
mt
);
if
(
!
mt
)
return
E_POINTER
;
return
E_POINTER
;
if
(
!
This
->
sink
.
pin
.
peer
)
if
(
!
filter
->
sink
.
pin
.
peer
)
return
VFW_E_NOT_CONNECTED
;
return
VFW_E_NOT_CONNECTED
;
*
type
=
This
->
filter_mt
;
if
(
type
->
cbFormat
)
{
CopyMediaType
(
mt
,
&
filter
->
filter_mt
);
type
->
pbFormat
=
CoTaskMemAlloc
(
type
->
cbFormat
);
CopyMemory
(
type
->
pbFormat
,
This
->
filter_mt
.
pbFormat
,
type
->
cbFormat
);
}
return
S_OK
;
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