From patchwork Mon Apr 16 07:16:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Krzciuk?= X-Patchwork-Id: 8464 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.85 with SMTP id c82csp496377jad; Mon, 16 Apr 2018 00:22:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx484KseuNpOEohM6An46eVndqVCMHONoK8v0BqNz0GjbUfgzOv+FU3AfuJjKRQDDIcIk8GCB X-Received: by 10.28.120.9 with SMTP id t9mr744142wmc.110.1523863332986; Mon, 16 Apr 2018 00:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523863332; cv=none; d=google.com; s=arc-20160816; b=Nn0ONaky8nIK0hLZgWVU278GJSpXgXwrFi4A3D0JCafaF5/jgUByaEROxF/fX2HDQ7 7/LCD2Y28SvLvxpbs4lLoOl5gGoYj7KABPBdCYmr8wSC8+ej/Crr8A7km76TaRHRuItd lT1gnBUIO7QLzJPLrwfXbrdHKbrqNwURRGCB9K1o5iF/5xTw+MAuGsryAJSh650MnSRK kl859cCuU537mS1gs7ImHumTJ9uyIT2EXsljkl68rFX+rn4qDKaB6EsR+zZMSKBtwQZR ATvlhhZm/xX5CGzo0DVXh3y7xnJVs1wv2usSstE92Qckd4wIoi/9lrBfhEbzFXArcS8P PBSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=OYsnwPVvDHGFUnhHG6o6mgY9t/9gbETaz8+5VytAdXs=; b=wrQimEpoGhkk0SU+IHq/TpKo2b9ejTS3043VoEuTEUHaa9lyNeJFzrNGVPpStXf8yf cP5pD0flJpxCicwSryTteDpYpubYu63N8Be8irz6jxotKUsNdN7egC73Yt9eYUuJGOfz NP7M89CicEFh31fYx6wbvm2drveua9jc+sKCLagsW1VtyyI3e3NRNH7yS2HU+c+7vRiB hn8Q46VgOuu/lVgISxtcBiyvboYFZ+KaClag/AAg7fB+gXO6Ns2jvWnla0AOkHiwKd6B zOUSs+ZBHwKTyhRh0lknFOtadzNuzvwIBOIe1f/fKaRVs6j4mOtJ5H0ohRBcba8m5rFp F9eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@vewd-com.20150623.gappssmtp.com header.s=20150623 header.b=WqR0ix9N; 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 b9si8263902wrj.343.2018.04.16.00.22.11; Mon, 16 Apr 2018 00:22:12 -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; dkim=neutral (body hash did not verify) header.i=@vewd-com.20150623.gappssmtp.com header.s=20150623 header.b=WqR0ix9N; 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 02C45689EB0; Mon, 16 Apr 2018 10:21:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 44CF1689834 for ; Mon, 16 Apr 2018 10:21:37 +0300 (EEST) Received: by mail-it0-f53.google.com with SMTP id 19-v6so10334734itw.3 for ; Mon, 16 Apr 2018 00:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vewd-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=2zvSvz2uK1D4dpkMPqy2HC2dWHGeuatiuIaiXp0ksjQ=; b=WqR0ix9NdHCTNRiGTWuSEZy+eEJvaaPSTi3rjNOz07ClwU95p1LBAWoDVEGibhss7h EtBLEQDgKLCag/G6Vn/85/VGIowWRaNapzUOv8ceNepYDPjRCLF4DdU/ilreoM3vjm6z RP2tkz2ZRpS1EfeYFK10sPW5/aZjUfBwBrrYWpbjDTBuE6PiII4mGSHWBBKCfblDJoij TYDUrpEcWHDtRC0er54eY2M5PickYAyk/eK/6y4FbVrmCyGrLNxctu0PSMaLJcwDKRzz +ZbG0TqwwSMQpRlPeJDYs8HAtkVh1WoiiQtiCZ2u1iFeBa+Cgp5HAVi0wC1PqM3u8eis 7N0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=2zvSvz2uK1D4dpkMPqy2HC2dWHGeuatiuIaiXp0ksjQ=; b=Os0U0hpKJp5r95HR92sabBL2iSqdJTmnD7nC+V1vqlhZVpMJm+bpaQTujgHjO2xcTb kt9U/25pAr0c3GJ3SamfYrgXmjP1B11vRNmzw8NdQ8TY7K8LUC5j1Fy2l7+rjwMSvvrE IsMa6hQuM/5ILw9e/vpA+r+ma1ToQUk8T1HRfJnjE01ywsepe8KvqOPA7K85Ca5jytoD ylUgtPYA4/OLEPSvO8BGvo3v6TA6XyBHtzaoBFdECULF++RghvsHbKXBEwaXt2h93G9M mvczjm3xGHchsWPB8elwlGB9t8vS9XCxlRHmeP/yhaK6WECCSUvZ1kKX3+GV2D8u7x29 qmew== X-Gm-Message-State: ALQs6tC3oCLQXBF+jF7c0gQUe528bb0/4JChYK32GspAfiB9Ssyoa/8e Nze/D5Al5/1IlM8izVMEelHpPfUhnCPubfHHFBqJUXrd X-Received: by 2002:a24:10c7:: with SMTP id 190-v6mr14165965ity.38.1523862969321; Mon, 16 Apr 2018 00:16:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.133.14 with HTTP; Mon, 16 Apr 2018 00:16:08 -0700 (PDT) In-Reply-To: <20180413155020.GV20131@michaelspb> References: <20180413155020.GV20131@michaelspb> From: =?UTF-8?Q?=C5=81ukasz_Krzciuk?= Date: Mon, 16 Apr 2018 09:16:08 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] avformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for OIPF cases 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" I agree, AV_LOG_INFO has been changed to AV_LOG_DEBUG. Regards, *Łukasz Krzciuk* Developer Vewd ul. Grabarska 2, Pegaz 2A, 50-079 Wrocław, Polska On Fri, Apr 13, 2018 at 5:50 PM, Michael Niedermayer wrote: > On Fri, Apr 13, 2018 at 03:44:40PM +0200, Łukasz Krzciuk wrote: > > Hi, > > > > this change is needed according to OIPF spec: 8.4.2 AVComponent, > > audioDescription case: > > > > 1. an audio component with an ISO_639_language_descriptor in the PMT > > with the audio_type field set to 0x03 > > 2. a supplementary_audio_descriptor with the editorial_classification > > field set to 0x01 > > 3. an ac-3_descriptor or an enhanced_ac-3_descriptor with a > > component_type field with the service_type flags set to Visually > Impaired > > > > > > Regards, > > > > *Łukasz Krzciuk* > > Developer > > > > Vewd > > ul. Grabarska 2, Pegaz 2A, 50-079 Wrocław, Polska > > > mpegts.c | 30 ++++++++++++++++++++++++++++++ > > 1 file changed, 30 insertions(+) > > 863b7bca7f23f9ea337fde33f5bb9265ef3b4270 0001-avformat-mpegts-set-AV_ > DISPOSITION_DESCRIPTIONS-for-.patch > > From 12ef5cdd9c443b1601dc98d910feac87233b1040 Mon Sep 17 00:00:00 2001 > > From: =?UTF-8?q?=C5=81ukasz=20Krzciuk?= > > Date: Fri, 13 Apr 2018 14:57:57 +0200 > > Subject: [PATCH] avformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for > OIPF > > cases > > > > 1. an audio component with an ISO_639_language_descriptor in the PMT > with the > > audio_type field set to 0x03 > > 2. a supplementary_audio_descriptor with the editorial_classification > field set > > to 0x01 > > 3. an ac-3_descriptor or an enhanced_ac-3_descriptor with a > component_type field > > with the service_type flags set to Visually Impaired > > --- > > libavformat/mpegts.c | 30 ++++++++++++++++++++++++++++++ > > 1 file changed, 30 insertions(+) > > > > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c > > index 37a6aa8..df2b3aa 100644 > > --- a/libavformat/mpegts.c > > +++ b/libavformat/mpegts.c > > @@ -1835,6 +1835,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext > *fc, AVStream *st, int stream_type > > break; > > case 0x03: > > st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; > > + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; > > break; > > } > > } > > @@ -1910,6 +1911,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext > *fc, AVStream *st, int stream_type > > switch ((flags >> 2) & 0x1F) { /* editorial_classification > */ > > case 0x01: > > st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; > > + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; > > break; > > case 0x02: > > st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; > > @@ -1934,6 +1936,34 @@ int ff_parse_mpeg2_descriptor(AVFormatContext > *fc, AVStream *st, int stream_type > > } > > } > > break; > > + case 0x6a: /* ac-3_descriptor */ > > + { > > + int component_type_flag = get8(pp, desc_end) & (1 << 7); > > + if (component_type_flag) { > > + int component_type = get8(pp, desc_end); > > + int service_type_mask = 0x38; // 0b00111000 > > + int service_type = ((component_type & > service_type_mask) >> 3); > > + if (service_type == 0x02 /* 0b010 */) { > > + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; > > + av_log(ts->stream, AV_LOG_INFO, "New track > disposition for id %u: %u\n", st->id, st->disposition); > > AV_LOG_INFO is likely too noisy for normal usecases > > thx > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Rewriting code that is poorly written but fully understood is good. > Rewriting code that one doesnt understand is a sign that one is less smart > then the original author, trying to rewrite it will not make it better. > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > From fc2e281eb0e0e526fee52944205d6bb3729a17f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Krzciuk?= Date: Fri, 13 Apr 2018 14:57:57 +0200 Subject: [PATCH] avformat/mpegts: set AV_DISPOSITION_DESCRIPTIONS for OIPF cases 1. an audio component with an ISO_639_language_descriptor in the PMT with the audio_type field set to 0x03 2. a supplementary_audio_descriptor with the editorial_classification field set to 0x01 3. an ac-3_descriptor or an enhanced_ac-3_descriptor with a component_type field with the service_type flags set to Visually Impaired --- libavformat/mpegts.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 37a6aa8..629631f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1835,6 +1835,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type break; case 0x03: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; break; } } @@ -1910,6 +1911,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type switch ((flags >> 2) & 0x1F) { /* editorial_classification */ case 0x01: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; break; case 0x02: st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; @@ -1934,6 +1936,34 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type } } break; + case 0x6a: /* ac-3_descriptor */ + { + int component_type_flag = get8(pp, desc_end) & (1 << 7); + if (component_type_flag) { + int component_type = get8(pp, desc_end); + int service_type_mask = 0x38; // 0b00111000 + int service_type = ((component_type & service_type_mask) >> 3); + if (service_type == 0x02 /* 0b010 */) { + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; + av_log(ts->stream, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); + } + } + } + break; + case 0x7a: /* enhanced_ac-3_descriptor */ + { + int component_type_flag = get8(pp, desc_end) & (1 << 7); + if (component_type_flag) { + int component_type = get8(pp, desc_end); + int service_type_mask = 0x38; // 0b00111000 + int service_type = ((component_type & service_type_mask) >> 3); + if (service_type == 0x02 /* 0b010 */) { + st->disposition |= AV_DISPOSITION_DESCRIPTIONS; + av_log(ts->stream, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); + } + } + } + break; default: break; } -- 2.8.3