[cheese/camerabin2] add some tags to produced files
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/camerabin2] add some tags to produced files
- Date: Tue, 6 Mar 2012 15:30:42 +0000 (UTC)
commit c95ca241efcd97e74d0a7111b3b0e6bb30412fda
Author: Oleksij Rempel (Alexey Fisher) <bug-track fisher-privat net>
Date: Tue Mar 6 14:31:17 2012 +0100
add some tags to produced files
the tag are important for search and managment apps.
this tags should help to track files produced by cheese.
Signed-off-by: Oleksij Rempel (Alexey Fisher) <bug-track fisher-privat net>
libcheese/cheese-camera.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index ebb894a..ea19841 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -1015,6 +1015,33 @@ cheese_camera_connect_effect_texture (CheeseCamera *camera, CheeseEffect *effect
g_object_set (G_OBJECT (priv->effects_valve), "drop", FALSE, NULL);
}
+static void
+cheese_camera_set_tags (CheeseCamera *camera)
+{
+ CheeseCameraPrivate *priv;
+ CheeseCameraDevice *device;
+ const gchar *device_name;
+ GstDateTime *datetime;
+ GstTagList *taglist;
+
+ device = cheese_camera_get_selected_device (camera);
+ device_name = cheese_camera_device_get_name (device);
+
+ datetime = gst_date_time_new_now_local_time();
+
+ taglist = gst_tag_list_new_full (
+ GST_TAG_APPLICATION_NAME, PACKAGE_STRING,
+ GST_TAG_DATE_TIME, datetime,
+ GST_TAG_DEVICE_MODEL, device_name,
+ GST_TAG_KEYWORDS, PACKAGE_NAME, NULL);
+
+ priv = camera->priv;
+ gst_tag_setter_merge_tags (GST_TAG_SETTER (priv->camerabin), taglist,
+ GST_TAG_MERGE_REPLACE);
+
+ gst_date_time_unref (datetime);
+}
+
/**
* cheese_camera_start_video_recording:
* @camera: a #CheeseCamera
@@ -1034,6 +1061,7 @@ cheese_camera_start_video_recording (CheeseCamera *camera, const gchar *filename
g_object_set (priv->camerabin, "mode", MODE_VIDEO, NULL);
g_object_set (priv->camerabin, "location", filename, NULL);
+ cheese_camera_set_tags (camera);
g_signal_emit_by_name (priv->camerabin, "start-capture", 0);
priv->is_recording = TRUE;
}
@@ -1132,6 +1160,7 @@ cheese_camera_take_photo (CheeseCamera *camera, const gchar *filename)
g_object_set (priv->camerabin, "location", priv->photo_filename, NULL);
g_object_set (priv->camerabin, "mode", MODE_IMAGE, NULL);
+ cheese_camera_set_tags (camera);
g_signal_emit_by_name (priv->camerabin, "start-capture", 0);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]