camerabin: Adds new video-colorspace-flag to flags

Adds a new flag to allow a colorspace convertion before
the video encoder element.

Fixes #603063
This commit is contained in:
Thiago Santos 2010-09-22 23:39:07 -03:00
parent 0a7ae539ea
commit b8afa0cc3c
3 changed files with 16 additions and 2 deletions

View file

@ -32,7 +32,7 @@
*-----------------------------------------------------------------------------
* audiosrc -> audio_queue -> audioconvert -> volume -> audioenc
* > videomux -> filesink
* video_queue -> [timeoverlay] -> videoenc
* video_queue -> [timeoverlay] -> [csp] -> videoenc -> queue
* -> [post proc] -> tee <
* queue ->
*-----------------------------------------------------------------------------
@ -581,6 +581,14 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid)
vid->vid_tee_probe_id = gst_pad_add_buffer_probe (vid->tee_video_srcpad,
G_CALLBACK (camerabin_video_pad_tee_src0_have_buffer), vid);
if (vid->flags & GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION) {
/* Add colorspace converter */
if (gst_camerabin_create_and_add_element (vidbin,
"ffmpegcolorspace") == NULL) {
goto error;
}
}
/* Add user set or default video encoder element */
if (vid->app_vid_enc) {
vid->vid_enc = vid->app_vid_enc;

View file

@ -43,6 +43,9 @@ register_gst_camerabin_flags (GType * id)
{C_FLAGS (GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION),
"Enable colorspace conversion for still image",
"image-colorspace-conversion"},
{C_FLAGS (GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION),
"Enable colorspace conversion for video capture",
"video-colorspace-conversion"},
{0, NULL, NULL}
};
*id = g_flags_register_static ("GstCameraBinFlags", values);

View file

@ -85,6 +85,8 @@ enum
* @GST_CAMERABIN_FLAG_DISABLE_AUDIO: disable audio elements
* @GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION: enable color
* conversion for image output element
* @GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION: enable color
* conversion for video encoder element
*
* Extra flags to configure the behaviour of the sinks.
*/
@ -95,7 +97,8 @@ typedef enum {
GST_CAMERABIN_FLAG_VIEWFINDER_SCALE = (1 << 3),
GST_CAMERABIN_FLAG_AUDIO_CONVERSION = (1 << 4),
GST_CAMERABIN_FLAG_DISABLE_AUDIO = (1 << 5),
GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION = (1 << 6)
GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION = (1 << 6),
GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION = (1 << 7)
} GstCameraBinFlags;
#define GST_TYPE_CAMERABIN_FLAGS (gst_camerabin_flags_get_type())