From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 79691495DB for ; Tue, 13 Feb 2024 23:04:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B20CA68D157; Wed, 14 Feb 2024 01:04:47 +0200 (EET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E75668CA65 for ; Wed, 14 Feb 2024 01:04:41 +0200 (EET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d94323d547so43036035ad.3 for ; Tue, 13 Feb 2024 15:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707865479; x=1708470279; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=TQFj3Pm6MRbjj4Ks2sPEf+78mDHtp5nYT6QGmRXHl0k=; b=BFsCuAlR0iNO6i6PhqbwhnQGRDwRjX2SdpAXCTQKwakZLaQKnGRcVoysge1xOvqD9D 0d5/3pqkALhCsrb55V0UD++EL78kR9fB3wONf92qQZa8BhKjUVDUsIDtkO+hz/gKEDaF /xhq9yuMUGKGQcEeL/OT72BysyFLpZ99dB8ulUbkHFloH+7XD/aP1Q7cPQJB3jbC33DV 04Lm06apgfntRtPPCPDtz6CXlcyUktbO1eEdObJGn2sWhCngHeD5QJliyzO9MK0UAc7O ZszcfO0TrAshbaLMItY9U3wSPKiUL3sP0WHWOZoUkxxlU5acAd8B6+7CbWLJ36YNesyn L8jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707865479; x=1708470279; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TQFj3Pm6MRbjj4Ks2sPEf+78mDHtp5nYT6QGmRXHl0k=; b=W7t1Y+i1LXpgnhxNyMjGAiBrT4YSry7gtiE64INzGzoWFILGUk+rcSD6iB+jnTM5Ld 8ADDv783OM5wrkkxHhpKSTpsUVLAQ8GH8g2nKryeXiQyLl8ZCTVAuM1GuMUvxL4oRj5H X4FrUjSndrJdqsCfKojBcDVRAcEq3feJjVeyOcXIR/9DzCrLmkCY+Npbqt77iy3YFqAl 9XYI7kHWDzaAM4dv0zgYXKBfaSRuUjyMC3eQtA44fxHOhggnPVnwMtqD/WEFv2kfdkps 94xPOtbOqnwKg+bk+5/NA6vXtBrCLAIZ8Y1C9MXXoM/MhwTES1YpiyDe82g95JkolalW fq5g== X-Gm-Message-State: AOJu0YysdZK8BmQ95ZvPnGZa2jlnU79csX0fUGEPDOuVDYKyYEKXmqdk WbxOgPKKV2GKA6b/KHtJoLTPJp7KXBKc0Zua/DRliS27vBvO3F8mWjzQJ/Re X-Google-Smtp-Source: AGHT+IGubggBD1QpAp/1xQ4p1K16ZvwgLionoHsr/uE9t9+zhftbnjZtrD4eagXZ8MI0WVhc2QMudg== X-Received: by 2002:a17:903:1c3:b0:1d8:f06f:5cfa with SMTP id e3-20020a17090301c300b001d8f06f5cfamr1013824plh.59.1707865479059; Tue, 13 Feb 2024 15:04:39 -0800 (PST) Received: from localhost.localdomain (2a01cb040b6872000000000000000afa.ipv6.abo.wanadoo.fr. [2a01:cb04:b68:7200::afa]) by smtp.gmail.com with ESMTPSA id l13-20020a170903244d00b001da294ff6d5sm2580098pls.189.2024.02.13.15.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 15:04:38 -0800 (PST) From: Matthieu Bouron To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Feb 2024 23:50:08 +0100 Message-ID: <20240213230418.457056-1-matthieu.bouron@gmail.com> X-Mailer: git-send-email 2.43.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] Add protocol for Android content providers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi, On Android, content providers are used for accessing files through shared mechanisms. One typical case would be an app willing to open a video from Google Photos, gallery apps, TikTok, Instagram or some other providers. A content URI looks something like "content://authority/path/id", see: https://developer.android.com/reference/android/content/ContentUris https://developer.android.com/guide/topics/providers/content-provider-basics It can currently be somehow managed through clumsy means such as using a "fd:" filename and crafting a special AVOption, which also has the drawback of requiring the third party to carry around opened file descriptors (with the multiple opened file limitations implied). Custom AVIOContexts are also an option. Both options will have to deal with the JNI though and end users will have to re-implement the same exact thing. This patchset addresses this by adding a content provider protocol, which has an API fairly similar to fopen. Android 11 appears to provide something transparent within fopen(), but FFmpeg doesn't use it in the file protocol, and Android < 11 are still widely used. The first part move the JNI infrastructure from avcodec to avutil (it remains internally shared, there is little user implication), and then the URLProtocol is added, along with a few cleanups. Regards, -- Matthieu _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".