From 26b3fde6a78f711ba510573eacbc92671a923b2d Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 7 Oct 2012 21:19:29 +0000 Subject: [PATCH 1/3] doc: update the faq entry about custom I/O URLProtocols are private and custom AVIOContexts are a simple and easier solution for most of the situations. --- doc/faq.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/faq.texi b/doc/faq.texi index ac06ebffcd..088ca03cc6 100644 --- a/doc/faq.texi +++ b/doc/faq.texi @@ -336,8 +336,8 @@ to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS @section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat? -You have to implement a URLProtocol, see @file{libavformat/file.c} in -Libav and @file{libmpdemux/demux_lavf.c} in MPlayer sources. +You have to create a custom AVIOContext using @code{avio_alloc_context}, +see @file{libavformat/aviobuf.c} in Libav and @file{libmpdemux/demux_lavf.c} in MPlayer2 sources. @section Why is @code{make fate} not running all tests? From 1093383d6cf7112d54b849e29c739e957d157b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 11 Oct 2012 14:30:23 +0300 Subject: [PATCH 2/3] random_seed: Support using CryptGenRandom on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- configure | 2 ++ libavutil/random_seed.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/configure b/configure index 17f38ec875..67f88eb0fd 100755 --- a/configure +++ b/configure @@ -1139,6 +1139,7 @@ HAVE_LIST=" closesocket cmov cpunop + CryptGenRandom dcbzl dev_bktr_ioctl_bt848_h dev_bktr_ioctl_meteor_h @@ -3202,6 +3203,7 @@ check_func sysctl check_func usleep check_func_headers io.h setmode check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32 +check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32 check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi check_func_headers windows.h GetProcessAffinityMask check_func_headers windows.h GetProcessTimes diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 8ee4cb716e..ec9caa74b7 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -23,6 +23,10 @@ #if HAVE_UNISTD_H #include #endif +#if HAVE_CRYPTGENRANDOM +#include +#include +#endif #include #include #include @@ -82,6 +86,17 @@ uint32_t av_get_random_seed(void) { uint32_t seed; +#if HAVE_CRYPTGENRANDOM + HCRYPTPROV provider; + if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { + BOOL ret = CryptGenRandom(provider, sizeof(seed), (PBYTE) &seed); + CryptReleaseContext(provider, 0); + if (ret) + return seed; + } +#endif + if (read_random(&seed, "/dev/urandom") == sizeof(seed)) return seed; if (read_random(&seed, "/dev/random") == sizeof(seed)) From 0a75d1da23b8659ec49391469bb592da12760077 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 8 Oct 2012 13:04:39 +0200 Subject: [PATCH 3/3] options_table: refs option is not snow-only --- libavcodec/options_table.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 4b6d4177da..9e9de46014 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -347,7 +347,7 @@ static const AVOption options[]={ {"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, 4, V|E}, {"brd_scale", "downscales frames for dynamic B-frame decision", OFFSET(brd_scale), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, 10, V|E}, {"keyint_min", "minimum interval between IDR-frames (x264)", OFFSET(keyint_min), AV_OPT_TYPE_INT, {.i64 = 25 }, INT_MIN, INT_MAX, V|E}, -{"refs", "reference frames to consider for motion compensation (Snow)", OFFSET(refs), AV_OPT_TYPE_INT, {.i64 = 1 }, INT_MIN, INT_MAX, V|E}, +{"refs", "reference frames to consider for motion compensation", OFFSET(refs), AV_OPT_TYPE_INT, {.i64 = 1 }, INT_MIN, INT_MAX, V|E}, {"chromaoffset", "chroma qp offset from luma", OFFSET(chromaoffset), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"trellis", "rate-distortion optimal quantization", OFFSET(trellis), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, #if FF_API_MPV_GLOBAL_OPTS