本文整理汇总了C++中GST_MESSAGE_SRC函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_MESSAGE_SRC函数的具体用法?C++ GST_MESSAGE_SRC怎么用?C++ GST_MESSAGE_SRC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_MESSAGE_SRC函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: create_window
static GstBusSyncReply
create_window(GstBus *bus, GstMessage *msg, gpointer data)
{
preview_t *preview = (preview_t*)data;
switch (GST_MESSAGE_TYPE(msg))
{
case GST_MESSAGE_ELEMENT:
{
#if GST_CHECK_VERSION(1, 0, 0)
if (!gst_is_video_overlay_prepare_window_handle_message(msg))
return GST_BUS_PASS;
gst_video_overlay_set_window_handle(
GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);
#else
if (!gst_structure_has_name(msg->structure, "prepare-xwindow-id"))
return GST_BUS_PASS;
#if !defined(_WIN32)
gst_x_overlay_set_xwindow_id(
GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);
#else
gst_directdraw_sink_set_window_id(
GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);
#endif
#endif
gst_message_unref(msg);
return GST_BUS_DROP;
} break;
default:
{
} break;
}
return GST_BUS_PASS;
}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:35,代码来源:preview.c
示例2: create_window
static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget)
{
GtkAllocation allocation;
if (gst_gtk_handle_need_context (bus, message, NULL))
return GST_BUS_DROP;
// ignore anything but 'prepare-window-handle' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
if (!gst_is_video_overlay_prepare_window_handle_message (message))
return GST_BUS_PASS;
g_print ("setting window handle %p\n", widget);
gst_video_overlay_set_gtk_window (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)), widget);
gtk_widget_get_allocation (widget, &allocation);
gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)), allocation.x, allocation.y, allocation.width, allocation.height);
gst_message_unref (message);
return GST_BUS_DROP;
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-bad,代码行数:25,代码来源:main.cpp
示例3: message_received
static void
message_received (GstBus * bus, GstMessage * message, GstPipeline * bin)
{
GST_INFO ("bus message from \"%" GST_PTR_FORMAT "\": %" GST_PTR_FORMAT,
GST_MESSAGE_SRC (message), message);
switch (message->type) {
case GST_MESSAGE_EOS:
g_main_loop_quit (main_loop);
break;
case GST_MESSAGE_WARNING:{
GError *gerror;
gchar *debug;
gst_message_parse_warning (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
g_error_free (gerror);
g_free (debug);
break;
}
case GST_MESSAGE_ERROR:{
GError *gerror;
gchar *debug;
gst_message_parse_error (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
g_error_free (gerror);
g_free (debug);
g_main_loop_quit (main_loop);
break;
}
default:
break;
}
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-base,代码行数:35,代码来源:adder.c
示例4: _test_reverse_negotiation_message
static void
_test_reverse_negotiation_message (GstBus * bus, GstMessage * message,
GMainLoop * loop)
{
GError *err = NULL;
gchar *debug;
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ERROR:
gst_message_parse_error (message, &err, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), err, debug);
g_error_free (err);
g_free (debug);
g_assert_not_reached ();
break;
case GST_MESSAGE_WARNING:
gst_message_parse_warning (message, &err, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), err, debug);
g_error_free (err);
g_free (debug);
g_assert_not_reached ();
break;
case GST_MESSAGE_EOS:
g_main_loop_quit (loop);
break;
default:
break;
}
}
开发者ID:rawoul,项目名称:gst-plugins-base,代码行数:29,代码来源:videoscale.c
示例5: 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
示例6: default_msg_handler
static bool default_msg_handler( decoder_t *p_dec, GstMessage *p_msg )
{
bool err = false;
switch( GST_MESSAGE_TYPE( p_msg ) ){
case GST_MESSAGE_ERROR:
{
gchar *psz_debug;
GError *p_error;
gst_message_parse_error( p_msg, &p_error, &psz_debug );
g_free( psz_debug );
msg_Err( p_dec, "Error from %s: %s",
GST_ELEMENT_NAME( GST_MESSAGE_SRC( p_msg ) ),
p_error->message );
g_error_free( p_error );
err = true;
}
break;
case GST_MESSAGE_WARNING:
{
gchar *psz_debug;
GError *p_error;
gst_message_parse_warning( p_msg, &p_error, &psz_debug );
g_free( psz_debug );
msg_Warn( p_dec, "Warning from %s: %s",
GST_ELEMENT_NAME( GST_MESSAGE_SRC( p_msg ) ),
p_error->message );
g_error_free( p_error );
}
break;
case GST_MESSAGE_INFO:
{
gchar *psz_debug;
GError *p_error;
gst_message_parse_info( p_msg, &p_error, &psz_debug );
g_free( psz_debug );
msg_Info( p_dec, "Info from %s: %s",
GST_ELEMENT_NAME( GST_MESSAGE_SRC( p_msg ) ),
p_error->message );
g_error_free( p_error );
}
break;
default:
break;
}
return err;
}
开发者ID:CityFire,项目名称:vlc,代码行数:54,代码来源:gstdecode.c
示例7: message_received
static void
message_received (GstBus * bus, GstMessage * message, gpointer user_data)
{
if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) {
GST_WARNING_OBJECT (GST_MESSAGE_SRC (message), "error: %" GST_PTR_FORMAT,
message);
} else {
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), "eos: %" GST_PTR_FORMAT,
message);
}
g_main_loop_quit (user_data);
}
开发者ID:Buzztrax,项目名称:buzztrax,代码行数:12,代码来源:e-sink-bin.c
示例8: typefind_message_received
static void
typefind_message_received (GstBus * bus, GstMessage * message,
gpointer user_data)
{
if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) {
GST_WARNING_OBJECT (GST_MESSAGE_SRC (message),
"error for '%s': %" GST_PTR_FORMAT, (gchar *) user_data, message);
} else {
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message),
"eos for '%s': %" GST_PTR_FORMAT, (gchar *) user_data, message);
}
g_main_loop_quit (typefind_main_loop);
}
开发者ID:Buzztrax,项目名称:buzztrax,代码行数:13,代码来源:e-sink-bin.c
示例9: ges_validate_handle_request_state_change
void
ges_validate_handle_request_state_change (GstMessage * message,
GApplication * application)
{
GstState state;
gst_message_parse_request_state (message, &state);
if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))
&& state == GST_STATE_NULL) {
gst_validate_printf (GST_MESSAGE_SRC (message),
"State change request NULL, " "quiting application\n");
g_application_quit (application);
}
}
开发者ID:GStreamer,项目名称:gst-editing-services,代码行数:15,代码来源:ges-validate.c
示例10: create_window
static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, gpointer data)
{
GstGLClutterActor **actor = (GstGLClutterActor **) data;
static gint count = 0;
static GMutex mutex;
// ignore anything but 'prepare-window-handle' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
if (!gst_is_video_overlay_prepare_window_handle_message (message))
return GST_BUS_PASS;
g_mutex_lock (&mutex);
if (count < N_ACTORS) {
g_message ("adding actor %d", count);
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC
(message)), actor[count]->win);
clutter_threads_add_idle ((GSourceFunc) create_actor, actor[count]);
count++;
}
g_mutex_unlock (&mutex);
gst_message_unref (message);
return GST_BUS_DROP;
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-bad,代码行数:28,代码来源:clutteractortee.c
示例11: handle_message
static gboolean
handle_message (GstBus * bus, GstMessage * message, gpointer data)
{
GstElement *bin = GST_ELEMENT_CAST (data);
switch (message->type) {
case GST_MESSAGE_EOS:
g_message ("got EOS");
g_main_loop_quit (loop);
break;
case GST_MESSAGE_WARNING:
case GST_MESSAGE_ERROR:
{
GError *gerror;
gchar *debug;
if (message->type == GST_MESSAGE_ERROR)
gst_message_parse_error (message, &gerror, &debug);
else
gst_message_parse_warning (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
g_error_free (gerror);
g_free (debug);
g_main_loop_quit (loop);
break;
}
case GST_MESSAGE_ASYNC_DONE:
g_timeout_add (40, (GSourceFunc) do_step, bin);
break;
default:
break;
}
return TRUE;
}
开发者ID:GrokImageCompression,项目名称:gst-plugins-base,代码行数:35,代码来源:stepping.c
示例12: pointerDetector_receive_message
void
pointerDetector_receive_message (GstBus *bus, GstMessage *message, gpointer pointerDetector)
{
const GstStructure *st;
gchar *windowID;
const gchar *type;
std::string windowIDStr, typeStr;
PointerDetectorFilter *filter = (PointerDetectorFilter *) pointerDetector;
if (GST_MESSAGE_SRC (message) != GST_OBJECT (filter->pointerDetector) ||
GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return;
st = gst_message_get_structure (message);
type = gst_structure_get_name (st);
if ( (g_strcmp0 (type, "window-out") != 0) &&
(g_strcmp0 (type, "window-in") != 0) ) {
GST_WARNING ("The message does not have the correct name");
return;
}
if (!gst_structure_get (st, "window", G_TYPE_STRING , &windowID, NULL) ) {
GST_WARNING ("The message does not contain the window ID");
return;
}
windowIDStr = windowID;
typeStr = type;
g_free (windowID);
filter->raiseEvent (typeStr, windowIDStr);
}
开发者ID:sgala,项目名称:kurento-media-server,代码行数:35,代码来源:PointerDetectorFilter.cpp
示例13: my_bus_callback
static gboolean
my_bus_callback (GstBus * bus, GstMessage * message, gpointer data)
{
GstElement *sender = (GstElement *) GST_MESSAGE_SRC (message);
const gchar *name = gst_element_get_name (sender);
GMainLoop *loop = (GMainLoop *) data;
g_print ("Got %s message from %s\n", GST_MESSAGE_TYPE_NAME (message), name);
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ERROR:{
GError *err;
gchar *debug;
gst_message_parse_error (message, &err, &debug);
g_print ("Error: %s (%s)\n", err->message, debug);
g_error_free (err);
g_free (debug);
g_main_loop_quit (loop);
break;
}
case GST_MESSAGE_EOS:
/* end-of-stream */
g_main_loop_quit (loop);
break;
default:
/* unhandled message */
break;
}
return TRUE;
}
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:34,代码来源:codec-select.c
示例14: BufferingMessageReceived
void GstEnginePipeline::BufferingMessageReceived(GstMessage* msg) {
// Only handle buffering messages from the queue2 element in audiobin - not
// the one that's created automatically by uridecodebin.
if (GST_ELEMENT(GST_MESSAGE_SRC(msg)) != queue_) {
return;
}
// If we are loading new next track, we don't have to pause the playback.
// The buffering is for the next track and not the current one.
if (emit_track_ended_on_stream_start_) {
qLog(Debug) << "Buffering next track";
return;
}
int percent = 0;
gst_message_parse_buffering(msg, &percent);
const GstState current_state = state();
if (percent == 0 && current_state == GST_STATE_PLAYING && !buffering_) {
buffering_ = true;
emit BufferingStarted();
SetState(GST_STATE_PAUSED);
} else if (percent == 100 && buffering_) {
buffering_ = false;
emit BufferingFinished();
SetState(GST_STATE_PLAYING);
} else if (buffering_) {
emit BufferingProgress(percent);
}
}
开发者ID:redyoshi49q,项目名称:Clementine,代码行数:33,代码来源:gstenginepipeline.cpp
示例15: busMessage
void ZBarFilterImpl::busMessage (GstMessage *message)
{
if (GST_MESSAGE_SRC (message) == GST_OBJECT (zbar) &&
GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) {
const GstStructure *st;
guint64 ts;
gchar *type, *symbol;
st = gst_message_get_structure (message);
if (g_strcmp0 (gst_structure_get_name (st), "barcode") != 0) {
return;
}
if (!gst_structure_get (st, "timestamp", G_TYPE_UINT64, &ts,
"type", G_TYPE_STRING, &type, "symbol",
G_TYPE_STRING, &symbol, NULL) ) {
return;
}
std::string symbolStr (symbol);
std::string typeStr (type);
g_free (type);
g_free (symbol);
barcodeDetected (ts, typeStr, symbolStr);
}
}
开发者ID:kirushyk,项目名称:kms-filters,代码行数:30,代码来源:ZBarFilterImpl.cpp
示例16: _bus_stop_stream_cb
static gboolean
_bus_stop_stream_cb (GstBus *bus, GstMessage *message, gpointer user_data)
{
FsStreamTransmitter *st = user_data;
GstState oldstate, newstate, pending;
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_STATE_CHANGED ||
G_OBJECT_TYPE (GST_MESSAGE_SRC (message)) != GST_TYPE_PIPELINE)
return bus_error_callback (bus, message, user_data);
gst_message_parse_state_changed (message, &oldstate, &newstate, &pending);
if (newstate != GST_STATE_PLAYING)
return TRUE;
if (pending != GST_STATE_VOID_PENDING)
ts_fail ("New state playing, but pending is %d", pending);
GST_DEBUG ("Stopping stream transmitter");
fs_stream_transmitter_stop (st);
g_object_unref (st);
GST_DEBUG ("Stopped stream transmitter");
g_atomic_int_set(&running, FALSE);
g_main_loop_quit (loop);
return TRUE;
}
开发者ID:pexip,项目名称:farstream,代码行数:30,代码来源:rawudp.c
示例17: event_loop
static void
event_loop (GstElement * pipe)
{
GstBus *bus;
GstMessage *message = NULL;
bus = gst_element_get_bus (GST_ELEMENT (pipe));
while (TRUE) {
message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);
g_assert (message != NULL);
switch (message->type) {
case GST_MESSAGE_EOS:
gst_message_unref (message);
return;
case GST_MESSAGE_WARNING:
case GST_MESSAGE_ERROR:{
GError *gerror;
gchar *debug;
gst_message_parse_error (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
gst_message_unref (message);
g_error_free (gerror);
g_free (debug);
return;
}
default:
gst_message_unref (message);
break;
}
}
}
开发者ID:genesi,项目名称:gstreamer,代码行数:35,代码来源:typefind.c
示例18: bus_handler
static gboolean
bus_handler (GstBus * bus, GstMessage * message, gpointer data)
{
GMainLoop *loop = (GMainLoop *) data;
switch (message->type) {
case GST_MESSAGE_EOS:
g_main_loop_quit (loop);
break;
case GST_MESSAGE_WARNING:
case GST_MESSAGE_ERROR:{
GError *gerror;
gchar *debug;
if (message->type == GST_MESSAGE_WARNING)
gst_message_parse_warning (message, &gerror, &debug);
else
gst_message_parse_error (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
gst_message_unref (message);
g_error_free (gerror);
g_free (debug);
g_main_loop_quit (loop);
break;
}
default:
break;
}
return TRUE;
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:31,代码来源:assrender.c
示例19: sync_bus_callback
static GstBusSyncReply
sync_bus_callback (GstBus * bus, GstMessage * message, gpointer data)
{
const GstStructure *st;
const GValue *image;
GstBuffer *buf = NULL;
guint8 *data_buf = NULL;
gchar *caps_string;
guint size = 0;
gchar *preview_filename = NULL;
FILE *f = NULL;
size_t written;
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ELEMENT:{
st = gst_message_get_structure (message);
if (st) {
if (gst_structure_has_name (message->structure, "prepare-xwindow-id")) {
if (!no_xwindow && window) {
gst_x_overlay_set_window_handle (GST_X_OVERLAY (GST_MESSAGE_SRC
(message)), window);
gst_message_unref (message);
message = NULL;
return GST_BUS_DROP;
}
} else if (gst_structure_has_name (st, "preview-image")) {
GST_DEBUG ("preview-image");
/* extract preview-image from msg */
image = gst_structure_get_value (st, "buffer");
if (image) {
buf = gst_value_get_buffer (image);
data_buf = GST_BUFFER_DATA (buf);
size = GST_BUFFER_SIZE (buf);
preview_filename = g_strdup_printf ("test_vga.rgb");
caps_string = gst_caps_to_string (GST_BUFFER_CAPS (buf));
g_print ("writing buffer to %s, elapsed: %.2fs, buffer caps: %s\n",
preview_filename, g_timer_elapsed (timer, NULL), caps_string);
g_free (caps_string);
f = g_fopen (preview_filename, "w");
if (f) {
written = fwrite (data_buf, size, 1, f);
if (!written) {
g_print ("error writing file\n");
}
fclose (f);
} else {
g_print ("error opening file for raw image writing\n");
}
g_free (preview_filename);
}
}
}
break;
}
default:
/* unhandled message */
break;
}
return GST_BUS_PASS;
}
开发者ID:mrchapp,项目名称:gst-plugins-bad,代码行数:60,代码来源:gst-camerabin2-test.c
示例20: handle_message
/* Process messages from GStreamer */
static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data) {
GError *err;
gchar *debug_info;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_ERROR:
gst_message_parse_error (msg, &err, &debug_info);
g_printerr ("Error received from element %s: %s\n", GST_OBJECT_NAME (msg->src), err->message);
g_printerr ("Debugging information: %s\n", debug_info ? debug_info : "none");
g_clear_error (&err);
g_free (debug_info);
g_main_loop_quit (data->main_loop);
break;
case GST_MESSAGE_EOS:
g_print ("End-Of-Stream reached.\n");
g_main_loop_quit (data->main_loop);
break;
case GST_MESSAGE_STATE_CHANGED: {
GstState old_state, new_state, pending_state;
gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);
if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->playbin2)) {
if (new_state == GST_STATE_PLAYING) {
/* Once we are in the playing state, analyze the streams */
analyze_streams (data);
}
}
}
break;
}
/* We want to keep receiving messages */
return TRUE;
}
开发者ID:kissdarkwind,项目名称:samples,代码行数:34,代码来源:test2.c
注:本文中的GST_MESSAGE_SRC函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论