summaryrefslogtreecommitdiff
path: root/libavdevice/libdc1394.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-29 02:55:19 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-29 03:34:35 +0200
commitb8a43bc1b50f409414493a05f6c4b7895ca4ddf9 (patch)
tree95dda1b7289aac9bdb1f457417baf9515aa4383a /libavdevice/libdc1394.c
parent39d607e5bbc25ad9629683702b510e865434ef21 (diff)
parent90da52f01f8b6c22af22a002eb226989b1cf7ef8 (diff)
Merge remote-tracking branch 'qatar/master' into master
* qatar/master: (27 commits) ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits() ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits. ac3dsp: fix loop condition in ac3_update_bap_counts_c() ARM: unbreak build ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4. ac3enc: split mantissa bit counting into a separate function. ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct. get_bits: add av_unused tag to cache variable sws: replace all long with int. ARM: aacdec: fix constraints on inline asm ARM: remove unnecessary volatile from inline asm ARM: add "cc" clobbers to inline asm where needed ARM: improve FASTDIV asm ac3enc: use LOCAL_ALIGNED macro APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7). lavu: add av_get_pix_fmt_name() convenience function cmdutils: remove OPT_FUNC2 swscale: fix crash in bilinear scaling. vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping webm: support stereo videos in matroska/webm muxer ... Conflicts: Changelog cmdutils.c cmdutils.h doc/APIchanges doc/muxers.texi ffmpeg.c ffplay.c libavcodec/ac3enc.c libavcodec/ac3enc_float.c libavcodec/avcodec.h libavcodec/get_bits.h libavcodec/libvpxenc.c libavcodec/version.h libavdevice/libdc1394.c libavformat/matroskaenc.c libavutil/avutil.h libswscale/rgb2rgb.c libswscale/swscale.c libswscale/swscale_template.c libswscale/x86/swscale_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/libdc1394.c')
-rw-r--r--libavdevice/libdc1394.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index bbb606b935..5a9043bc24 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include "libavutil/parseutils.h"
+#include "libavutil/pixdesc.h"
#include <dc1394/dc1394.h>
@@ -42,6 +43,7 @@ typedef struct dc1394_data {
int current_frame;
int fps;
char *video_size; /**< String describing video size, set by a private option. */
+ char *pixel_format; /**< Set by a private option. */
AVPacket packet;
} dc1394_data;
@@ -82,6 +84,7 @@ struct dc1394_frame_rate {
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "qvga"}, 0, 0, DEC },
+ { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "uyvy422"}, 0, 0, DEC },
{ NULL },
};
@@ -134,6 +137,14 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap)
goto out_camera;
}
+ if (dc1394->pixel_format) {
+ if ((ap->pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == PIX_FMT_NONE) {
+ av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format);
+ ret = AVERROR(EINVAL);
+ goto out;
+ }
+ }
+
if (dc1394->video_size) {
if ((ret = av_parse_video_size(&ap->width, &ap->height, dc1394->video_size)) < 0) {
av_log(c, AV_LOG_ERROR, "Couldn't parse video size.\n");
@@ -303,6 +314,8 @@ out_camera:
dc1394_video_set_transmission(dc1394->camera, DC1394_OFF);
dc1394_camera_free (dc1394->camera);
out:
+ av_freep(&dc1394->video_size);
+ av_freep(&dc1394->pixel_format);
dc1394_free(dc1394->d);
return ret;
}