---
libavdevice/bktr.c | 2 ++
libavdevice/libdc1394.c | 2 ++
libavdevice/v4l.c | 2 ++
libavdevice/v4l2.c | 2 ++
libavdevice/vfwcap.c | 2 ++
libavdevice/x11grab.c | 2 ++
libavformat/avformat.h | 4 ++--
libavformat/img2.c | 2 ++
libavformat/rawdec.c | 2 ++
9 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index e0fa8da..6d49024 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -252,10 +252,12 @@ static int grab_read_header(AVFormatContext *s1,
AVFormatParameters *ap)
if (ap->time_base.den <= 0)
return -1;
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
s->width = ap->width;
if (ap->height > 0)
s->height = ap->height;
+#endif
if (s->height <= 0 || s->width <= 0) {
av_log(s1, AV_LOG_ERROR, "Invalid width/height: %dx%d", s->width,
s->height);
return AVERROR(EINVAL);
diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index 514087d..f0a7d25 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -102,10 +102,12 @@ static inline int dc1394_read_common(AVFormatContext *c,
AVFormatParameters *ap,
enum PixelFormat pix_fmt = ap->pix_fmt == PIX_FMT_NONE ? PIX_FMT_UYVY422 :
ap->pix_fmt; /* defaults */
int frame_rate = !ap->time_base.num ? 30000 : av_rescale(1000,
ap->time_base.den, ap->time_base.num);
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
dc1394->width = ap->width;
if (ap->height > 0)
dc1394->height = ap->height;
+#endif
for (fmt = dc1394_frame_formats; fmt->width; fmt++)
if (fmt->pix_fmt == pix_fmt && fmt->width == dc1394->width &&
fmt->height == dc1394->height)
diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c
index f88885c..f946bb3 100644
--- a/libavdevice/v4l.c
+++ b/libavdevice/v4l.c
@@ -89,10 +89,12 @@ static int grab_read_header(AVFormatContext *s1,
AVFormatParameters *ap)
}
s->time_base = ap->time_base;
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
s->video_win.width = ap->width;
if (ap->height > 0)
s->video_win.height = ap->height;
+#endif
st = av_new_stream(s1, 0);
if (!st)
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index d7aebe2..4e0b499 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -587,10 +587,12 @@ static int v4l2_read_header(AVFormatContext *s1,
AVFormatParameters *ap)
}
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
s->width = ap->width;
if (ap->height > 0)
s->height = ap->height;
+#endif
capabilities = 0;
s->fd = device_open(s1, &capabilities);
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
index a245d0e..5734176 100644
--- a/libavdevice/vfwcap.c
+++ b/libavdevice/vfwcap.c
@@ -320,10 +320,12 @@ static int vfw_read_header(AVFormatContext *s,
AVFormatParameters *ap)
dump_bih(s, &bi->bmiHeader);
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
ctx->width = ap->width;
if (ap->height > 0)
ctx->height = ap->height;
+#endif
if (ctx->width > 0)
bi->bmiHeader.biWidth = ctx->width ;
if (ctx->height > 0)
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index cb643d8..d48478b 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -103,10 +103,12 @@ x11grab_read_header(AVFormatContext *s1,
AVFormatParameters *ap)
*offset= 0;
}
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
x11grab->width = ap->width;
if (ap->height > 0)
x11grab->height = ap->height;
+#endif
av_log(s1, AV_LOG_INFO, "device: %s -> display: %s x: %d y: %d width: %d
height: %d\n", s1->filename, param, x_off, y_off, x11grab->width,
x11grab->height);
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 11dbe8b..434baa9 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -231,9 +231,9 @@ typedef struct AVFormatParameters {
#if FF_API_FORMAT_PARAMETERS
attribute_deprecated int sample_rate;
attribute_deprecated int channels;
+ attribute_deprecated int width;
+ attribute_deprecated int height;
#endif
- int width;
- int height;
enum PixelFormat pix_fmt;
#if FF_API_FORMAT_PARAMETERS
attribute_deprecated int channel; /**< Used to select DV channel. */
diff --git a/libavformat/img2.c b/libavformat/img2.c
index 1d50fbf..77d7c65 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -226,10 +226,12 @@ static int read_header(AVFormatContext *s1,
AVFormatParameters *ap)
av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den);
}
+#if FF_API_FORMAT_PARAMETERS
if(ap->width && ap->height){
st->codec->width = ap->width;
st->codec->height= ap->height;
}
+#endif
if (!s->is_pipe) {
if (find_image_range(&first_index, &last_index, s->path) < 0)
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 329985d..dd7230f 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -72,10 +72,12 @@ int ff_raw_read_header(AVFormatContext *s,
AVFormatParameters *ap)
av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
else
av_set_pts_info(st, 64, 1, 25);
+#if FF_API_FORMAT_PARAMETERS
if (ap->width > 0)
s1->width = ap->width;
if (ap->height > 0)
s1->height = ap->height;
+#endif
st->codec->width = s1->width;
st->codec->height = s1->height;
st->codec->pix_fmt = ap->pix_fmt;
--
1.7.5.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel