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
7fe6f6e2
Commit
7fe6f6e2
authored
Oct 25, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caf muxer: write metadata
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
507f2940
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+21
-3
Changelog
Changelog
+1
-0
cafenc.c
libavformat/cafenc.c
+17
-0
version.h
libavformat/version.h
+1
-1
caf
tests/ref/lavf/caf
+2
-2
No files found.
Changelog
View file @
7fe6f6e2
...
...
@@ -17,6 +17,7 @@ version <next>:
- support for building DLLs using MSVC
- LVF demuxer
- ffescape tool
- metadata (info chunk) support in CAF muxer
version 1.0:
...
...
libavformat/cafenc.c
View file @
7fe6f6e2
...
...
@@ -25,6 +25,7 @@
#include "isom.h"
#include "avio_internal.h"
#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
typedef
struct
{
int64_t
data
;
...
...
@@ -102,7 +103,9 @@ static int caf_write_header(AVFormatContext *s)
AVIOContext
*
pb
=
s
->
pb
;
AVCodecContext
*
enc
=
s
->
streams
[
0
]
->
codec
;
CAFContext
*
caf
=
s
->
priv_data
;
AVDictionaryEntry
*
t
=
NULL
;
unsigned
int
codec_tag
=
ff_codec_get_tag
(
ff_codec_caf_tags
,
enc
->
codec_id
);
int64_t
chunk_size
=
0
;
switch
(
enc
->
codec_id
)
{
case
AV_CODEC_ID_AAC
:
...
...
@@ -180,6 +183,20 @@ static int caf_write_header(AVFormatContext *s)
avio_write
(
pb
,
enc
->
extradata
,
enc
->
extradata_size
);
}
if
(
av_dict_count
(
s
->
metadata
))
{
ffio_wfourcc
(
pb
,
"info"
);
//< Information chunk
while
((
t
=
av_dict_get
(
s
->
metadata
,
""
,
t
,
AV_DICT_IGNORE_SUFFIX
)))
{
chunk_size
+=
strlen
(
t
->
key
)
+
strlen
(
t
->
value
)
+
2
;
}
avio_wb64
(
pb
,
chunk_size
+
4
);
avio_wb32
(
pb
,
av_dict_count
(
s
->
metadata
));
t
=
NULL
;
while
((
t
=
av_dict_get
(
s
->
metadata
,
""
,
t
,
AV_DICT_IGNORE_SUFFIX
)))
{
avio_put_str
(
pb
,
t
->
key
);
avio_put_str
(
pb
,
t
->
value
);
}
}
ffio_wfourcc
(
pb
,
"data"
);
//< Audio Data chunk
caf
->
data
=
avio_tell
(
pb
);
avio_wb64
(
pb
,
-
1
);
//< mChunkSize
...
...
libavformat/version.h
View file @
7fe6f6e2
...
...
@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 3
4
#define LIBAVFORMAT_VERSION_MINOR 3
5
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
tests/ref/lavf/caf
View file @
7fe6f6e2
71e1abdfc59613fe05fca2939f02e02d
*./tests/data/lavf/lavf.caf
902
04
./tests/data/lavf/lavf.caf
6c97bfc8e455d5fb8b3b45806857a953
*./tests/data/lavf/lavf.caf
902
35
./tests/data/lavf/lavf.caf
./tests/data/lavf/lavf.caf CRC=0xf1ae5536
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