summaryrefslogtreecommitdiffstats
path: root/examples/app/appsrc_ex.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-06-05 16:38:50 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-06-05 16:38:50 +0000
commit308354073ca3a67261f6cfa096490803bf037ccd (patch)
tree3d22cda2df0c74b2be38607998f394655fa9c109 /examples/app/appsrc_ex.c
parentc6dffa0538819d2995d105e63b445359faa340d0 (diff)
downloadgst-plugins-bad-308354073ca3a67261f6cfa096490803bf037ccd.tar.gz
gst-plugins-bad-308354073ca3a67261f6cfa096490803bf037ccd.tar.bz2
gst-plugins-bad-308354073ca3a67261f6cfa096490803bf037ccd.zip
examples/app/: Added an example on how to use appsrc in playbin in streaming mode from an mmapped file.
Original commit message from CVS: * examples/app/.cvsignore: * examples/app/Makefile.am: * examples/app/appsrc-stream.c: (read_data), (start_feed), (stop_feed), (found_source), (bus_message), (main): Added an example on how to use appsrc in playbin in streaming mode from an mmapped file. * examples/app/appsrc_ex.c: (main): Set pipeline to NULL to free queued buffers. * gst-libs/gst/app/gstapp-marshal.list: * gst-libs/gst/app/gstappsrc.c: (stream_type_get_type), (_do_init), (gst_app_src_class_init), (gst_app_src_init), (gst_app_src_flush_queued), (gst_app_src_dispose), (gst_app_src_set_property), (gst_app_src_get_property), (gst_app_src_unlock), (gst_app_src_unlock_stop), (gst_app_src_start), (gst_app_src_stop), (gst_app_src_is_seekable), (gst_app_src_check_get_range), (gst_app_src_do_seek), (gst_app_src_create), (gst_app_src_set_stream_type), (gst_app_src_get_stream_type), (gst_app_src_set_max_bytes), (gst_app_src_get_max_bytes), (gst_app_src_push_buffer), (gst_app_src_end_of_stream), (gst_app_src_uri_get_type), (gst_app_src_uri_get_protocols), (gst_app_src_uri_get_uri), (gst_app_src_uri_set_uri), (gst_app_src_uri_handler_init): * gst-libs/gst/app/gstappsrc.h: Measure max queue size in bytes instead. Add support for 3 modes of operation, streaming, seekable and random-access, making basesrc handle the scheduling modes for each. Add appsrc:// uri handler so that automatic plugging can be done from playbin2 or uridecodebin, for example. Added support for custom segment formats. Add support for push and pull based operations from the application. Expand the methods so that errors can be detected. Flush the queued buffers on seeks and when shutting down. Add signals to inform the app that a seek must happen.
Diffstat (limited to 'examples/app/appsrc_ex.c')
-rw-r--r--examples/app/appsrc_ex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/app/appsrc_ex.c b/examples/app/appsrc_ex.c
index c6f8b29e..bc629fb0 100644
--- a/examples/app/appsrc_ex.c
+++ b/examples/app/appsrc_ex.c
@@ -62,8 +62,8 @@ main (int argc, char *argv[])
data = malloc (100);
memset (data, i, 100);
- printf ("%d: creating buffer for pointer %p\n", i, data);
buf = gst_app_buffer_new (data, 100, dont_eat_my_chicken_wings, data);
+ printf ("%d: creating buffer for pointer %p, %p\n", i, data, buf);
gst_app_src_push_buffer (GST_APP_SRC (app->src), buf);
}
@@ -73,8 +73,10 @@ main (int argc, char *argv[])
GstBuffer *buf;
buf = gst_app_sink_pull_buffer (GST_APP_SINK (app->sink));
+ printf ("retrieved buffer %p\n", buf);
gst_buffer_unref (buf);
}
+ gst_element_set_state (app->pipe, GST_STATE_NULL);
return 0;
}