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
e7a6f8c9
Commit
e7a6f8c9
authored
Nov 11, 2016
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: Add spherical packet side data API
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
8f58ecc3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
3 deletions
+58
-3
APIchanges
doc/APIchanges
+4
-0
ffprobe.c
ffprobe.c
+13
-0
avcodec.h
libavcodec/avcodec.h
+7
-1
avpacket.c
libavcodec/avpacket.c
+1
-0
utils.c
libavcodec/utils.c
+1
-0
version.h
libavcodec/version.h
+2
-2
dump.c
libavformat/dump.c
+30
-0
No files found.
doc/APIchanges
View file @
e7a6f8c9
...
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
...
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
API changes, most recent first:
API changes, most recent first:
2016-xx-xx - xxxxxxx - lavc 57.67.100 / 57.29.0 - avcodec.h
Add AV_PKT_DATA_SPHERICAL packet side data to export AVSphericalMapping
information from containers.
2016-xx-xx - xxxxxxx - lavu 55.42.100 / 55.30.0 - spherical.h
2016-xx-xx - xxxxxxx - lavu 55.42.100 / 55.30.0 - spherical.h
Add AV_FRAME_DATA_SPHERICAL value, av_spherical_alloc() API and
Add AV_FRAME_DATA_SPHERICAL value, av_spherical_alloc() API and
AVSphericalMapping type to export and describe spherical video properties.
AVSphericalMapping type to export and describe spherical video properties.
...
...
ffprobe.c
View file @
e7a6f8c9
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "libavutil/hash.h"
#include "libavutil/hash.h"
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixdesc.h"
#include "libavutil/spherical.h"
#include "libavutil/stereo3d.h"
#include "libavutil/stereo3d.h"
#include "libavutil/dict.h"
#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
...
@@ -1783,6 +1784,18 @@ static void print_pkt_side_data(WriterContext *w,
...
@@ -1783,6 +1784,18 @@ static void print_pkt_side_data(WriterContext *w,
const
AVStereo3D
*
stereo
=
(
AVStereo3D
*
)
sd
->
data
;
const
AVStereo3D
*
stereo
=
(
AVStereo3D
*
)
sd
->
data
;
print_str
(
"type"
,
av_stereo3d_type_name
(
stereo
->
type
));
print_str
(
"type"
,
av_stereo3d_type_name
(
stereo
->
type
));
print_int
(
"inverted"
,
!!
(
stereo
->
flags
&
AV_STEREO3D_FLAG_INVERT
));
print_int
(
"inverted"
,
!!
(
stereo
->
flags
&
AV_STEREO3D_FLAG_INVERT
));
}
else
if
(
sd
->
type
==
AV_PKT_DATA_SPHERICAL
)
{
const
AVSphericalMapping
*
spherical
=
(
AVSphericalMapping
*
)
sd
->
data
;
if
(
spherical
->
projection
==
AV_SPHERICAL_EQUIRECTANGULAR
)
print_str
(
"projection"
,
"equirectangular"
);
else
if
(
spherical
->
projection
==
AV_SPHERICAL_CUBEMAP
)
print_str
(
"projection"
,
"cubemap"
);
else
print_str
(
"projection"
,
"unknown"
);
print_int
(
"yaw"
,
(
double
)
spherical
->
yaw
/
(
1
<<
16
));
print_int
(
"pitch"
,
(
double
)
spherical
->
pitch
/
(
1
<<
16
));
print_int
(
"roll"
,
(
double
)
spherical
->
roll
/
(
1
<<
16
));
}
}
writer_print_section_footer
(
w
);
writer_print_section_footer
(
w
);
}
}
...
...
libavcodec/avcodec.h
View file @
e7a6f8c9
...
@@ -1536,7 +1536,13 @@ enum AVPacketSideDataType {
...
@@ -1536,7 +1536,13 @@ enum AVPacketSideDataType {
* should be associated with a video stream and containts data in the form
* should be associated with a video stream and containts data in the form
* of the AVMasteringDisplayMetadata struct.
* of the AVMasteringDisplayMetadata struct.
*/
*/
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
,
/**
* This side data should be associated with a video stream and corresponds
* to the AVSphericalMapping structure.
*/
AV_PKT_DATA_SPHERICAL
,
};
};
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
...
...
libavcodec/avpacket.c
View file @
e7a6f8c9
...
@@ -372,6 +372,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type)
...
@@ -372,6 +372,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type)
case
AV_PKT_DATA_METADATA_UPDATE
:
return
"Metadata Update"
;
case
AV_PKT_DATA_METADATA_UPDATE
:
return
"Metadata Update"
;
case
AV_PKT_DATA_MPEGTS_STREAM_ID
:
return
"MPEGTS Stream ID"
;
case
AV_PKT_DATA_MPEGTS_STREAM_ID
:
return
"MPEGTS Stream ID"
;
case
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
:
return
"Mastering display metadata"
;
case
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
:
return
"Mastering display metadata"
;
case
AV_PKT_DATA_SPHERICAL
:
return
"Spherical Mapping"
;
}
}
return
NULL
;
return
NULL
;
}
}
...
...
libavcodec/utils.c
View file @
e7a6f8c9
...
@@ -762,6 +762,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
...
@@ -762,6 +762,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
}
sd
[]
=
{
}
sd
[]
=
{
{
AV_PKT_DATA_REPLAYGAIN
,
AV_FRAME_DATA_REPLAYGAIN
},
{
AV_PKT_DATA_REPLAYGAIN
,
AV_FRAME_DATA_REPLAYGAIN
},
{
AV_PKT_DATA_DISPLAYMATRIX
,
AV_FRAME_DATA_DISPLAYMATRIX
},
{
AV_PKT_DATA_DISPLAYMATRIX
,
AV_FRAME_DATA_DISPLAYMATRIX
},
{
AV_PKT_DATA_SPHERICAL
,
AV_FRAME_DATA_SPHERICAL
},
{
AV_PKT_DATA_STEREO3D
,
AV_FRAME_DATA_STEREO3D
},
{
AV_PKT_DATA_STEREO3D
,
AV_FRAME_DATA_STEREO3D
},
{
AV_PKT_DATA_AUDIO_SERVICE_TYPE
,
AV_FRAME_DATA_AUDIO_SERVICE_TYPE
},
{
AV_PKT_DATA_AUDIO_SERVICE_TYPE
,
AV_FRAME_DATA_AUDIO_SERVICE_TYPE
},
{
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
,
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
},
{
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
,
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
},
...
...
libavcodec/version.h
View file @
e7a6f8c9
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
#include "libavutil/version.h"
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 6
6
#define LIBAVCODEC_VERSION_MINOR 6
7
#define LIBAVCODEC_VERSION_MICRO 10
9
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
libavformat/dump.c
View file @
e7a6f8c9
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "libavutil/avstring.h"
#include "libavutil/replaygain.h"
#include "libavutil/replaygain.h"
#include "libavutil/spherical.h"
#include "libavutil/stereo3d.h"
#include "libavutil/stereo3d.h"
#include "avformat.h"
#include "avformat.h"
...
@@ -342,6 +343,31 @@ static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {
...
@@ -342,6 +343,31 @@ static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {
av_q2d
(
metadata
->
min_luminance
),
av_q2d
(
metadata
->
max_luminance
));
av_q2d
(
metadata
->
min_luminance
),
av_q2d
(
metadata
->
max_luminance
));
}
}
static
void
dump_spherical
(
void
*
ctx
,
AVPacketSideData
*
sd
)
{
AVSphericalMapping
*
spherical
=
(
AVSphericalMapping
*
)
sd
->
data
;
double
yaw
,
pitch
,
roll
;
if
(
sd
->
size
<
sizeof
(
*
spherical
))
{
av_log
(
ctx
,
AV_LOG_INFO
,
"invalid data"
);
return
;
}
if
(
spherical
->
projection
==
AV_SPHERICAL_EQUIRECTANGULAR
)
av_log
(
ctx
,
AV_LOG_INFO
,
"equirectangular "
);
else
if
(
spherical
->
projection
==
AV_SPHERICAL_CUBEMAP
)
av_log
(
ctx
,
AV_LOG_INFO
,
"cubemap "
);
else
{
av_log
(
ctx
,
AV_LOG_WARNING
,
"unknown"
);
return
;
}
yaw
=
((
double
)
spherical
->
yaw
)
/
(
1
<<
16
);
pitch
=
((
double
)
spherical
->
pitch
)
/
(
1
<<
16
);
roll
=
((
double
)
spherical
->
roll
)
/
(
1
<<
16
);
av_log
(
ctx
,
AV_LOG_INFO
,
"(%f/%f/%f) "
,
yaw
,
pitch
,
roll
);
}
static
void
dump_sidedata
(
void
*
ctx
,
AVStream
*
st
,
const
char
*
indent
)
static
void
dump_sidedata
(
void
*
ctx
,
AVStream
*
st
,
const
char
*
indent
)
{
{
int
i
;
int
i
;
...
@@ -393,6 +419,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
...
@@ -393,6 +419,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
case
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
:
case
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
:
dump_mastering_display_metadata
(
ctx
,
&
sd
);
dump_mastering_display_metadata
(
ctx
,
&
sd
);
break
;
break
;
case
AV_PKT_DATA_SPHERICAL
:
av_log
(
ctx
,
AV_LOG_INFO
,
"spherical: "
);
dump_spherical
(
ctx
,
&
sd
);
break
;
default:
default:
av_log
(
ctx
,
AV_LOG_INFO
,
av_log
(
ctx
,
AV_LOG_INFO
,
"unknown side data type %d (%d bytes)"
,
sd
.
type
,
sd
.
size
);
"unknown side data type %d (%d bytes)"
,
sd
.
type
,
sd
.
size
);
...
...
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