Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
284bac2e
Commit
284bac2e
authored
May 26, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libdc1394: return meaninful error codes.
parent
33e03696
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
libdc1394.c
libavdevice/libdc1394.c
+6
-3
No files found.
libavdevice/libdc1394.c
View file @
284bac2e
...
...
@@ -116,6 +116,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
int
width
=
!
ap
->
width
?
320
:
ap
->
width
;
int
height
=
!
ap
->
height
?
240
:
ap
->
height
;
int
frame_rate
=
!
ap
->
time_base
.
num
?
30000
:
av_rescale
(
1000
,
ap
->
time_base
.
den
,
ap
->
time_base
.
num
);
int
ret
=
0
;
for
(
fmt
=
dc1394_frame_formats
;
fmt
->
width
;
fmt
++
)
if
(
fmt
->
pix_fmt
==
pix_fmt
&&
fmt
->
width
==
width
&&
fmt
->
height
==
height
)
...
...
@@ -128,13 +129,16 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
if
(
!
fps
->
frame_rate
||
!
fmt
->
width
)
{
av_log
(
c
,
AV_LOG_ERROR
,
"Can't find matching camera format for %s, %dx%d@%d:1000fps
\n
"
,
avcodec_get_pix_fmt_name
(
pix_fmt
),
width
,
height
,
frame_rate
);
ret
=
AVERROR
(
EINVAL
);
goto
out
;
}
/* create a video stream */
vst
=
av_new_stream
(
c
,
0
);
if
(
!
vst
)
if
(
!
vst
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
out
;
}
av_set_pts_info
(
vst
,
64
,
1
,
1000
);
vst
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
vst
->
codec
->
codec_id
=
CODEC_ID_RAWVIDEO
;
...
...
@@ -156,9 +160,8 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
vst
->
codec
->
bit_rate
=
av_rescale
(
dc1394
->
packet
.
size
*
8
,
fps
->
frame_rate
,
1000
);
*
select_fps
=
fps
;
*
select_fmt
=
fmt
;
return
0
;
out:
return
-
1
;
return
ret
;
}
#if HAVE_LIBDC1394_1
...
...
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