diff mbox

[FFmpeg-devel,07/21] libavcodec/metaenc: added an encoder/decoder for timed metadata

Message ID 1471943019-14136-8-git-send-email-erkki.seppala.ext@nokia.com
State Superseded
Headers show

Commit Message

erkki.seppala.ext@nokia.com Aug. 23, 2016, 9:03 a.m. UTC
From: Erkki Seppälä <erkki.seppala.ext@nokia.com>

This encoder is used primarily with ISO media files and basically
copies the data, while allowing the rest of the FFMPEG to refer
to the meta data with its identifiers.

Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
Signed-off-by: OZOPlayer <OZOPL@nokia.com>
---
 configure               | 4 ++--
 libavcodec/Makefile     | 2 +-
 libavcodec/allcodecs.c  | 3 +++
 libavcodec/codec_desc.c | 8 ++++++++
 4 files changed, 14 insertions(+), 3 deletions(-)

Comments

Michael Niedermayer Aug. 23, 2016, 2:46 p.m. UTC | #1
On Tue, Aug 23, 2016 at 12:03:25PM +0300, erkki.seppala.ext@nokia.com wrote:
> From: Erkki Seppälä <erkki.seppala.ext@nokia.com>
> 
> This encoder is used primarily with ISO media files and basically
> copies the data, while allowing the rest of the FFMPEG to refer
> to the meta data with its identifiers.
> 
> Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
> Signed-off-by: OZOPlayer <OZOPL@nokia.com>
> ---
>  configure               | 4 ++--
>  libavcodec/Makefile     | 2 +-
>  libavcodec/allcodecs.c  | 3 +++
>  libavcodec/codec_desc.c | 8 ++++++++
>  4 files changed, 14 insertions(+), 3 deletions(-)

this breaks fate
make distclean ; ./configure && make -j12 fate
deadlocks and never finishes

[...]
erkki.seppala.ext@nokia.com Aug. 25, 2016, 3:58 p.m. UTC | #2
On 08/23/2016 05:46 PM, Michael Niedermayer wrote:
> this breaks fate
> make distclean ; ./configure && make -j12 fate
> deadlocks and never finishes

Well that was embarrassing, thanks for pointing it out.

The issue was that I had introduced metacodec_class that was shared 
between ff_meta_encoder and ff_meta_decoder, and due to this sharing 
av_opt_child_class_next was never able to get pass them as it 
automatically returned to the same metacodec_class on every iteration.

As it seems the metacodec_class was useless in the first place, I opted 
to remove it. make fate now doesn't hang, but I discovered uhm issues 
with some of the other patches that will be fixed in v2.

I'll be sure to ensure make fate passes all my next patches. Thanks.
diff mbox

Patch

diff --git a/configure b/configure
index 9b92426..ded5452 100755
--- a/configure
+++ b/configure
@@ -2848,11 +2848,11 @@  matroska_demuxer_select="iso_media riffdec"
 matroska_demuxer_suggest="bzlib lzo zlib"
 matroska_muxer_select="iso_media riffenc"
 mmf_muxer_select="riffenc"
-mov_demuxer_select="iso_media riffdec"
+mov_demuxer_select="iso_media riffdec meta_decoder"
 mov_demuxer_suggest="zlib"
 mov_muxer_select="iso_media riffenc rtpenc_chain"
 mp3_demuxer_select="mpegaudio_parser"
-mp4_muxer_select="mov_muxer"
+mp4_muxer_select="mov_muxer meta_encoder"
 mpegts_demuxer_select="iso_media"
 mpegts_muxer_select="adts_muxer latm_muxer"
 mpegtsraw_demuxer_select="mpegts_demuxer"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a6e79ce..98a7a8d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -799,7 +799,7 @@  OBJS-$(CONFIG_VP9_DXVA2_HWACCEL)          += dxva2_vp9.o
 OBJS-$(CONFIG_VP9_VAAPI_HWACCEL)          += vaapi_vp9.o
 
 # libavformat dependencies
-OBJS-$(CONFIG_ISO_MEDIA)               += mpeg4audio.o mpegaudiodata.o
+OBJS-$(CONFIG_ISO_MEDIA)               += mpeg4audio.o mpegaudiodata.o metacodec.o
 
 OBJS-$(CONFIG_ADTS_MUXER)              += mpeg4audio.o
 OBJS-$(CONFIG_CAF_DEMUXER)             += ac3tab.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 4c6b94e..30d0243 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -687,4 +687,7 @@  void avcodec_register_all(void)
     REGISTER_PARSER(VP3,                vp3);
     REGISTER_PARSER(VP8,                vp8);
     REGISTER_PARSER(VP9,                vp9);
+
+    /* data, meta data */
+    REGISTER_ENCDEC(META,               meta);
 }
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 24948ca..e85b51d 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2965,6 +2965,14 @@  static const AVCodecDescriptor codec_descriptors[] = {
         .mime_types= MT("application/octet-stream"),
     },
 
+    {
+        .id        = AV_CODEC_ID_META,
+        .type      = AVMEDIA_TYPE_DATA,
+        .name      = "meta_data",
+        .long_name = NULL_IF_CONFIG_SMALL("binary data"),
+        .mime_types= MT("application/octet-stream"),
+    },
+
     /* deprecated codec ids */
 };