From patchwork Tue Nov 21 04:54:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 6244 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp4792903jah; Mon, 20 Nov 2017 20:54:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMYtoB9nxxPWEj4uMfOwk4YpRs78jjNGlXFsPirxQ+JSsD8mH+jSscY6Cg/tC2Cv2ADMTRLc X-Received: by 10.28.137.5 with SMTP id l5mr137777wmd.123.1511240082619; Mon, 20 Nov 2017 20:54:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511240082; cv=none; d=google.com; s=arc-20160816; b=jTJrLqvs1bAChi99M5m/VaSqlBGc2PYEHsHzPS4zmj4Wnm1DuQbhk+HgI95QuI7iI+ ED3sR8Fc8IfAt/MDIM7dOMwJyl6GLLBujbfZ6nUNffNmSy/7+bEkH7+PRnkYQqmpE6di rQ8fDmpM3Ki5C6ATz5nsGdnkuJZyBHf2Uz1CV6uPlltkM1V/4IyX09NeVOXZBTC8l8CU TpfZRMe9e0VYLSSn+cjcUfE4ieHWCoRW5RMrQ9xusrGOiT1XsENV3YfRsC6xAUWo/OgQ hjUGcz4CvTbEhGU17R7R/d6NWNdKYVKUH5gW9i92+4Ovjsn/6mNED8coP++SOthJdqeB rNPw== 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:dkim-signature:delivered-to :arc-authentication-results; bh=BslYbv9VPW72gd3vED+LnpPF5wnslnWCVJL6rIhc+NU=; b=CCd9WrILEphkhtmRh/eEAUHk1L8uxGl5dp9/NeVDS4oe7YME7PeqNnarzprMYmBU4+ HSpELOxSf9OmrZp8WYpvoL5L899G8z/NgKzN3IcrzjEA+iZNAt+rgEMfNCXOpcMEo9fn P04jaes1yZSD0dKo/NNHkjVSF1Y4UlfCL2olMsnVr6Jl0+WObi6onW+vIO3BJocRdZEO nSV8DLshZ2favunmjOQHbimr023o68N3R2FSQ4kcVrK/dWaEo3+qn61wK7WRXGe7RmIJ z7/nZM47g19VCwHpoSxs/+rfiY/3Yf8QYtRF1mfvGUqXB0f57S8vJDMAESylxP0Fed0T m65Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=y9QVBxze; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z90si9521612wrc.349.2017.11.20.20.54.41; Mon, 20 Nov 2017 20:54:42 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=y9QVBxze; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D246F689EC3; Tue, 21 Nov 2017 06:54:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i831.smtp2go.com (a2i831.smtp2go.com [103.47.207.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C1964689B6B for ; Tue, 21 Nov 2017 06:54:16 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1511240979; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=6YseIOrt5daIwZ+uRkry2V3YAove7peh3uYIuimWeek=; b=y9QVBxze ar9bGxpQ74KRqBqRpk3xK/P8rldVvhxkQ5uQfr78nn+6mAchBAvmWQHrkQ9IgQA/3Kl9SVfUDSTIu kcs3j7Ogkz4UOeiBm/mp8STH7oWBs8tOC2m4BDKLwrGgx7lCBpufzjP7vSK01qvRAQO9nO59Es8MU 886hD55MgXzsV2SL24v8nCgoe38DU1QnP3b4IuCk6aTdHf7GUJZ6CQK877o0Xg4B4sFg8ycaj+ph+ SjTerdypYsFyPq2KMAEWsDkSBNhwDoZpYzF5Q8AjoVuF75lQqRw0j2G/KKCLWg0jO5hPoumUNjOL7 AYbWriYsgjEx+ha9KcZmcBMdJQ==; From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Nov 2017 10:24:22 +0530 Message-Id: <1511240064-18791-1-git-send-email-kjeyapal@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20171117110123.GB2728888@phare.normalesup.org> References: <20171117110123.GB2728888@phare.normalesup.org> X-Smtpcorp-Track: 1-H0Zq4baUnJji.EBGHWMtrS Feedback-ID: 337386m:337386asVRLGB:337386s6ykF_52nb:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH v2 1/3] libavformat/avio: Utility function to return URLContext 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: Karthick J MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/avio_internal.h | 8 ++++++++ libavformat/aviobuf.c | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index c01835d..04c1ad5 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -133,6 +133,14 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); int ffio_fdopen(AVIOContext **s, URLContext *h); /** + * Return the URLContext associated with the AVIOContext + * + * @param s IO context + * @return pointer to URLContext or NULL. + */ +URLContext *ffio_geturlcontext(AVIOContext *s); + +/** * Open a write-only fake memory stream. The written data is not stored * anywhere - this is only used for measuring the amount of data * written. diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 3b4c843..86eb657 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -980,6 +980,19 @@ fail: return AVERROR(ENOMEM); } +URLContext* ffio_geturlcontext(AVIOContext *s) +{ + AVIOInternal *internal; + if (!s) + return NULL; + + internal = s->opaque; + if (internal && s->read_packet == io_read_packet) + return internal->h; + else + return NULL; +} + int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) { uint8_t *buffer;