Lines 6046-6051
static int mov_read_clli(MOVContext *c, AVIOContext *pb, MOVAtom atom)
Link Here
|
6046 |
return 0; |
6046 |
return 0; |
6047 |
} |
6047 |
} |
6048 |
|
6048 |
|
|
|
6049 |
static int mov_read_amve(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
6050 |
{ |
6051 |
MOVStreamContext *sc; |
6052 |
const int illuminance_den = 10000; |
6053 |
const int ambient_den = 50000; |
6054 |
if (c->fc->nb_streams < 1) |
6055 |
return AVERROR_INVALIDDATA; |
6056 |
sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data; |
6057 |
if (atom.size < 6) { |
6058 |
av_log(c->fc, AV_LOG_ERROR, "Empty Ambient Viewing Environment Info box\n"); |
6059 |
return AVERROR_INVALIDDATA; |
6060 |
} |
6061 |
if (sc->ambient){ |
6062 |
av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate AMVE\n"); |
6063 |
return 0; |
6064 |
} |
6065 |
sc->ambient = av_ambient_viewing_environment_alloc(&sc->ambient_size); |
6066 |
if (!sc->ambient) |
6067 |
return AVERROR(ENOMEM); |
6068 |
sc->ambient->ambient_illuminance = av_make_q(avio_rb32(pb), illuminance_den); |
6069 |
sc->ambient->ambient_light_x = av_make_q(avio_rb16(pb), ambient_den); |
6070 |
sc->ambient->ambient_light_y = av_make_q(avio_rb16(pb), ambient_den); |
6071 |
return 0; |
6072 |
} |
6073 |
|
6049 |
static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
6074 |
static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
6050 |
{ |
6075 |
{ |
6051 |
AVStream *st; |
6076 |
AVStream *st; |
Lines 7966-7971
static const MOVParseTableEntry mov_default_parse_table[] = {
Link Here
|
7966 |
{ MKTAG('p','c','m','C'), mov_read_pcmc }, /* PCM configuration box */ |
7991 |
{ MKTAG('p','c','m','C'), mov_read_pcmc }, /* PCM configuration box */ |
7967 |
{ MKTAG('p','i','t','m'), mov_read_pitm }, |
7992 |
{ MKTAG('p','i','t','m'), mov_read_pitm }, |
7968 |
{ MKTAG('e','v','c','C'), mov_read_glbl }, |
7993 |
{ MKTAG('e','v','c','C'), mov_read_glbl }, |
|
|
7994 |
{ MKTAG('a','m','v','e'), mov_read_amve }, /* ambient viewing environment box */ |
7969 |
{ 0, NULL } |
7995 |
{ 0, NULL } |
7970 |
}; |
7996 |
}; |
7971 |
|
7997 |
|
Lines 8436-8441
static int mov_read_close(AVFormatContext *s)
Link Here
|
8436 |
av_freep(&sc->spherical); |
8462 |
av_freep(&sc->spherical); |
8437 |
av_freep(&sc->mastering); |
8463 |
av_freep(&sc->mastering); |
8438 |
av_freep(&sc->coll); |
8464 |
av_freep(&sc->coll); |
|
|
8465 |
av_freep(&sc->ambient); |
8439 |
} |
8466 |
} |
8440 |
|
8467 |
|
8441 |
av_freep(&mov->dv_demux); |
8468 |
av_freep(&mov->dv_demux); |
Lines 8797-8802
static int mov_read_header(AVFormatContext *s)
Link Here
|
8797 |
|
8824 |
|
8798 |
sc->coll = NULL; |
8825 |
sc->coll = NULL; |
8799 |
} |
8826 |
} |
|
|
8827 |
if (sc->ambient) { |
8828 |
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data, |
8829 |
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, |
8830 |
(uint8_t *)sc->ambient, sc->ambient_size, 0)) |
8831 |
return AVERROR(ENOMEM); |
8832 |
|
8833 |
sc->ambient = NULL; |
8834 |
} |
8800 |
break; |
8835 |
break; |
8801 |
} |
8836 |
} |
8802 |
} |
8837 |
} |