Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
93014864
Commit
93014864
authored
Jul 23, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add stream-level stereo3d side data
parent
f2583bc8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
1 deletion
+69
-1
APIchanges
doc/APIchanges
+3
-0
avcodec.h
libavcodec/avcodec.h
+6
-0
utils.c
libavcodec/utils.c
+9
-0
version.h
libavcodec/version.h
+1
-1
dump.c
libavformat/dump.c
+50
-0
No files found.
doc/APIchanges
View file @
93014864
...
...
@@ -13,6 +13,9 @@ libavutil: 2014-08-09
API changes, most recent first:
2014-08-xx - xxxxxxx - lavc 56.1.0 - avcodec.h
Add AV_PKT_DATA_STEREO3D to export container-level stereo3d information.
2014-08-xx - xxxxxxx - lavf 56.03.0 - avformat.h
Add AVFormatContext.max_ts_probe.
...
...
libavcodec/avcodec.h
View file @
93014864
...
...
@@ -911,6 +911,12 @@ enum AVPacketSideDataType {
* See libavutil/display.h for a detailed description of the data.
*/
AV_PKT_DATA_DISPLAYMATRIX
,
/*
* This side data should be associated with a video stream and contains
* Stereoscopic 3D information in form of the AVStereo3D struct.
*/
AV_PKT_DATA_STEREO3D
,
};
typedef
struct
AVPacketSideData
{
...
...
libavcodec/utils.c
View file @
93014864
...
...
@@ -596,6 +596,15 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
memcpy
(
frame_sd
->
data
,
packet_sd
,
size
);
}
/* copy the stereo3d format to the output frame */
packet_sd
=
av_packet_get_side_data
(
pkt
,
AV_PKT_DATA_STEREO3D
,
&
size
);
if
(
packet_sd
)
{
frame_sd
=
av_frame_new_side_data
(
frame
,
AV_FRAME_DATA_STEREO3D
,
size
);
if
(
!
frame_sd
)
return
AVERROR
(
ENOMEM
);
memcpy
(
frame_sd
->
data
,
packet_sd
,
size
);
}
return
0
;
}
...
...
libavcodec/version.h
View file @
93014864
...
...
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR
0
#define LIBAVCODEC_VERSION_MINOR
1
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
libavformat/dump.c
View file @
93014864
...
...
@@ -27,6 +27,7 @@
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/replaygain.h"
#include "libavutil/stereo3d.h"
#include "avformat.h"
...
...
@@ -229,6 +230,51 @@ static void dump_replaygain(void *ctx, AVPacketSideData *sd)
print_peak
(
ctx
,
"album peak"
,
rg
->
album_peak
);
}
static
void
dump_stereo3d
(
void
*
ctx
,
AVPacketSideData
*
sd
)
{
AVStereo3D
*
stereo
;
if
(
sd
->
size
<
sizeof
(
*
stereo
))
{
av_log
(
ctx
,
AV_LOG_INFO
,
"invalid data"
);
return
;
}
stereo
=
(
AVStereo3D
*
)
sd
->
data
;
switch
(
stereo
->
type
)
{
case
AV_STEREO3D_2D
:
av_log
(
ctx
,
AV_LOG_INFO
,
"2D"
);
break
;
case
AV_STEREO3D_SIDEBYSIDE
:
av_log
(
ctx
,
AV_LOG_INFO
,
"side by side"
);
break
;
case
AV_STEREO3D_TOPBOTTOM
:
av_log
(
ctx
,
AV_LOG_INFO
,
"top and bottom"
);
break
;
case
AV_STEREO3D_FRAMESEQUENCE
:
av_log
(
ctx
,
AV_LOG_INFO
,
"frame alternate"
);
break
;
case
AV_STEREO3D_CHECKERBOARD
:
av_log
(
ctx
,
AV_LOG_INFO
,
"checkerboard"
);
break
;
case
AV_STEREO3D_LINES
:
av_log
(
ctx
,
AV_LOG_INFO
,
"interleaved lines"
);
break
;
case
AV_STEREO3D_COLUMNS
:
av_log
(
ctx
,
AV_LOG_INFO
,
"interleaved columns"
);
break
;
case
AV_STEREO3D_SIDEBYSIDE_QUINCUNX
:
av_log
(
ctx
,
AV_LOG_INFO
,
"side by side (quincunx subsampling)"
);
break
;
default:
av_log
(
ctx
,
AV_LOG_WARNING
,
"unknown"
);
break
;
}
if
(
stereo
->
flags
&
AV_STEREO3D_FLAG_INVERT
)
av_log
(
ctx
,
AV_LOG_INFO
,
" (inverted)"
);
}
static
void
dump_sidedata
(
void
*
ctx
,
AVStream
*
st
,
const
char
*
indent
)
{
int
i
;
...
...
@@ -262,6 +308,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
av_log
(
ctx
,
AV_LOG_INFO
,
"displaymatrix: rotation of %.2f degrees"
,
av_display_rotation_get
((
int32_t
*
)
sd
.
data
));
break
;
case
AV_PKT_DATA_STEREO3D
:
av_log
(
ctx
,
AV_LOG_INFO
,
"stereo3d: "
);
dump_stereo3d
(
ctx
,
&
sd
);
break
;
default:
av_log
(
ctx
,
AV_LOG_WARNING
,
"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