Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
81a91269
Commit
81a91269
authored
Mar 03, 2015
by
Mark Reid
Committed by
Michael Niedermayer
Mar 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavformat/avio: added avio_put_str16be
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6394acaf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
6 deletions
+30
-6
APIchanges
doc/APIchanges
+3
-0
avio.h
libavformat/avio.h
+6
-0
aviobuf.c
libavformat/aviobuf.c
+19
-4
version.h
libavformat/version.h
+2
-2
No files found.
doc/APIchanges
View file @
81a91269
...
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
...
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
API changes, most recent first:
API changes, most recent first:
2015-03-xx - xxxxxxx - lavf 56.24.100
Add avio_put_str16be()
2015-xx-xx - xxxxxxx - lavc 56.13
2015-xx-xx - xxxxxxx - lavc 56.13
Add width, height, coded_width, coded_height and format to
Add width, height, coded_width, coded_height and format to
AVCodecParserContext.
AVCodecParserContext.
...
...
libavformat/avio.h
View file @
81a91269
...
@@ -233,6 +233,12 @@ int avio_put_str(AVIOContext *s, const char *str);
...
@@ -233,6 +233,12 @@ int avio_put_str(AVIOContext *s, const char *str);
*/
*/
int
avio_put_str16le
(
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
* Passing this as the "whence" parameter to a seek function causes it to
* return the filesize without seeking anywhere. Supporting this is optional.
* return the filesize without seeking anywhere. Supporting this is optional.
...
...
libavformat/aviobuf.c
View file @
81a91269
...
@@ -342,7 +342,7 @@ int avio_put_str(AVIOContext *s, const char *str)
...
@@ -342,7 +342,7 @@ int avio_put_str(AVIOContext *s, const char *str)
return
len
;
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
;
const
uint8_t
*
q
=
str
;
int
ret
=
0
;
int
ret
=
0
;
...
@@ -353,12 +353,16 @@ int avio_put_str16le(AVIOContext *s, const char *str)
...
@@ -353,12 +353,16 @@ int avio_put_str16le(AVIOContext *s, const char *str)
uint16_t
tmp
;
uint16_t
tmp
;
GET_UTF8
(
ch
,
*
q
++
,
goto
invalid
;)
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
;
continue
;
invalid:
invalid:
av_log
(
s
,
AV_LOG_ERROR
,
"Invaid UTF8 sequence in avio_put_str16
le
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"Invaid UTF8 sequence in avio_put_str16
%s
\n
"
,
be
?
"be"
:
"le
"
);
err
=
AVERROR
(
EINVAL
);
err
=
AVERROR
(
EINVAL
);
}
}
if
(
be
)
avio_wb16
(
s
,
0
);
else
avio_wl16
(
s
,
0
);
avio_wl16
(
s
,
0
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
...
@@ -366,6 +370,17 @@ invalid:
...
@@ -366,6 +370,17 @@ invalid:
return
ret
;
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
ff_get_v_length
(
uint64_t
val
)
{
{
int
i
=
1
;
int
i
=
1
;
...
...
libavformat/version.h
View file @
81a91269
...
@@ -30,8 +30,8 @@
...
@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 2
3
#define LIBAVFORMAT_VERSION_MINOR 2
4
#define LIBAVFORMAT_VERSION_MICRO 10
6
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment