[FFmpeg-devel] [PATCH 1/4] libavformat/movenc: add dnxhr compatibility for apple players
Michael Niedermayer
michael at niedermayer.cc
Sun Jul 17 14:35:48 EEST 2016
On Sat, Jul 16, 2016 at 07:37:36PM -0700, Mark Reid wrote:
> ---
> libavcodec/dnxhddec.c | 3 +++
> libavformat/movenc.c | 19 ++++++++++++++-----
> 2 files changed, 17 insertions(+), 5 deletions(-)
this should be split
a single patch changing both libs is a bit suspicous API wise
>
> diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
> index 5b60326..4c6f708 100644
> --- a/libavcodec/dnxhddec.c
> +++ b/libavcodec/dnxhddec.c
> @@ -204,6 +204,9 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
> }
>
> cid = AV_RB32(buf + 0x28);
> + if (cid >= 1270 && cid <= 1274)
> + ctx->avctx->codec_tag = MKTAG('A','V','d','h');
codec_tag is documented as:
* - decoding: Set by user, will be converted to uppercase by libavcodec during init.
this sets it in the decoder by libavcodec though
> +
> if ((ret = dnxhd_init_vlc(ctx, cid, bitdepth)) < 0)
> return ret;
> if (ctx->mbaff && ctx->cid_table->cid != 1260)
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index d614933..7906f83 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -32,6 +32,7 @@
> #include "isom.h"
> #include "avc.h"
> #include "libavcodec/ac3_parser.h"
> +#include "libavcodec/dnxhddata.h"
> #include "libavcodec/get_bits.h"
> #include "libavcodec/put_bits.h"
> #include "libavcodec/vc1_common.h"
> @@ -1070,11 +1071,7 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
> int cid;
>
> if (track->vos_data && track->vos_len > 0x29) {
> - if (track->vos_data[0] == 0x00 &&
> - track->vos_data[1] == 0x00 &&
> - track->vos_data[2] == 0x02 &&
> - track->vos_data[3] == 0x80 &&
> - (track->vos_data[4] == 0x01 || track->vos_data[4] == 0x02)) {
> + if (avpriv_dnxhd_parse_header_prefix(track->vos_data) != 0) {
> /* looks like a DNxHD bit stream */
> interlaced = (track->vos_data[5] & 2);
> cid = AV_RB32(track->vos_data + 0x28);
is this a separateable change that could be in its own patch ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160717/9de856e8/attachment.sig>
More information about the ffmpeg-devel
mailing list