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
e32dead3
Commit
e32dead3
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: Get rid of V4l_GetFrame().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bc42cc42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
v4l.c
dlls/qcap/v4l.c
+12
-18
No files found.
dlls/qcap/v4l.c
View file @
e32dead3
...
...
@@ -361,27 +361,13 @@ static void Resize(const Capture * capBox, LPBYTE output, const BYTE *input)
}
}
static
void
V4l_GetFrame
(
Capture
*
device
,
unsigned
char
**
buffer
)
{
while
(
video_read
(
device
->
fd
,
device
->
image_data
,
device
->
image_size
)
==
-
1
)
{
if
(
errno
!=
EAGAIN
)
{
ERR
(
"Failed to read frame: %s
\n
"
,
strerror
(
errno
));
break
;
}
}
TRACE
(
"Successfully read a frame.
\n
"
);
*
buffer
=
device
->
image_data
;
}
static
DWORD
WINAPI
ReadThread
(
LPVOID
lParam
)
{
Capture
*
capBox
=
lParam
;
HRESULT
hr
;
IMediaSample
*
pSample
=
NULL
;
ULONG
framecount
=
0
;
unsigned
char
*
pTarget
,
*
p
Input
,
*
p
Output
;
unsigned
char
*
pTarget
,
*
pOutput
;
capBox
->
image_size
=
capBox
->
height
*
capBox
->
width
*
3
;
if
(
!
(
capBox
->
image_data
=
heap_alloc
(
capBox
->
image_size
)))
...
...
@@ -414,9 +400,17 @@ static DWORD WINAPI ReadThread(LPVOID lParam)
TRACE
(
"Data length: %d KB
\n
"
,
len
/
1024
);
IMediaSample_GetPointer
(
pSample
,
&
pTarget
);
/* FIXME: Check return values.. */
V4l_GetFrame
(
capBox
,
&
pInput
);
memcpy
(
pOutput
,
pInput
,
len
);
while
(
video_read
(
capBox
->
fd
,
capBox
->
image_data
,
capBox
->
image_size
)
==
-
1
)
{
if
(
errno
!=
EAGAIN
)
{
ERR
(
"Failed to read frame: %s
\n
"
,
strerror
(
errno
));
break
;
}
}
memcpy
(
pOutput
,
capBox
->
image_data
,
len
);
Resize
(
capBox
,
pTarget
,
pOutput
);
hr
=
BaseOutputPinImpl_Deliver
((
BaseOutputPin
*
)
capBox
->
pOut
,
pSample
);
TRACE
(
"%p -> Frame %u: %x
\n
"
,
capBox
,
++
framecount
,
hr
);
...
...
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