On Wed, 23 Jan 2013, Luca Barbato wrote:

From: Gavriloaie Eugen-Andrei <[email protected]>

It is a shortcut to set all the params using x264_param_parse,
makes simpler importing settings from other software using x264.
---

Doc update follows. The patch looks quite useful to me.

libavcodec/libx264.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index e9cbbad..34fe34b 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -70,6 +70,7 @@ typedef struct X264Context {
    int slice_max_size;
    char *stats;
    int nal_hrd;
+    char *x264_params;
} X264Context;

static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -407,6 +408,32 @@ static av_cold int X264_init(AVCodecContext *avctx)
    if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
        x4->params.b_repeat_headers = 0;

+    if (x4->x264_params) {
+        char *params    = NULL;
+        char *keyvalues = NULL;
+        char *param     = NULL;
+        char *key       = NULL;
+        char *value     = NULL;
+
+        param = strtok_r(x4->x264_params, ":", &params);
+        while (param) {
+            param = strtok_r(NULL, ":", &params);

strtok_r is not universally available, either this needs to go behind HAVE_STRTOK_R, or use some other function that does the equivalent.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to