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
e3453fd4
Commit
e3453fd4
authored
Apr 02, 2016
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
matroska: Write the field order information
And bump the document version to 4.
parent
b3051a46
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
28 deletions
+69
-28
matroskaenc.c
libavformat/matroskaenc.c
+43
-2
wavpack.mak
tests/fate/wavpack.mak
+2
-2
mkv
tests/ref/lavf/mkv
+2
-2
lavf-mkv
tests/ref/seek/lavf-mkv
+22
-22
No files found.
libavformat/matroskaenc.c
View file @
e3453fd4
...
...
@@ -626,6 +626,45 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb,
return
ret
;
}
static
void
mkv_write_field_order
(
AVIOContext
*
pb
,
enum
AVFieldOrder
field_order
)
{
switch
(
field_order
)
{
case
AV_FIELD_UNKNOWN
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFLAGINTERLACED
,
MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED
);
break
;
case
AV_FIELD_PROGRESSIVE
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFLAGINTERLACED
,
MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE
);
break
;
case
AV_FIELD_TT
:
case
AV_FIELD_BB
:
case
AV_FIELD_TB
:
case
AV_FIELD_BT
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFLAGINTERLACED
,
MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED
);
switch
(
field_order
)
{
case
AV_FIELD_TT
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFIELDORDER
,
MATROSKA_VIDEO_FIELDORDER_TT
);
break
;
case
AV_FIELD_BB
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFIELDORDER
,
MATROSKA_VIDEO_FIELDORDER_BB
);
break
;
case
AV_FIELD_TB
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFIELDORDER
,
MATROSKA_VIDEO_FIELDORDER_TB
);
break
;
case
AV_FIELD_BT
:
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOFIELDORDER
,
MATROSKA_VIDEO_FIELDORDER_BT
);
break
;
}
}
}
static
int
mkv_write_stereo_mode
(
AVFormatContext
*
s
,
AVIOContext
*
pb
,
AVStream
*
st
,
int
mode
)
{
...
...
@@ -825,10 +864,12 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
}
subinfo
=
start_ebml_master
(
pb
,
MATROSKA_ID_TRACKVIDEO
,
0
);
// XXX: interlace flag?
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOPIXELWIDTH
,
par
->
width
);
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOPIXELHEIGHT
,
par
->
height
);
mkv_write_field_order
(
pb
,
par
->
field_order
);
// check both side data and metadata for stereo information,
// write the result to the bitstream if any is found
ret
=
mkv_write_stereo_mode
(
s
,
pb
,
st
,
mkv
->
mode
);
...
...
@@ -1145,7 +1186,7 @@ static int mkv_write_header(AVFormatContext *s)
put_ebml_uint
(
pb
,
EBML_ID_EBMLMAXIDLENGTH
,
4
);
put_ebml_uint
(
pb
,
EBML_ID_EBMLMAXSIZELENGTH
,
8
);
put_ebml_string
(
pb
,
EBML_ID_DOCTYPE
,
s
->
oformat
->
name
);
put_ebml_uint
(
pb
,
EBML_ID_DOCTYPEVERSION
,
2
);
put_ebml_uint
(
pb
,
EBML_ID_DOCTYPEVERSION
,
4
);
put_ebml_uint
(
pb
,
EBML_ID_DOCTYPEREADVERSION
,
2
);
end_ebml_master
(
pb
,
ebml_header
);
...
...
tests/fate/wavpack.mak
View file @
e3453fd4
...
...
@@ -91,12 +91,12 @@ fate-wavpack-matroskamode: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/special/matros
FATE_WAVPACK-$(call DEMMUX, WV, MATROSKA) += fate-wavpack-matroska_mux-mono
fate-wavpack-matroska_mux-mono: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/mono_16bit_int.wv -c copy -fflags +bitexact -f matroska
fate-wavpack-matroska_mux-mono: CMP = oneline
fate-wavpack-matroska_mux-mono: REF =
6bd769b3f0e9d7fa6261c3b73a53eb7
d
fate-wavpack-matroska_mux-mono: REF =
90bb202ca75333d25146c52f863f93b
d
FATE_WAVPACK-$(call DEMMUX, WV, MATROSKA) += fate-wavpack-matroska_mux-61
fate-wavpack-matroska_mux-61: CMD = md5 -i $(TARGET_SAMPLES)/wavpack/num_channels/eva_2.22_6.1_16bit-partial.wv -c copy -fflags +bitexact -f matroska
fate-wavpack-matroska_mux-61: CMP = oneline
fate-wavpack-matroska_mux-61: REF =
2d2f1e7f81a8b1983fcffc7f24de8a11
fate-wavpack-matroska_mux-61: REF =
de9f9f8136377af41ac1e899aaec6752
FATE_SAMPLES_AVCONV += $(FATE_WAVPACK-yes)
fate-wavpack: $(FATE_WAVPACK-yes)
tests/ref/lavf/mkv
View file @
e3453fd4
268fb8f9278b0df2f87a6a9455f3cd56
*./tests/data/lavf/lavf.mkv
32038
0
./tests/data/lavf/lavf.mkv
76d400179dfd6143f50ea4d19fe8ed99
*./tests/data/lavf/lavf.mkv
32038
3
./tests/data/lavf/lavf.mkv
./tests/data/lavf/lavf.mkv CRC=0x36193cda
tests/ref/seek/lavf-mkv
View file @
e3453fd4
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st:-1 flags:1 ts: 1.894167
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
68
size: 27834
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
71
size: 27834
ret: 0 st: 0 flags:0 ts: 0.788000
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
68
size: 27834
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
71
size: 27834
ret: 0 st: 0 flags:1 ts:-0.317000
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st: 1 flags:0 ts: 2.577000
ret:-EOF
ret: 0 st: 1 flags:1 ts: 1.471000
ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 3201
09
size: 209
ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 3201
12
size: 209
ret: 0 st:-1 flags:0 ts: 0.365002
ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 14682
1
size: 27925
ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 14682
4
size: 27925
ret: 0 st:-1 flags:1 ts:-0.740831
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st: 0 flags:0 ts: 2.153000
ret:-EOF
ret: 0 st: 0 flags:1 ts: 1.048000
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
68
size: 27834
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
71
size: 27834
ret: 0 st: 1 flags:0 ts:-0.058000
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st: 1 flags:1 ts: 2.836000
ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 3201
09
size: 209
ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 3201
12
size: 209
ret: 0 st:-1 flags:0 ts: 1.730004
ret:-EOF
ret: 0 st:-1 flags:1 ts: 0.624171
ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 14682
1
size: 27925
ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 14682
4
size: 27925
ret: 0 st: 0 flags:0 ts:-0.482000
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st: 0 flags:1 ts: 2.413000
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
68
size: 27834
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
71
size: 27834
ret: 0 st: 1 flags:0 ts: 1.307000
ret:-EOF
ret: 0 st: 1 flags:1 ts: 0.201000
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st:-1 flags:0 ts:-0.904994
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st:-1 flags:1 ts: 1.989173
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
68
size: 27834
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
71
size: 27834
ret: 0 st: 0 flags:0 ts: 0.883000
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
68
size: 27834
ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 2922
71
size: 27834
ret: 0 st: 0 flags:1 ts:-0.222000
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
ret: 0 st: 1 flags:0 ts: 2.672000
ret:-EOF
ret: 0 st: 1 flags:1 ts: 1.566000
ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 3201
09
size: 209
ret: 0 st: 1 flags:1 dts: 0.982000 pts: 0.982000 pos: 3201
12
size: 209
ret: 0 st:-1 flags:0 ts: 0.460008
ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 14682
1
size: 27925
ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 14682
4
size: 27925
ret: 0 st:-1 flags:1 ts:-0.645825
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
0
size: 208
ret: 0 st: 1 flags:1 dts:-0.011000 pts:-0.011000 pos: 63
3
size: 208
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