From c9ff32215b433d505f251c1f212b1fa0a5e17b73 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sat, 1 Dec 2012 01:07:24 +0100 Subject: lavu/opt: allow to set sample and pixel format with av_opt_set_int() This change requires the user to specify min and max value, and makes possible to prevent the user to set AV_{SAMPLE,PIX}_FMT_NONE if forbidden. Add required ifdeffery in case of mixed libraries, when libavutil is updated but not the other libraries. This is a followup of 08d0969c1402ccec4dce44bd430128fb59d7b790. --- libavdevice/dshow.c | 2 +- libavdevice/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libavdevice') diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 26a4f15086..ea01b2a30f 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1018,7 +1018,7 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt) #define DEC AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { { "video_size", "set video size given a string such as 640x480 or hd720.", OFFSET(requested_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, - { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, 0, 0, DEC }, + { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_NONE}, -1, AV_PIX_FMT_NB-1, DEC }, { "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "sample_rate", "set audio sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC }, { "sample_size", "set audio sample size", OFFSET(sample_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 16, DEC }, diff --git a/libavdevice/version.h b/libavdevice/version.h index d5d5da5123..5eed4f5e1a 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -29,7 +29,7 @@ #define LIBAVDEVICE_VERSION_MAJOR 54 #define LIBAVDEVICE_VERSION_MINOR 3 -#define LIBAVDEVICE_VERSION_MICRO 101 +#define LIBAVDEVICE_VERSION_MICRO 102 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ LIBAVDEVICE_VERSION_MINOR, \ -- cgit v1.2.3