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
1181461c
Commit
1181461c
authored
Aug 23, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/asetpts,setpts: add variables T, STARTT, PREV_INT and PREV_OUTT
parent
3d6d59ef
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
5 deletions
+30
-5
filters.texi
doc/filters.texi
+11
-0
f_setpts.c
libavfilter/f_setpts.c
+18
-4
version.h
libavfilter/version.h
+1
-1
No files found.
doc/filters.texi
View file @
1181461c
...
@@ -4129,9 +4129,15 @@ audio sample rate
...
@@ -4129,9 +4129,15 @@ audio sample rate
@item STARTPTS
@item STARTPTS
the PTS of the first frame
the PTS of the first frame
@item STARTT
the time in seconds of the first frame
@item INTERLACED
@item INTERLACED
tell if the current frame is interlaced
tell if the current frame is interlaced
@item T
the time in seconds of the current frame
@item TB
@item TB
the time base
the time base
...
@@ -4142,9 +4148,14 @@ for the current frame
...
@@ -4142,9 +4148,14 @@ for the current frame
@item PREV_INPTS
@item PREV_INPTS
previous input PTS
previous input PTS
@item PREV_INT
previous input time in seconds
@item PREV_OUTPTS
@item PREV_OUTPTS
previous output PTS
previous output PTS
@item PREV_OUTT
previous output time in seconds
@end table
@end table
@subsection Examples
@subsection Examples
...
...
libavfilter/f_setpts.c
View file @
1181461c
...
@@ -41,10 +41,14 @@ static const char *const var_names[] = {
...
@@ -41,10 +41,14 @@ static const char *const var_names[] = {
"NB_SAMPLES"
,
///< number of samples in the current frame (only audio)
"NB_SAMPLES"
,
///< number of samples in the current frame (only audio)
"POS"
,
///< original position in the file of the frame
"POS"
,
///< original position in the file of the frame
"PREV_INPTS"
,
///< previous input PTS
"PREV_INPTS"
,
///< previous input PTS
"PREV_INT"
,
///< previous input time in seconds
"PREV_OUTPTS"
,
///< previous output PTS
"PREV_OUTPTS"
,
///< previous output PTS
"PREV_OUTT"
,
///< previous output time in seconds
"PTS"
,
///< original pts in the file of the frame
"PTS"
,
///< original pts in the file of the frame
"SAMPLE_RATE"
,
///< sample rate (only audio)
"SAMPLE_RATE"
,
///< sample rate (only audio)
"STARTPTS"
,
///< PTS at start of movie
"STARTPTS"
,
///< PTS at start of movie
"STARTT"
,
///< time at start of movie
"T"
,
///< original time in the file of the frame
"TB"
,
///< timebase
"TB"
,
///< timebase
NULL
NULL
};
};
...
@@ -56,10 +60,14 @@ enum var_name {
...
@@ -56,10 +60,14 @@ enum var_name {
VAR_NB_SAMPLES
,
VAR_NB_SAMPLES
,
VAR_POS
,
VAR_POS
,
VAR_PREV_INPTS
,
VAR_PREV_INPTS
,
VAR_PREV_INT
,
VAR_PREV_OUTPTS
,
VAR_PREV_OUTPTS
,
VAR_PREV_OUTT
,
VAR_PTS
,
VAR_PTS
,
VAR_SAMPLE_RATE
,
VAR_SAMPLE_RATE
,
VAR_STARTPTS
,
VAR_STARTPTS
,
VAR_STARTT
,
VAR_T
,
VAR_TB
,
VAR_TB
,
VAR_VARS_NB
VAR_VARS_NB
};
};
...
@@ -82,9 +90,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
...
@@ -82,9 +90,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
}
}
setpts
->
var_values
[
VAR_N
]
=
0
.
0
;
setpts
->
var_values
[
VAR_N
]
=
0
.
0
;
setpts
->
var_values
[
VAR_PREV_INPTS
]
=
NAN
;
setpts
->
var_values
[
VAR_PREV_INPTS
]
=
setpts
->
var_values
[
VAR_PREV_INT
]
=
NAN
;
setpts
->
var_values
[
VAR_PREV_OUTPTS
]
=
NAN
;
setpts
->
var_values
[
VAR_PREV_OUTPTS
]
=
setpts
->
var_values
[
VAR_PREV_OUTT
]
=
NAN
;
setpts
->
var_values
[
VAR_STARTPTS
]
=
NAN
;
setpts
->
var_values
[
VAR_STARTPTS
]
=
setpts
->
var_values
[
VAR_STARTT
]
=
NAN
;
return
0
;
return
0
;
}
}
...
@@ -106,6 +114,7 @@ static int config_input(AVFilterLink *inlink)
...
@@ -106,6 +114,7 @@ static int config_input(AVFilterLink *inlink)
#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)*av_q2d(tb))
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
inpicref
)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
inpicref
)
{
{
...
@@ -116,9 +125,12 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
...
@@ -116,9 +125,12 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
if
(
!
outpicref
)
if
(
!
outpicref
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
if
(
isnan
(
setpts
->
var_values
[
VAR_STARTPTS
]))
if
(
isnan
(
setpts
->
var_values
[
VAR_STARTPTS
]))
{
setpts
->
var_values
[
VAR_STARTPTS
]
=
TS2D
(
inpicref
->
pts
);
setpts
->
var_values
[
VAR_STARTPTS
]
=
TS2D
(
inpicref
->
pts
);
setpts
->
var_values
[
VAR_STARTT
]
=
TS2T
(
inpicref
->
pts
,
inlink
->
time_base
);
}
setpts
->
var_values
[
VAR_PTS
]
=
TS2D
(
inpicref
->
pts
);
setpts
->
var_values
[
VAR_PTS
]
=
TS2D
(
inpicref
->
pts
);
setpts
->
var_values
[
VAR_T
]
=
TS2T
(
inpicref
->
pts
,
inlink
->
time_base
);
setpts
->
var_values
[
VAR_POS
]
=
inpicref
->
pos
==
-
1
?
NAN
:
inpicref
->
pos
;
setpts
->
var_values
[
VAR_POS
]
=
inpicref
->
pos
==
-
1
?
NAN
:
inpicref
->
pos
;
switch
(
inlink
->
type
)
{
switch
(
inlink
->
type
)
{
...
@@ -150,7 +162,9 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
...
@@ -150,7 +162,9 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
setpts
->
var_values
[
VAR_N
]
+=
1
.
0
;
setpts
->
var_values
[
VAR_N
]
+=
1
.
0
;
setpts
->
var_values
[
VAR_PREV_INPTS
]
=
TS2D
(
inpicref
->
pts
);
setpts
->
var_values
[
VAR_PREV_INPTS
]
=
TS2D
(
inpicref
->
pts
);
setpts
->
var_values
[
VAR_PREV_INT
]
=
TS2T
(
inpicref
->
pts
,
inlink
->
time_base
);
setpts
->
var_values
[
VAR_PREV_OUTPTS
]
=
TS2D
(
outpicref
->
pts
);
setpts
->
var_values
[
VAR_PREV_OUTPTS
]
=
TS2D
(
outpicref
->
pts
);
setpts
->
var_values
[
VAR_PREV_OUTT
]
=
TS2T
(
outpicref
->
pts
,
inlink
->
time_base
);
if
(
setpts
->
type
==
AVMEDIA_TYPE_AUDIO
)
{
if
(
setpts
->
type
==
AVMEDIA_TYPE_AUDIO
)
{
setpts
->
var_values
[
VAR_NB_CONSUMED_SAMPLES
]
+=
inpicref
->
audio
->
nb_samples
;
setpts
->
var_values
[
VAR_NB_CONSUMED_SAMPLES
]
+=
inpicref
->
audio
->
nb_samples
;
...
...
libavfilter/version.h
View file @
1181461c
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 13
#define LIBAVFILTER_VERSION_MINOR 13
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
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