On Sat, Feb 15, 2014 at 3:24 PM, Tim Walker <[email protected]> wrote:
> On 12 Feb 2014, at 00:13, Vittorio Giovara <[email protected]> wrote:
>
>> Compute the full rotatation angle exported by display_matrix.
>> ---
>>
>> diff --git a/Changelog b/Changelog
>> index 6c54281..178d55d 100644
>> --- a/Changelog
>> +++ b/Changelog
>> @@ -57,6 +57,7 @@ version 10:
>> - framepack filter
>> - Mirillis FIC video decoder
>> - Support DNx444
>> +- mov rotation exported as AVPacketSideData
>
> Maybe "mov rotation angle"?

Amended locally.

>> @@ -2964,6 +2983,15 @@ static int mov_read_packet(AVFormatContext *s, 
>> AVPacket *pkt)
>>                 sc->has_palette = 0;
>>             }
>>         }
>> +        if (sc->rotation != 0) {
>> +            uint8_t *rotation;
>> +            rotation = av_packet_new_side_data(pkt, AV_PKT_DATA_ROTATION, 
>> sizeof(uint32_t));
>> +            if (rotation) {
>> +                AV_WL32(rotation, sc->rotation);
>> +                sc->rotation = 0;
>> +            } else
>> +                av_log(mov->fc, AV_LOG_ERROR, "Cannot append rotation angle 
>> to packet\n");
>> +        }
>> #if CONFIG_DV_DEMUXER
>>         if (mov->dv_demux && sc->dv_audio_container) {
>>             avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, 
>> pkt->size);
>> --
>> 1.8.4
>
> Is there a chance that the packet has been used before and already contains 
> side data? Or is it necessarily a new packet with no side data to begin with?

Well you have an array of side data in avpacket and
av_packet_new_side_data takes care of (re)allocation.
Side data is also correctly passed during copy_props so all should be fine.
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to