Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/libdav1d: use named constants for ITU-T T.35 metadata
Date: Tue, 12 Mar 2024 15:44:34 -0300
Message-ID: <20240312184435.7420-3-jamrial@gmail.com> (raw)
In-Reply-To: <20240312184435.7420-1-jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/libdav1d.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 1aa2d1f343..597944d88d 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -37,6 +37,7 @@
 #include "decode.h"
 #include "dovi_rpu.h"
 #include "internal.h"
+#include "itut35.h"
 
 #define FF_DAV1D_VERSION_AT_LEAST(x,y) \
     (DAV1D_API_VERSION_MAJOR > (x) || DAV1D_API_VERSION_MAJOR == (x) && DAV1D_API_VERSION_MINOR >= (y))
@@ -542,7 +543,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
 
         provider_code = bytestream2_get_be16(&gb);
         switch (provider_code) {
-        case 0x31: { // atsc_provider_code
+        case ITU_T_T35_PROVIDER_CODE_ATSC: {
             uint32_t user_identifier = bytestream2_get_be32(&gb);
             switch (user_identifier) {
             case MKBETAG('G', 'A', '9', '4'): { // closed captions
@@ -566,12 +567,12 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
             }
             break;
         }
-        case 0x3C: { // smpte_provider_code
+        case ITU_T_T35_PROVIDER_CODE_SMTPE: {
             AVDynamicHDRPlus *hdrplus;
             int provider_oriented_code = bytestream2_get_be16(&gb);
             int application_identifier = bytestream2_get_byte(&gb);
 
-            if (itut_t35->country_code != 0xB5 ||
+            if (itut_t35->country_code != ITU_T_T35_COUNTRY_CODE_US ||
                 provider_oriented_code != 1 || application_identifier != 4)
                 break;
 
@@ -587,9 +588,10 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
                 goto fail;
             break;
         }
-        case 0x3B: { // dolby_provider_code
+        case ITU_T_T35_PROVIDER_CODE_DOLBY: {
             int provider_oriented_code = bytestream2_get_be32(&gb);
-            if (itut_t35->country_code != 0xB5 || provider_oriented_code != 0x800)
+            if (itut_t35->country_code != ITU_T_T35_COUNTRY_CODE_US ||
+                provider_oriented_code != 0x800)
                 break;
 
             res = ff_dovi_rpu_parse(&dav1d->dovi, gb.buffer, gb.buffer_end - gb.buffer);
-- 
2.44.0

_______________________________________________
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".

  parent reply	other threads:[~2024-03-12 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 18:44 [FFmpeg-devel] [PATCH 1/4] avcodec/av1dec: " James Almer
2024-03-12 18:44 ` [FFmpeg-devel] [PATCH 2/4] avcodec/h2645_sei: " James Almer
2024-03-12 18:44 ` James Almer [this message]
2024-03-12 18:44 ` [FFmpeg-devel] [PATCH 4/4] avformat/matroska: " James Almer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240312184435.7420-3-jamrial@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git