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:
parent
0a7ae539ea
commit
b8afa0cc3c
@ -32,7 +32,7 @@
|
|||||||
*-----------------------------------------------------------------------------
|
*-----------------------------------------------------------------------------
|
||||||
* audiosrc -> audio_queue -> audioconvert -> volume -> audioenc
|
* audiosrc -> audio_queue -> audioconvert -> volume -> audioenc
|
||||||
* > videomux -> filesink
|
* > videomux -> filesink
|
||||||
* video_queue -> [timeoverlay] -> videoenc
|
* video_queue -> [timeoverlay] -> [csp] -> videoenc -> queue
|
||||||
* -> [post proc] -> tee <
|
* -> [post proc] -> tee <
|
||||||
* queue ->
|
* 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,
|
vid->vid_tee_probe_id = gst_pad_add_buffer_probe (vid->tee_video_srcpad,
|
||||||
G_CALLBACK (camerabin_video_pad_tee_src0_have_buffer), vid);
|
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 */
|
/* Add user set or default video encoder element */
|
||||||
if (vid->app_vid_enc) {
|
if (vid->app_vid_enc) {
|
||||||
vid->vid_enc = vid->app_vid_enc;
|
vid->vid_enc = vid->app_vid_enc;
|
||||||
|
@ -43,6 +43,9 @@ register_gst_camerabin_flags (GType * id)
|
|||||||
{C_FLAGS (GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION),
|
{C_FLAGS (GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION),
|
||||||
"Enable colorspace conversion for still image",
|
"Enable colorspace conversion for still image",
|
||||||
"image-colorspace-conversion"},
|
"image-colorspace-conversion"},
|
||||||
|
{C_FLAGS (GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION),
|
||||||
|
"Enable colorspace conversion for video capture",
|
||||||
|
"video-colorspace-conversion"},
|
||||||
{0, NULL, NULL}
|
{0, NULL, NULL}
|
||||||
};
|
};
|
||||||
*id = g_flags_register_static ("GstCameraBinFlags", values);
|
*id = g_flags_register_static ("GstCameraBinFlags", values);
|
||||||
|
@ -85,6 +85,8 @@ enum
|
|||||||
* @GST_CAMERABIN_FLAG_DISABLE_AUDIO: disable audio elements
|
* @GST_CAMERABIN_FLAG_DISABLE_AUDIO: disable audio elements
|
||||||
* @GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION: enable color
|
* @GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION: enable color
|
||||||
* conversion for image output element
|
* 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.
|
* 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_VIEWFINDER_SCALE = (1 << 3),
|
||||||
GST_CAMERABIN_FLAG_AUDIO_CONVERSION = (1 << 4),
|
GST_CAMERABIN_FLAG_AUDIO_CONVERSION = (1 << 4),
|
||||||
GST_CAMERABIN_FLAG_DISABLE_AUDIO = (1 << 5),
|
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;
|
} GstCameraBinFlags;
|
||||||
|
|
||||||
#define GST_TYPE_CAMERABIN_FLAGS (gst_camerabin_flags_get_type())
|
#define GST_TYPE_CAMERABIN_FLAGS (gst_camerabin_flags_get_type())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user