[FFmpeg-devel] [PATCH] lavd/v4l2: don't use avpriv_ prefix for internal functions
James Almer
jamrial at gmail.com
Tue Oct 21 08:56:06 CEST 2014
No need to keep the old symbols around until a major bump since lavd functions
with the avpriv_ prefix were never exposed.
Signed-off-by: James Almer <jamrial at gmail.com>
---
"avpriv_*;" can be added to libavdevice.v after this patch, but personally I'd say
to wait until it's needed rather than adding it right now.
libavdevice/v4l2-common.c | 30 +++++++++++++++---------------
libavdevice/v4l2-common.h | 8 ++++----
libavdevice/v4l2.c | 20 ++++++++++----------
libavdevice/v4l2enc.c | 2 +-
4 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index c4c75d7..966b9a1 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -18,7 +18,7 @@
#include "v4l2-common.h"
-const struct fmt_map avpriv_fmt_conversion_table[] = {
+const struct fmt_map ff_fmt_conversion_table[] = {
//ff_fmt codec_id v4l2_fmt
{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 },
{ AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 },
@@ -58,43 +58,43 @@ const struct fmt_map avpriv_fmt_conversion_table[] = {
{ AV_PIX_FMT_NONE, AV_CODEC_ID_NONE, 0 },
};
-uint32_t avpriv_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
+uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
{
int i;
- for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
+ for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
if ((codec_id == AV_CODEC_ID_NONE ||
- avpriv_fmt_conversion_table[i].codec_id == codec_id) &&
+ ff_fmt_conversion_table[i].codec_id == codec_id) &&
(pix_fmt == AV_PIX_FMT_NONE ||
- avpriv_fmt_conversion_table[i].ff_fmt == pix_fmt)) {
- return avpriv_fmt_conversion_table[i].v4l2_fmt;
+ ff_fmt_conversion_table[i].ff_fmt == pix_fmt)) {
+ return ff_fmt_conversion_table[i].v4l2_fmt;
}
}
return 0;
}
-enum AVPixelFormat avpriv_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)
+enum AVPixelFormat ff_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)
{
int i;
- for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
- if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt &&
- avpriv_fmt_conversion_table[i].codec_id == codec_id) {
- return avpriv_fmt_conversion_table[i].ff_fmt;
+ for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
+ if (ff_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt &&
+ ff_fmt_conversion_table[i].codec_id == codec_id) {
+ return ff_fmt_conversion_table[i].ff_fmt;
}
}
return AV_PIX_FMT_NONE;
}
-enum AVCodecID avpriv_fmt_v4l2codec(uint32_t v4l2_fmt)
+enum AVCodecID ff_fmt_v4l2codec(uint32_t v4l2_fmt)
{
int i;
- for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
- if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) {
- return avpriv_fmt_conversion_table[i].codec_id;
+ for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
+ if (ff_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) {
+ return ff_fmt_conversion_table[i].codec_id;
}
}
diff --git a/libavdevice/v4l2-common.h b/libavdevice/v4l2-common.h
index 8aef234..40c7164 100644
--- a/libavdevice/v4l2-common.h
+++ b/libavdevice/v4l2-common.h
@@ -53,10 +53,10 @@ struct fmt_map {
uint32_t v4l2_fmt;
};
-extern av_export const struct fmt_map avpriv_fmt_conversion_table[];
+extern const struct fmt_map ff_fmt_conversion_table[];
-uint32_t avpriv_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id);
-enum AVPixelFormat avpriv_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id);
-enum AVCodecID avpriv_fmt_v4l2codec(uint32_t v4l2_fmt);
+uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id);
+enum AVPixelFormat ff_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id);
+enum AVCodecID ff_fmt_v4l2codec(uint32_t v4l2_fmt);
#endif /* AVDEVICE_V4L2_COMMON_H */
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index cf7a92c..e2994d8 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -270,8 +270,8 @@ static void list_formats(AVFormatContext *ctx, int type)
struct v4l2_fmtdesc vfd = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
while(!v4l2_ioctl(s->fd, VIDIOC_ENUM_FMT, &vfd)) {
- enum AVCodecID codec_id = avpriv_fmt_v4l2codec(vfd.pixelformat);
- enum AVPixelFormat pix_fmt = avpriv_fmt_v4l2ff(vfd.pixelformat, codec_id);
+ enum AVCodecID codec_id = ff_fmt_v4l2codec(vfd.pixelformat);
+ enum AVPixelFormat pix_fmt = ff_fmt_v4l2ff(vfd.pixelformat, codec_id);
vfd.index++;
@@ -763,7 +763,7 @@ static int device_try_init(AVFormatContext *ctx,
{
int ret, i;
- *desired_format = avpriv_fmt_ff2v4l(pix_fmt, ctx->video_codec_id);
+ *desired_format = ff_fmt_ff2v4l(pix_fmt, ctx->video_codec_id);
if (*desired_format) {
ret = device_init(ctx, width, height, *desired_format);
@@ -775,14 +775,14 @@ static int device_try_init(AVFormatContext *ctx,
}
if (!*desired_format) {
- for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
+ for (i = 0; ff_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
if (ctx->video_codec_id == AV_CODEC_ID_NONE ||
- avpriv_fmt_conversion_table[i].codec_id == ctx->video_codec_id) {
+ ff_fmt_conversion_table[i].codec_id == ctx->video_codec_id) {
av_log(ctx, AV_LOG_DEBUG, "Trying to set codec:%s pix_fmt:%s\n",
- avcodec_get_name(avpriv_fmt_conversion_table[i].codec_id),
- (char *)av_x_if_null(av_get_pix_fmt_name(avpriv_fmt_conversion_table[i].ff_fmt), "none"));
+ avcodec_get_name(ff_fmt_conversion_table[i].codec_id),
+ (char *)av_x_if_null(av_get_pix_fmt_name(ff_fmt_conversion_table[i].ff_fmt), "none"));
- *desired_format = avpriv_fmt_conversion_table[i].v4l2_fmt;
+ *desired_format = ff_fmt_conversion_table[i].v4l2_fmt;
ret = device_init(ctx, width, height, *desired_format);
if (ret >= 0)
break;
@@ -801,7 +801,7 @@ static int device_try_init(AVFormatContext *ctx,
}
}
- *codec_id = avpriv_fmt_v4l2codec(*desired_format);
+ *codec_id = ff_fmt_v4l2codec(*desired_format);
av_assert0(*codec_id != AV_CODEC_ID_NONE);
return ret;
}
@@ -926,7 +926,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
s->frame_format = desired_format;
- st->codec->pix_fmt = avpriv_fmt_v4l2ff(desired_format, codec_id);
+ st->codec->pix_fmt = ff_fmt_v4l2ff(desired_format, codec_id);
s->frame_size =
avpicture_get_size(st->codec->pix_fmt, s->width, s->height);
diff --git a/libavdevice/v4l2enc.c b/libavdevice/v4l2enc.c
index c9f8d92..ac4068c 100644
--- a/libavdevice/v4l2enc.c
+++ b/libavdevice/v4l2enc.c
@@ -56,7 +56,7 @@ static av_cold int write_header(AVFormatContext *s1)
enc_ctx = s1->streams[0]->codec;
- v4l2_pixfmt = avpriv_fmt_ff2v4l(enc_ctx->pix_fmt, AV_CODEC_ID_RAWVIDEO);
+ v4l2_pixfmt = ff_fmt_ff2v4l(enc_ctx->pix_fmt, AV_CODEC_ID_RAWVIDEO);
if (!v4l2_pixfmt) { // XXX: try to force them one by one?
av_log(s1, AV_LOG_ERROR, "Unknown V4L2 pixel format equivalent for %s\n",
av_get_pix_fmt_name(enc_ctx->pix_fmt));
--
2.0.4
More information about the ffmpeg-devel
mailing list