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
e0eb0bda
Commit
e0eb0bda
authored
Feb 17, 2017
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/decklink_enc: convert to codecpar
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
6d856b25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
decklink_enc.cpp
libavdevice/decklink_enc.cpp
+10
-10
No files found.
libavdevice/decklink_enc.cpp
View file @
e0eb0bda
...
...
@@ -92,20 +92,20 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
{
struct
decklink_cctx
*
cctx
=
(
struct
decklink_cctx
*
)
avctx
->
priv_data
;
struct
decklink_ctx
*
ctx
=
(
struct
decklink_ctx
*
)
cctx
->
ctx
;
AVCodec
Context
*
c
=
st
->
codec
;
AVCodec
Parameters
*
c
=
st
->
codecpar
;
if
(
ctx
->
video
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only one video stream is supported!
\n
"
);
return
-
1
;
}
if
(
c
->
pix_fm
t
!=
AV_PIX_FMT_UYVY422
)
{
if
(
c
->
forma
t
!=
AV_PIX_FMT_UYVY422
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported pixel format!"
" Only AV_PIX_FMT_UYVY422 is supported.
\n
"
);
return
-
1
;
}
if
(
ff_decklink_set_format
(
avctx
,
c
->
width
,
c
->
height
,
c
->
time_base
.
num
,
c
->
time_base
.
den
))
{
st
->
time_base
.
num
,
st
->
time_base
.
den
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported video size or framerate!"
" Check available formats with -list_formats 1.
\n
"
);
return
-
1
;
...
...
@@ -121,8 +121,8 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
ctx
->
dlo
->
SetScheduledFrameCompletionCallback
(
ctx
->
output_callback
);
/* Start video semaphore. */
ctx
->
frames_preroll
=
c
->
time_base
.
den
*
ctx
->
preroll
;
if
(
c
->
time_base
.
den
>
1000
)
ctx
->
frames_preroll
=
st
->
time_base
.
den
*
ctx
->
preroll
;
if
(
st
->
time_base
.
den
>
1000
)
ctx
->
frames_preroll
/=
1000
;
/* Buffer twice as many frames as the preroll. */
...
...
@@ -131,7 +131,7 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
sem_init
(
&
ctx
->
semaphore
,
0
,
ctx
->
frames_buffer
);
/* The device expects the framerate to be fixed. */
avpriv_set_pts_info
(
st
,
64
,
c
->
time_base
.
num
,
c
->
time_base
.
den
);
avpriv_set_pts_info
(
st
,
64
,
st
->
time_base
.
num
,
st
->
time_base
.
den
);
ctx
->
video
=
1
;
...
...
@@ -142,7 +142,7 @@ static int decklink_setup_audio(AVFormatContext *avctx, AVStream *st)
{
struct
decklink_cctx
*
cctx
=
(
struct
decklink_cctx
*
)
avctx
->
priv_data
;
struct
decklink_ctx
*
ctx
=
(
struct
decklink_ctx
*
)
cctx
->
ctx
;
AVCodec
Context
*
c
=
st
->
codec
;
AVCodec
Parameters
*
c
=
st
->
codecpar
;
if
(
ctx
->
audio
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only one audio stream is supported!
\n
"
);
...
...
@@ -352,7 +352,7 @@ av_cold int ff_decklink_write_header(AVFormatContext *avctx)
ret
=
AVERROR
(
EIO
);
for
(
n
=
0
;
n
<
avctx
->
nb_streams
;
n
++
)
{
AVStream
*
st
=
avctx
->
streams
[
n
];
AVCodec
Context
*
c
=
st
->
codec
;
AVCodec
Parameters
*
c
=
st
->
codecpar
;
if
(
c
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
if
(
decklink_setup_audio
(
avctx
,
st
))
goto
error
;
...
...
@@ -380,9 +380,9 @@ int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt)
ctx
->
last_pts
=
FFMAX
(
ctx
->
last_pts
,
pkt
->
pts
);
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
if
(
st
->
codec
par
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
return
decklink_write_video_packet
(
avctx
,
pkt
);
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
else
if
(
st
->
codec
par
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
return
decklink_write_audio_packet
(
avctx
,
pkt
);
return
AVERROR
(
EIO
);
...
...
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