23 #include <dc1394/dc1394.h> 68 { 1875, DC1394_FRAMERATE_1_875 },
69 { 3750, DC1394_FRAMERATE_3_75 },
70 { 7500, DC1394_FRAMERATE_7_5 },
71 { 15000, DC1394_FRAMERATE_15 },
72 { 30000, DC1394_FRAMERATE_30 },
73 { 60000, DC1394_FRAMERATE_60 },
74 {120000, DC1394_FRAMERATE_120 },
75 {240000, DC1394_FRAMERATE_240 },
79 #define OFFSET(x) offsetof(dc1394_data, x) 80 #define DEC AV_OPT_FLAG_DECODING_PARAM 170 dc1394camera_list_t *list;
179 dc1394->
d = dc1394_new();
180 if (dc1394_camera_enumerate(dc1394->
d, &list) != DC1394_SUCCESS || !list) {
185 if (list->num == 0) {
187 dc1394_camera_free_list(list);
192 dc1394->
camera = dc1394_camera_new (dc1394->
d, list->ids[0].guid);
197 dc1394_camera_free_list(list);
206 dc1394_camera_free_list (list);
209 if (dc1394->
camera->bmode_capable>0) {
210 dc1394_video_set_operation_mode(dc1394->
camera, DC1394_OPERATION_MODE_1394B);
211 i = DC1394_ISO_SPEED_800;
213 i = DC1394_ISO_SPEED_400;
216 for (res = DC1394_FAILURE; i >= DC1394_ISO_SPEED_MIN && res != DC1394_SUCCESS; i--) {
217 res=dc1394_video_set_iso_speed(dc1394->
camera, i);
219 if (res != DC1394_SUCCESS) {
233 if (dc1394_capture_setup(dc1394->
camera, 10, DC1394_CAPTURE_FLAGS_DEFAULT)!=DC1394_SUCCESS) {
238 if (dc1394_video_set_transmission(dc1394->
camera, DC1394_ON) !=DC1394_SUCCESS) {
245 dc1394_capture_stop(dc1394->
camera);
246 dc1394_video_set_transmission(dc1394->
camera, DC1394_OFF);
247 dc1394_camera_free (dc1394->
camera);
249 dc1394_free(dc1394->
d);
260 if (dc1394_capture_enqueue(dc1394->
camera, dc1394->
frame) != DC1394_SUCCESS)
264 res = dc1394_capture_dequeue(dc1394->
camera, DC1394_CAPTURE_POLICY_WAIT, &dc1394->
frame);
265 if (res == DC1394_SUCCESS) {
283 dc1394_video_set_transmission(dc1394->
camera, DC1394_OFF);
284 dc1394_capture_stop(dc1394->
camera);
285 dc1394_camera_free(dc1394->
camera);
286 dc1394_free(dc1394->
d);
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
static int dc1394_read_common(AVFormatContext *c, const struct dc1394_frame_format **select_fmt, const struct dc1394_frame_rate **select_fps)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static enum AVPixelFormat pix_fmt
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
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.
dc1394video_frame_t * frame
#define LIBAVUTIL_VERSION_INT
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVInputFormat ff_libdc1394_demuxer
int index
stream index in AVFormatContext
static const struct dc1394_frame_format dc1394_frame_formats[]
const char * av_default_item_name(void *ptr)
Return the context name.
static int dc1394_read_header(AVFormatContext *c)
char * framerate
Set by a private option.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const struct dc1394_frame_rate dc1394_frame_rates[]
enum AVMediaType codec_type
General type of the encoded data.
AVRational avg_frame_rate
Average framerate.
int flags
A combination of AV_PKT_FLAG values.
common internal API header
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
char * pixel_format
Set by a private option.
#define AV_LOG_INFO
Standard information.
static const AVOption options[]
static const AVClass libdc1394_class
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
int frame_rate
frames per 1000 seconds (fps * 1000)
char * video_size
String describing video size, set by a private option.
static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt)
void * priv_data
Format private data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
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.
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
AVPixelFormat
Pixel format.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static int dc1394_close(AVFormatContext *context)