本文整理汇总了C++中GST_IS_BIN函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_IS_BIN函数的具体用法?C++ GST_IS_BIN怎么用?C++ GST_IS_BIN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_IS_BIN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: preview_draw_cb
G_MODULE_EXPORT gboolean
preview_draw_cb(
GtkWidget *widget,
cairo_t *cr,
signal_user_data_t *ud)
{
#if defined(_ENABLE_GST)
#if GST_CHECK_VERSION(1, 0, 0)
if (ud->preview->live_enabled && ud->preview->state == PREVIEW_STATE_LIVE)
{
if (GST_STATE(ud->preview->play) >= GST_STATE_PAUSED)
{
GstElement *vsink;
GstVideoOverlay *vover;
g_object_get(ud->preview->play, "video-sink", &vsink, NULL);
if (GST_IS_BIN(vsink))
vover = GST_VIDEO_OVERLAY(gst_bin_get_by_interface(
GST_BIN(vsink), GST_TYPE_VIDEO_OVERLAY));
else
vover = GST_VIDEO_OVERLAY(vsink);
gst_video_overlay_expose(vover);
// For some reason, the exposed region doesn't always get
// cleaned up here. But a delayed gst_x_overlay_expose()
// takes care of it.
g_idle_add((GSourceFunc)delayed_expose_cb, ud);
}
return FALSE;
}
#else
if (ud->preview->live_enabled && ud->preview->state == PREVIEW_STATE_LIVE)
{
if (GST_STATE(ud->preview->play) >= GST_STATE_PAUSED)
{
GstElement *vsink;
GstXOverlay *xover;
g_object_get(ud->preview->play, "video-sink", &vsink, NULL);
if (GST_IS_BIN(vsink))
xover = GST_X_OVERLAY(gst_bin_get_by_interface(
GST_BIN(vsink), GST_TYPE_X_OVERLAY));
else
xover = GST_X_OVERLAY(vsink);
gst_x_overlay_expose(xover);
// For some reason, the exposed region doesn't always get
// cleaned up here. But a delayed gst_x_overlay_expose()
// takes care of it.
g_idle_add((GSourceFunc)delayed_expose_cb, ud);
}
return FALSE;
}
#endif
#endif
if (ud->preview->pix != NULL)
{
_draw_pixbuf(cr, ud->preview->pix);
}
return FALSE;
}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:60,代码来源:preview.c
示例2: _bp_dvd_find_navigation
void _bp_dvd_find_navigation (BansheePlayer *player)
{
GstElement *video_sink = NULL;
GstElement *navigation = NULL;
GstNavigation *previous_navigation;
previous_navigation = player->navigation;
g_object_get (player->playbin, "video-sink", &video_sink, NULL);
if (video_sink == NULL) {
player->navigation = NULL;
if (previous_navigation != NULL) {
gst_object_unref (previous_navigation);
}
}
navigation = GST_IS_BIN (video_sink)
? gst_bin_get_by_interface (GST_BIN (video_sink), GST_TYPE_NAVIGATION)
: video_sink;
player->navigation = GST_IS_NAVIGATION (navigation) ? GST_NAVIGATION (navigation) : NULL;
if (previous_navigation != NULL) {
gst_object_unref (previous_navigation);
}
gst_object_unref (video_sink);
}
开发者ID:3dfxmadscientist,项目名称:gnome-apps,代码行数:28,代码来源:banshee-player-dvd.c
示例3: LOG
void
BasePlatformInterface::PrepareVideoWindow(GstMessage *aMessage)
{
GstElement *element = NULL;
GstXOverlay *xoverlay = NULL;
if (GST_IS_BIN (mVideoSink)) {
/* Get the actual implementing object from the bin */
element = gst_bin_get_by_interface(GST_BIN (mVideoSink),
GST_TYPE_X_OVERLAY);
}
else {
element = mVideoSink;
}
if (GST_IS_X_OVERLAY (element)) {
xoverlay = GST_X_OVERLAY (element);
LOG(("xoverlay interface found, setting video window"));
}
else {
LOG(("No xoverlay interface found, cannot set video window"));
return;
}
SetXOverlayWindowID(xoverlay);
ResizeToWindow();
}
开发者ID:Brijen,项目名称:nightingale-hacking,代码行数:28,代码来源:sbGStreamerPlatformBase.cpp
示例4: watch_container
static guint
watch_container (InsanityGstPipelineTest * ptest, GstBin * bin)
{
GstIterator *it;
gboolean done = FALSE;
GValue data = { 0, };
GstElement *e;
it = gst_bin_iterate_elements (bin);
while (!done) {
switch (gst_iterator_next (it, &data)) {
case GST_ITERATOR_OK:
e = GST_ELEMENT_CAST (g_value_get_object (&data));
add_element_used (ptest, e);
if (GST_IS_BIN (e)) {
watch_container (ptest, GST_BIN (e));
}
g_value_reset (&data);
break;
case GST_ITERATOR_RESYNC:
gst_iterator_resync (it);
break;
case GST_ITERATOR_DONE:
default:
done = TRUE;
break;
}
}
g_value_unset (&data);
gst_iterator_free (it);
return g_signal_connect (bin, "element-added", (GCallback) on_element_added,
ptest);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:gstreamer__attic__insanity-gst,代码行数:34,代码来源:insanitygstpipelinetest.c
示例5: gst_debug_bin_to_dot_file_with_ts
/*
* gst_debug_bin_to_dot_file_with_ts:
* @bin: the top-level pipeline that should be analyzed
* @file_name: output base filename (e.g. "myplayer")
*
* This works like gst_debug_bin_to_dot_file(), but adds the current timestamp
* to the filename, so that it can be used to take multiple snapshots.
*/
void
gst_debug_bin_to_dot_file_with_ts (GstBin * bin,
GstDebugGraphDetails details, const gchar * file_name)
{
gchar *ts_file_name = NULL;
GstClockTime elapsed;
g_return_if_fail (GST_IS_BIN (bin));
if (!file_name) {
file_name = g_get_application_name ();
if (!file_name)
file_name = "unnamed";
}
/* add timestamp */
elapsed = GST_CLOCK_DIFF (_priv_gst_info_start_time,
gst_util_get_timestamp ());
/* we don't use GST_TIME_FORMAT as such filenames would fail on some
* filesystems like fat */
ts_file_name =
g_strdup_printf ("%u.%02u.%02u.%09u-%s", GST_TIME_ARGS (elapsed),
file_name);
gst_debug_bin_to_dot_file (bin, details, ts_file_name);
g_free (ts_file_name);
}
开发者ID:BigBrother-International,项目名称:gstreamer,代码行数:36,代码来源:gstdebugutils.c
示例6: find_cogl_gst_video_sink
static CoglGstVideoSink *
find_cogl_gst_video_sink (GstElement *element)
{
GstElement *sink_element = NULL;
GstIterator *iterator;
GstElement *iterator_value;
GValue value;
if (!GST_IS_BIN (element))
return NULL;
iterator = gst_bin_iterate_recurse (GST_BIN (element));
g_value_init (&value, GST_TYPE_ELEMENT);
while (gst_iterator_next (iterator, &value) == GST_ITERATOR_OK)
{
iterator_value = g_value_get_object (&value);
g_value_reset (&value);
if (COGL_GST_IS_VIDEO_SINK (iterator_value))
{
sink_element = iterator_value;
break;
}
}
g_value_unset (&value);
gst_iterator_free (iterator);
return COGL_GST_VIDEO_SINK (sink_element);
}
开发者ID:3v1n0,项目名称:cogl,代码行数:34,代码来源:cogl-basic-video-player.c
示例7: shmdata_base_reader_clean_element
//FIXME this should be part of the library
void
shmdata_base_reader_clean_element (GstElement *element)
{
if (element != NULL && GST_IS_ELEMENT(element)
&& GST_STATE_CHANGE_FAILURE != GST_STATE_RETURN(element)) {
{ // unlinking pads
GstIterator *pad_iter = gst_element_iterate_pads(element);
gst_iterator_foreach(pad_iter, (GFunc) shmdata_base_reader_unlink_pad, NULL);
gst_iterator_free(pad_iter);
}
{ // releasing request pads
GstIterator *pad_iter = gst_element_iterate_pads(element);
gst_iterator_foreach(pad_iter,
(GFunc) shmdata_base_reader_release_request_pad,
element);
gst_iterator_free(pad_iter);
}
GstState state = GST_STATE_TARGET(element);
if (state != GST_STATE_NULL) {
if (GST_STATE_CHANGE_ASYNC ==
gst_element_set_state(element, GST_STATE_NULL)) {
while (GST_STATE(element) != GST_STATE_NULL) {
// warning this may be blocking
gst_element_get_state(element, NULL, NULL,
GST_CLOCK_TIME_NONE);
}
}
}
if (GST_IS_BIN(gst_element_get_parent(element)))
gst_bin_remove(GST_BIN(gst_element_get_parent(element)), element);
else
gst_object_unref(element);
}
}
开发者ID:step21,项目名称:shmdata,代码行数:36,代码来源:base-reader.c
示例8: bus_callback
static gboolean
bus_callback (GstBus * bus, GstMessage * message, gpointer data)
{
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ERROR:{
GError *err;
gchar *debug;
gst_message_parse_error (message, &err, &debug);
g_print ("Error: %s\n", err->message);
g_error_free (err);
g_free (debug);
/* Write debug graph to file */
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (camerabin),
GST_DEBUG_GRAPH_SHOW_ALL, "camerabin.error");
g_main_loop_quit (loop);
break;
}
case GST_MESSAGE_STATE_CHANGED:
if (GST_IS_BIN (GST_MESSAGE_SRC (message))) {
GstState oldstate, newstate;
gst_message_parse_state_changed (message, &oldstate, &newstate, NULL);
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), "state-changed: %s -> %s",
gst_element_state_get_name (oldstate),
gst_element_state_get_name (newstate));
}
break;
case GST_MESSAGE_EOS:
/* end-of-stream */
GST_INFO ("got eos() - should not happen");
g_main_loop_quit (loop);
break;
case GST_MESSAGE_ELEMENT:
if (GST_MESSAGE_SRC (message) == (GstObject *) camerabin) {
const GstStructure *structure = gst_message_get_structure (message);
if (gst_structure_has_name (structure, "image-done")) {
#ifndef GST_DISABLE_GST_DEBUG
const gchar *fname = gst_structure_get_string (structure, "filename");
GST_DEBUG ("image done: %s", fname);
#endif
if (capture_count < capture_total) {
g_idle_add ((GSourceFunc) run_pipeline, NULL);
} else {
g_main_loop_quit (loop);
}
}
}
break;
default:
/* unhandled message */
break;
}
return TRUE;
}
开发者ID:mrchapp,项目名称:gst-plugins-bad,代码行数:59,代码来源:gst-camerabin2-test.c
示例9: on_element_added
static void
on_element_added (GstElement * bin, GstElement * element,
InsanityGstPipelineTest * ptest)
{
add_element_used (ptest, element);
if (GST_IS_BIN (element))
watch_container (ptest, GST_BIN (element));
}
开发者ID:freedesktop-unofficial-mirror,项目名称:gstreamer__attic__insanity-gst,代码行数:8,代码来源:insanitygstpipelinetest.c
示例10: log_new_element_stats
static void
log_new_element_stats (GstElementStats * stats, GstElement * element,
GstClockTime elapsed)
{
gst_tracer_record_log (tr_new_element, (guint64) (guintptr) g_thread_self (),
elapsed, stats->index, stats->parent_ix, GST_OBJECT_NAME (element),
G_OBJECT_TYPE_NAME (element), GST_IS_BIN (element));
}
开发者ID:like0403,项目名称:gstreamer,代码行数:8,代码来源:gststats.c
示例11: fs_element_added_notifier_add
void
fs_element_added_notifier_add (FsElementAddedNotifier *notifier,
GstBin *bin)
{
g_return_if_fail (notifier && FS_IS_ELEMENT_ADDED_NOTIFIER (notifier));
g_return_if_fail (bin && GST_IS_BIN (bin));
_element_added_callback (NULL, GST_ELEMENT_CAST (bin), notifier);
}
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:9,代码来源:fs-element-added-notifier.c
示例12: gst_validate_bin_monitor_setup
static gboolean
gst_validate_bin_monitor_setup (GstValidateMonitor * monitor)
{
GstIterator *iterator;
gboolean done;
GstElement *element;
GstValidateBinMonitor *bin_monitor = GST_VALIDATE_BIN_MONITOR_CAST (monitor);
GstBin *bin = GST_VALIDATE_BIN_MONITOR_GET_BIN (bin_monitor);
if (!GST_IS_BIN (bin)) {
GST_WARNING_OBJECT (monitor, "Trying to create bin monitor with other "
"type of object");
return FALSE;
}
GST_DEBUG_OBJECT (bin_monitor, "Setting up monitor for bin %" GST_PTR_FORMAT,
bin);
if (g_object_get_data ((GObject *) bin, "validate-monitor")) {
GST_DEBUG_OBJECT (bin_monitor,
"Bin already has a validate-monitor associated");
return FALSE;
}
bin_monitor->element_added_id =
g_signal_connect (bin, "element-added",
G_CALLBACK (_validate_bin_element_added), monitor);
iterator = gst_bin_iterate_elements (bin);
done = FALSE;
while (!done) {
GValue value = { 0, };
switch (gst_iterator_next (iterator, &value)) {
case GST_ITERATOR_OK:
element = g_value_get_object (&value);
gst_validate_bin_monitor_wrap_element (bin_monitor, element);
g_value_reset (&value);
break;
case GST_ITERATOR_RESYNC:
/* TODO how to handle this? */
gst_iterator_resync (iterator);
break;
case GST_ITERATOR_ERROR:
done = TRUE;
break;
case GST_ITERATOR_DONE:
done = TRUE;
break;
}
}
gst_iterator_free (iterator);
return TRUE;
}
开发者ID:reynaldo-samsung,项目名称:gst-devtools,代码行数:55,代码来源:gst-validate-bin-monitor.c
示例13: calculate_latency
static void
calculate_latency (GstElement * parent, GstPad * pad, guint64 ts)
{
if (parent && (!GST_IS_BIN (parent)) &&
GST_OBJECT_FLAG_IS_SET (parent, GST_ELEMENT_FLAG_SINK)) {
GstEvent *ev = g_object_get_qdata ((GObject *) pad, latency_probe_id);
log_latency (gst_event_get_structure (ev), pad, ts);
gst_event_unref (ev);
}
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gstreamer,代码行数:11,代码来源:gstlatency.c
示例14: shmdata_base_reader_set_bin
gboolean
shmdata_base_reader_set_bin (shmdata_base_reader_t * reader, GstElement *bin)
{
if (!GST_IS_BIN (bin))
{
g_warning ("base reader: not a bin");
return FALSE;
}
reader->bin_ = bin;
return TRUE;
}
开发者ID:step21,项目名称:shmdata,代码行数:11,代码来源:base-reader.c
示例15: gst_wrapper_camera_bin_reset_video_src_caps
static void
gst_wrapper_camera_bin_reset_video_src_caps (GstWrapperCameraBinSrc * self,
GstCaps * caps)
{
GstClock *clock;
gint64 base_time;
GST_DEBUG_OBJECT (self, "Resetting src caps to %" GST_PTR_FORMAT, caps);
if (self->src_vid_src) {
clock = gst_element_get_clock (self->src_vid_src);
base_time = gst_element_get_base_time (self->src_vid_src);
gst_element_set_state (self->src_vid_src, GST_STATE_READY);
set_capsfilter_caps (self, caps);
self->drop_newseg = TRUE;
GST_DEBUG_OBJECT (self, "Bringing source up");
gst_element_sync_state_with_parent (self->src_vid_src);
if (clock) {
gst_element_set_clock (self->src_vid_src, clock);
gst_element_set_base_time (self->src_vid_src, base_time);
if (GST_IS_BIN (self->src_vid_src)) {
GstIterator *it =
gst_bin_iterate_elements (GST_BIN (self->src_vid_src));
gpointer item = NULL;
gboolean done = FALSE;
while (!done) {
switch (gst_iterator_next (it, &item)) {
case GST_ITERATOR_OK:
gst_element_set_base_time (GST_ELEMENT (item), base_time);
gst_object_unref (item);
break;
case GST_ITERATOR_RESYNC:
gst_iterator_resync (it);
break;
case GST_ITERATOR_ERROR:
done = TRUE;
break;
case GST_ITERATOR_DONE:
done = TRUE;
break;
}
}
gst_iterator_free (it);
}
gst_object_unref (clock);
}
}
}
开发者ID:Tonyton,项目名称:gstreamer-ducati,代码行数:53,代码来源:gstwrappercamerabinsrc.c
示例16: _element_added_callback
static void
_element_added_callback (GstBin *parent, GstElement *element,
gpointer user_data)
{
FsElementAddedNotifier *notifier = FS_ELEMENT_ADDED_NOTIFIER (user_data);
if (GST_IS_BIN (element)) {
GstIterator *iter = NULL;
gboolean done;
g_signal_connect_object (element, "element-added",
G_CALLBACK (_element_added_callback), notifier, 0);
if (parent)
g_signal_connect_object (element, "parent-unset",
G_CALLBACK (_bin_unparented_cb), notifier, 0);
iter = gst_bin_iterate_elements (GST_BIN (element));
done = FALSE;
while (!done)
{
gpointer item = NULL;
switch (gst_iterator_next (iter, &item)) {
case GST_ITERATOR_OK:
/* We make sure the callback has not already been added */
if (g_signal_handler_find (item,
G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
0, 0, NULL, /* id, detail, closure */
_element_added_callback, notifier) == 0)
_element_added_callback (GST_BIN_CAST (element), item, notifier);
gst_object_unref (item);
break;
case GST_ITERATOR_RESYNC:
// We don't rollback anything, we just ignore already processed ones
gst_iterator_resync (iter);
break;
case GST_ITERATOR_ERROR:
g_error ("Wrong parameters were given?");
done = TRUE;
break;
case GST_ITERATOR_DONE:
done = TRUE;
break;
}
}
gst_iterator_free (iter);
}
g_signal_emit (notifier, signals[ELEMENT_ADDED], 0, parent, element);
}
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:53,代码来源:fs-element-added-notifier.c
示例17: log_new_element_stats
static void
log_new_element_stats (GstElementStats * stats, GstElement * element,
GstClockTime elapsed)
{
gst_tracer_log_trace (gst_structure_new ("new-element",
"thread-id", G_TYPE_UINT, GPOINTER_TO_UINT (g_thread_self ()),
"ts", G_TYPE_UINT64, elapsed,
"ix", G_TYPE_UINT, stats->index,
"parent-ix", G_TYPE_UINT, stats->parent_ix,
"name", G_TYPE_STRING, GST_OBJECT_NAME (element),
"type", G_TYPE_STRING, G_OBJECT_TYPE_NAME (element),
"is-bin", G_TYPE_BOOLEAN, GST_IS_BIN (element), NULL));
}
开发者ID:carlo0815,项目名称:gstreamer1.7.1,代码行数:13,代码来源:gststats.c
示例18: send_latency_probe
static void
send_latency_probe (GstElement * parent, GstPad * pad, guint64 ts)
{
if (parent && (!GST_IS_BIN (parent)) &&
GST_OBJECT_FLAG_IS_SET (parent, GST_ELEMENT_FLAG_SOURCE)) {
GstEvent *latency_probe = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
gst_structure_new_id (latency_probe_id,
latency_probe_pad, GST_TYPE_PAD, pad,
latency_probe_ts, G_TYPE_UINT64, ts,
NULL));
gst_pad_push_event (pad, latency_probe);
}
}
开发者ID:GrokImageCompression,项目名称:gstreamer,代码行数:13,代码来源:gstlatency.c
示例19: bp_video_find_xoverlay
static gboolean
bp_video_find_xoverlay (BansheePlayer *player)
{
GstElement *video_sink = NULL;
GstElement *xoverlay;
GstXOverlay *previous_xoverlay;
gboolean found_xoverlay;
g_object_get (player->playbin, "video-sink", &video_sink, NULL);
g_mutex_lock (player->video_mutex);
previous_xoverlay = player->xoverlay;
if (video_sink == NULL) {
player->xoverlay = NULL;
if (previous_xoverlay != NULL) {
gst_object_unref (previous_xoverlay);
}
g_mutex_unlock (player->video_mutex);
return FALSE;
}
xoverlay = GST_IS_BIN (video_sink)
? gst_bin_get_by_interface (GST_BIN (video_sink), GST_TYPE_X_OVERLAY)
: video_sink;
player->xoverlay = GST_IS_X_OVERLAY (xoverlay) ? GST_X_OVERLAY (xoverlay) : NULL;
if (previous_xoverlay != NULL) {
gst_object_unref (previous_xoverlay);
}
#if !defined(GDK_WINDOWING_WIN32) // We can't rely on aspect ratio from dshowvideosink
if (player->xoverlay != NULL && g_object_class_find_property (
G_OBJECT_GET_CLASS (player->xoverlay), "force-aspect-ratio")) {
g_object_set (G_OBJECT (player->xoverlay), "force-aspect-ratio", TRUE, NULL);
}
#endif
if (player->xoverlay != NULL && g_object_class_find_property (
G_OBJECT_GET_CLASS (player->xoverlay), "handle-events")) {
g_object_set (G_OBJECT (player->xoverlay), "handle-events", FALSE, NULL);
}
gst_object_unref (video_sink);
found_xoverlay = (player->xoverlay != NULL) ? TRUE : FALSE;
g_mutex_unlock (player->video_mutex);
return found_xoverlay;
}
开发者ID:3dfxmadscientist,项目名称:gnome-apps,代码行数:50,代码来源:banshee-player-video.c
示例20: timeout_check
static gboolean
timeout_check (gpointer pipeline)
{
if (GST_IS_BIN (pipeline)) {
gchar *timeout_file =
g_strdup_printf ("timeout-%s", GST_OBJECT_NAME (pipeline));
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
GST_DEBUG_GRAPH_SHOW_ALL, timeout_file);
g_free (timeout_file);
}
return FALSE;
}
开发者ID:rveejay,项目名称:kms-core,代码行数:14,代码来源:passthrough.c
注:本文中的GST_IS_BIN函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论