Commit 56412e0a authored by Kyle Robbertze's avatar Kyle Robbertze

New upstream version 0.4.1

parent 56c87312
0.4.1 (27-06-2019)
=====
* Fix memory leak in `RGBA32.of_RGB24_string`.
* Add `YUV420.of_string`.
0.4.0 (18-08-2018)
=====
* Use bytes instead of strings whenever appropriate.
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ocaml-mm 0.4.0.
# Generated by GNU Autoconf 2.69 for ocaml-mm 0.4.1.
#
# Report bugs to <savonet-users@lists.sourceforge.net>.
#
......@@ -640,8 +640,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ocaml-mm'
PACKAGE_TARNAME='ocaml-mm'
PACKAGE_VERSION='0.4.0'
PACKAGE_STRING='ocaml-mm 0.4.0'
PACKAGE_VERSION='0.4.1'
PACKAGE_STRING='ocaml-mm 0.4.1'
PACKAGE_BUGREPORT='savonet-users@lists.sourceforge.net'
PACKAGE_URL=''
......@@ -828,7 +828,6 @@ enable_oss
enable_ffmpeg
enable_v4l
with_bytes_dir
enable_bytes_dynamic_plugin
'
ac_precious_vars='build_alias
host_alias
......@@ -1390,7 +1389,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ocaml-mm 0.4.0 to adapt to many kinds of systems.
\`configure' configures ocaml-mm 0.4.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1456,7 +1455,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ocaml-mm 0.4.0:";;
short | recursive ) echo "Configuration of ocaml-mm 0.4.1:";;
esac
cat <<\_ACEOF
......@@ -1478,8 +1477,6 @@ Optional Features:
--disable-oss "don't use OSS"
--disable-ffmpeg "don't use FFmpeg"
--disable-v4l "don't use video4linux"
--enable-bytes-dynamic-plugin
Compile bytes as an optional dynamic plugin.
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
......@@ -1584,7 +1581,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ocaml-mm configure 0.4.0
ocaml-mm configure 0.4.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1953,7 +1950,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ocaml-mm $as_me 0.4.0, which was
It was created by ocaml-mm $as_me 0.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -6910,12 +6907,6 @@ if test "${with_bytes_dir+set}" = set; then :
fi
# Check whether --enable-bytes-dynamic-plugin was given.
if test "${enable_bytes_dynamic_plugin+set}" = set; then :
enableval=$enable_bytes_dynamic_plugin;
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ocaml bytes module" >&5
......@@ -6924,11 +6915,6 @@ $as_echo_n "checking for ocaml bytes module... " >&6; }
OCAML_CHECK="${OCAMLFIND} query bytes"
if test "x$enable_bytes_dynamic_plugin" = "xyes" ; then
BYTES_SHARED="yes"
PLUGINS="$PLUGINS bytes"
fi
DEPS_CHECK=yes
for i in ; do
......@@ -6967,14 +6953,9 @@ fi
if test -z "${VERSION_OK}"; then
as_fn_error $? "requires version >= found ${BYTES_version}." "$LINENO" 5
else
if test -z "${BYTES_SHARED}"; then
BYTES_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINDING_PKGS 2>/dev/null`"
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} ${BYTES_PACKAGES}"
W_BYTES=yes
else
bytes_packages="`${OCAMLFIND} query -r -separator " " -format "%p" $BINDING_PKGS 2>/dev/null`"
W_BYTES=bytes
fi
BYTES_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINDING_PKGS 2>/dev/null`"
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} ${BYTES_PACKAGES}"
W_BYTES=yes
LIBS_VERSIONS="${LIBS_VERSIONS} bytes=$BYTES_version"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
......@@ -7021,11 +7002,7 @@ fi
BYTES_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINGING_PKGS 2>/dev/null`"
echo ${with_bytes_dir} | grep ^/ > /dev/null 2>&1 \
|| with_bytes_dir=${PWD}/${with_bytes_dir}
if test -z "${BYTES_SHARED}"; then
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} -I ${with_bytes_dir} ${BYTES_PACKAGES}"
else
bytes_ocamlcflags="-I ${with_bytes_dir} ${BYTES_PACKAGES}"
fi
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} -I ${with_bytes_dir} ${BYTES_PACKAGES}"
# We need to recurse here because
# some package may not be registered using ocamlfind
if test -n ""; then
......@@ -7036,13 +7013,8 @@ fi
for i in ${BYTES_requires}; do
BYTES_PACKAGES="${BYTES_PACKAGES} `${OCAMLFIND} query -separator " " -format "-package %p" $i 2>/dev/null`"
done
if test -z "${BYTES_SHARED}"; then
liquidsoap_ocamllflags="${liquidsoap_ocamllflags} ${BYTES_PACKAGES} ${BYTES_CMA}"
W_BYTES=yes
else
bytes_ocamllflags="${BYTES_PACKAGES} ${BYTES_CMA}"
W_BYTES=bytes
fi
liquidsoap_ocamllflags="${liquidsoap_ocamllflags} ${BYTES_PACKAGES} ${BYTES_CMA}"
W_BYTES=yes
LIBS_VERSIONS="${LIBS_VERSIONS} bytes=$BYTES_version"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
......@@ -7054,15 +7026,7 @@ fi
if test -z "${W_BYTES}" ; then
w_BYTES="no (requires bytes)"
else
if test -z "${BYTES_SHARED}"; then
w_BYTES=yes
else
PLUGINS_DATA="$PLUGINS_DATA
bytes_ocamlcflags=${bytes_ocamlcflags}
bytes_ocamllflags=${bytes_ocamllflags}
bytes_packages=${bytes_packages}"
w_BYTES=plugin
fi
w_BYTES=yes
fi
INCDIRS="$INCDIRS `$OCAMLFIND query bytes`"
......@@ -7588,7 +7552,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ocaml-mm $as_me 0.4.0, which was
This file was extended by ocaml-mm $as_me 0.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -7650,7 +7614,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ocaml-mm config.status 0.4.0
ocaml-mm config.status 0.4.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_INIT([ocaml-mm],[0.4.0],[savonet-users@lists.sourceforge.net])
AC_INIT([ocaml-mm],[0.4.1],[savonet-users@lists.sourceforge.net])
VERSION=$PACKAGE_VERSION
AC_MSG_RESULT(configuring $PACKAGE_STRING)
......
......@@ -5,7 +5,7 @@ endif
ifeq "no" "yes"
LIBS += ao
endif
ifeq "yes" "yes"
ifeq "no" "yes"
LIBS += ffmpeg
endif
ifeq "no" "yes"
......
......@@ -58,7 +58,7 @@ object (self)
(fun n ->
let s = Bytes.create n in
let n = self#stream_read s 0 n in
s, n)
Bytes.to_string s, n)
in
let _, c, _ = Mad.get_output_format f in
(* TODO: we should decode a frame in order to get the real number of
......@@ -94,7 +94,7 @@ object (self)
end
class reader_of_file fname =
object (self)
object
inherit IO.Unix.rw ~read:true fname
inherit reader
end
......@@ -83,7 +83,7 @@ object (self)
let s = Bytes.create slen in
let r = self#stream_read s 0 slen in
let len = Audio.S16LE.duration channels r in
Audio.S16LE.to_audio s 0 buf ofs len;
Audio.S16LE.to_audio (Bytes.to_string s) 0 buf ofs len;
len
method seek (n:int) : unit = assert false
......
......@@ -34,8 +34,6 @@
let init () =
Sdl.init [`VIDEO]
module I = Image.RGBA32
(*
(** 8bit surfaces always use a palette *)
let from_8 surface =
......@@ -172,7 +170,7 @@ let from_32 surface =
*)
class writer_to_screen w h =
object (self)
object
initializer
Sdlevent.enable_events Sdlevent.quit_mask;
(* Try to get 32bpp because it's faster (twice as fast here), but accept
......@@ -223,7 +221,7 @@ class midi_keyboard : MIDI.IO.Reader.t =
| Not_found ->
array_index knotes1 c + 59
in
object (self)
object
initializer
Sdl.init [`EVENTTHREAD; `VIDEO];
Sdlevent.disable_events (Sdlevent.all_events_mask);
......@@ -236,7 +234,7 @@ object (self)
val channel = 0
method read sr buf ofs len =
method read _ buf ofs len =
MIDI.Multitrack.clear buf ofs len;
Sdlevent.pump ();
while Sdlevent.has_event () do
......
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2018-03-11.20; # UTC
scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
......@@ -271,18 +271,15 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
......@@ -291,11 +288,6 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
......@@ -332,16 +324,14 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
......@@ -444,8 +434,8 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
......@@ -510,9 +500,9 @@ do
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
......@@ -26,13 +26,6 @@ done])
m4_defun([AC_MSG_RESULT_NOT],
[ifelse([$1],[],[AC_MSG_RESULT($2)],[AC_MSG_ERROR($2)])])
m4_defun([AC_COND_PLUGIN],
[ifelse([$1],[],
[AC_ARG_ENABLE([$2-dynamic-plugin],
AC_HELP_STRING(
[--enable-$2-dynamic-plugin],
[Compile $2 as an optional dynamic plugin.]))])])
AC_DEFUN([AC_CHECK_OCAML_BINDING],[dnl
m4_define([BINDING],[m4_translit([$1],['a-z.-'],['A-Z__'])])
......@@ -43,8 +36,7 @@ dnl $2 = PKG_VERSION
dnl $3 = PKG_DEPS
dnl $4 = PKG_MANDATORY
dnl $5 = PKG_USED (for instance sdl.mixer au lieu of sdl. Should only be used for bindings not provided by us..)
dnl $6 = DYNAMIC_PLUGIN
dnl $7 = PKG_CMA (used for duppy.syntax and flac.ogg when locally compiled..)
dnl $6 = PKG_CMA (used for duppy.syntax and flac.ogg when locally compiled..)
if test -n "$5"; then
BINDING_PKGS="$5"
......@@ -57,8 +49,6 @@ AC_ARG_WITH([binding()-dir],
[--with-binding()-dir=path],
[look for ocaml-binding() library in "path" (autodetected by default)]))
AC_COND_PLUGIN([$6],[$1])
dnl Version stuff
m4_define([VERSION_CHECK],[ifelse([$2],[],[],[ >= $2])])
......@@ -68,27 +58,12 @@ OCAML_CHECK="${OCAMLFIND} query $1"
dnl This (horrible) macro does the following:
dnl Detect optional binding
dnl If builtin and provided by ocamlfind,
dnl If provided by ocamlfind,
dnl fills liquidsoap_ocamlcflags with "-package deps" for
dnl each dependency
dnl If builtin and provided by us, fills
dnl If provided by us, fills
dnl liquidsoap_ocamlcflags with "-I /path/to/ocaml-foo/src"
dnl and liquidsoap_ocamllfflags with "foo.cmxa"
dnl If plugin and provided by ocamlfind,
dnl fills plugin_packages with "deps"
dnl If plugin and provided by us, fills
dnl plugin_ocamlcflags with "-I /path/to/ocaml-foo/src"
dnl and plugin_ocamllflags with "foo.cmxa"
dnl Ultimately, plugin_ocamlcflags and plugin_ocamllflags
dnl are added to the global $PLUGINS_DATA variable and
dnl $PLUGINS is updated with the name of this plugin.
dnl W_plugin is set to "yes" for builtin compilation
dnl and "binding" for plugin compilation.
if test "x$enable_[]binding()_dynamic_plugin" = "xyes" ; then
BINDING()_SHARED="yes"
PLUGINS="$PLUGINS binding()"
fi
AC_OCAML_CHECK_DEPS([$3])
if test -z $DEPS_CHECK; then
......@@ -103,14 +78,9 @@ else
if test -z "${VERSION_OK}"; then
AC_MSG_RESULT_NOT([$4],[requires version >= $2 found ${[]BINDING()_version}.])
else
if test -z "${[]BINDING()_SHARED}"; then
BINDING()_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINDING_PKGS 2>/dev/null`"
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} ${[]BINDING()_PACKAGES}"
W_[]BINDING()=yes
else
[]binding()_packages="`${OCAMLFIND} query -r -separator " " -format "%p" $BINDING_PKGS 2>/dev/null`"
W_[]BINDING()=[]binding()
fi
BINDING()_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINDING_PKGS 2>/dev/null`"
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} ${[]BINDING()_PACKAGES}"
W_[]BINDING()=yes
LIBS_VERSIONS="${LIBS_VERSIONS} $1=$[]BINDING()_version"
AC_MSG_RESULT(ok)
fi
......@@ -140,28 +110,19 @@ else
BINDING()_PACKAGES="`${OCAMLFIND} query -separator " " -format "-package %p" $BINGING_PKGS 2>/dev/null`"
echo ${with_[]binding()_dir} | grep ^/ > /dev/null 2>&1 \
|| with_[]binding()_dir=${PWD}/${with_[]binding()_dir}
if test -z "${[]BINDING()_SHARED}"; then
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} -I ${with_[]binding()_dir} ${[]BINDING()_PACKAGES}"
else
[]binding()_ocamlcflags="-I ${with_[]binding()_dir} ${[]BINDING()_PACKAGES}"
fi
liquidsoap_ocamlcflags="${liquidsoap_ocamlcflags} -I ${with_[]binding()_dir} ${[]BINDING()_PACKAGES}"
# We need to recurse here because
# some package may not be registered using ocamlfind
if test -n "$7"; then
BINDING()_CMA=$7.${cma}
if test -n "$6"; then
BINDING()_CMA=$6.${cma}
else
BINDING()_CMA=$1.${cma}
fi
for i in ${[]BINDING()_requires}; do
BINDING()_PACKAGES="${[]BINDING()_PACKAGES} `${OCAMLFIND} query -separator " " -format "-package %p" $i 2>/dev/null`"
done
if test -z "${[]BINDING()_SHARED}"; then
liquidsoap_ocamllflags="${liquidsoap_ocamllflags} ${[]BINDING()_PACKAGES} ${[]BINDING()_CMA}"
W_[]BINDING()=yes
else
[]binding()_ocamllflags="${[]BINDING()_PACKAGES} ${[]BINDING()_CMA}"
W_[]BINDING()=[]binding()
fi
liquidsoap_ocamllflags="${liquidsoap_ocamllflags} ${[]BINDING()_PACKAGES} ${[]BINDING()_CMA}"
W_[]BINDING()=yes
LIBS_VERSIONS="${LIBS_VERSIONS} $1=$[]BINDING()_version"
AC_MSG_RESULT(ok)
fi
......@@ -172,15 +133,7 @@ AC_SUBST(W_[]BINDING())
if test -z "${W_[]BINDING()}" ; then
w_[]BINDING()="no (requires $1)"
else
if test -z "${[]BINDING()_SHARED}"; then
w_[]BINDING()=yes
else
PLUGINS_DATA="$PLUGINS_DATA
[]binding()_ocamlcflags=${[]binding()_ocamlcflags}
[]binding()_ocamllflags=${[]binding()_ocamllflags}
[]binding()_packages=${[]binding()_packages}"
w_[]BINDING()=plugin
fi
w_[]BINDING()=yes
fi])
......@@ -104,7 +104,6 @@ module Gray8 = struct
end
end
module YUV420 = struct
(* TODO: also store width and height? *)
type data = (int, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
......@@ -140,6 +139,15 @@ module YUV420 = struct
let (_,v) = create_rounded_plane (h/2) (w/2) in
make w h y ys u v uvs
external of_string : t -> string -> unit = "caml_yuv_of_string"
let of_string s width =
let pixels = String.length s * 4 / 6 in
let height = pixels / width in
let img = create width height in
of_string img s;
img
external blank : data -> unit = "caml_yuv_blank"
let blank_all x =
......
......@@ -62,10 +62,13 @@ module YUV420 : sig
(** Create an image of given width and height. *)
val create : int -> int -> t
val of_string : string -> int -> t
(** Clear an image (sets it to black). *)
val blank_all : t -> unit
val make : int -> int -> data -> int -> data -> data -> int -> t
val internal : t -> (data * int) * (data * data * int)
end
......@@ -283,6 +286,8 @@ module Generic : sig
(** Create a generic image from an RGBA32 image. *)
val of_RGBA32 : RGBA32.t -> t
val to_RGBA32 : t -> RGBA32.t
(** Create a generic image from a YUV420 image. *)
val of_YUV420 : YUV420.t -> t
......
......@@ -463,12 +463,13 @@ void RGB_to_YUV420(frame *rgb,
CAMLprim value caml_rgb_of_YUV420(value yuv, value dst)
{
CAMLparam2(yuv,dst);
CAMLlocal2(y_val,uv_val);
frame rgb;
frame_of_value(dst, &rgb);
value y_val = Field(yuv, 0);
y_val = Field(yuv, 0);
unsigned char *y = Caml_ba_data_val(Field(y_val, 0));
int y_stride = Int_val(Field(y_val, 1));
value uv_val = Field(yuv, 1);
uv_val = Field(yuv, 1);
unsigned char *u = Caml_ba_data_val(Field(uv_val, 0));
unsigned char *v = Caml_ba_data_val(Field(uv_val, 1));
int uv_stride = Int_val(Field(uv_val, 2));
......@@ -481,6 +482,41 @@ CAMLprim value caml_rgb_of_YUV420(value yuv, value dst)
CAMLreturn(Val_unit);
}
CAMLprim value caml_yuv_of_string(value yuv, value s)
{
CAMLparam2(yuv, s);
CAMLlocal1(tmp);
tmp = Field(yuv,0);
int width = Int_val(Field(yuv,1));
int height = Int_val(Field(yuv,2));
unsigned char *y = Caml_ba_data_val(Field(Field(tmp,0),0));
int y_stride = Int_val(Field(Field(tmp,0),1));
tmp = Field(tmp,1);
unsigned char *u = Caml_ba_data_val(Field(tmp,0));
unsigned char *v = Caml_ba_data_val(Field(tmp,1));
int uv_stride = Int_val(Field(tmp,2));
int datalen = width*height*6/4;
unsigned char *data = (unsigned char*)memalign(ALIGNMENT_BYTES, datalen);
if (data == NULL) caml_raise_out_of_memory();
memcpy(data, String_val(s), datalen);
int i, j;
caml_enter_blocking_section();
for (i = 0; i < height; i++)
memcpy(y+i*y_stride, data+i*width, width);
for (i = 0; i < height/2; i++) {
memcpy(u+i*uv_stride, data+datalen*4/6+i*width/2, width/2);
memcpy(v+i*uv_stride, data+datalen*5/6+i*width/2, width/2);
}
caml_leave_blocking_section();
free(data);
CAMLreturn(Val_unit);
}
CAMLprim value caml_yuv_blank(value f)
{
CAMLparam1(f);
......@@ -495,9 +531,10 @@ CAMLprim value caml_yuv_blank(value f)
CAMLprim value caml_rgb_to_YUV420(value f, value yuv)
{
CAMLparam2(f,yuv);
CAMLlocal1(tmp);
frame rgb;
frame_of_value(f, &rgb);
value tmp = Field(yuv, 0);
tmp = Field(yuv, 0);
unsigned char *y = Caml_ba_data_val(Field(tmp,0));
tmp = Field(yuv,1);
unsigned char *u = Caml_ba_data_val(Field(tmp,0));
......@@ -555,6 +592,8 @@ CAMLprim value caml_rgb_of_rgb8_string(value _rgb, value _data)
}
caml_leave_blocking_section();
free(data);
CAMLreturn(Val_unit);
}
......@@ -1003,7 +1042,7 @@ CAMLprim value caml_rgba_swap_rb(value _rgba)
CAMLreturn(Val_unit);
}
CAMLprim value caml_rgb_add(value _dst, value _src)
CAMLprim value caml_rgb_add(value _src, value _dst)
{
CAMLparam2(_src,_dst);
frame src,dst;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment