From patchwork Fri May 25 14:16:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Keroulas X-Patchwork-Id: 9078 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp1399062jad; Fri, 25 May 2018 07:17:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZol2zO+Csh5sOromsgSw/r1VlqnaFCwAZh6/s3p6ycvayLAG4cGGhsTWqEc/7au9ma5pn8k X-Received: by 2002:adf:a075:: with SMTP id l50-v6mr2639198wrl.227.1527257837404; Fri, 25 May 2018 07:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527257837; cv=none; d=google.com; s=arc-20160816; b=frMU7djJmjeVuP3H5o4zFGJxwDSTLCI+ZYE562LUBkvVMjdw0Iv1lGIau63i3OyTyz 07AJPCXku03ig4ZTUeBV7ykbnR2RTL8PNvBVCJlJuPq/Mu0JcwW9N0g1V4jEHLWJBFN9 tVXnNj3N3jvm7jS8Amwqef3Xcguc9+B1OAkhiNlZsjozH+dko5B6r+e+IAdAJaMkR6Aw 0Skbx32OcTyMK2ceyfNa8StgiUdWmaR/s0JQFPibxs80GAhrqdGOR5YGNuarZDjFYhQ4 Lpx/D01AHfmQj0m0jmYx1XoJb/0dJ+/0iyEQevdgzq+P7O5q3JmmmyhECFRcKzrni9q/ hQeQ== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=YINbkidj72wqjh1np2LNDTHMFUAHQmDf1UddAG6abdU=; b=QSK67p7ZrxKmsVw7vJmeTyOh1O9TPJg/4/BXp6jDnZZZiVRof6z4KSCNm9PDAOpIeL l+sTiMVUAIZp7NhlNdwrHeVLkNpCS7DIwRKXTHrmv2bMlTn8ySWhbilCU4aje2mux2w4 dNlDmL8YHMDgcf1dhKTqvYu8TcB2XC6lFRc+TAD/qlulsv5NDeGNveskhLoWfiboxuoB r7TOOV77kPBRzWoBJB7Jf+0Qp2xuTkU0X+HjF3mwWQUEOXPFhyz5LfFf+c+l0I4SBBA7 /7s24WjisIpXHNqr95KFpcrBDDcPpDnnixgjeXxf/s8RGBPIOqNR+AUuB7E+p+Oa/8wT 8ncg== 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 c83-v6si5416488wmd.46.2018.05.25.07.16.54; Fri, 25 May 2018 07:17:17 -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 DA65168A362; Fri, 25 May 2018 17:16:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A20468A204 for ; Fri, 25 May 2018 17:15:54 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 14E489C349F for ; Fri, 25 May 2018 10:16:36 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Zz-F8Nr_EwW8; Fri, 25 May 2018 10:16:35 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 74A689C34A2; Fri, 25 May 2018 10:16:35 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id iJkViZFuJzPf; Fri, 25 May 2018 10:16:35 -0400 (EDT) Received: from pkeroulas.cbc-rc.ca (unknown [192.168.50.171]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 4BBDF9C349F; Fri, 25 May 2018 10:16:35 -0400 (EDT) From: Patrick Keroulas To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 May 2018 10:16:29 -0400 Message-Id: <1527257791-26839-2-git-send-email-patrick.keroulas@savoirfairelinux.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527257791-26839-1-git-send-email-patrick.keroulas@savoirfairelinux.com> References: <1527257791-26839-1-git-send-email-patrick.keroulas@savoirfairelinux.com> Subject: [FFmpeg-devel] [PATCH v7 2/4] libavutil: add ancillary data 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: Patrick Keroulas MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Ancillary data can carry various side data that can't be transmitted in bitstreams. For now, this struct includes interlaced field flags and the must be attached to an AVPacket as side data. Signed-off-by: Patrick Keroulas --- libavutil/Makefile | 2 ++ libavutil/ancillary_data.c | 27 +++++++++++++++++++++++ libavutil/ancillary_data.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++ libavutil/version.h | 4 ++-- 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 libavutil/ancillary_data.c create mode 100644 libavutil/ancillary_data.h diff --git a/libavutil/Makefile b/libavutil/Makefile index d0632f1..7349b4f 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -4,6 +4,7 @@ DESC = FFmpeg utility library HEADERS = adler32.h \ aes.h \ aes_ctr.h \ + ancillary_data.h \ attributes.h \ audio_fifo.h \ avassert.h \ @@ -92,6 +93,7 @@ BUILT_HEADERS = avconfig.h \ OBJS = adler32.o \ aes.o \ aes_ctr.o \ + ancillary_data.o \ audio_fifo.o \ avstring.o \ base64.o \ diff --git a/libavutil/ancillary_data.c b/libavutil/ancillary_data.c new file mode 100644 index 0000000..26686b8 --- /dev/null +++ b/libavutil/ancillary_data.c @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2018 Patrick Keroulas + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "ancillary_data.h" +#include "mem.h" + +AVAncillaryData *av_ancillary_data_alloc(void) +{ + return av_mallocz(sizeof(AVAncillaryData)); +} diff --git a/libavutil/ancillary_data.h b/libavutil/ancillary_data.h new file mode 100644 index 0000000..860bc92 --- /dev/null +++ b/libavutil/ancillary_data.h @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2018 Patrick Keroulas + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_ANCILLARY_DATA_H +#define AVUTIL_ANCILLARY_DATA_H + +#include + +enum AVAncillaryDataFields { + AV_ANCILLARY_DATA_FIELD_TOP_FIELD = 0x01, + AV_ANCILLARY_DATA_FIELD_BOTTOM_FIELD = 0x02, +}; + +/** + * Ancillary data carries various side data that can't be transmitted in + * AV bit streams for codecs like bitpacked or v210. + * + * To be used as payload of a AVPacketSideData. + * + */ +typedef struct AVAncillaryData { + /** + * Flags to determine if the AVPacket holds a top/bottom field in + * case of interlaced format. + */ + uint8_t field; +} AVAncillaryData; + +/** + * Allocate an AVAncillaryData structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVAncillaryData filled with default values or NULL + * on failure. + */ +AVAncillaryData *av_ancillary_data_alloc(void); + +#endif /* AVUTIL_ANCILLARY_DATA_H */ diff --git a/libavutil/version.h b/libavutil/version.h index 44bdebd..84409b1 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,8 +79,8 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 18 -#define LIBAVUTIL_VERSION_MICRO 102 +#define LIBAVUTIL_VERSION_MINOR 19 +#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \