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
7aa9a04f
Commit
7aa9a04f
authored
Apr 10, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap: Make the image buffer a local variable.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2011518d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
v4l.c
dlls/qcap/v4l.c
+7
-10
No files found.
dlls/qcap/v4l.c
View file @
7aa9a04f
...
@@ -105,9 +105,6 @@ struct _Capture
...
@@ -105,9 +105,6 @@ struct _Capture
int
fd
,
mmap
;
int
fd
,
mmap
;
BOOL
iscommitted
,
stopped
;
BOOL
iscommitted
,
stopped
;
int
image_size
;
unsigned
char
*
image_data
;
HANDLE
thread
;
HANDLE
thread
;
};
};
...
@@ -367,10 +364,11 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
...
@@ -367,10 +364,11 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
HRESULT
hr
;
HRESULT
hr
;
IMediaSample
*
pSample
=
NULL
;
IMediaSample
*
pSample
=
NULL
;
ULONG
framecount
=
0
;
ULONG
framecount
=
0
;
unsigned
char
*
pTarget
;
unsigned
char
*
pTarget
,
*
image_data
;
unsigned
int
image_size
;
capBox
->
image_size
=
capBox
->
height
*
capBox
->
width
*
3
;
image_size
=
capBox
->
height
*
capBox
->
width
*
3
;
if
(
!
(
capBox
->
image_data
=
heap_alloc
(
capBox
->
image_size
)))
if
(
!
(
image_data
=
heap_alloc
(
image_size
)))
{
{
ERR
(
"Failed to allocate memory.
\n
"
);
ERR
(
"Failed to allocate memory.
\n
"
);
capBox
->
thread
=
0
;
capBox
->
thread
=
0
;
...
@@ -399,7 +397,7 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
...
@@ -399,7 +397,7 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
IMediaSample_GetPointer
(
pSample
,
&
pTarget
);
IMediaSample_GetPointer
(
pSample
,
&
pTarget
);
while
(
video_read
(
capBox
->
fd
,
capBox
->
image_data
,
capBox
->
image_size
)
==
-
1
)
while
(
video_read
(
capBox
->
fd
,
image_data
,
image_size
)
==
-
1
)
{
{
if
(
errno
!=
EAGAIN
)
if
(
errno
!=
EAGAIN
)
{
{
...
@@ -408,7 +406,7 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
...
@@ -408,7 +406,7 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
}
}
}
}
Resize
(
capBox
,
pTarget
,
capBox
->
image_data
);
Resize
(
capBox
,
pTarget
,
image_data
);
hr
=
BaseOutputPinImpl_Deliver
((
BaseOutputPin
*
)
capBox
->
pOut
,
pSample
);
hr
=
BaseOutputPinImpl_Deliver
((
BaseOutputPin
*
)
capBox
->
pOut
,
pSample
);
TRACE
(
"%p -> Frame %u: %x
\n
"
,
capBox
,
++
framecount
,
hr
);
TRACE
(
"%p -> Frame %u: %x
\n
"
,
capBox
,
++
framecount
,
hr
);
IMediaSample_Release
(
pSample
);
IMediaSample_Release
(
pSample
);
...
@@ -416,7 +414,6 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
...
@@ -416,7 +414,6 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
if
(
FAILED
(
hr
)
&&
hr
!=
VFW_E_NOT_CONNECTED
)
if
(
FAILED
(
hr
)
&&
hr
!=
VFW_E_NOT_CONNECTED
)
{
{
TRACE
(
"Return %x, stop IFilterGraph
\n
"
,
hr
);
TRACE
(
"Return %x, stop IFilterGraph
\n
"
,
hr
);
heap_free
(
capBox
->
image_data
);
capBox
->
thread
=
0
;
capBox
->
thread
=
0
;
capBox
->
stopped
=
TRUE
;
capBox
->
stopped
=
TRUE
;
break
;
break
;
...
@@ -425,6 +422,7 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
...
@@ -425,6 +422,7 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
}
}
LeaveCriticalSection
(
&
capBox
->
CritSect
);
LeaveCriticalSection
(
&
capBox
->
CritSect
);
heap_free
(
image_data
);
return
0
;
return
0
;
}
}
...
@@ -535,7 +533,6 @@ HRESULT qcap_driver_stop(Capture *capBox, FILTER_STATE *state)
...
@@ -535,7 +533,6 @@ HRESULT qcap_driver_stop(Capture *capBox, FILTER_STATE *state)
if
(
hr
!=
S_OK
&&
hr
!=
VFW_E_NOT_COMMITTED
)
if
(
hr
!=
S_OK
&&
hr
!=
VFW_E_NOT_COMMITTED
)
WARN
(
"Decommitting allocator: %x
\n
"
,
hr
);
WARN
(
"Decommitting allocator: %x
\n
"
,
hr
);
}
}
heap_free
(
capBox
->
image_data
);
}
}
*
state
=
State_Stopped
;
*
state
=
State_Stopped
;
...
...
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