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
dcc9bde0
Commit
dcc9bde0
authored
Aug 09, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write stream headers
Originally committed as revision 10008 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3bf98161
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
1 deletion
+54
-1
nutenc.c
libavformat/nutenc.c
+54
-1
No files found.
libavformat/nutenc.c
View file @
dcc9bde0
...
...
@@ -251,6 +251,12 @@ static int write_header(AVFormatContext *s){
nut
->
time_base
[
j
]
=
nut
->
stream
[
i
].
time_base
;
if
(
j
==
nut
->
time_base_count
)
nut
->
time_base_count
++
;
if
(
av_q2d
(
nut
->
stream
[
i
].
time_base
)
>=
0
.
001
)
nut
->
stream
[
i
].
msb_pts_shift
=
7
;
else
nut
->
stream
[
i
].
msb_pts_shift
=
14
;
nut
->
stream
[
i
].
max_pts_distance
=
FFMAX
(
1
/
av_q2d
(
nut
->
stream
[
i
].
time_base
),
1
);
}
//FIXME make nut->stream[i].time_base pointers into nut->time_base
...
...
@@ -320,9 +326,55 @@ static int write_header(AVFormatContext *s){
update_packetheader
(
nut
,
bc
,
0
,
1
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
){
codec
=
s
->
streams
[
i
]
->
codec
;
put_be64
(
bc
,
STREAM_STARTCODE
);
put_packetheader
(
nut
,
bc
,
120
/*FIXME check*/
+
codec
->
extradata_size
,
1
);
put_v
(
bc
,
i
);
switch
(
codec
->
codec_type
){
case
CODEC_TYPE_VIDEO
:
put_v
(
bc
,
0
);
break
;
case
CODEC_TYPE_AUDIO
:
put_v
(
bc
,
1
);
break
;
// case CODEC_TYPE_TEXT : put_v(bc, 2); break;
default
:
put_v
(
bc
,
3
);
break
;
}
put_v
(
bc
,
4
);
if
(
codec
->
codec_tag
){
put_le32
(
bc
,
codec
->
codec_tag
);
}
else
return
-
1
;
put_v
(
bc
,
0
);
//FIXME
put_v
(
bc
,
nut
->
stream
[
i
].
msb_pts_shift
);
put_v
(
bc
,
nut
->
stream
[
i
].
max_pts_distance
);
put_v
(
bc
,
codec
->
has_b_frames
);
put_byte
(
bc
,
0
);
/* flags: 0x1 - fixed_fps, 0x2 - index_present */
put_v
(
bc
,
codec
->
extradata_size
);
put_buffer
(
bc
,
codec
->
extradata
,
codec
->
extradata_size
);
switch
(
codec
->
codec_type
){
case
CODEC_TYPE_AUDIO
:
put_v
(
bc
,
codec
->
sample_rate
);
put_v
(
bc
,
1
);
put_v
(
bc
,
codec
->
channels
);
break
;
case
CODEC_TYPE_VIDEO
:
put_v
(
bc
,
codec
->
width
);
put_v
(
bc
,
codec
->
height
);
put_v
(
bc
,
codec
->
sample_aspect_ratio
.
num
);
put_v
(
bc
,
codec
->
sample_aspect_ratio
.
den
);
put_v
(
bc
,
0
);
/* csp type -- unknown */
break
;
default
:
break
;
}
update_packetheader
(
nut
,
bc
,
0
,
1
);
}
put_flush_packet
(
bc
);
//FIXME
stream header
, ...
//FIXME
info header, header repeation, header packet CRC
, ...
return
0
;
}
...
...
@@ -350,4 +402,5 @@ AVOutputFormat nut_muxer = {
write_packet
,
// write_trailer,
.
flags
=
AVFMT_GLOBALHEADER
,
.
codec_tag
=
(
const
AVCodecTag
*
[]){
codec_bmp_tags
,
codec_wav_tags
,
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