Go to the documentation of this file.
23 #include <dc1394/dc1394.h>
69 { 1875, DC1394_FRAMERATE_1_875 },
70 { 3750, DC1394_FRAMERATE_3_75 },
71 { 7500, DC1394_FRAMERATE_7_5 },
72 { 15000, DC1394_FRAMERATE_15 },
73 { 30000, DC1394_FRAMERATE_30 },
74 { 60000, DC1394_FRAMERATE_60 },
75 {120000, DC1394_FRAMERATE_120 },
76 {240000, DC1394_FRAMERATE_240 },
80 #define OFFSET(x) offsetof(dc1394_data, x)
81 #define DEC AV_OPT_FLAG_DECODING_PARAM
83 {
"video_size",
"A string describing frame size, such as 640x480 or hd720.",
OFFSET(video_size),
AV_OPT_TYPE_STRING, {.str =
"qvga"}, 0, 0,
DEC },
171 dc1394camera_list_t *
list;
180 dc1394->
d = dc1394_new();
181 if (dc1394_camera_enumerate(dc1394->
d, &
list) != DC1394_SUCCESS || !
list) {
186 if (
list->num == 0) {
188 dc1394_camera_free_list(
list);
193 dc1394->
camera = dc1394_camera_new (dc1394->
d,
list->ids[0].guid);
198 dc1394_camera_free_list(
list);
207 dc1394_camera_free_list (
list);
210 if (dc1394->
camera->bmode_capable>0) {
211 dc1394_video_set_operation_mode(dc1394->
camera, DC1394_OPERATION_MODE_1394B);
212 i = DC1394_ISO_SPEED_800;
214 i = DC1394_ISO_SPEED_400;
217 for (res = DC1394_FAILURE;
i >= DC1394_ISO_SPEED_MIN && res != DC1394_SUCCESS;
i--) {
218 res=dc1394_video_set_iso_speed(dc1394->
camera,
i);
220 if (res != DC1394_SUCCESS) {
234 if (dc1394_capture_setup(dc1394->
camera, 10, DC1394_CAPTURE_FLAGS_DEFAULT)!=DC1394_SUCCESS) {
239 if (dc1394_video_set_transmission(dc1394->
camera, DC1394_ON) !=DC1394_SUCCESS) {
246 dc1394_capture_stop(dc1394->
camera);
247 dc1394_video_set_transmission(dc1394->
camera, DC1394_OFF);
248 dc1394_camera_free (dc1394->
camera);
250 dc1394_free(dc1394->
d);
261 if (dc1394_capture_enqueue(dc1394->
camera, dc1394->
frame) != DC1394_SUCCESS)
265 res = dc1394_capture_dequeue(dc1394->
camera, DC1394_CAPTURE_POLICY_WAIT, &dc1394->
frame);
266 if (res == DC1394_SUCCESS) {
284 dc1394_video_set_transmission(dc1394->
camera, DC1394_OFF);
285 dc1394_capture_stop(dc1394->
camera);
286 dc1394_camera_free(dc1394->
camera);
287 dc1394_free(dc1394->
d);
293 .
p.
name =
"libdc1394",
AVPixelFormat
Pixel format.
char * video_size
String describing video size, set by a private option.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AVRational avg_frame_rate
Average framerate.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int dc1394_read_common(AVFormatContext *c, const struct dc1394_frame_format **select_fmt, const struct dc1394_frame_rate **select_fps)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static enum AVPixelFormat pix_fmt
int frame_rate
frames per 1000 seconds (fps * 1000)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
static int read_header(FFV1Context *f)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
const char * av_default_item_name(void *ptr)
Return the context name.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static int dc1394_read_header(AVFormatContext *c)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int dc1394_close(AVFormatContext *context)
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters.
int flags
A combination of AV_PKT_FLAG values.
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
#define AV_LOG_INFO
Standard information.
char * pixel_format
Set by a private option.
const FFInputFormat ff_libdc1394_demuxer
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static const struct dc1394_frame_format dc1394_frame_formats[]
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static const AVClass libdc1394_class
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
int index
stream index in AVFormatContext
static const struct dc1394_frame_rate dc1394_frame_rates[]
static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt)
static const AVOption options[]
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
dc1394video_frame_t * frame
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
char * framerate
Set by a private option.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
@ AV_PIX_FMT_UYYVYY411
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3