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
e352b293
Commit
e352b293
authored
Nov 29, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Add an option for exporting all metadata
parent
5639ed9a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
isom.h
libavformat/isom.h
+2
-0
mov.c
libavformat/mov.c
+18
-7
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/isom.h
View file @
e352b293
...
...
@@ -141,6 +141,7 @@ typedef struct MOVStreamContext {
}
MOVStreamContext
;
typedef
struct
MOVContext
{
const
AVClass
*
class
;
///< class for private options
AVFormatContext
*
fc
;
int
time_scale
;
int64_t
duration
;
///< duration of the longest track
...
...
@@ -155,6 +156,7 @@ typedef struct MOVContext {
int
itunes_metadata
;
///< metadata are itunes style
int
chapter_track
;
int64_t
next_root_atom
;
///< offset of the next root atom
int
export_all
;
}
MOVContext
;
int
ff_mp4_read_descr_len
(
AVIOContext
*
pb
);
...
...
libavformat/mov.c
View file @
e352b293
...
...
@@ -27,8 +27,6 @@
#include <limits.h>
#include <stdint.h>
//#define MOV_EXPORT_ALL_METADATA
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
...
...
@@ -37,6 +35,7 @@
#include "libavutil/time_internal.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavcodec/ac3tab.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -253,9 +252,7 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext *pb, unsigned len)
static
int
mov_read_udta_string
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
{
#ifdef MOV_EXPORT_ALL_METADATA
char
tmp_key
[
5
];
#endif
char
str
[
1024
],
key2
[
32
],
language
[
4
]
=
{
0
};
const
char
*
key
=
NULL
;
uint16_t
langcode
=
0
;
...
...
@@ -329,12 +326,10 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
else
str_size
=
atom
.
size
;
#ifdef MOV_EXPORT_ALL_METADATA
if
(
!
key
)
{
if
(
c
->
export_all
&&
!
key
)
{
snprintf
(
tmp_key
,
5
,
"%.4s"
,
(
char
*
)
&
atom
.
type
);
key
=
tmp_key
;
}
#endif
if
(
!
key
)
return
0
;
...
...
@@ -3420,9 +3415,25 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
return
0
;
}
#define OFFSET(x) offsetof(MOVContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static
const
AVOption
mov_options
[]
=
{
{
"export_all"
,
"Export unrecognized metadata entries"
,
OFFSET
(
export_all
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
.
flags
=
FLAGS
},
{
NULL
},
};
static
const
AVClass
mov_class
=
{
.
class_name
=
"mov,mp4,m4a,3gp,3g2,mj2"
,
.
item_name
=
av_default_item_name
,
.
option
=
mov_options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVInputFormat
ff_mov_demuxer
=
{
.
name
=
"mov,mp4,m4a,3gp,3g2,mj2"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"QuickTime / MOV"
),
.
priv_class
=
&
mov_class
,
.
priv_data_size
=
sizeof
(
MOVContext
),
.
extensions
=
"mov,mp4,m4a,3gp,3g2,mj2"
,
.
read_probe
=
mov_probe
,
...
...
libavformat/version.h
View file @
e352b293
...
...
@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 7
#define LIBAVFORMAT_VERSION_MICRO
0
#define LIBAVFORMAT_VERSION_MICRO
1
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_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