Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose
@ 2022-03-28 23:24 James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 2/7] avformat/mov_chan: add a few missing channel label mappings James Almer
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

This function turns a mov channel label into a lavf native bitmask.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov_chan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index f52239d347..4607540297 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -485,7 +485,7 @@ static uint64_t mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
     return layout_map[i].layout;
 }
 
-static uint32_t mov_get_channel_label(uint32_t label)
+static uint32_t mov_get_channel_mask(uint32_t label)
 {
     if (label == 0)
         return 0;
@@ -590,7 +590,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
         avio_rl32(pb);                      // mCoordinates[2]
         size -= 20;
         if (layout_tag == 0) {
-            uint32_t mask_incr = mov_get_channel_label(label);
+            uint32_t mask_incr = mov_get_channel_mask(label);
             if (mask_incr == 0) {
                 label_mask = 0;
                 break;
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 2/7] avformat/mov_chan: add a few missing channel label mappings
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
@ 2022-03-28 23:24 ` James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 3/7] avformat/mov_chan: use a higher log level for a debug message James Almer
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov_chan.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 4607540297..98773bb460 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -485,12 +485,18 @@ static uint64_t mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
     return layout_map[i].layout;
 }
 
-static uint32_t mov_get_channel_mask(uint32_t label)
+static uint64_t mov_get_channel_mask(uint32_t label)
 {
     if (label == 0)
         return 0;
     if (label <= 18)
         return 1U << (label - 1);
+    if (label == 35)
+        return AV_CH_WIDE_LEFT;
+    if (label == 36)
+        return AV_CH_WIDE_RIGHT;
+    if (label == 37)
+        return AV_CH_LOW_FREQUENCY_2;
     if (label == 38)
         return AV_CH_STEREO_LEFT;
     if (label == 39)
@@ -557,8 +563,8 @@ uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
 int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
                      int64_t size)
 {
-    uint32_t layout_tag, bitmap, num_descr, label_mask;
-    uint64_t mask = 0;
+    uint32_t layout_tag, bitmap, num_descr;
+    uint64_t label_mask, mask = 0;
     int i;
 
     if (size < 12)
@@ -590,7 +596,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
         avio_rl32(pb);                      // mCoordinates[2]
         size -= 20;
         if (layout_tag == 0) {
-            uint32_t mask_incr = mov_get_channel_mask(label);
+            uint64_t mask_incr = mov_get_channel_mask(label);
             if (mask_incr == 0) {
                 label_mask = 0;
                 break;
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 3/7] avformat/mov_chan: use a higher log level for a debug message
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 2/7] avformat/mov_chan: add a few missing channel label mappings James Almer
@ 2022-03-28 23:24 ` James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 4/7] avformat/movenc: write channel descriptions when a known layout or a bitmap can't be used James Almer
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

Trace is too noisy and this line is useful enough to get it printed
at debug level.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov_chan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 98773bb460..3c23142f35 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -574,7 +574,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
     bitmap     = avio_rb32(pb);
     num_descr  = avio_rb32(pb);
 
-    av_log(s, AV_LOG_TRACE, "chan: layout=%"PRIu32" "
+    av_log(s, AV_LOG_DEBUG, "chan: layout=%"PRIu32" "
            "bitmap=%"PRIu32" num_descr=%"PRIu32"\n",
            layout_tag, bitmap, num_descr);
 
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 4/7] avformat/movenc: write channel descriptions when a known layout or a bitmap can't be used
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 2/7] avformat/mov_chan: add a few missing channel label mappings James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 3/7] avformat/mov_chan: use a higher log level for a debug message James Almer
@ 2022-03-28 23:24 ` James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 5/7] avformat/mov_chan: move the definition of MovChannelLayoutTag to the header James Almer
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

Fixes part of ticket #2865

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov_chan.c | 75 ++++++++++++++++++++++++++++++++----------
 libavformat/mov_chan.h |  8 +++--
 libavformat/movenc.c   | 37 +++++++++++++++------
 3 files changed, 90 insertions(+), 30 deletions(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 3c23142f35..4cb373d1b9 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -504,9 +504,29 @@ static uint64_t mov_get_channel_mask(uint32_t label)
     return 0;
 }
 
-uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
-                                       const AVChannelLayout *ch_layout,
-                                       uint32_t *bitmap)
+static uint32_t mov_get_channel_label(enum AVChannel channel)
+{
+    if (channel < 0)
+        return 0;
+    if (channel <= AV_CHAN_TOP_BACK_RIGHT)
+        return channel + 1;
+    if (channel == AV_CHAN_WIDE_LEFT)
+        return 35;
+    if (channel == AV_CHAN_WIDE_RIGHT)
+        return 36;
+    if (channel == AV_CHAN_LOW_FREQUENCY_2)
+        return 37;
+    if (channel == AV_CHAN_STEREO_LEFT)
+        return 38;
+    if (channel == AV_CHAN_STEREO_RIGHT)
+        return 39;
+    return 0;
+}
+
+int ff_mov_get_channel_layout_tag(const AVCodecParameters *par,
+                                  uint32_t *layout,
+                                  uint32_t *bitmap,
+                                  uint32_t **pchannel_desc)
 {
     int i, j;
     uint32_t tag = 0;
@@ -514,7 +534,7 @@ uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
 
     /* find the layout list for the specified codec */
     for (i = 0; mov_codec_ch_layouts[i].codec_id != AV_CODEC_ID_NONE; i++) {
-        if (mov_codec_ch_layouts[i].codec_id == codec_id)
+        if (mov_codec_ch_layouts[i].codec_id == par->codec_id)
             break;
     }
     if (mov_codec_ch_layouts[i].codec_id != AV_CODEC_ID_NONE)
@@ -525,7 +545,7 @@ uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
         const struct MovChannelLayoutMap *layout_map;
 
         /* get the layout map based on the channel count */
-        channels = ch_layout->nb_channels;
+        channels = par->ch_layout.nb_channels;
         if (channels > 9)
             channels = 0;
         layout_map = mov_ch_layout_map[channels];
@@ -536,8 +556,8 @@ uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
                 continue;
             for (j = 0; layout_map[j].tag != 0; j++) {
                 if (layout_map[j].tag    == layouts[i] &&
-                    (ch_layout->order == AV_CHANNEL_ORDER_NATIVE &&
-                     layout_map[j].layout == ch_layout->u.mask))
+                    (par->ch_layout.order == AV_CHANNEL_ORDER_NATIVE &&
+                     layout_map[j].layout == par->ch_layout.u.mask))
                     break;
             }
             if (layout_map[j].tag)
@@ -546,18 +566,39 @@ uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
         tag = layouts[i];
     }
 
-    /* if no tag was found, use channel bitmap as a backup if possible */
-    if (tag == 0 && av_channel_layout_check(ch_layout) &&
-        ch_layout->order == AV_CHANNEL_ORDER_NATIVE &&
-        ch_layout->u.mask < 0x40000) {
-        tag     = MOV_CH_LAYOUT_USE_BITMAP;
-        *bitmap = (uint32_t)ch_layout->u.mask;
-    } else
-        *bitmap = 0;
+    *layout = tag;
+    *bitmap = 0;
+    *pchannel_desc = NULL;
+
+    /* if no tag was found, use channel bitmap or description as a backup if possible */
+    if (tag == 0) {
+        uint32_t *channel_desc;
+        if (par->ch_layout.order == AV_CHANNEL_ORDER_NATIVE &&
+            par->ch_layout.u.mask < 0x40000) {
+            *layout = MOV_CH_LAYOUT_USE_BITMAP;
+            *bitmap = (uint32_t)par->ch_layout.u.mask;
+            return 0;
+        } else if (par->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
+            return AVERROR(ENOSYS);
+
+        channel_desc = av_malloc_array(par->ch_layout.nb_channels, sizeof(*channel_desc));
+        if (!channel_desc)
+            return AVERROR(ENOMEM);
+
+        for (i = 0; i < par->ch_layout.nb_channels; i++) {
+            channel_desc[i] =
+                mov_get_channel_label(av_channel_layout_channel_from_index(&par->ch_layout, i));
+
+            if (channel_desc[i] == 0) {
+                av_free(channel_desc);
+                return AVERROR(ENOSYS);
+            }
+        }
 
-    /* TODO: set channel descriptions as a secondary backup */
+        *pchannel_desc = channel_desc;
+    }
 
-    return tag;
+    return 0;
 }
 
 int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
diff --git a/libavformat/mov_chan.h b/libavformat/mov_chan.h
index 9514dfa405..2815f15f07 100644
--- a/libavformat/mov_chan.h
+++ b/libavformat/mov_chan.h
@@ -30,6 +30,7 @@
 
 #include "libavutil/channel_layout.h"
 #include "libavcodec/codec_id.h"
+#include "libavcodec/codec_par.h"
 #include "avformat.h"
 
 /**
@@ -41,9 +42,10 @@
  * @param[out] bitmap          channel bitmap
  * @return                     channel layout tag
  */
-uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id,
-                                       const AVChannelLayout *ch_layout,
-                                       uint32_t *bitmap);
+int ff_mov_get_channel_layout_tag(const AVCodecParameters *par,
+                                       uint32_t *layout,
+                                       uint32_t *bitmap,
+                                       uint32_t **pchannel_desc);
 
 /**
  * Read 'chan' tag from the input stream.
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 46d66c29c2..263649f1da 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -867,20 +867,27 @@ static int mov_write_dmlp_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
 
 static int mov_write_chan_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
 {
-    uint32_t layout_tag, bitmap;
+    uint32_t layout_tag, bitmap, *channel_desc;
     int64_t pos = avio_tell(pb);
+    int num_desc, ret;
 
-    layout_tag = ff_mov_get_channel_layout_tag(track->par->codec_id,
-                                               &track->par->ch_layout,
-                                               &bitmap);
-    if (!layout_tag) {
-        av_log(s, AV_LOG_WARNING, "not writing 'chan' tag due to "
-               "lack of channel information\n");
+    if (track->multichannel_as_mono)
         return 0;
+
+    ret = ff_mov_get_channel_layout_tag(track->par, &layout_tag,
+                                        &bitmap, &channel_desc);
+
+    if (ret < 0) {
+        if (ret == AVERROR(ENOSYS)) {
+            av_log(s, AV_LOG_WARNING, "not writing 'chan' tag due to "
+                                      "lack of channel information\n");
+            ret = 0;
+        }
+
+        return ret;
     }
 
-    if (track->multichannel_as_mono)
-        return 0;
+    num_desc = layout_tag ? 0 : track->par->ch_layout.nb_channels;
 
     avio_wb32(pb, 0);           // Size
     ffio_wfourcc(pb, "chan");   // Type
@@ -888,7 +895,17 @@ static int mov_write_chan_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
     avio_wb24(pb, 0);           // Flags
     avio_wb32(pb, layout_tag);  // mChannelLayoutTag
     avio_wb32(pb, bitmap);      // mChannelBitmap
-    avio_wb32(pb, 0);           // mNumberChannelDescriptions
+    avio_wb32(pb, num_desc);    // mNumberChannelDescriptions
+
+    for (int i = 0; i < num_desc; i++) {
+        avio_wb32(pb, channel_desc[i]); // mChannelLabel
+        avio_wb32(pb, 0);               // mChannelFlags
+        avio_wl32(pb, 0);               // mCoordinates[0]
+        avio_wl32(pb, 0);               // mCoordinates[1]
+        avio_wl32(pb, 0);               // mCoordinates[2]
+    }
+
+    av_free(channel_desc);
 
     return update_size(pb, pos);
 }
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 5/7] avformat/mov_chan: move the definition of MovChannelLayoutTag to the header
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
                   ` (2 preceding siblings ...)
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 4/7] avformat/movenc: write channel descriptions when a known layout or a bitmap can't be used James Almer
@ 2022-03-28 23:24 ` James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 6/7] avformat/movenc: don't use mono layout when a front center label is expected James Almer
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov_chan.c | 104 -----------------------------------------
 libavformat/mov_chan.h | 104 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index 4cb373d1b9..5b757c6a8a 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -29,110 +29,6 @@
 #include "libavcodec/codec_id.h"
 #include "mov_chan.h"
 
-/**
- * Channel Layout Tag
- * This tells which channels are present in the audio stream and the order in
- * which they appear.
- *
- * @note We're using the channel layout tag to indicate channel order
- *       when the value is greater than 0x10000. The Apple documentation has
- *       some contradictions as to how this is actually supposed to be handled.
- *
- *       Core Audio File Format Spec:
- *           "The high 16 bits indicates a specific ordering of the channels."
- *       Core Audio Data Types Reference:
- *           "These identifiers specify the channels included in a layout but
- *            do not specify a particular ordering of those channels."
- */
-enum MovChannelLayoutTag {
-#define MOV_CH_LAYOUT_UNKNOWN             0xFFFF0000
-    MOV_CH_LAYOUT_USE_DESCRIPTIONS      = (  0 << 16) | 0,
-    MOV_CH_LAYOUT_USE_BITMAP            = (  1 << 16) | 0,
-    MOV_CH_LAYOUT_DISCRETEINORDER       = (147 << 16) | 0,
-    MOV_CH_LAYOUT_MONO                  = (100 << 16) | 1,
-    MOV_CH_LAYOUT_STEREO                = (101 << 16) | 2,
-    MOV_CH_LAYOUT_STEREOHEADPHONES      = (102 << 16) | 2,
-    MOV_CH_LAYOUT_MATRIXSTEREO          = (103 << 16) | 2,
-    MOV_CH_LAYOUT_MIDSIDE               = (104 << 16) | 2,
-    MOV_CH_LAYOUT_XY                    = (105 << 16) | 2,
-    MOV_CH_LAYOUT_BINAURAL              = (106 << 16) | 2,
-    MOV_CH_LAYOUT_AMBISONIC_B_FORMAT    = (107 << 16) | 4,
-    MOV_CH_LAYOUT_QUADRAPHONIC          = (108 << 16) | 4,
-    MOV_CH_LAYOUT_PENTAGONAL            = (109 << 16) | 5,
-    MOV_CH_LAYOUT_HEXAGONAL             = (110 << 16) | 6,
-    MOV_CH_LAYOUT_OCTAGONAL             = (111 << 16) | 8,
-    MOV_CH_LAYOUT_CUBE                  = (112 << 16) | 8,
-    MOV_CH_LAYOUT_MPEG_3_0_A            = (113 << 16) | 3,
-    MOV_CH_LAYOUT_MPEG_3_0_B            = (114 << 16) | 3,
-    MOV_CH_LAYOUT_MPEG_4_0_A            = (115 << 16) | 4,
-    MOV_CH_LAYOUT_MPEG_4_0_B            = (116 << 16) | 4,
-    MOV_CH_LAYOUT_MPEG_5_0_A            = (117 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_0_B            = (118 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_0_C            = (119 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_0_D            = (120 << 16) | 5,
-    MOV_CH_LAYOUT_MPEG_5_1_A            = (121 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_5_1_B            = (122 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_5_1_C            = (123 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_5_1_D            = (124 << 16) | 6,
-    MOV_CH_LAYOUT_MPEG_6_1_A            = (125 << 16) | 7,
-    MOV_CH_LAYOUT_MPEG_7_1_A            = (126 << 16) | 8,
-    MOV_CH_LAYOUT_MPEG_7_1_B            = (127 << 16) | 8,
-    MOV_CH_LAYOUT_MPEG_7_1_C            = (128 << 16) | 8,
-    MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1    = (129 << 16) | 8,
-    MOV_CH_LAYOUT_SMPTE_DTV             = (130 << 16) | 8,
-    MOV_CH_LAYOUT_ITU_2_1               = (131 << 16) | 3,
-    MOV_CH_LAYOUT_ITU_2_2               = (132 << 16) | 4,
-    MOV_CH_LAYOUT_DVD_4                 = (133 << 16) | 3,
-    MOV_CH_LAYOUT_DVD_5                 = (134 << 16) | 4,
-    MOV_CH_LAYOUT_DVD_6                 = (135 << 16) | 5,
-    MOV_CH_LAYOUT_DVD_10                = (136 << 16) | 4,
-    MOV_CH_LAYOUT_DVD_11                = (137 << 16) | 5,
-    MOV_CH_LAYOUT_DVD_18                = (138 << 16) | 5,
-    MOV_CH_LAYOUT_AUDIOUNIT_6_0         = (139 << 16) | 6,
-    MOV_CH_LAYOUT_AUDIOUNIT_7_0         = (140 << 16) | 7,
-    MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT   = (148 << 16) | 7,
-    MOV_CH_LAYOUT_AAC_6_0               = (141 << 16) | 6,
-    MOV_CH_LAYOUT_AAC_6_1               = (142 << 16) | 7,
-    MOV_CH_LAYOUT_AAC_7_0               = (143 << 16) | 7,
-    MOV_CH_LAYOUT_AAC_OCTAGONAL         = (144 << 16) | 8,
-    MOV_CH_LAYOUT_TMH_10_2_STD          = (145 << 16) | 16,
-    MOV_CH_LAYOUT_TMH_10_2_FULL         = (146 << 16) | 21,
-    MOV_CH_LAYOUT_AC3_1_0_1             = (149 << 16) | 2,
-    MOV_CH_LAYOUT_AC3_3_0               = (150 << 16) | 3,
-    MOV_CH_LAYOUT_AC3_3_1               = (151 << 16) | 4,
-    MOV_CH_LAYOUT_AC3_3_0_1             = (152 << 16) | 4,
-    MOV_CH_LAYOUT_AC3_2_1_1             = (153 << 16) | 4,
-    MOV_CH_LAYOUT_AC3_3_1_1             = (154 << 16) | 5,
-    MOV_CH_LAYOUT_EAC3_6_0_A            = (155 << 16) | 6,
-    MOV_CH_LAYOUT_EAC3_7_0_A            = (156 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_6_1_A            = (157 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_6_1_B            = (158 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_6_1_C            = (159 << 16) | 7,
-    MOV_CH_LAYOUT_EAC3_7_1_A            = (160 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_B            = (161 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_C            = (162 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_D            = (163 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_E            = (164 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_F            = (165 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_G            = (166 << 16) | 8,
-    MOV_CH_LAYOUT_EAC3_7_1_H            = (167 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_3_1               = (168 << 16) | 4,
-    MOV_CH_LAYOUT_DTS_4_1               = (169 << 16) | 5,
-    MOV_CH_LAYOUT_DTS_6_0_A             = (170 << 16) | 6,
-    MOV_CH_LAYOUT_DTS_6_0_B             = (171 << 16) | 6,
-    MOV_CH_LAYOUT_DTS_6_0_C             = (172 << 16) | 6,
-    MOV_CH_LAYOUT_DTS_6_1_A             = (173 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_6_1_B             = (174 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_6_1_C             = (175 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_6_1_D             = (182 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_7_0               = (176 << 16) | 7,
-    MOV_CH_LAYOUT_DTS_7_1               = (177 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_8_0_A             = (178 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_8_0_B             = (179 << 16) | 8,
-    MOV_CH_LAYOUT_DTS_8_1_A             = (180 << 16) | 9,
-    MOV_CH_LAYOUT_DTS_8_1_B             = (181 << 16) | 9,
-};
-
 struct MovChannelLayoutMap {
     uint32_t tag;
     uint64_t layout;
diff --git a/libavformat/mov_chan.h b/libavformat/mov_chan.h
index 2815f15f07..93d9878798 100644
--- a/libavformat/mov_chan.h
+++ b/libavformat/mov_chan.h
@@ -33,6 +33,110 @@
 #include "libavcodec/codec_par.h"
 #include "avformat.h"
 
+/**
+ * Channel Layout Tag
+ * This tells which channels are present in the audio stream and the order in
+ * which they appear.
+ *
+ * @note We're using the channel layout tag to indicate channel order
+ *       when the value is greater than 0x10000. The Apple documentation has
+ *       some contradictions as to how this is actually supposed to be handled.
+ *
+ *       Core Audio File Format Spec:
+ *           "The high 16 bits indicates a specific ordering of the channels."
+ *       Core Audio Data Types Reference:
+ *           "These identifiers specify the channels included in a layout but
+ *            do not specify a particular ordering of those channels."
+ */
+enum MovChannelLayoutTag {
+#define MOV_CH_LAYOUT_UNKNOWN             0xFFFF0000
+    MOV_CH_LAYOUT_USE_DESCRIPTIONS      = (  0 << 16) | 0,
+    MOV_CH_LAYOUT_USE_BITMAP            = (  1 << 16) | 0,
+    MOV_CH_LAYOUT_DISCRETEINORDER       = (147 << 16) | 0,
+    MOV_CH_LAYOUT_MONO                  = (100 << 16) | 1,
+    MOV_CH_LAYOUT_STEREO                = (101 << 16) | 2,
+    MOV_CH_LAYOUT_STEREOHEADPHONES      = (102 << 16) | 2,
+    MOV_CH_LAYOUT_MATRIXSTEREO          = (103 << 16) | 2,
+    MOV_CH_LAYOUT_MIDSIDE               = (104 << 16) | 2,
+    MOV_CH_LAYOUT_XY                    = (105 << 16) | 2,
+    MOV_CH_LAYOUT_BINAURAL              = (106 << 16) | 2,
+    MOV_CH_LAYOUT_AMBISONIC_B_FORMAT    = (107 << 16) | 4,
+    MOV_CH_LAYOUT_QUADRAPHONIC          = (108 << 16) | 4,
+    MOV_CH_LAYOUT_PENTAGONAL            = (109 << 16) | 5,
+    MOV_CH_LAYOUT_HEXAGONAL             = (110 << 16) | 6,
+    MOV_CH_LAYOUT_OCTAGONAL             = (111 << 16) | 8,
+    MOV_CH_LAYOUT_CUBE                  = (112 << 16) | 8,
+    MOV_CH_LAYOUT_MPEG_3_0_A            = (113 << 16) | 3,
+    MOV_CH_LAYOUT_MPEG_3_0_B            = (114 << 16) | 3,
+    MOV_CH_LAYOUT_MPEG_4_0_A            = (115 << 16) | 4,
+    MOV_CH_LAYOUT_MPEG_4_0_B            = (116 << 16) | 4,
+    MOV_CH_LAYOUT_MPEG_5_0_A            = (117 << 16) | 5,
+    MOV_CH_LAYOUT_MPEG_5_0_B            = (118 << 16) | 5,
+    MOV_CH_LAYOUT_MPEG_5_0_C            = (119 << 16) | 5,
+    MOV_CH_LAYOUT_MPEG_5_0_D            = (120 << 16) | 5,
+    MOV_CH_LAYOUT_MPEG_5_1_A            = (121 << 16) | 6,
+    MOV_CH_LAYOUT_MPEG_5_1_B            = (122 << 16) | 6,
+    MOV_CH_LAYOUT_MPEG_5_1_C            = (123 << 16) | 6,
+    MOV_CH_LAYOUT_MPEG_5_1_D            = (124 << 16) | 6,
+    MOV_CH_LAYOUT_MPEG_6_1_A            = (125 << 16) | 7,
+    MOV_CH_LAYOUT_MPEG_7_1_A            = (126 << 16) | 8,
+    MOV_CH_LAYOUT_MPEG_7_1_B            = (127 << 16) | 8,
+    MOV_CH_LAYOUT_MPEG_7_1_C            = (128 << 16) | 8,
+    MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1    = (129 << 16) | 8,
+    MOV_CH_LAYOUT_SMPTE_DTV             = (130 << 16) | 8,
+    MOV_CH_LAYOUT_ITU_2_1               = (131 << 16) | 3,
+    MOV_CH_LAYOUT_ITU_2_2               = (132 << 16) | 4,
+    MOV_CH_LAYOUT_DVD_4                 = (133 << 16) | 3,
+    MOV_CH_LAYOUT_DVD_5                 = (134 << 16) | 4,
+    MOV_CH_LAYOUT_DVD_6                 = (135 << 16) | 5,
+    MOV_CH_LAYOUT_DVD_10                = (136 << 16) | 4,
+    MOV_CH_LAYOUT_DVD_11                = (137 << 16) | 5,
+    MOV_CH_LAYOUT_DVD_18                = (138 << 16) | 5,
+    MOV_CH_LAYOUT_AUDIOUNIT_6_0         = (139 << 16) | 6,
+    MOV_CH_LAYOUT_AUDIOUNIT_7_0         = (140 << 16) | 7,
+    MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT   = (148 << 16) | 7,
+    MOV_CH_LAYOUT_AAC_6_0               = (141 << 16) | 6,
+    MOV_CH_LAYOUT_AAC_6_1               = (142 << 16) | 7,
+    MOV_CH_LAYOUT_AAC_7_0               = (143 << 16) | 7,
+    MOV_CH_LAYOUT_AAC_OCTAGONAL         = (144 << 16) | 8,
+    MOV_CH_LAYOUT_TMH_10_2_STD          = (145 << 16) | 16,
+    MOV_CH_LAYOUT_TMH_10_2_FULL         = (146 << 16) | 21,
+    MOV_CH_LAYOUT_AC3_1_0_1             = (149 << 16) | 2,
+    MOV_CH_LAYOUT_AC3_3_0               = (150 << 16) | 3,
+    MOV_CH_LAYOUT_AC3_3_1               = (151 << 16) | 4,
+    MOV_CH_LAYOUT_AC3_3_0_1             = (152 << 16) | 4,
+    MOV_CH_LAYOUT_AC3_2_1_1             = (153 << 16) | 4,
+    MOV_CH_LAYOUT_AC3_3_1_1             = (154 << 16) | 5,
+    MOV_CH_LAYOUT_EAC3_6_0_A            = (155 << 16) | 6,
+    MOV_CH_LAYOUT_EAC3_7_0_A            = (156 << 16) | 7,
+    MOV_CH_LAYOUT_EAC3_6_1_A            = (157 << 16) | 7,
+    MOV_CH_LAYOUT_EAC3_6_1_B            = (158 << 16) | 7,
+    MOV_CH_LAYOUT_EAC3_6_1_C            = (159 << 16) | 7,
+    MOV_CH_LAYOUT_EAC3_7_1_A            = (160 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_B            = (161 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_C            = (162 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_D            = (163 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_E            = (164 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_F            = (165 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_G            = (166 << 16) | 8,
+    MOV_CH_LAYOUT_EAC3_7_1_H            = (167 << 16) | 8,
+    MOV_CH_LAYOUT_DTS_3_1               = (168 << 16) | 4,
+    MOV_CH_LAYOUT_DTS_4_1               = (169 << 16) | 5,
+    MOV_CH_LAYOUT_DTS_6_0_A             = (170 << 16) | 6,
+    MOV_CH_LAYOUT_DTS_6_0_B             = (171 << 16) | 6,
+    MOV_CH_LAYOUT_DTS_6_0_C             = (172 << 16) | 6,
+    MOV_CH_LAYOUT_DTS_6_1_A             = (173 << 16) | 7,
+    MOV_CH_LAYOUT_DTS_6_1_B             = (174 << 16) | 7,
+    MOV_CH_LAYOUT_DTS_6_1_C             = (175 << 16) | 7,
+    MOV_CH_LAYOUT_DTS_6_1_D             = (182 << 16) | 7,
+    MOV_CH_LAYOUT_DTS_7_0               = (176 << 16) | 7,
+    MOV_CH_LAYOUT_DTS_7_1               = (177 << 16) | 8,
+    MOV_CH_LAYOUT_DTS_8_0_A             = (178 << 16) | 8,
+    MOV_CH_LAYOUT_DTS_8_0_B             = (179 << 16) | 8,
+    MOV_CH_LAYOUT_DTS_8_1_A             = (180 << 16) | 9,
+    MOV_CH_LAYOUT_DTS_8_1_B             = (181 << 16) | 9,
+};
+
 /**
  * Get the channel layout tag for the specified codec id and channel layout.
  * If the layout tag was not found, use a channel bitmap if possible.
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 6/7] avformat/movenc: don't use mono layout when a front center label is expected
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
                   ` (3 preceding siblings ...)
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 5/7] avformat/mov_chan: move the definition of MovChannelLayoutTag to the header James Almer
@ 2022-03-28 23:24 ` James Almer
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 7/7] fate: add a test for writing channel descriptions in mov James Almer
  2022-04-05 12:20 ` [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

On output streams where a multichannel stream needs to be stored as one track
per channel, each track will have a channel layout describing the position of
the channel they contain. For the track with front center, the mov muxer was
using the mov layout "mono" instead of the label for the front center position.

Since our channel layout API considers front center == mono, we need to do some
heuristics. To achieve this, we make sure all audio tracks contain streams with
a single channel, and only one of them is front center. In that case, we write
the front center label instead of signaling mono layout.

Fixes the last part of ticket #2865

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/movenc.c | 25 +++++++++++++++++++++++++
 libavformat/movenc.h |  1 +
 2 files changed, 26 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 263649f1da..b9956e699c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -887,6 +887,17 @@ static int mov_write_chan_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
         return ret;
     }
 
+    if (layout_tag == MOV_CH_LAYOUT_MONO && track->mono_as_fc > 0) {
+        av_assert0(!channel_desc);
+        channel_desc = av_malloc(sizeof(*channel_desc));
+        if (!channel_desc)
+            return AVERROR(ENOMEM);
+
+        layout_tag = 0;
+        bitmap = 0;
+        *channel_desc = 3; // channel label "Center"
+    }
+
     num_desc = layout_tag ? 0 : track->par->ch_layout.nb_channels;
 
     avio_wb32(pb, 0);           // Size
@@ -6970,6 +6981,20 @@ static int mov_write_header(AVFormatContext *s)
             if (j == i)
                 continue;
 
+            if (stj->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
+                (trackj->par->ch_layout.nb_channels != 1 ||
+                 !av_channel_layout_compare(&trackj->par->ch_layout,
+                                            &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO))
+            )
+                track->mono_as_fc = -1;
+
+            if (stj->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
+                av_channel_layout_compare(&trackj->par->ch_layout,
+                                          &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO) &&
+                trackj->par->ch_layout.nb_channels == 1 && track->mono_as_fc >= 0
+            )
+                track->mono_as_fc++;
+
             if (stj->codecpar->codec_type != AVMEDIA_TYPE_AUDIO ||
                 av_channel_layout_compare(&trackj->par->ch_layout,
                                           &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO) ||
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 2ac84ed070..67d6d4fb66 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -107,6 +107,7 @@ typedef struct MOVTrack {
     int         tag; ///< stsd fourcc
     AVStream        *st;
     AVCodecParameters *par;
+    int mono_as_fc;
     int multichannel_as_mono;
 
     int         vos_len;
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [FFmpeg-devel] [PATCH 7/7] fate: add a test for writing channel descriptions in mov
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
                   ` (4 preceding siblings ...)
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 6/7] avformat/movenc: don't use mono layout when a front center label is expected James Almer
@ 2022-03-28 23:24 ` James Almer
  2022-04-05 12:20 ` [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-03-28 23:24 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: James Almer <jamrial@gmail.com>
---
 tests/fate/mov.mak                     | 11 ++++++-
 tests/ref/fate/mov-channel-description | 42 ++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/mov-channel-description

diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index b54c009f05..5d9f183203 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -153,4 +153,13 @@ fate-mov-mp4-disposition-mpegts-remux: CMD = transcode mpegts $(TARGET_SAMPLES)/
 
 FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_MOV_FFMPEG_FFPROBE-yes)
 
-fate-mov: $(FATE_MOV) $(FATE_MOV_FFPROBE) $(FATE_MOV_FASTSTART) $(FATE_MOV_FFMPEG_FFPROBE-yes)
+FATE_MOV_FFMPEG-$(call ALLYES, FILE_PROTOCOL PIPE_PROTOCOL \
+                               WAV_DEMUXER PAN_FILTER PCM_S16LE_ENCODER \
+                               MOV_MUXER FRAMECRC_MUXER ) \
+                          += fate-mov-channel-description
+fate-mov-channel-description: tests/data/asynth-44100-1.wav
+fate-mov-channel-description: CMD = transcode wav $(TARGET_PATH)/tests/data/asynth-44100-1.wav mov "-filter_complex [0:a:0]pan=FL|c0=c0[outFL] -map [outFL] -filter_complex [0:a:0]pan=FR|c0=c1[outFR] -map [outFR] -filter_complex [0:a:0]pan=FC|c0=c2[outFC] -map [outFC] -filter_complex [0:a:0]pan=LFE|c0=c3[outLFE] -map [outLFE] -filter_complex [0:a:0]pan=BL|c0=c4[outBL] -map [outBL] -filter_complex [0:a:0]pan=BR|c0=c5[outBR] -map [outBR] -filter_complex [0:a:0]pan=DL|c0=c6[outDL] -map [outDL] -filter_complex [0:a:0]pan=DR|c0=c7[outDR] -map [outDR] -c:a pcm_s16le" "-map 0 -c copy -frames:a 0"
+
+FATE_FFMPEG += $(FATE_MOV_FFMPEG-yes)
+
+fate-mov: $(FATE_MOV) $(FATE_MOV_FFMPEG-yes) $(FATE_MOV_FFPROBE) $(FATE_MOV_FASTSTART) $(FATE_MOV_FFMPEG_FFPROBE-yes)
diff --git a/tests/ref/fate/mov-channel-description b/tests/ref/fate/mov-channel-description
new file mode 100644
index 0000000000..21b2e11406
--- /dev/null
+++ b/tests/ref/fate/mov-channel-description
@@ -0,0 +1,42 @@
+497848e1bc5c9dcd416124b6f739d733 *tests/data/fate/mov-channel-description.mov
+4242044 tests/data/fate/mov-channel-description.mov
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 44100
+#channel_layout_name 0: 1 channels (FL)
+#tb 1: 1/44100
+#media_type 1: audio
+#codec_id 1: pcm_s16le
+#sample_rate 1: 44100
+#channel_layout_name 1: 1 channels (FR)
+#tb 2: 1/44100
+#media_type 2: audio
+#codec_id 2: pcm_s16le
+#sample_rate 2: 44100
+#channel_layout_name 2: mono
+#tb 3: 1/44100
+#media_type 3: audio
+#codec_id 3: pcm_s16le
+#sample_rate 3: 44100
+#channel_layout_name 3: 1 channels (LFE)
+#tb 4: 1/44100
+#media_type 4: audio
+#codec_id 4: pcm_s16le
+#sample_rate 4: 44100
+#channel_layout_name 4: 1 channels (BL)
+#tb 5: 1/44100
+#media_type 5: audio
+#codec_id 5: pcm_s16le
+#sample_rate 5: 44100
+#channel_layout_name 5: 1 channels (BR)
+#tb 6: 1/44100
+#media_type 6: audio
+#codec_id 6: pcm_s16le
+#sample_rate 6: 44100
+#channel_layout_name 6: 1 channels (DL)
+#tb 7: 1/44100
+#media_type 7: audio
+#codec_id 7: pcm_s16le
+#sample_rate 7: 44100
+#channel_layout_name 7: 1 channels (DR)
-- 
2.35.1

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose
  2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
                   ` (5 preceding siblings ...)
  2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 7/7] fate: add a test for writing channel descriptions in mov James Almer
@ 2022-04-05 12:20 ` James Almer
  6 siblings, 0 replies; 8+ messages in thread
From: James Almer @ 2022-04-05 12:20 UTC (permalink / raw)
  To: ffmpeg-devel

On 3/28/2022 8:24 PM, James Almer wrote:
> This function turns a mov channel label into a lavf native bitmask.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   libavformat/mov_chan.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
> index f52239d347..4607540297 100644
> --- a/libavformat/mov_chan.c
> +++ b/libavformat/mov_chan.c
> @@ -485,7 +485,7 @@ static uint64_t mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
>       return layout_map[i].layout;
>   }
>   
> -static uint32_t mov_get_channel_label(uint32_t label)
> +static uint32_t mov_get_channel_mask(uint32_t label)
>   {
>       if (label == 0)
>           return 0;
> @@ -590,7 +590,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
>           avio_rl32(pb);                      // mCoordinates[2]
>           size -= 20;
>           if (layout_tag == 0) {
> -            uint32_t mask_incr = mov_get_channel_label(label);
> +            uint32_t mask_incr = mov_get_channel_mask(label);
>               if (mask_incr == 0) {
>                   label_mask = 0;
>                   break;

Will apply set.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-04-05 12:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 23:24 [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer
2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 2/7] avformat/mov_chan: add a few missing channel label mappings James Almer
2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 3/7] avformat/mov_chan: use a higher log level for a debug message James Almer
2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 4/7] avformat/movenc: write channel descriptions when a known layout or a bitmap can't be used James Almer
2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 5/7] avformat/mov_chan: move the definition of MovChannelLayoutTag to the header James Almer
2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 6/7] avformat/movenc: don't use mono layout when a front center label is expected James Almer
2022-03-28 23:24 ` [FFmpeg-devel] [PATCH 7/7] fate: add a test for writing channel descriptions in mov James Almer
2022-04-05 12:20 ` [FFmpeg-devel] [PATCH 1/7] avformat/mov_chan: rename mov_get_channel_label() to better reflect its purpose James Almer

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