Lines Matching refs:camera
241 static void gst_camera_bin_init (GstCameraBin2 * camera);
475 GstCameraBin2 *camera = GST_CAMERA_BIN2_CAST (user_data); in gst_camera_bin_src_notify_readyforcapture() local
478 g_object_get (camera->src, "ready-for-capture", &ready, NULL); in gst_camera_bin_src_notify_readyforcapture()
482 if (camera->mode == MODE_VIDEO) { in gst_camera_bin_src_notify_readyforcapture()
484 gst_element_set_state (camera->videosink, GST_STATE_NULL); in gst_camera_bin_src_notify_readyforcapture()
485 location = g_strdup_printf (camera->location, camera->capture_index); in gst_camera_bin_src_notify_readyforcapture()
486 GST_DEBUG_OBJECT (camera, "Switching videobin location to %s", location); in gst_camera_bin_src_notify_readyforcapture()
487 g_object_set (camera->videosink, "location", location, NULL); in gst_camera_bin_src_notify_readyforcapture()
489 if (gst_element_set_state (camera->videosink, GST_STATE_PLAYING) == in gst_camera_bin_src_notify_readyforcapture()
493 gst_element_set_state (camera->videosink, GST_STATE_NULL); in gst_camera_bin_src_notify_readyforcapture()
497 camera->capture_index++; in gst_camera_bin_src_notify_readyforcapture()
858 gst_camera_bin_init (GstCameraBin2 * camera) in gst_camera_bin_init() argument
860 camera->post_previews = DEFAULT_POST_PREVIEWS; in gst_camera_bin_init()
861 camera->mode = DEFAULT_MODE; in gst_camera_bin_init()
862 camera->location = g_strdup (DEFAULT_LOCATION); in gst_camera_bin_init()
863 camera->viewfinderbin = gst_element_factory_make ("viewfinderbin", "vf-bin"); in gst_camera_bin_init()
864 camera->zoom = DEFAULT_ZOOM; in gst_camera_bin_init()
865 camera->max_zoom = MAX_ZOOM; in gst_camera_bin_init()
866 camera->flags = DEFAULT_FLAGS; in gst_camera_bin_init()
867 g_mutex_init (&camera->preview_list_mutex); in gst_camera_bin_init()
868 g_mutex_init (&camera->image_capture_mutex); in gst_camera_bin_init()
869 g_mutex_init (&camera->video_capture_mutex); in gst_camera_bin_init()
870 g_cond_init (&camera->video_state_cond); in gst_camera_bin_init()
875 camera->videobin_capsfilter = gst_element_factory_make ("capsfilter", in gst_camera_bin_init()
877 camera->imagebin_capsfilter = gst_element_factory_make ("capsfilter", in gst_camera_bin_init()
879 camera->viewfinderbin_capsfilter = gst_element_factory_make ("capsfilter", in gst_camera_bin_init()
882 gst_bin_add_many (GST_BIN (camera), in gst_camera_bin_init()
883 gst_object_ref (camera->viewfinderbin), in gst_camera_bin_init()
884 gst_object_ref (camera->videobin_capsfilter), in gst_camera_bin_init()
885 gst_object_ref (camera->imagebin_capsfilter), in gst_camera_bin_init()
886 gst_object_ref (camera->viewfinderbin_capsfilter), NULL); in gst_camera_bin_init()
889 camera->audio_capsfilter = gst_element_factory_make ("capsfilter", in gst_camera_bin_init()
891 camera->audio_volume = gst_element_factory_make ("volume", "audio-volume"); in gst_camera_bin_init()
895 gst_image_capture_bin_post_image_done (GstCameraBin2 * camera, in gst_image_capture_bin_post_image_done() argument
902 msg = gst_message_new_element (GST_OBJECT_CAST (camera), in gst_image_capture_bin_post_image_done()
906 if (!gst_element_post_message (GST_ELEMENT_CAST (camera), msg)) in gst_image_capture_bin_post_image_done()
907 GST_WARNING_OBJECT (camera, "Failed to post image-done message"); in gst_image_capture_bin_post_image_done()
911 gst_video_capture_bin_post_video_done (GstCameraBin2 * camera) in gst_video_capture_bin_post_video_done() argument
915 msg = gst_message_new_element (GST_OBJECT_CAST (camera), in gst_video_capture_bin_post_video_done()
918 if (!gst_element_post_message (GST_ELEMENT_CAST (camera), msg)) in gst_video_capture_bin_post_video_done()
919 GST_WARNING_OBJECT (camera, "Failed to post video-done message"); in gst_video_capture_bin_post_video_done()
1125 gst_camera_bin_check_and_replace_filter (GstCameraBin2 * camera, in gst_camera_bin_check_and_replace_filter() argument
1131 GST_DEBUG_OBJECT (camera, "Current filter is the same as the previous, " in gst_camera_bin_check_and_replace_filter()
1136 GST_DEBUG_OBJECT (camera, "Replacing current filter (%s) with new filter " in gst_camera_bin_check_and_replace_filter()
1141 gst_bin_remove (GST_BIN_CAST (camera), *current_filter); in gst_camera_bin_check_and_replace_filter()
1151 gst_bin_add (GST_BIN_CAST (camera), gst_object_ref (new_filter)); in gst_camera_bin_check_and_replace_filter()
1172 GstCameraBin2 * camera) in encodebin_element_added() argument
1193 encodebin_find_pad (GstCameraBin2 * camera, GstElement * encodebin, in encodebin_find_pad() argument
1201 GST_DEBUG_OBJECT (camera, "Looking at encodebin pads, searching for %s pad", in encodebin_find_pad()
1213 GST_DEBUG_OBJECT (camera, "Found video pad %s", GST_PAD_NAME (pad)); in encodebin_find_pad()
1219 GST_DEBUG_OBJECT (camera, "Found audio pad %s", GST_PAD_NAME (pad)); in encodebin_find_pad()
1247 GST_DEBUG_OBJECT (camera, "No pads found, trying to request one"); in encodebin_find_pad()
1254 GST_DEBUG_OBJECT (camera, "No templates found, can't request pad"); in encodebin_find_pad()
1259 GST_DEBUG_OBJECT (camera, "Got pad: %s", pad ? GST_PAD_NAME (pad) : "null"); in encodebin_find_pad()
1266 gst_camera_bin_video_profile_has_audio (GstCameraBin2 * camera) in gst_camera_bin_video_profile_has_audio() argument
1270 g_return_val_if_fail (camera->video_profile != NULL, FALSE); in gst_camera_bin_video_profile_has_audio()
1272 if (GST_IS_ENCODING_VIDEO_PROFILE (camera->video_profile)) in gst_camera_bin_video_profile_has_audio()
1277 *) camera->video_profile); list; list = g_list_next (list)) { in gst_camera_bin_video_profile_has_audio()
1288 gst_camera_bin_link_encodebin (GstCameraBin2 * camera, GstElement * encodebin, in gst_camera_bin_link_encodebin() argument
1298 sinkpad = encodebin_find_pad (camera, encodebin, padtype); in gst_camera_bin_link_encodebin()
1319 GstCameraBin2 *camera = (GstCameraBin2 *) user_data; in gst_camera_bin_src_notify_max_zoom_cb() local
1321 g_object_get (self, "max-zoom", &camera->max_zoom, NULL); in gst_camera_bin_src_notify_max_zoom_cb()
1322 GST_DEBUG_OBJECT (camera, "Max zoom updated to %f", camera->max_zoom); in gst_camera_bin_src_notify_max_zoom_cb()
1327 (G_OBJECT (camera)), "zoom")); in gst_camera_bin_src_notify_max_zoom_cb()
1328 zoom_pspec->maximum = camera->max_zoom; in gst_camera_bin_src_notify_max_zoom_cb()
1330 g_object_notify (G_OBJECT (camera), "max-zoom"); in gst_camera_bin_src_notify_max_zoom_cb()
1337 GstCameraBin2 *camera = (GstCameraBin2 *) user_data; in gst_camera_bin_src_notify_zoom_cb() local
1339 g_object_get (self, "zoom", &camera->zoom, NULL); in gst_camera_bin_src_notify_zoom_cb()
1340 GST_DEBUG_OBJECT (camera, "Zoom updated to %f", camera->zoom); in gst_camera_bin_src_notify_zoom_cb()
1341 g_object_notify (G_OBJECT (camera), "zoom"); in gst_camera_bin_src_notify_zoom_cb()
1444 GstCameraBin2 *camera = data; in gst_camera_bin_audio_src_data_probe() local
1448 if (G_UNLIKELY (camera->audio_send_newseg)) { in gst_camera_bin_audio_src_data_probe()
1467 camera->audio_send_newseg = FALSE; in gst_camera_bin_audio_src_data_probe()
1473 if (camera->audio_drop_eos) { in gst_camera_bin_audio_src_data_probe()
1476 camera->audio_drop_eos = TRUE; in gst_camera_bin_audio_src_data_probe()
1479 camera->audio_send_newseg = FALSE; in gst_camera_bin_audio_src_data_probe()
1502 gst_camera_bin_create_elements (GstCameraBin2 * camera) in gst_camera_bin_create_elements() argument
1511 if (!camera->elements_created) { in gst_camera_bin_create_elements()
1513 if (!(camera->audio_capsfilter && camera->videobin_capsfilter && in gst_camera_bin_create_elements()
1514 camera->imagebin_capsfilter && camera->viewfinderbin_capsfilter)) { in gst_camera_bin_create_elements()
1519 camera->video_encodebin = in gst_camera_bin_create_elements()
1521 if (!camera->video_encodebin) { in gst_camera_bin_create_elements()
1525 camera->video_encodebin_signal_id = in gst_camera_bin_create_elements()
1526 g_signal_connect (camera->video_encodebin, "element-added", in gst_camera_bin_create_elements()
1527 (GCallback) encodebin_element_added, camera); in gst_camera_bin_create_elements()
1529 camera->videosink = in gst_camera_bin_create_elements()
1531 if (!camera->videosink) { in gst_camera_bin_create_elements()
1535 g_object_set (camera->videosink, "async", FALSE, NULL); in gst_camera_bin_create_elements()
1538 if (!camera->audio_volume) { in gst_camera_bin_create_elements()
1543 if (camera->video_profile == NULL) { in gst_camera_bin_create_elements()
1556 GST_WARNING_OBJECT (camera, "Failed to create encoding profiles"); in gst_camera_bin_create_elements()
1564 GST_WARNING_OBJECT (camera, "Failed to create encoding profiles"); in gst_camera_bin_create_elements()
1568 camera->video_profile = (GstEncodingProfile *) prof; in gst_camera_bin_create_elements()
1569 camera->video_profile_switch = TRUE; in gst_camera_bin_create_elements()
1572 camera->image_encodebin = in gst_camera_bin_create_elements()
1574 if (!camera->image_encodebin) { in gst_camera_bin_create_elements()
1579 g_object_set (camera->image_encodebin, "queue-time-max", (guint64) 0, NULL); in gst_camera_bin_create_elements()
1581 camera->image_encodebin_signal_id = in gst_camera_bin_create_elements()
1582 g_signal_connect (camera->image_encodebin, "element-added", in gst_camera_bin_create_elements()
1583 (GCallback) encodebin_element_added, camera); in gst_camera_bin_create_elements()
1585 camera->imagesink = in gst_camera_bin_create_elements()
1587 if (!camera->imagesink) { in gst_camera_bin_create_elements()
1591 g_object_set (camera->imagesink, "async", FALSE, "post-messages", TRUE, in gst_camera_bin_create_elements()
1594 if (camera->image_profile == NULL) { in gst_camera_bin_create_elements()
1603 camera->image_profile = (GstEncodingProfile *) vprof; in gst_camera_bin_create_elements()
1604 camera->image_profile_switch = TRUE; in gst_camera_bin_create_elements()
1607 camera->viewfinderbin_queue = in gst_camera_bin_create_elements()
1609 if (!camera->viewfinderbin_queue) { in gst_camera_bin_create_elements()
1614 g_object_set (camera->viewfinderbin_queue, "leaky", 2, "silent", TRUE, in gst_camera_bin_create_elements()
1618 gst_bin_add_many (GST_BIN_CAST (camera), in gst_camera_bin_create_elements()
1619 gst_object_ref (camera->video_encodebin), in gst_camera_bin_create_elements()
1620 gst_object_ref (camera->videosink), in gst_camera_bin_create_elements()
1621 gst_object_ref (camera->image_encodebin), in gst_camera_bin_create_elements()
1622 gst_object_ref (camera->imagesink), in gst_camera_bin_create_elements()
1623 gst_object_ref (camera->viewfinderbin_queue), NULL); in gst_camera_bin_create_elements()
1625 gst_element_link_pads_full (camera->video_encodebin, "src", in gst_camera_bin_create_elements()
1626 camera->videosink, "sink", GST_PAD_LINK_CHECK_NOTHING); in gst_camera_bin_create_elements()
1627 gst_element_link_pads_full (camera->image_encodebin, "src", in gst_camera_bin_create_elements()
1628 camera->imagesink, "sink", GST_PAD_LINK_CHECK_NOTHING); in gst_camera_bin_create_elements()
1629 gst_element_link_pads_full (camera->viewfinderbin_queue, "src", in gst_camera_bin_create_elements()
1630 camera->viewfinderbin_capsfilter, "sink", GST_PAD_LINK_CHECK_CAPS); in gst_camera_bin_create_elements()
1631 gst_element_link_pads_full (camera->viewfinderbin_capsfilter, "src", in gst_camera_bin_create_elements()
1632 camera->viewfinderbin, "sink", GST_PAD_LINK_CHECK_CAPS); in gst_camera_bin_create_elements()
1638 srcpad = gst_element_get_static_pad (camera->image_encodebin, "src"); in gst_camera_bin_create_elements()
1641 gst_camera_bin_image_sink_event_probe, camera, NULL); in gst_camera_bin_create_elements()
1655 gst_element_set_locked_state (camera->videosink, TRUE); in gst_camera_bin_create_elements()
1656 gst_element_set_locked_state (camera->imagesink, TRUE); in gst_camera_bin_create_elements()
1658 g_object_set (camera->videosink, "location", camera->location, NULL); in gst_camera_bin_create_elements()
1659 g_object_set (camera->imagesink, "location", camera->location, NULL); in gst_camera_bin_create_elements()
1664 if (camera->flags & GST_CAM_FLAG_NO_AUDIO_CONVERSION) in gst_camera_bin_create_elements()
1666 if (camera->flags & GST_CAM_FLAG_NO_VIDEO_CONVERSION) in gst_camera_bin_create_elements()
1668 g_object_set (camera->video_encodebin, "flags", encbin_flags, NULL); in gst_camera_bin_create_elements()
1672 if (camera->flags & GST_CAM_FLAG_NO_IMAGE_CONVERSION) in gst_camera_bin_create_elements()
1673 g_object_set (camera->image_encodebin, "flags", (1 << 1), NULL); in gst_camera_bin_create_elements()
1675 g_object_set (camera->viewfinderbin, "disable-converters", in gst_camera_bin_create_elements()
1676 camera->flags & GST_CAM_FLAG_NO_VIEWFINDER_CONVERSION ? TRUE : FALSE, in gst_camera_bin_create_elements()
1679 if (camera->video_profile_switch) { in gst_camera_bin_create_elements()
1680 GST_DEBUG_OBJECT (camera, "Switching video-encodebin's profile"); in gst_camera_bin_create_elements()
1681 g_object_set (camera->video_encodebin, "profile", camera->video_profile, in gst_camera_bin_create_elements()
1683 if (GST_PAD_LINK_FAILED (gst_camera_bin_link_encodebin (camera, in gst_camera_bin_create_elements()
1684 camera->video_encodebin, camera->videobin_capsfilter, in gst_camera_bin_create_elements()
1688 camera->video_profile_switch = FALSE; in gst_camera_bin_create_elements()
1694 if (camera->image_profile_switch) { in gst_camera_bin_create_elements()
1695 GST_DEBUG_OBJECT (camera, "Switching image-encodebin's profile"); in gst_camera_bin_create_elements()
1696 g_object_set (camera->image_encodebin, "profile", camera->image_profile, in gst_camera_bin_create_elements()
1698 if (GST_PAD_LINK_FAILED (gst_camera_bin_link_encodebin (camera, in gst_camera_bin_create_elements()
1699 camera->image_encodebin, camera->imagebin_capsfilter, in gst_camera_bin_create_elements()
1703 camera->image_profile_switch = FALSE; in gst_camera_bin_create_elements()
1707 if (camera->src) { in gst_camera_bin_create_elements()
1708 if (camera->user_src && camera->user_src != camera->src) { in gst_camera_bin_create_elements()
1710 if (camera->src_capture_notify_id) in gst_camera_bin_create_elements()
1711 g_signal_handler_disconnect (camera->src, in gst_camera_bin_create_elements()
1712 camera->src_capture_notify_id); in gst_camera_bin_create_elements()
1714 gst_bin_remove (GST_BIN_CAST (camera), camera->src); in gst_camera_bin_create_elements()
1715 gst_object_unref (camera->src); in gst_camera_bin_create_elements()
1716 camera->src = NULL; in gst_camera_bin_create_elements()
1720 if (!camera->src) { in gst_camera_bin_create_elements()
1721 if (camera->user_src) { in gst_camera_bin_create_elements()
1722 camera->src = gst_object_ref (camera->user_src); in gst_camera_bin_create_elements()
1724 camera->src = in gst_camera_bin_create_elements()
1731 g_assert (camera->src != NULL); in gst_camera_bin_create_elements()
1732 g_object_set (camera->src, "mode", camera->mode, NULL); in gst_camera_bin_create_elements()
1733 if (camera->src) { in gst_camera_bin_create_elements()
1734 if (g_object_class_find_property (G_OBJECT_GET_CLASS (camera->src), in gst_camera_bin_create_elements()
1736 g_object_set (camera->src, "post-previews", camera->post_previews, in gst_camera_bin_create_elements()
1737 "preview-caps", camera->preview_caps, "preview-filter", in gst_camera_bin_create_elements()
1738 camera->preview_filter, NULL); in gst_camera_bin_create_elements()
1740 g_signal_connect (G_OBJECT (camera->src), "notify::zoom", in gst_camera_bin_create_elements()
1741 (GCallback) gst_camera_bin_src_notify_zoom_cb, camera); in gst_camera_bin_create_elements()
1742 g_object_set (camera->src, "zoom", camera->zoom, NULL); in gst_camera_bin_create_elements()
1743 g_signal_connect (G_OBJECT (camera->src), "notify::max-zoom", in gst_camera_bin_create_elements()
1744 (GCallback) gst_camera_bin_src_notify_max_zoom_cb, camera); in gst_camera_bin_create_elements()
1747 GstPad *imgsrc = gst_element_get_static_pad (camera->src, "imgsrc"); in gst_camera_bin_create_elements()
1749 gst_bin_add (GST_BIN_CAST (camera), gst_object_ref (camera->src)); in gst_camera_bin_create_elements()
1750 camera->src_capture_notify_id = g_signal_connect (G_OBJECT (camera->src), in gst_camera_bin_create_elements()
1752 G_CALLBACK (gst_camera_bin_src_notify_readyforcapture), camera); in gst_camera_bin_create_elements()
1754 if (!gst_element_link_pads (camera->src, "vfsrc", in gst_camera_bin_create_elements()
1755 camera->viewfinderbin_queue, "sink")) { in gst_camera_bin_create_elements()
1756 GST_ERROR_OBJECT (camera, in gst_camera_bin_create_elements()
1761 if (!gst_element_link_pads (camera->src, "imgsrc", in gst_camera_bin_create_elements()
1762 camera->imagebin_capsfilter, "sink")) { in gst_camera_bin_create_elements()
1763 GST_ERROR_OBJECT (camera, in gst_camera_bin_create_elements()
1767 if (!gst_element_link_pads (camera->src, "vidsrc", in gst_camera_bin_create_elements()
1768 camera->videobin_capsfilter, "sink")) { in gst_camera_bin_create_elements()
1769 GST_ERROR_OBJECT (camera, in gst_camera_bin_create_elements()
1775 gst_camera_bin_image_src_buffer_probe, camera, NULL); in gst_camera_bin_create_elements()
1779 gst_camera_bin_check_and_replace_filter (camera, &camera->image_filter, in gst_camera_bin_create_elements()
1780 camera->user_image_filter, camera->src, camera->imagebin_capsfilter, in gst_camera_bin_create_elements()
1782 gst_camera_bin_check_and_replace_filter (camera, &camera->video_filter, in gst_camera_bin_create_elements()
1783 camera->user_video_filter, camera->src, camera->videobin_capsfilter, in gst_camera_bin_create_elements()
1785 gst_camera_bin_check_and_replace_filter (camera, &camera->viewfinder_filter, in gst_camera_bin_create_elements()
1786 camera->user_viewfinder_filter, camera->viewfinderbin_queue, in gst_camera_bin_create_elements()
1787 camera->viewfinderbin_capsfilter, NULL); in gst_camera_bin_create_elements()
1790 has_audio = gst_camera_bin_video_profile_has_audio (camera); in gst_camera_bin_create_elements()
1791 if (camera->audio_src) { in gst_camera_bin_create_elements()
1792 if ((camera->user_audio_src && camera->user_audio_src != camera->audio_src) in gst_camera_bin_create_elements()
1794 gst_bin_remove (GST_BIN_CAST (camera), camera->audio_src); in gst_camera_bin_create_elements()
1795 gst_bin_remove (GST_BIN_CAST (camera), camera->audio_volume); in gst_camera_bin_create_elements()
1796 gst_bin_remove (GST_BIN_CAST (camera), camera->audio_capsfilter); in gst_camera_bin_create_elements()
1797 gst_object_unref (camera->audio_src); in gst_camera_bin_create_elements()
1798 camera->audio_src = NULL; in gst_camera_bin_create_elements()
1802 if (!camera->audio_src && has_audio) { in gst_camera_bin_create_elements()
1803 if (camera->user_audio_src) { in gst_camera_bin_create_elements()
1804 camera->audio_src = gst_object_ref (camera->user_audio_src); in gst_camera_bin_create_elements()
1806 camera->audio_src = in gst_camera_bin_create_elements()
1808 if (!camera->audio_src) { in gst_camera_bin_create_elements()
1814 gst_element_set_locked_state (camera->audio_src, TRUE); in gst_camera_bin_create_elements()
1821 if (g_object_class_find_property (G_OBJECT_GET_CLASS (camera->audio_src), in gst_camera_bin_create_elements()
1823 g_object_set (camera->audio_src, "provide-clock", FALSE, NULL); in gst_camera_bin_create_elements()
1825 gst_bin_add (GST_BIN_CAST (camera), gst_object_ref (camera->audio_src)); in gst_camera_bin_create_elements()
1826 gst_bin_add (GST_BIN_CAST (camera), gst_object_ref (camera->audio_volume)); in gst_camera_bin_create_elements()
1827 gst_bin_add (GST_BIN_CAST (camera), in gst_camera_bin_create_elements()
1828 gst_object_ref (camera->audio_capsfilter)); in gst_camera_bin_create_elements()
1830 gst_element_link_pads_full (camera->audio_src, "src", in gst_camera_bin_create_elements()
1831 camera->audio_volume, "sink", GST_PAD_LINK_CHECK_CAPS); in gst_camera_bin_create_elements()
1832 gst_element_link_pads_full (camera->audio_volume, "src", in gst_camera_bin_create_elements()
1833 camera->audio_capsfilter, "sink", GST_PAD_LINK_CHECK_CAPS); in gst_camera_bin_create_elements()
1835 srcpad = gst_element_get_static_pad (camera->audio_src, "src"); in gst_camera_bin_create_elements()
1840 gst_camera_bin_audio_src_data_probe, camera, NULL); in gst_camera_bin_create_elements()
1845 gst_camera_bin_check_and_replace_filter (camera, &camera->audio_filter, in gst_camera_bin_create_elements()
1846 camera->user_audio_filter, camera->audio_src, camera->audio_volume, in gst_camera_bin_create_elements()
1851 if (GST_PAD_LINK_FAILED (gst_camera_bin_link_encodebin (camera, in gst_camera_bin_create_elements()
1852 camera->video_encodebin, camera->audio_capsfilter, in gst_camera_bin_create_elements()
1858 camera->elements_created = TRUE; in gst_camera_bin_create_elements()
1862 gst_element_post_message (GST_ELEMENT_CAST (camera), in gst_camera_bin_create_elements()
1863 gst_missing_element_message_new (GST_ELEMENT_CAST (camera), in gst_camera_bin_create_elements()
1865 GST_ELEMENT_ERROR (camera, CORE, MISSING_PLUGIN, in gst_camera_bin_create_elements()
1886 GstCameraBin2 *camera = GST_CAMERA_BIN2_CAST (element); in gst_camera_bin_change_state() local
1891 if (!gst_camera_bin_create_elements (camera)) { in gst_camera_bin_change_state()
1896 GST_CAMERA_BIN2_RESET_PROCESSING_COUNTER (camera); in gst_camera_bin_change_state()
1897 camera->audio_drop_eos = TRUE; in gst_camera_bin_change_state()
1898 camera->audio_send_newseg = FALSE; in gst_camera_bin_change_state()
1901 if (GST_STATE (camera->videosink) >= GST_STATE_PAUSED) in gst_camera_bin_change_state()
1902 gst_element_set_state (camera->videosink, GST_STATE_READY); in gst_camera_bin_change_state()
1903 if (GST_STATE (camera->imagesink) >= GST_STATE_PAUSED) in gst_camera_bin_change_state()
1904 gst_element_set_state (camera->imagesink, GST_STATE_READY); in gst_camera_bin_change_state()
1907 gst_element_set_state (camera->videosink, GST_STATE_NULL); in gst_camera_bin_change_state()
1908 gst_element_set_state (camera->imagesink, GST_STATE_NULL); in gst_camera_bin_change_state()
1918 if (camera->audio_src && GST_STATE (camera->audio_src) >= GST_STATE_READY) in gst_camera_bin_change_state()
1919 gst_element_set_state (camera->audio_src, GST_STATE_READY); in gst_camera_bin_change_state()
1921 gst_tag_setter_reset_tags (GST_TAG_SETTER (camera)); in gst_camera_bin_change_state()
1922 GST_CAMERA_BIN2_RESET_PROCESSING_COUNTER (camera); in gst_camera_bin_change_state()
1923 camera->video_state = GST_CAMERA_BIN_VIDEO_IDLE; in gst_camera_bin_change_state()
1925 g_mutex_lock (&camera->image_capture_mutex); in gst_camera_bin_change_state()
1926 g_slist_foreach (camera->image_location_list, (GFunc) g_free, NULL); in gst_camera_bin_change_state()
1927 g_slist_free (camera->image_location_list); in gst_camera_bin_change_state()
1928 camera->image_location_list = NULL; in gst_camera_bin_change_state()
1930 g_slist_foreach (camera->image_tags_list, in gst_camera_bin_change_state()
1932 g_slist_free (camera->image_tags_list); in gst_camera_bin_change_state()
1933 camera->image_tags_list = NULL; in gst_camera_bin_change_state()
1934 g_mutex_unlock (&camera->image_capture_mutex); in gst_camera_bin_change_state()
1936 g_mutex_lock (&camera->preview_list_mutex); in gst_camera_bin_change_state()
1937 g_slist_foreach (camera->preview_location_list, (GFunc) g_free, NULL); in gst_camera_bin_change_state()
1938 g_slist_free (camera->preview_location_list); in gst_camera_bin_change_state()
1939 camera->preview_location_list = NULL; in gst_camera_bin_change_state()
1940 g_mutex_unlock (&camera->preview_list_mutex); in gst_camera_bin_change_state()
1943 gst_element_set_state (camera->audio_volume, GST_STATE_READY); in gst_camera_bin_change_state()
1944 gst_element_set_state (camera->audio_capsfilter, GST_STATE_READY); in gst_camera_bin_change_state()
1947 if (camera->audio_src) in gst_camera_bin_change_state()
1948 gst_element_set_state (camera->audio_src, GST_STATE_NULL); in gst_camera_bin_change_state()
1951 gst_element_set_state (camera->audio_volume, GST_STATE_NULL); in gst_camera_bin_change_state()
1952 gst_element_set_state (camera->audio_capsfilter, GST_STATE_NULL); in gst_camera_bin_change_state()
1965 GstCameraBin2 *camera = GST_CAMERA_BIN2_CAST (element); in gst_camera_bin_send_event() local
1977 if (camera->videosink) { in gst_camera_bin_send_event()
1978 gst_element_get_state (camera->videosink, ¤t, NULL, 0); in gst_camera_bin_send_event()
1980 gst_element_post_message (camera->videosink, in gst_camera_bin_send_event()
1981 gst_message_new_eos (GST_OBJECT (camera->videosink))); in gst_camera_bin_send_event()
1983 if (camera->imagesink) { in gst_camera_bin_send_event()
1984 gst_element_get_state (camera->imagesink, ¤t, NULL, 0); in gst_camera_bin_send_event()
1986 gst_element_post_message (camera->imagesink, in gst_camera_bin_send_event()
1987 gst_message_new_eos (GST_OBJECT (camera->imagesink))); in gst_camera_bin_send_event()
2001 gst_camera_bin_set_location (GstCameraBin2 * camera, const gchar * location) in gst_camera_bin_set_location() argument
2003 GST_DEBUG_OBJECT (camera, "Setting mode %d location to %s", camera->mode, in gst_camera_bin_set_location()
2005 g_free (camera->location); in gst_camera_bin_set_location()
2006 camera->location = g_strdup (location); in gst_camera_bin_set_location()
2010 gst_camera_bin_set_audio_src (GstCameraBin2 * camera, GstElement * src) in gst_camera_bin_set_audio_src() argument
2012 GST_DEBUG_OBJECT (GST_OBJECT (camera), in gst_camera_bin_set_audio_src()
2015 if (camera->user_audio_src) in gst_camera_bin_set_audio_src()
2016 g_object_unref (camera->user_audio_src); in gst_camera_bin_set_audio_src()
2020 camera->user_audio_src = src; in gst_camera_bin_set_audio_src()
2024 gst_camera_bin_set_camera_src (GstCameraBin2 * camera, GstElement * src) in gst_camera_bin_set_camera_src() argument
2026 GST_DEBUG_OBJECT (GST_OBJECT (camera), in gst_camera_bin_set_camera_src()
2029 if (camera->user_src) in gst_camera_bin_set_camera_src()
2030 g_object_unref (camera->user_src); in gst_camera_bin_set_camera_src()
2034 camera->user_src = src; in gst_camera_bin_set_camera_src()
2041 GstCameraBin2 *camera = GST_CAMERA_BIN2_CAST (object); in gst_camera_bin_set_property() local
2045 gst_camera_bin_change_mode (camera, g_value_get_enum (value)); in gst_camera_bin_set_property()
2048 gst_camera_bin_set_location (camera, g_value_get_string (value)); in gst_camera_bin_set_property()
2051 gst_camera_bin_set_camera_src (camera, g_value_get_object (value)); in gst_camera_bin_set_property()
2054 gst_camera_bin_set_audio_src (camera, g_value_get_object (value)); in gst_camera_bin_set_property()
2057 g_object_set (camera->audio_volume, "mute", g_value_get_boolean (value), in gst_camera_bin_set_property()
2061 GST_DEBUG_OBJECT (camera, in gst_camera_bin_set_property()
2065 if (G_LIKELY (camera->audio_capsfilter)) { in gst_camera_bin_set_property()
2066 g_object_set (camera->audio_capsfilter, "caps", in gst_camera_bin_set_property()
2069 GST_WARNING_OBJECT (camera, "Audio capsfilter missing"); in gst_camera_bin_set_property()
2075 GST_DEBUG_OBJECT (camera, in gst_camera_bin_set_property()
2079 if (G_LIKELY (camera->imagebin_capsfilter)) { in gst_camera_bin_set_property()
2080 g_object_set (camera->imagebin_capsfilter, "caps", in gst_camera_bin_set_property()
2083 GST_WARNING_OBJECT (camera, "Image capsfilter missing"); in gst_camera_bin_set_property()
2088 GST_DEBUG_OBJECT (camera, in gst_camera_bin_set_property()
2092 if (G_LIKELY (camera->videobin_capsfilter)) { in gst_camera_bin_set_property()
2093 g_object_set (camera->videobin_capsfilter, "caps", in gst_camera_bin_set_property()
2096 GST_WARNING_OBJECT (camera, "Video capsfilter missing"); in gst_camera_bin_set_property()
2102 GST_DEBUG_OBJECT (camera, in gst_camera_bin_set_property()
2106 if (G_LIKELY (camera->viewfinderbin_capsfilter)) { in gst_camera_bin_set_property()
2107 g_object_set (camera->viewfinderbin_capsfilter, "caps", in gst_camera_bin_set_property()
2110 GST_WARNING_OBJECT (camera, "Viewfinder capsfilter missing"); in gst_camera_bin_set_property()
2115 camera->post_previews = g_value_get_boolean (value); in gst_camera_bin_set_property()
2116 if (camera->src in gst_camera_bin_set_property()
2117 && g_object_class_find_property (G_OBJECT_GET_CLASS (camera->src), in gst_camera_bin_set_property()
2119 g_object_set (camera->src, "post-previews", camera->post_previews, in gst_camera_bin_set_property()
2123 gst_caps_replace (&camera->preview_caps, in gst_camera_bin_set_property()
2125 if (camera->src in gst_camera_bin_set_property()
2126 && g_object_class_find_property (G_OBJECT_GET_CLASS (camera->src), in gst_camera_bin_set_property()
2128 g_object_set (camera->src, "preview-caps", camera->preview_caps, NULL); in gst_camera_bin_set_property()
2131 if (camera->video_profile) in gst_camera_bin_set_property()
2132 gst_encoding_profile_unref (camera->video_profile); in gst_camera_bin_set_property()
2133 camera->video_profile = (GstEncodingProfile *) g_value_dup_object (value); in gst_camera_bin_set_property()
2134 camera->video_profile_switch = TRUE; in gst_camera_bin_set_property()
2137 if (camera->user_image_filter) in gst_camera_bin_set_property()
2138 g_object_unref (camera->user_image_filter); in gst_camera_bin_set_property()
2140 camera->user_image_filter = g_value_dup_object (value); in gst_camera_bin_set_property()
2143 if (camera->user_video_filter) in gst_camera_bin_set_property()
2144 g_object_unref (camera->user_video_filter); in gst_camera_bin_set_property()
2146 camera->user_video_filter = g_value_dup_object (value); in gst_camera_bin_set_property()
2149 if (camera->user_viewfinder_filter) in gst_camera_bin_set_property()
2150 g_object_unref (camera->user_viewfinder_filter); in gst_camera_bin_set_property()
2152 camera->user_viewfinder_filter = g_value_dup_object (value); in gst_camera_bin_set_property()
2155 if (camera->preview_filter) in gst_camera_bin_set_property()
2156 g_object_unref (camera->preview_filter); in gst_camera_bin_set_property()
2158 camera->preview_filter = g_value_dup_object (value); in gst_camera_bin_set_property()
2159 if (camera->src in gst_camera_bin_set_property()
2160 && g_object_class_find_property (G_OBJECT_GET_CLASS (camera->src), in gst_camera_bin_set_property()
2162 g_object_set (camera->src, "preview-filter", camera->preview_filter, in gst_camera_bin_set_property()
2166 if (camera->user_audio_filter) in gst_camera_bin_set_property()
2167 g_object_unref (camera->user_audio_filter); in gst_camera_bin_set_property()
2169 camera->user_audio_filter = g_value_dup_object (value); in gst_camera_bin_set_property()
2172 g_object_set (camera->viewfinderbin, "video-sink", in gst_camera_bin_set_property()
2176 camera->zoom = g_value_get_float (value); in gst_camera_bin_set_property()
2178 if (camera->zoom > camera->max_zoom) { in gst_camera_bin_set_property()
2179 GST_DEBUG_OBJECT (camera, "Clipping zoom %f to max-zoom %f", in gst_camera_bin_set_property()
2180 camera->zoom, camera->max_zoom); in gst_camera_bin_set_property()
2181 camera->zoom = camera->max_zoom; in gst_camera_bin_set_property()
2183 if (camera->src) in gst_camera_bin_set_property()
2184 g_object_set (camera->src, "zoom", camera->zoom, NULL); in gst_camera_bin_set_property()
2187 if (camera->image_profile) in gst_camera_bin_set_property()
2188 gst_encoding_profile_unref (camera->image_profile); in gst_camera_bin_set_property()
2189 camera->image_profile = (GstEncodingProfile *) g_value_dup_object (value); in gst_camera_bin_set_property()
2195 if (GST_IS_ENCODING_VIDEO_PROFILE (camera->image_profile)) in gst_camera_bin_set_property()
2197 (GstEncodingVideoProfile *) camera->image_profile, TRUE); in gst_camera_bin_set_property()
2198 else if (GST_IS_ENCODING_CONTAINER_PROFILE (camera->image_profile)) { in gst_camera_bin_set_property()
2201 (GstEncodingContainerProfile *) camera->image_profile); in gst_camera_bin_set_property()
2209 camera->image_profile_switch = TRUE; in gst_camera_bin_set_property()
2212 camera->flags = g_value_get_flags (value); in gst_camera_bin_set_property()
2224 GstCameraBin2 *camera = GST_CAMERA_BIN2_CAST (object); in gst_camera_bin_get_property() local
2228 g_value_set_enum (value, camera->mode); in gst_camera_bin_get_property()
2231 g_value_set_string (value, camera->location); in gst_camera_bin_get_property()
2234 g_value_set_object (value, camera->user_src); in gst_camera_bin_get_property()
2237 g_value_set_object (value, camera->user_audio_src); in gst_camera_bin_get_property()
2242 g_object_get (camera->audio_volume, "mute", &mute, NULL); in gst_camera_bin_get_property()
2256 element = camera->src; in gst_camera_bin_get_property()
2259 element = camera->src; in gst_camera_bin_get_property()
2262 element = camera->src; in gst_camera_bin_get_property()
2265 element = camera->audio_src; in gst_camera_bin_get_property()
2287 GST_DEBUG_OBJECT (camera, "Source not created, can't get " in gst_camera_bin_get_property()
2294 if (G_LIKELY (camera->audio_capsfilter)) { in gst_camera_bin_get_property()
2295 g_object_get (camera->audio_capsfilter, "caps", &caps, NULL); in gst_camera_bin_get_property()
2305 if (G_LIKELY (camera->imagebin_capsfilter)) { in gst_camera_bin_get_property()
2306 g_object_get (camera->imagebin_capsfilter, "caps", &caps, NULL); in gst_camera_bin_get_property()
2316 if (G_LIKELY (camera->videobin_capsfilter)) { in gst_camera_bin_get_property()
2317 g_object_get (camera->videobin_capsfilter, "caps", &caps, NULL); in gst_camera_bin_get_property()
2327 if (G_LIKELY (camera->viewfinderbin_capsfilter)) { in gst_camera_bin_get_property()
2328 g_object_get (camera->viewfinderbin_capsfilter, "caps", &caps, NULL); in gst_camera_bin_get_property()
2337 g_value_set_boolean (value, camera->post_previews); in gst_camera_bin_get_property()
2340 if (camera->preview_caps) in gst_camera_bin_get_property()
2341 gst_value_set_caps (value, camera->preview_caps); in gst_camera_bin_get_property()
2344 if (camera->video_profile) { in gst_camera_bin_get_property()
2345 g_value_set_object (value, camera->video_profile); in gst_camera_bin_get_property()
2349 if (camera->user_video_filter) in gst_camera_bin_get_property()
2350 g_value_set_object (value, camera->user_video_filter); in gst_camera_bin_get_property()
2353 if (camera->user_image_filter) in gst_camera_bin_get_property()
2354 g_value_set_object (value, camera->user_image_filter); in gst_camera_bin_get_property()
2357 if (camera->user_viewfinder_filter) in gst_camera_bin_get_property()
2358 g_value_set_object (value, camera->user_viewfinder_filter); in gst_camera_bin_get_property()
2361 if (camera->user_audio_filter) in gst_camera_bin_get_property()
2362 g_value_set_object (value, camera->user_audio_filter); in gst_camera_bin_get_property()
2365 if (camera->preview_filter) in gst_camera_bin_get_property()
2366 g_value_set_object (value, camera->preview_filter); in gst_camera_bin_get_property()
2371 g_object_get (camera->viewfinderbin, "video-sink", &sink, NULL); in gst_camera_bin_get_property()
2376 g_value_set_float (value, camera->zoom); in gst_camera_bin_get_property()
2379 g_value_set_float (value, camera->max_zoom); in gst_camera_bin_get_property()
2382 if (camera->image_profile) { in gst_camera_bin_get_property()
2383 g_value_set_object (value, camera->image_profile); in gst_camera_bin_get_property()
2388 g_atomic_int_get (&camera->processing_counter) == 0); in gst_camera_bin_get_property()
2391 g_value_set_flags (value, camera->flags); in gst_camera_bin_get_property()