This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit f778a7e2418a992d925d8f1cae1e339a720fe890
Author:     James Almer <[email protected]>
AuthorDate: Sat May 30 16:00:48 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Sun May 31 03:43:29 2026 +0000

    avformat: deprecate AVStreamGroupLCEVC
    
    It's been replaced with AVStreamGroupLayeredVideo, which is functionally the
    same while generic enough to be shared with other kinds of layered video
    implementations.
    
    Signed-off-by: James Almer <[email protected]>
---
 doc/APIchanges              |  2 ++
 libavformat/avformat.h      | 13 +++++++++++++
 libavformat/dashdec.c       | 10 +++++-----
 libavformat/demux.c         |  6 +++---
 libavformat/dump.c          |  5 +++--
 libavformat/mov.c           |  6 +++---
 libavformat/movenc.c        | 14 +++++++-------
 libavformat/mpegts.c        |  2 +-
 libavformat/options.c       | 41 +++++++++++++----------------------------
 libavformat/version_major.h |  2 ++
 10 files changed, 52 insertions(+), 49 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 69f098aba7..4695a38e8a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -6,6 +6,8 @@ API changes, most recent first:
   Add AVStreamGroupLayeredVideo
   Add AVStreamGroup.params.layered_video
   Add AV_STREAM_GROUP_PARAMS_DOLBY_VISION
+  Deprecate AVStreamGroupLCEVC
+  Deprecate AVStreamGroup.params.lcevc
 
 2026-05-xx - xxxxxxxxxx - lavc 62.35.100 - packet.h
   Add AV_PKT_DATA_HEVC_CONF side data type.
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 95440ef8c2..1efe383b25 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1079,13 +1079,18 @@ typedef struct AVStreamGroupLayeredVideo {
     /**
      * Index of the enhancement layer stream in AVStreamGroup.
      */
+#if FF_API_LCEVC_STRUCT
     union {
+#endif
         unsigned int el_index;
+#if FF_API_LCEVC_STRUCT
         /**
          * Alias for @ref el_index, kept for backward compatibility.
          */
+        attribute_deprecated
         unsigned int lcevc_index;
     };
+#endif
     /**
      * Width of the final stream for presentation.
      */
@@ -1096,12 +1101,14 @@ typedef struct AVStreamGroupLayeredVideo {
     int height;
 } AVStreamGroupLayeredVideo;
 
+#if FF_API_LCEVC_STRUCT
 /**
  * Alias kept for backward compatibility.
  *
  * AVStreamGroupLCEVC was renamed to @ref AVStreamGroupLayeredVideo.
  */
 #define AVStreamGroupLCEVC AVStreamGroupLayeredVideo
+#endif
 
 /**
  * AVStreamGroupTREF is meant to define the relation between video, audio,
@@ -1169,7 +1176,13 @@ typedef struct AVStreamGroup {
         struct AVIAMFMixPresentation *iamf_mix_presentation;
         struct AVStreamGroupTileGrid *tile_grid;
         struct AVStreamGroupLayeredVideo *layered_video;
+#if FF_API_LCEVC_STRUCT
+        /**
+         * deprecated, use layered_video.
+         */
+        attribute_deprecated
         struct AVStreamGroupLCEVC *lcevc;
+#endif
         struct AVStreamGroupTREF *tref;
     } params;
 
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index bed82fcf45..8536bb6575 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -2064,8 +2064,8 @@ static int open_demux_for_component(AVFormatContext *s, 
struct representation *p
 
         switch (stg->type) {
         case AV_STREAM_GROUP_PARAMS_LCEVC: {
-            AVStreamGroupLCEVC *ilcevc = istg->params.lcevc;
-            AVStreamGroupLCEVC *lcevc = stg->params.lcevc;
+            AVStreamGroupLayeredVideo *ilcevc = istg->params.layered_video;
+            AVStreamGroupLayeredVideo *lcevc = stg->params.layered_video;
             ret = av_opt_copy(lcevc, ilcevc);
             if (ret < 0)
                 return ret;
@@ -2285,8 +2285,8 @@ static int dash_read_header(AVFormatContext *s)
         AVStreamGroup *stg = avformat_stream_group_create(s, 
AV_STREAM_GROUP_PARAMS_LCEVC, NULL);
         if (!stg)
             return AVERROR(ENOMEM);
-        stg->params.lcevc->width  = rep->assoc_stream[0]->codecpar->width;
-        stg->params.lcevc->height = rep->assoc_stream[0]->codecpar->height;
+        stg->params.layered_video->width  = 
rep->assoc_stream[0]->codecpar->width;
+        stg->params.layered_video->height = 
rep->assoc_stream[0]->codecpar->height;
         ret = avformat_stream_group_add_stream(stg, ref->assoc_stream[0]);
         if (ret < 0)
             return ret;
@@ -2294,7 +2294,7 @@ static int dash_read_header(AVFormatContext *s)
         if (ret < 0)
             return ret;
         stg->id = stg->index;
-        stg->params.lcevc->lcevc_index = stg->nb_streams - 1;
+        stg->params.layered_video->el_index = stg->nb_streams - 1;
     }
 
     return 0;
diff --git a/libavformat/demux.c b/libavformat/demux.c
index a87f2755de..55085210de 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -3166,7 +3166,7 @@ int avformat_find_stream_info(AVFormatContext *ic, 
AVDictionary **options)
     /* update the stream group parameters from the stream contexts if needed */
     for (unsigned i = 0; i < ic->nb_stream_groups; i++) {
         AVStreamGroup *const stg  = ic->stream_groups[i];
-        AVStreamGroupLCEVC *lcevc;
+        AVStreamGroupLayeredVideo *lcevc;
         const AVStream *st;
 
         if (stg->type != AV_STREAM_GROUP_PARAMS_LCEVC)
@@ -3174,10 +3174,10 @@ int avformat_find_stream_info(AVFormatContext *ic, 
AVDictionary **options)
 
         /* For LCEVC in mpegts, the parser is needed to get the enhancement 
layer
          * dimensions */
-        lcevc = stg->params.lcevc;
+        lcevc = stg->params.layered_video;
         if (lcevc->width && lcevc->height)
             continue;
-        st = stg->streams[lcevc->lcevc_index];
+        st = stg->streams[lcevc->el_index];
         lcevc->width  = st->codecpar->width;
         lcevc->height = st->codecpar->height;
     }
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 67e37d7192..9e0a4adad2 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -811,11 +811,12 @@ static void dump_stream_group(const AVFormatContext *ic, 
uint8_t *printed,
         break;
     }
     case AV_STREAM_GROUP_PARAMS_LCEVC: {
-        const AVStreamGroupLCEVC *lcevc = stg->params.lcevc;
+        const AVStreamGroupLayeredVideo *lcevc = stg->params.layered_video;
         AVCodecContext *avctx = avcodec_alloc_context3(NULL);
         const char *ptr = NULL;
         av_log(NULL, AV_LOG_INFO, " LCEVC:");
-        if (avctx && stg->nb_streams && !avcodec_parameters_to_context(avctx, 
stg->streams[0]->codecpar)) {
+        if (avctx && stg->nb_streams == 2 &&
+            !avcodec_parameters_to_context(avctx, 
stg->streams[!lcevc->el_index]->codecpar)) {
             avctx->width  = lcevc->width;
             avctx->height = lcevc->height;
             avctx->coded_width  = lcevc->width;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6f6b9a37ed..3ab73d8747 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -11037,8 +11037,8 @@ static int mov_parse_lcevc_streams(AVFormatContext *s)
             return AVERROR(ENOMEM);
 
         stg->id = st->id;
-        stg->params.lcevc->width  = st->codecpar->width;
-        stg->params.lcevc->height = st->codecpar->height;
+        stg->params.layered_video->width  = st->codecpar->width;
+        stg->params.layered_video->height = st->codecpar->height;
 
         while (st_base = mov_find_reference_track(s, st, tag->id, tag->nb_id, 
j)) {
             err = avformat_stream_group_add_stream(stg, st_base);
@@ -11060,7 +11060,7 @@ static int mov_parse_lcevc_streams(AVFormatContext *s)
         if (err < 0)
             return err;
 
-        stg->params.lcevc->lcevc_index = stg->nb_streams - 1;
+        stg->params.layered_video->el_index = stg->nb_streams - 1;
     }
 
     return 0;
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ca96c0887c..b466ba7531 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -8265,12 +8265,12 @@ static int mov_init(AVFormatContext *s)
                 av_log(s, AV_LOG_ERROR, "Exactly two Streams are supported for 
Stream Groups of type LCEVC\n");
                 return AVERROR(EINVAL);
             }
-            AVStreamGroupLCEVC *lcevc = stg->params.lcevc;
-            if (lcevc->lcevc_index > 1)
+            AVStreamGroupLayeredVideo *lcevc = stg->params.layered_video;
+            if (lcevc->el_index > 1)
                 return AVERROR(EINVAL);
-            AVStream *st = stg->streams[lcevc->lcevc_index];
+            AVStream *st = stg->streams[lcevc->el_index];
             if (st->codecpar->codec_id != AV_CODEC_ID_LCEVC) {
-                av_log(s, AV_LOG_ERROR, "Stream #%u is not an LCEVC stream\n", 
lcevc->lcevc_index);
+                av_log(s, AV_LOG_ERROR, "Stream #%u is not an LCEVC stream\n", 
lcevc->el_index);
                 return AVERROR(EINVAL);
             }
         }
@@ -8614,14 +8614,14 @@ static int mov_init(AVFormatContext *s)
 
         switch (stg->type) {
         case AV_STREAM_GROUP_PARAMS_LCEVC: {
-            AVStreamGroupLCEVC *lcevc = stg->params.lcevc;
-            AVStream *st    = stg->streams[lcevc->lcevc_index];
+            AVStreamGroupLayeredVideo *lcevc = stg->params.layered_video;
+            AVStream *st    = stg->streams[lcevc->el_index];
             MOVTrack *track = st->priv_data;
 
             for (int j = 0; j < mov->nb_tracks; j++) {
                 MOVTrack *trk = &mov->tracks[j];
 
-                if (trk->st == stg->streams[!lcevc->lcevc_index]) {
+                if (trk->st == stg->streams[!lcevc->el_index]) {
                     track->src_track = av_malloc(sizeof(*track->src_track));
                     if (!track->src_track)
                         return AVERROR(ENOMEM);
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index aa1484fb74..21fdbe6b17 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2670,7 +2670,7 @@ static void create_stream_groups(MpegTSContext *ts, 
struct Program *prg)
             switch (grp->type) {
             case AV_STREAM_GROUP_PARAMS_LCEVC:
                 if (grp->streams[j]->codecpar->codec_id == AV_CODEC_ID_LCEVC)
-                    stg->params.lcevc->lcevc_index = stg->nb_streams - 1;
+                    stg->params.layered_video->el_index = stg->nb_streams - 1;
                 break;
             case AV_STREAM_GROUP_PARAMS_DOLBY_VISION:
                 if (j == 0) {
diff --git a/libavformat/options.c b/libavformat/options.c
index db9cb76048..6da1b690c6 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -350,22 +350,6 @@ static const AVClass tile_grid_class = {
     .option     = tile_grid_options,
 };
 
-#define OFFSET(x) offsetof(AVStreamGroupLCEVC, x)
-static const AVOption lcevc_options[] = {
-    { "lcevc_index", "Index of the LCEVC stream within the group", 
OFFSET(lcevc_index),
-        AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
-    { "video_size", "size of video after LCEVC enhancement has been applied", 
OFFSET(width),
-        AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS },
-    { NULL },
-};
-#undef OFFSET
-
-static const AVClass lcevc_class = {
-    .class_name = "AVStreamGroupLCEVC",
-    .version    = LIBAVUTIL_VERSION_INT,
-    .option     = lcevc_options,
-};
-
 #define OFFSET(x) offsetof(AVStreamGroupTREF, x)
 static const AVOption tref_options[] = {
     { "metadata_index", "Index of the data stream within the group", 
OFFSET(metadata_index),
@@ -380,14 +364,24 @@ static const AVClass tref_class = {
     .option     = tref_options,
 };
 
+#if FF_API_LCEVC_STRUCT
+FF_DISABLE_DEPRECATION_WARNINGS
+#endif
 #define OFFSET(x) offsetof(AVStreamGroupLayeredVideo, x)
 static const AVOption layered_video_options[] = {
+#if FF_API_LCEVC_STRUCT
+    { "lcevc_index", "Index of the LCEVC stream within the group", 
OFFSET(lcevc_index),
+        AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS | 
AV_OPT_FLAG_DEPRECATED },
+#endif
     { "el_index", "Index of the enhancement layer stream within the group", 
OFFSET(el_index),
         AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
     { "video_size", "size of the final layered video presentation", 
OFFSET(width),
         AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, INT_MAX, FLAGS },
     { NULL },
 };
+#if FF_API_LCEVC_STRUCT
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 #undef OFFSET
 
 static const AVClass layered_video_class = {
@@ -407,10 +401,9 @@ static void *stream_group_child_next(void *obj, void *prev)
             return stg->params.iamf_mix_presentation;
         case AV_STREAM_GROUP_PARAMS_TILE_GRID:
             return stg->params.tile_grid;
-        case AV_STREAM_GROUP_PARAMS_LCEVC:
-            return stg->params.lcevc;
         case AV_STREAM_GROUP_PARAMS_TREF:
             return stg->params.tref;
+        case AV_STREAM_GROUP_PARAMS_LCEVC:
         case AV_STREAM_GROUP_PARAMS_DOLBY_VISION:
             return stg->params.layered_video;
         default:
@@ -440,12 +433,10 @@ static const AVClass *stream_group_child_iterate(void 
**opaque)
     case AV_STREAM_GROUP_PARAMS_TILE_GRID:
         ret = &tile_grid_class;
         break;
-    case AV_STREAM_GROUP_PARAMS_LCEVC:
-        ret = &lcevc_class;
-        break;
     case AV_STREAM_GROUP_PARAMS_TREF:
         ret = &tref_class;
         break;
+    case AV_STREAM_GROUP_PARAMS_LCEVC:
     case AV_STREAM_GROUP_PARAMS_DOLBY_VISION:
         ret = &layered_video_class;
         break;
@@ -518,13 +509,6 @@ AVStreamGroup 
*avformat_stream_group_create(AVFormatContext *s,
         stg->params.tile_grid->av_class = &tile_grid_class;
         av_opt_set_defaults(stg->params.tile_grid);
         break;
-    case AV_STREAM_GROUP_PARAMS_LCEVC:
-        stg->params.lcevc = av_mallocz(sizeof(*stg->params.lcevc));
-        if (!stg->params.lcevc)
-            goto fail;
-        stg->params.lcevc->av_class = &lcevc_class;
-        av_opt_set_defaults(stg->params.lcevc);
-        break;
     case AV_STREAM_GROUP_PARAMS_TREF:
         stg->params.tref = av_mallocz(sizeof(*stg->params.tref));
         if (!stg->params.tref)
@@ -532,6 +516,7 @@ AVStreamGroup *avformat_stream_group_create(AVFormatContext 
*s,
         stg->params.tref->av_class = &tref_class;
         av_opt_set_defaults(stg->params.tref);
         break;
+    case AV_STREAM_GROUP_PARAMS_LCEVC:
     case AV_STREAM_GROUP_PARAMS_DOLBY_VISION:
         stg->params.layered_video = 
av_mallocz(sizeof(*stg->params.layered_video));
         if (!stg->params.layered_video)
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 878f93b10a..2cae480a4b 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -49,6 +49,8 @@
 
 #define FF_API_FDEBUG_TS                (LIBAVFORMAT_VERSION_MAJOR < 63)
 
+#define FF_API_LCEVC_STRUCT             (LIBAVFORMAT_VERSION_MAJOR < 64)
+
 #define FF_API_R_FRAME_RATE            1
 
 #endif /* AVFORMAT_VERSION_MAJOR_H */

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to