Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3432a593
Commit
3432a593
authored
Apr 10, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2c: merge I/O method initialization (no functional changes)
parent
dfa3bcc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
23 deletions
+13
-23
modules/access/v4l2/access.c
modules/access/v4l2/access.c
+13
-23
No files found.
modules/access/v4l2/access.c
View file @
3432a593
...
@@ -85,10 +85,6 @@ int AccessOpen( vlc_object_t *obj )
...
@@ -85,10 +85,6 @@ int AccessOpen( vlc_object_t *obj )
}
}
sys
->
i_fd
=
fd
;
sys
->
i_fd
=
fd
;
if
(
sys
->
io
==
IO_METHOD_READ
)
access
->
pf_read
=
AccessReadStream
;
else
access
->
pf_block
=
AccessRead
;
access
->
pf_seek
=
NULL
;
access
->
pf_seek
=
NULL
;
access
->
pf_control
=
AccessControl
;
access
->
pf_control
=
AccessControl
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -131,16 +127,6 @@ int InitVideo (access_t *access, int fd)
...
@@ -131,16 +127,6 @@ int InitVideo (access_t *access, int fd)
return
-
1
;
return
-
1
;
}
}
if
(
cap
.
capabilities
&
V4L2_CAP_STREAMING
)
sys
->
io
=
IO_METHOD_MMAP
;
else
if
(
cap
.
capabilities
&
V4L2_CAP_READWRITE
)
sys
->
io
=
IO_METHOD_READ
;
else
{
msg_Err
(
access
,
"no supported I/O method"
);
return
-
1
;
}
if
(
SetupInput
(
VLC_OBJECT
(
access
),
fd
))
if
(
SetupInput
(
VLC_OBJECT
(
access
),
fd
))
return
-
1
;
return
-
1
;
...
@@ -180,13 +166,8 @@ int InitVideo (access_t *access, int fd)
...
@@ -180,13 +166,8 @@ int InitVideo (access_t *access, int fd)
}
}
/* Init I/O method */
/* Init I/O method */
switch
(
sys
->
io
)
if
(
cap
.
capabilities
&
V4L2_CAP_STREAMING
)
{
{
case
IO_METHOD_READ
:
sys
->
blocksize
=
fmt
.
fmt
.
pix
.
sizeimage
;
break
;
case
IO_METHOD_MMAP
:
if
(
InitMmap
(
VLC_OBJECT
(
access
),
sys
,
fd
))
if
(
InitMmap
(
VLC_OBJECT
(
access
),
sys
,
fd
))
return
-
1
;
return
-
1
;
for
(
unsigned
int
i
=
0
;
i
<
sys
->
i_nbuffers
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
sys
->
i_nbuffers
;
i
++
)
...
@@ -210,9 +191,18 @@ int InitVideo (access_t *access, int fd)
...
@@ -210,9 +191,18 @@ int InitVideo (access_t *access, int fd)
msg_Err
(
access
,
"cannot start streaming: %m"
);
msg_Err
(
access
,
"cannot start streaming: %m"
);
return
-
1
;
return
-
1
;
}
}
break
;
default:
access
->
pf_block
=
AccessRead
;
assert
(
0
);
}
else
if
(
cap
.
capabilities
&
V4L2_CAP_READWRITE
)
{
sys
->
blocksize
=
fmt
.
fmt
.
pix
.
sizeimage
;
access
->
pf_read
=
AccessReadStream
;
}
else
{
msg_Err
(
access
,
"no supported I/O method"
);
return
-
1
;
}
}
return
0
;
return
0
;
}
}
...
...
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