[FFmpeg-devel] [PATCH] gxf: remove gxf_ prefix to timecode metadata keys.

Clément Bœsch ubitux at gmail.com
Fri Dec 23 00:43:37 CET 2011


On Thu, Dec 15, 2011 at 09:42:18PM +0100, Clément Bœsch wrote:
[...]
> But anyway, I'll send a version with both timecode and gxf_timecode later.
> Note that it will clutter the code a bit for a while since there are 3
> scores.

New patch attached.

-- 
Clément B.
-------------- next part --------------
From d26ec6f1880890f7f417c792cdba3c3a7dea0b14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Thu, 15 Dec 2011 16:19:45 +0100
Subject: [PATCH] gxf: remove gxf_ prefix to timecode metadata keys.

This will allow a shared "timecode" key metadata between formats to ease
third-party extraction.
---
 libavformat/gxf.c     |   18 ++++++++++++++++--
 libavformat/version.h |    5 ++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index 95a8142..15ec1de 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -339,9 +339,14 @@ static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) {
         gxf_track_tags(pb, &track_len, si);
         // check for timecode tracks
         if (track_type == 7 || track_type == 8 || track_type == 24) {
+#if FF_GXF_TIMECODE
             add_timecode_metadata(&s->metadata, "gxf_timecode",
                                   si->track_aux_data & 0xffffffff,
                                   si->fields_per_frame);
+#endif
+            add_timecode_metadata(&s->metadata, "timecode",
+                                  si->track_aux_data & 0xffffffff,
+                                  si->fields_per_frame);
 
         }
         avio_skip(pb, track_len);
@@ -388,12 +393,21 @@ static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) {
             }
 
             if (len >= 0x18) {
+                uint32_t tc_markin, tc_markout;
                 len -= 0x18;
                 avio_skip(pb, 0x10);
+                tc_markin  = avio_rl32(pb);
+                tc_markout = avio_rl32(pb);
+#if FF_GXF_TIMECODE
                 add_timecode_metadata(&s->metadata, "gxf_timecode_at_mark_in",
-                                      avio_rl32(pb), si->fields_per_frame);
+                                      tc_markin, si->fields_per_frame);
                 add_timecode_metadata(&s->metadata, "gxf_timecode_at_mark_out",
-                                      avio_rl32(pb), si->fields_per_frame);
+                                      tc_markout, si->fields_per_frame);
+#endif
+                add_timecode_metadata(&s->metadata, "timecode_at_mark_in",
+                                      tc_markin, si->fields_per_frame);
+                add_timecode_metadata(&s->metadata, "timecode_at_mark_out",
+                                      tc_markout, si->fields_per_frame);
             }
         } else
             av_log(s, AV_LOG_INFO, "UMF packet too short\n");
diff --git a/libavformat/version.h b/libavformat/version.h
index 4c73dbf..b1a4cb3 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 53
 #define LIBAVFORMAT_VERSION_MINOR 28
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
@@ -128,5 +128,8 @@
 #ifndef FF_API_CLOSE_INPUT_FILE
 #define FF_API_CLOSE_INPUT_FILE        (LIBAVFORMAT_VERSION_MAJOR < 54)
 #endif
+#ifndef FF_GXF_TIMECODE
+#define FF_GXF_TIMECODE                (LIBAVFORMAT_VERSION_MAJOR < 54)
+#endif
 
 #endif /* AVFORMAT_VERSION_H */
-- 
1.7.8.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111223/303d21e4/attachment.asc>


More information about the ffmpeg-devel mailing list