From patchwork Thu Jun 4 14:12:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 20148 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 7D053449088 for ; Thu, 4 Jun 2020 17:40:11 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 67E7D68B051; Thu, 4 Jun 2020 17:40:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E330668B01C for ; Thu, 4 Jun 2020 17:40:04 +0300 (EEST) Received: by mail-oi1-f195.google.com with SMTP id s21so5251861oic.9 for ; Thu, 04 Jun 2020 07:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QsTYslWyk77GeGdY8lUhzOw6wEDH2SICyVgquixFgGQ=; b=iLDTtuw9aVaWDabH78OGe0B8NDik76UxU2/pj+jltanP2KVyyCRo3MsmfOYyxgBqWV rMEEWwC+OxJXQTn9Er+Km1RTOZB/O7slAfDdli2pQNu3xwfvtiDVqRbYKlT5HSMWedct pXI7FY48cHLV3qakpatFiMRw/ZTPuqDSKEPvM3V9u3f5y48eqzLgH8aUnJjS6Gz5gg7M BDvxISZTt0rmur17YjcQmP4X/XUYL7Q7y112liv9XyB5qFZU4t/hDBf6LKyOPNXRX4x8 hGEk+m0/naMq596j9adaZMT5PmeeoQ+cHJml2+O+7ZYDJKAxBJL/G9WpSAfInxIx75GA bnOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QsTYslWyk77GeGdY8lUhzOw6wEDH2SICyVgquixFgGQ=; b=SBjo3HM9OKDPi4ls/kqFW4AJKckAIdMtTtlqxEKetYL9sMFpNyoNZqswLXgRKU6eOi au5HOmAsN+Yfti2/7zFehgTts6G478cS9mKg+c5wVZiNgshe4HOALwBSymPUV1WkbxRA MEsOzCDUcA9B2jy07lFi0fHHI8QzoI/yytYvdgbdiHqiqT1YZGdvJc5u3Kw3pGqRGljy BwQGur6v6TCGorMIl2FHRiMlQnnQcChTwBVveW0p2gqPhYTgBBG9mvkOVduXJez4XmBE b1R+YnDtgptAgYDt3tB0Aul0aoILc1MycdqbbhzzIhF/fBbfSEzws4Hgxz2TC1/8gvg/ FweQ== X-Gm-Message-State: AOAM532djlfmUIOnrSsBBn0Z/8D17TRn5ZOcNUUMvbBzQ+IZHVj2RnVw WktYOirSwbMxjXXxEQ0DZRtAXJcY X-Google-Smtp-Source: ABdhPJwG/x2sBsZVV9uId0Adv1qHB892oRN9c9w1/ZmFDE0k94YBVVBv9Cyzix3PAQGU2OYTIXe3rg== X-Received: by 2002:a17:90a:c905:: with SMTP id v5mr6328634pjt.39.1591280011977; Thu, 04 Jun 2020 07:13:31 -0700 (PDT) Received: from localhost.localdomain ([49.51.162.193]) by smtp.gmail.com with ESMTPSA id i10sm4812525pfa.166.2020.06.04.07.13.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2020 07:13:31 -0700 (PDT) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Jun 2020 22:12:55 +0800 Message-Id: <1591279975-31536-3-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591279975-31536-1-git-send-email-mypopydev@gmail.com> References: <1591279975-31536-1-git-send-email-mypopydev@gmail.com> Subject: [FFmpeg-devel] [PATCH 3/3] lavf/dashdec: Add missed side data/disposition X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Jun Zhao MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jun Zhao dash demuxer get the strem info form sub-stream, but missed sida data/disposition part, e,g, missed the DOVI sida data when the stream is Dolby Vision streams Signed-off-by: Jun Zhao --- libavformat/dashdec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index ec2aadc..694782c 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -2001,6 +2001,20 @@ static int open_demux_for_component(AVFormatContext *s, struct representation *p st->id = i; avcodec_parameters_copy(st->codecpar, ist->codecpar); avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den); + + // copy disposition + st->disposition = ist->disposition; + + // copy side data + for (int i = 0; i < ist->nb_side_data; i++) { + const AVPacketSideData *sd_src = &ist->side_data[i]; + uint8_t *dst_data; + + dst_data = av_stream_new_side_data(st, sd_src->type, sd_src->size); + if (!dst_data) + return AVERROR(ENOMEM); + memcpy(dst_data, sd_src->data, sd_src->size); + } } return 0;