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
2fb6acd9
Commit
2fb6acd9
authored
Nov 02, 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
c70add61
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
3 deletions
+65
-3
avprobe.c
avprobe.c
+21
-0
APIchanges
doc/APIchanges
+4
-0
avcodec.h
libavcodec/avcodec.h
+6
-0
decode.c
libavcodec/decode.c
+1
-0
version.h
libavcodec/version.h
+2
-2
dump.c
libavformat/dump.c
+30
-0
version.h
libavutil/version.h
+1
-1
No files found.
avprobe.c
View file @
2fb6acd9
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "libavutil/display.h"
#include "libavutil/display.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/libm.h"
#include "libavutil/libm.h"
...
@@ -766,6 +767,7 @@ static void show_stream(InputFile *ifile, InputStream *ist)
...
@@ -766,6 +767,7 @@ static void show_stream(InputFile *ifile, InputStream *ist)
for
(
i
=
0
;
i
<
stream
->
nb_side_data
;
i
++
)
{
for
(
i
=
0
;
i
<
stream
->
nb_side_data
;
i
++
)
{
const
AVPacketSideData
*
sd
=
&
stream
->
side_data
[
i
];
const
AVPacketSideData
*
sd
=
&
stream
->
side_data
[
i
];
AVStereo3D
*
stereo
;
AVStereo3D
*
stereo
;
AVSphericalMapping
*
spherical
;
switch
(
sd
->
type
)
{
switch
(
sd
->
type
)
{
case
AV_PKT_DATA_DISPLAYMATRIX
:
case
AV_PKT_DATA_DISPLAYMATRIX
:
...
@@ -786,6 +788,25 @@ static void show_stream(InputFile *ifile, InputStream *ist)
...
@@ -786,6 +788,25 @@ static void show_stream(InputFile *ifile, InputStream *ist)
!!
(
stereo
->
flags
&
AV_STEREO3D_FLAG_INVERT
));
!!
(
stereo
->
flags
&
AV_STEREO3D_FLAG_INVERT
));
probe_object_footer
(
"stereo3d"
);
probe_object_footer
(
"stereo3d"
);
break
;
break
;
case
AV_PKT_DATA_SPHERICAL
:
spherical
=
(
AVSphericalMapping
*
)
sd
->
data
;
probe_object_header
(
"spherical"
);
if
(
spherical
->
projection
==
AV_SPHERICAL_EQUIRECTANGULAR
)
probe_str
(
"projection"
,
"equirectangular"
);
else
if
(
spherical
->
projection
==
AV_SPHERICAL_CUBEMAP
)
probe_str
(
"projection"
,
"cubemap"
);
else
probe_str
(
"projection"
,
"unknown"
);
probe_object_header
(
"orientation"
);
probe_int
(
"yaw"
,
(
double
)
spherical
->
yaw
/
(
1
<<
16
));
probe_int
(
"pitch"
,
(
double
)
spherical
->
pitch
/
(
1
<<
16
));
probe_int
(
"roll"
,
(
double
)
spherical
->
roll
/
(
1
<<
16
));
probe_object_footer
(
"orientation"
);
probe_object_footer
(
"spherical"
);
break
;
}
}
}
}
probe_object_footer
(
"sidedata"
);
probe_object_footer
(
"sidedata"
);
...
...
doc/APIchanges
View file @
2fb6acd9
...
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
...
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
API changes, most recent first:
API changes, most recent first:
2016-xx-xx - xxxxxxx - lavc 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.30.0 - spherical.h
2016-xx-xx - xxxxxxx - lavu 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.
...
...
libavcodec/avcodec.h
View file @
2fb6acd9
...
@@ -1289,6 +1289,12 @@ enum AVPacketSideDataType {
...
@@ -1289,6 +1289,12 @@ enum AVPacketSideDataType {
* This side data corresponds to the AVCPBProperties struct.
* This side data corresponds to the AVCPBProperties struct.
*/
*/
AV_PKT_DATA_CPB_PROPERTIES
,
AV_PKT_DATA_CPB_PROPERTIES
,
/**
* This side data should be associated with a video stream and corresponds
* to the AVSphericalMapping structure.
*/
AV_PKT_DATA_SPHERICAL
,
};
};
typedef
struct
AVPacketSideData
{
typedef
struct
AVPacketSideData
{
...
...
libavcodec/decode.c
View file @
2fb6acd9
...
@@ -747,6 +747,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
...
@@ -747,6 +747,7 @@ int ff_decode_frame_props(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
},
};
};
...
...
libavcodec/version.h
View file @
2fb6acd9
...
@@ -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
28
#define LIBAVCODEC_VERSION_MINOR
30
#define LIBAVCODEC_VERSION_MICRO
4
#define LIBAVCODEC_VERSION_MICRO
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 @
2fb6acd9
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "libavutil/log.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/mathematics.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"
...
@@ -306,6 +307,31 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
...
@@ -306,6 +307,31 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
cpb
->
vbv_delay
);
cpb
->
vbv_delay
);
}
}
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
;
...
@@ -354,6 +380,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
...
@@ -354,6 +380,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
av_log
(
ctx
,
AV_LOG_INFO
,
"cpb: "
);
av_log
(
ctx
,
AV_LOG_INFO
,
"cpb: "
);
dump_cpb
(
ctx
,
&
sd
);
dump_cpb
(
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_WARNING
,
av_log
(
ctx
,
AV_LOG_WARNING
,
"unknown side data type %d (%d bytes)"
,
sd
.
type
,
sd
.
size
);
"unknown side data type %d (%d bytes)"
,
sd
.
type
,
sd
.
size
);
...
...
libavutil/version.h
View file @
2fb6acd9
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
*/
*/
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR
30
#define LIBAVUTIL_VERSION_MINOR
29
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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