4 * Copyright (C) 2012 Cisco Systems, Inc.
5 * Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #ifndef __GST_UVC_H264_SRC_H__
25 #define __GST_UVC_H264_SRC_H__
32 #include <gst/basecamerabinsrc/gstbasecamerasrc.h>
33 #if defined (HAVE_GUDEV) && defined (HAVE_LIBUSB)
40 #define GST_TYPE_UVC_H264_SRC \
41 (gst_uvc_h264_src_get_type())
42 #define GST_UVC_H264_SRC(obj) \
43 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_UVC_H264_SRC, GstUvcH264Src))
44 #define GST_UVC_H264_SRC_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_UVC_H264_SRC, GstUvcH264SrcClass))
46 #define GST_IS_UVC_H264_SRC(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_UVC_H264_SRC))
48 #define GST_IS_UVC_H264_SRC_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_UVC_H264_SRC))
50 GType gst_uvc_h264_src_get_type (void);
52 typedef struct _GstUvcH264Src GstUvcH264Src;
53 typedef struct _GstUvcH264SrcClass GstUvcH264SrcClass;
55 enum GstVideoRecordingStatus {
56 GST_VIDEO_RECORDING_STATUS_DONE,
57 GST_VIDEO_RECORDING_STATUS_STARTING,
58 GST_VIDEO_RECORDING_STATUS_RUNNING,
59 GST_VIDEO_RECORDING_STATUS_FINISHING
70 UVC_H264_SRC_FORMAT_NONE,
71 UVC_H264_SRC_FORMAT_JPG,
72 UVC_H264_SRC_FORMAT_H264,
73 UVC_H264_SRC_FORMAT_RAW
74 } GstUvcH264SrcFormat;
82 GstBaseCameraSrc parent;
90 GstElement *mjpg_demux;
92 GstElement *vid_colorspace;
93 GstElement *vf_colorspace;
95 GstUvcH264SrcFormat main_format;
98 guint32 main_frame_interval;
99 UvcH264StreamFormat main_stream_format;
100 guint16 main_profile;
101 GstUvcH264SrcFormat secondary_format;
102 guint16 secondary_width;
103 guint16 secondary_height;
104 guint32 secondary_frame_interval;
108 #if defined (HAVE_GUDEV) && defined (HAVE_LIBUSB)
109 libusb_context *usb_ctx;
112 GstPadEventFunction srcpad_event_func;
113 GstEvent *key_unit_event;
118 /* When restarting the source */
119 gboolean reconfiguring;
123 gchar *colorspace_name;
124 gchar *jpeg_decoder_name;
125 int num_clock_samples;
127 /* v4l2src proxied properties */
131 /* Static controls */
132 guint32 initial_bitrate;
134 UvcH264SliceMode slice_mode;
135 guint16 iframe_period;
136 UvcH264UsageType usage_type;
137 UvcH264Entropy entropy;
139 guint8 num_reorder_frames;
140 gboolean preview_flipped;
141 guint16 leaky_bucket_size;
143 /* Dynamic controls */
144 UvcH264RateControl rate_control;
145 gboolean fixed_framerate;
147 guint32 peak_bitrate;
148 guint32 average_bitrate;
149 gint8 min_qp[QP_FRAMES];
150 gint8 max_qp[QP_FRAMES];
151 guint8 ltr_buffer_size;
152 guint8 ltr_encoder_control;
157 * GstUvcH264SrcClass:
160 struct _GstUvcH264SrcClass
162 GstBaseCameraSrcClass parent;
166 #endif /* __GST_UVC_H264_SRC_H__ */