[longomatch/dvcam: 2/6] Use camerabin flags to disable audio and src colorspace conversion and scaling



commit 6c66e9e716239a8db31947892e8fcf4eb695f318
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Jun 2 21:03:09 2010 +0200

    Use camerabin flags to disable audio and src colorspace conversion and scaling

 libcesarplayer/src/gst-camera-capturer.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libcesarplayer/src/gst-camera-capturer.c b/libcesarplayer/src/gst-camera-capturer.c
index 20476e1..64f8a88 100644
--- a/libcesarplayer/src/gst-camera-capturer.c
+++ b/libcesarplayer/src/gst-camera-capturer.c
@@ -54,6 +54,16 @@
 
 #define DEFAULT_SOURCE_TYPE  GST_CAMERA_CAPTURE_SOURCE_TYPE_RAW
 
+typedef enum {
+  GST_CAMERABIN_FLAG_SOURCE_RESIZE               = (1 << 0),
+  GST_CAMERABIN_FLAG_SOURCE_COLOR_CONVERSION     = (1 << 1),
+  GST_CAMERABIN_FLAG_VIEWFINDER_COLOR_CONVERSION = (1 << 2),
+  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)
+} GstCameraBinFlags;
+
 /* Signals */
 enum
 {
@@ -906,6 +916,7 @@ gst_camera_capturer_new (gchar * filename, GError ** err)
   GstCameraCapturer *gcc = NULL;
   GstPad *videosrcpad;
   gchar *plugin;
+  gint flags = 0;
 
   gcc = g_object_new (GST_TYPE_CAMERA_CAPTURER, NULL);
 
@@ -938,6 +949,13 @@ gst_camera_capturer_new (gchar * filename, GError ** err)
   GST_INFO_OBJECT (gcc, "Setting capture mode to \"video\"");
   g_object_set (gcc->priv->camerabin, "mode", 1, NULL);
 
+  GST_INFO_OBJECT (gcc, "Setting capture mode to \"video\"");
+  flags =  GST_CAMERABIN_FLAG_DISABLE_AUDIO;
+#ifdef WIN32
+  flags |= GST_CAMERABIN_FLAG_VIEWFINDER_COLOR_CONVERSION;
+#endif
+  g_object_set (gcc->priv->camerabin, "flags", flags, NULL);
+
   /* assume we're always called from the main Gtk+ GUI thread */
   gui_thread = g_thread_self ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]