Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f1fa0918
Commit
f1fa0918
authored
Apr 11, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: remove unneeded demux_sys_t.io
parent
a1cd839e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
33 deletions
+14
-33
modules/access/v4l2/demux.c
modules/access/v4l2/demux.c
+14
-33
No files found.
modules/access/v4l2/demux.c
View file @
f1fa0918
...
...
@@ -41,20 +41,11 @@
#include "v4l2.h"
/* TODO: remove this, use callbacks */
typedef
enum
{
IO_METHOD_READ
=
1
,
IO_METHOD_MMAP
,
}
io_method
;
struct
demux_sys_t
{
int
fd
;
vlc_thread_t
thread
;
/* Video */
io_method
io
;
struct
buffer_t
*
bufv
;
union
{
...
...
@@ -480,14 +471,12 @@ static int InitVideo (demux_t *demux, int fd)
msg_Err
(
demux
,
"cannot start streaming: %m"
);
return
-
1
;
}
sys
->
io
=
IO_METHOD_MMAP
;
entry
=
StreamThread
;
}
else
if
(
caps
&
V4L2_CAP_READWRITE
)
{
sys
->
bufv
=
NULL
;
sys
->
blocksize
=
fmt
.
fmt
.
pix
.
sizeimage
;
sys
->
io
=
IO_METHOD_READ
;
entry
=
ReadThread
;
}
else
...
...
@@ -511,30 +500,22 @@ void DemuxClose( vlc_object_t *obj )
vlc_join
(
sys
->
thread
,
NULL
);
/* Stop video capture */
switch
(
sys
->
io
)
if
(
sys
->
bufv
!=
NULL
)
{
case
IO_METHOD_READ
:
/* Nothing to do */
break
;
case
IO_METHOD_MMAP
:
for
(
uint32_t
i
=
0
;
i
<
sys
->
bufc
;
i
++
)
{
/* NOTE: Some buggy drivers hang if buffers are not unmapped before
* streamoff */
for
(
uint32_t
i
=
0
;
i
<
sys
->
bufc
;
i
++
)
{
struct
v4l2_buffer
buf
=
{
.
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
,
.
memory
=
V4L2_MEMORY_MMAP
,
};
v4l2_ioctl
(
fd
,
VIDIOC_DQBUF
,
&
buf
);
v4l2_munmap
(
sys
->
bufv
[
i
].
start
,
sys
->
bufv
[
i
].
length
);
}
enum
v4l2_buf_type
buf_type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
;
v4l2_ioctl
(
fd
,
VIDIOC_STREAMOFF
,
&
buf_type
);
free
(
sys
->
bufv
);
break
;
struct
v4l2_buffer
buf
=
{
.
type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
,
.
memory
=
V4L2_MEMORY_MMAP
,
};
v4l2_ioctl
(
fd
,
VIDIOC_DQBUF
,
&
buf
);
v4l2_munmap
(
sys
->
bufv
[
i
].
start
,
sys
->
bufv
[
i
].
length
);
}
enum
v4l2_buf_type
buf_type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE
;
v4l2_ioctl
(
fd
,
VIDIOC_STREAMOFF
,
&
buf_type
);
free
(
sys
->
bufv
);
}
ControlsDeinit
(
obj
,
sys
->
controls
);
...
...
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