Re: [FFmpeg-devel] [PATCH v3 1/2] libavformat/avio: added avio_put_str16be

2015-03-03 Thread Michael Niedermayer
On Mon, Mar 02, 2015 at 08:06:13PM -0800, Mark Reid wrote:
 ---
  doc/APIchanges|  3 +++
  libavformat/avio.h|  6 ++
  libavformat/aviobuf.c | 23 +++
  libavformat/version.h |  4 ++--
  4 files changed, 30 insertions(+), 6 deletions(-)

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/2] libavformat/avio: added avio_put_str16be

2015-03-03 Thread Mark Reid
On Tue, Mar 3, 2015 at 9:25 AM, Michael Niedermayer michae...@gmx.at
wrote:

 On Mon, Mar 02, 2015 at 08:06:13PM -0800, Mark Reid wrote:
  ---
   doc/APIchanges|  3 +++
   libavformat/avio.h|  6 ++
   libavformat/aviobuf.c | 23 +++
   libavformat/version.h |  4 ++--
   4 files changed, 30 insertions(+), 6 deletions(-)

 applied

 thanks

 [...]
 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 Those who are best at talking, realize last or never when they are wrong.

 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


I'll need to resend part 2 of this patch series to update a regression test
because this recent commit
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=618021ea58cda5ce294efa53ce5a69ce27420ef8
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 1/2] libavformat/avio: added avio_put_str16be

2015-03-02 Thread Mark Reid
---
 doc/APIchanges|  3 +++
 libavformat/avio.h|  6 ++
 libavformat/aviobuf.c | 23 +++
 libavformat/version.h |  4 ++--
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 5fdfc82..6875aed 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2015-03-xx - xxx - lavf 56.24.100
+  Add avio_put_str16be()
+
 2015-xx-xx - xxx - lavc 56.13
   Add width, height, coded_width, coded_height and format to
   AVCodecParserContext.
diff --git a/libavformat/avio.h b/libavformat/avio.h
index b9b4017..8fc7e27 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -234,6 +234,12 @@ int avio_put_str(AVIOContext *s, const char *str);
 int avio_put_str16le(AVIOContext *s, const char *str);
 
 /**
+ * Convert an UTF-8 string to UTF-16BE and write it.
+ * @return number of bytes written.
+ */
+int avio_put_str16be(AVIOContext *s, const char *str);
+
+/**
  * Passing this as the whence parameter to a seek function causes it to
  * return the filesize without seeking anywhere. Supporting this is optional.
  * If it is not supported then the seek function will return 0.
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 8fd0466..537c11f 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -342,7 +342,7 @@ int avio_put_str(AVIOContext *s, const char *str)
 return len;
 }
 
-int avio_put_str16le(AVIOContext *s, const char *str)
+static inline int put_str16(AVIOContext *s, const char *str, const int be)
 {
 const uint8_t *q = str;
 int ret = 0;
@@ -353,19 +353,34 @@ int avio_put_str16le(AVIOContext *s, const char *str)
 uint16_t tmp;
 
 GET_UTF8(ch, *q++, goto invalid;)
-PUT_UTF16(ch, tmp, avio_wl16(s, tmp); ret += 2;)
+PUT_UTF16(ch, tmp, be ? avio_wb16(s, tmp) : avio_wl16(s, tmp);
+  ret += 2;)
 continue;
 invalid:
-av_log(s, AV_LOG_ERROR, Invaid UTF8 sequence in avio_put_str16le\n);
+av_log(s, AV_LOG_ERROR, Invaid UTF8 sequence in avio_put_str16%s\n, 
be ? be : le);
 err = AVERROR(EINVAL);
 }
-avio_wl16(s, 0);
+if (be)
+avio_wb16(s, 0);
+else
+avio_wl16(s, 0);
 if (err)
 return err;
 ret += 2;
 return ret;
 }
 
+#define PUT_STR16(type, big_endian)  \
+int avio_put_str16 ## type(AVIOContext *s, const char *str)  \
+{\
+return put_str16(s, str, big_endian);\
+}
+
+PUT_STR16(le, 0)
+PUT_STR16(be, 1)
+
+#undef PUT_STR16
+
 int ff_get_v_length(uint64_t val)
 {
 int i = 1;
diff --git a/libavformat/version.h b/libavformat/version.h
index 248cd3c..08ab50b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include libavutil/version.h
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR  23
-#define LIBAVFORMAT_VERSION_MICRO 106
+#define LIBAVFORMAT_VERSION_MINOR  24
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
2.2.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel