[FFmpeg-devel] [PATCH 3/3] mov: Export spherical information

James Almer jamrial at gmail.com
Sat Nov 12 01:23:38 EET 2016


On 11/11/2016 7:49 PM, Vittorio Giovara wrote:
> This implements Spherical Video V1 and V2, as described in the
> spatial-media collection by Google.
> 
> Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
> ---
> Please CC.
> Vittorio
> 
>  libavformat/isom.h |   7 ++
>  libavformat/mov.c  | 281 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 287 insertions(+), 1 deletion(-)

[...]

> @@ -5682,6 +5927,40 @@ static int mov_read_header(AVFormatContext *s)
>                  sd->data = (uint8_t*)sc->display_matrix;
>                  sc->display_matrix = NULL;
>              }
> +            if (sc->stereo3d) {
> +                AVPacketSideData *sd, *tmp;
> +
> +                tmp = av_realloc_array(st->side_data,
> +                                       st->nb_side_data + 1, sizeof(*tmp));
> +                if (!tmp)
> +                    return AVERROR(ENOMEM);
> +
> +                st->side_data = tmp;
> +                st->nb_side_data++;
> +
> +                sd = &st->side_data[st->nb_side_data - 1];
> +                sd->type = AV_PKT_DATA_STEREO3D;
> +                sd->size = sizeof(*sc->stereo3d);
> +                sd->data = (uint8_t *)sc->stereo3d;
> +                sc->stereo3d = NULL;
> +            }
> +            if (sc->spherical) {
> +                AVPacketSideData *sd, *tmp;
> +
> +                tmp = av_realloc_array(st->side_data,
> +                                       st->nb_side_data + 1, sizeof(*tmp));
> +                if (!tmp)
> +                    return AVERROR(ENOMEM);
> +
> +                st->side_data = tmp;
> +                st->nb_side_data++;
> +
> +                sd = &st->side_data[st->nb_side_data - 1];
> +                sd->type = AV_PKT_DATA_SPHERICAL;
> +                sd->size = sc->spherical_size;
> +                sd->data = (uint8_t *)sc->spherical;
> +                sc->spherical = NULL;
> +            }

Why isn't this using av_stream_new_side_data()?

The question also goes for the display_matrix case already in the tree.

>              break;
>          }
>      }
> 



More information about the ffmpeg-devel mailing list