From patchwork Mon Sep 3 10:05:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 10219 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp2492850jap; Mon, 3 Sep 2018 03:07:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNaphyMeMld7E+mgndRAn1XLJaLqRa+iVPm7qq13swrQEYVBgW7qxGCTwdwHwuQYLF8Qi3 X-Received: by 2002:a5d:490b:: with SMTP id x11-v6mr17567748wrq.114.1535969243274; Mon, 03 Sep 2018 03:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535969243; cv=none; d=google.com; s=arc-20160816; b=rr+ZCivz+7xQKGhVSJsayOz26irDCpmuODFDfxcP3K6s3jKI2tjQDZbFDnNe4QPPbq A9uGfPL1dVHccEaDTRSvvbRL1F6Z7ZyyswBYFeyHIbM3aYOo0VU7YPGqzEcJ7UWk/cJC 7JsJXjaflFvtXzbGzbhLuzD0rjHfw/0N5fMJfqlEXs3HA5ZpCpHVQ510GF4AVJppxnGe U9uidJkWDnILNrOuqu3SckA585fbgA15lTwTKU1lNpnKneXqtnh7MD2V4Cr5BPgfU51Q cmqCCTIMvRVyN7T92qeNXamHQnbGVhCIVzBisG1I4A4IiZStd9kB50OxZ3GZ+CQurz8Q P3Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=4AVFPtiVyha3YgtE0VZyNDX8gSiYdajSm3qeynN3jsA=; b=ZEpIHt+6KxoB4AXfvzdRH4GC3m6IG5arSgziwkQ7kMvKiaLRJynI5Lyt7f86uNgiEX EFQSWq4x88V5OeB5gaiAB+Aw+EjrURp+564wFLf5BTgnDEqIOeOcVmjI5D2JgBZUpXKg z6C02V3ROfNs9GZxqxNnXtAcLTNVv8QgNvDQ/1IaH9OMdn3oqu4TfxxDxpzICRfOg0Tr f0KXdDmJfxUU2At2kZlAZRj+Z5Ojifcgm0r0WacnVnNeYGwMup6G18t3b1RlSu2WyvuO YOfUrzrdU5aU9UImEXR4gP25c2xf/9Zf5Gg3pvZWoFXOjYsZIDRc/xda6dWXNv+1mOSV qTiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s13-v6si15536707wrp.192.2018.09.03.03.07.22; Mon, 03 Sep 2018 03:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C6341689EA2; Mon, 3 Sep 2018 13:06:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 474C7689B75 for ; Mon, 3 Sep 2018 13:06:32 +0300 (EEST) X-QQ-mid: bizesmtp22t1535969184tp3ok958 Received: from localhost (unknown [117.136.38.158]) by esmtp6.qq.com (ESMTP) with id ; Mon, 03 Sep 2018 18:06:23 +0800 (CST) X-QQ-SSF: 01100000002000F0FMF0000A0000000 X-QQ-FEAT: IhrZBUlRAsips7p9u/qt2+9xbuRkXbN+zbXOp1G8ZQhtH1Tr2prw+MshbHiHI aRo4cJEoWqk7t0AplBE+DAgLIkJucgzo1co1uPXbPPcHsCn58ep8BA/sfzUVwQ1f+wY6WN4 6krxW1BQB3YE8QuyBk38HUOwHc7z3s6+iaqEp8Qkt2BYvDzBY4SODnf8aNlERfPd9vDhwLu p4lMNUWB8rdrGz/tIPF71I8VEpDRd8HFBx8HxLZmPDMWlymIU9wa8Lrq2Re4cUsZyNzU30X tp2b90DVv5Pvwq30FmsyzhrGRweBBspfLg6w== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Sep 2018 18:05:57 +0800 Message-Id: <20180903100600.85023-5-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.15.2 (Apple Git-101.1) In-Reply-To: <20180903100600.85023-1-lq@chinaffmpeg.org> References: <20180903100600.85023-1-lq@chinaffmpeg.org> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH 5/8] avformat/dashdec: add trace message for get the logic output message 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Steven Liu --- libavformat/dashdec.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 14a54a02cf..40e12e19ce 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -919,18 +919,22 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, if (presentation_timeoffset_val) { rep->presentation_timeoffset = (int64_t) strtoll(presentation_timeoffset_val, NULL, 10); + av_log(s, AV_LOG_TRACE, "rep->presentation_timeoffset = [%"PRId64"]\n", rep->presentation_timeoffset); xmlFree(presentation_timeoffset_val); } if (duration_val) { rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10); + av_log(s, AV_LOG_TRACE, "rep->fragment_duration = [%"PRId64"]\n", rep->fragment_duration); xmlFree(duration_val); } if (timescale_val) { rep->fragment_timescale = (int64_t) strtoll(timescale_val, NULL, 10); + av_log(s, AV_LOG_TRACE, "rep->fragment_timescale = [%"PRId64"]\n", rep->fragment_timescale); xmlFree(timescale_val); } if (startnumber_val) { rep->first_seq_no = (int64_t) strtoll(startnumber_val, NULL, 10); + av_log(s, AV_LOG_TRACE, "rep->first_seq_no = [%"PRId64"]\n", rep->first_seq_no); xmlFree(startnumber_val); } if (adaptionset_supplementalproperty_node) { @@ -988,10 +992,12 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, timescale_val = get_val_from_nodes_tab(segmentlists_tab, 2, "timescale"); if (duration_val) { rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10); + av_log(s, AV_LOG_TRACE, "rep->fragment_duration = [%"PRId64"]\n", rep->fragment_duration); xmlFree(duration_val); } if (timescale_val) { rep->fragment_timescale = (int64_t) strtoll(timescale_val, NULL, 10); + av_log(s, AV_LOG_TRACE, "rep->fragment_timescale = [%"PRId64"]\n", rep->fragment_timescale); xmlFree(timescale_val); } fragmenturl_node = xmlFirstElementChild(representation_segmentlist_node); @@ -1219,20 +1225,28 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) if (!av_strcasecmp(attr->name, (const char *)"availabilityStartTime")) { c->availability_start_time = get_utc_date_time_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->availability_start_time = [%"PRId64"]\n", c->availability_start_time); }else if (!av_strcasecmp(attr->name, (const char *)"availabilityEndTime")) { c->availability_end_time = get_utc_date_time_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->availability_end_time = [%"PRId64"]\n", c->availability_end_time); } else if (!av_strcasecmp(attr->name, (const char *)"publishTime")) { c->publish_time = get_utc_date_time_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->publish_time = [%"PRId64"]\n", c->publish_time); } else if (!av_strcasecmp(attr->name, (const char *)"minimumUpdatePeriod")) { c->minimum_update_period = get_duration_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->minimum_update_period = [%"PRId64"]\n", c->minimum_update_period); } else if (!av_strcasecmp(attr->name, (const char *)"timeShiftBufferDepth")) { c->time_shift_buffer_depth = get_duration_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->time_shift_buffer_depth = [%"PRId64"]\n", c->time_shift_buffer_depth); } else if (!av_strcasecmp(attr->name, (const char *)"minBufferTime")) { c->min_buffer_time = get_duration_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->min_buffer_time = [%"PRId64"]\n", c->min_buffer_time); } else if (!av_strcasecmp(attr->name, (const char *)"suggestedPresentationDelay")) { c->suggested_presentation_delay = get_duration_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->suggested_presentation_delay = [%"PRId64"]\n", c->suggested_presentation_delay); } else if (!av_strcasecmp(attr->name, (const char *)"mediaPresentationDuration")) { c->media_presentation_duration = get_duration_insec(s, (const char *)val); + av_log(s, AV_LOG_TRACE, "c->media_presentation_duration = [%"PRId64"]\n", c->media_presentation_duration); } attr = attr->next; xmlFree(val); @@ -1314,8 +1328,10 @@ static int64_t calc_cur_seg_no(AVFormatContext *s, struct representation *pls) if (c->is_live) { if (pls->n_fragments) { + av_log(s, AV_LOG_TRACE, "in n_fragments mode\n"); num = pls->first_seq_no; } else if (pls->n_timelines) { + av_log(s, AV_LOG_TRACE, "in n_timelines mode\n"); start_time_offset = get_segment_start_time_based_on_timeline(pls, 0xFFFFFFFF) - 60 * pls->fragment_timescale; // 60 seconds before end num = calc_next_seg_no_from_timelines(pls, start_time_offset); if (num == -1) @@ -1323,6 +1339,7 @@ static int64_t calc_cur_seg_no(AVFormatContext *s, struct representation *pls) else num += pls->first_seq_no; } else if (pls->fragment_duration){ + av_log(s, AV_LOG_TRACE, "in fragment_duration mode fragment_timescale = %"PRId64", presentation_timeoffset = %"PRId64"\n", pls->fragment_timescale, pls->presentation_timeoffset); if (pls->presentation_timeoffset) { num = pls->presentation_timeoffset * pls->fragment_timescale / pls->fragment_duration; } else if (c->publish_time > 0 && !c->availability_start_time) { @@ -1343,6 +1360,7 @@ static int64_t calc_min_seg_no(AVFormatContext *s, struct representation *pls) int64_t num = 0; if (c->is_live && pls->fragment_duration) { + av_log(s, AV_LOG_TRACE, "in live mode\n"); num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) - c->time_shift_buffer_depth) * pls->fragment_timescale) / pls->fragment_duration; } else { num = pls->first_seq_no;