• Home
  • Raw
  • Download

Lines Matching refs:app

80 read_data (App * app)  in read_data()  argument
86 if (app->offset >= app->length) { in read_data()
88 g_signal_emit_by_name (app->appsrc, "end-of-stream", &ret); in read_data()
96 if (app->offset + len > app->length) in read_data()
97 len = app->length - app->offset; in read_data()
101 app->data, app->length, app->offset, len, NULL, NULL)); in read_data()
104 app->offset, len); in read_data()
105 g_signal_emit_by_name (app->appsrc, "push-buffer", buffer, &ret); in read_data()
112 app->offset += len; in read_data()
120 start_feed (GstElement * playbin, guint size, App * app) in start_feed() argument
122 if (app->sourceid == 0) { in start_feed()
124 app->sourceid = g_idle_add ((GSourceFunc) read_data, app); in start_feed()
131 stop_feed (GstElement * playbin, App * app) in stop_feed() argument
133 if (app->sourceid != 0) { in stop_feed()
135 g_source_remove (app->sourceid); in stop_feed()
136 app->sourceid = 0; in stop_feed()
145 found_source (GObject * object, GObject * orig, GParamSpec * pspec, App * app) in found_source() argument
148 g_object_get (orig, pspec->name, &app->appsrc, NULL); in found_source()
150 GST_DEBUG ("got appsrc %p", app->appsrc); in found_source()
155 g_object_set (app->appsrc, "size", (gint64) app->length, NULL); in found_source()
159 g_signal_connect (app->appsrc, "need-data", G_CALLBACK (start_feed), app); in found_source()
160 g_signal_connect (app->appsrc, "enough-data", G_CALLBACK (stop_feed), app); in found_source()
164 bus_message (GstBus * bus, GstMessage * message, App * app) in bus_message() argument
172 g_main_loop_quit (app->loop); in bus_message()
175 g_main_loop_quit (app->loop); in bus_message()
186 App *app = &s_app; in main() local
201 app->file = g_mapped_file_new (argv[1], FALSE, &error); in main()
209 app->length = g_mapped_file_get_length (app->file); in main()
210 app->data = (guint8 *) g_mapped_file_get_contents (app->file); in main()
211 app->offset = 0; in main()
215 app->loop = g_main_loop_new (NULL, TRUE); in main()
217 app->playbin = gst_element_factory_make ("playbin", NULL); in main()
218 g_assert (app->playbin); in main()
220 bus = gst_pipeline_get_bus (GST_PIPELINE (app->playbin)); in main()
223 gst_bus_add_watch (bus, (GstBusFunc) bus_message, app); in main()
226 g_object_set (app->playbin, "uri", "appsrc://", NULL); in main()
230 g_signal_connect (app->playbin, "deep-notify::source", in main()
231 (GCallback) found_source, app); in main()
234 gst_element_set_state (app->playbin, GST_STATE_PLAYING); in main()
237 g_main_loop_run (app->loop); in main()
241 gst_element_set_state (app->playbin, GST_STATE_NULL); in main()
244 g_mapped_file_unref (app->file); in main()
247 g_main_loop_unref (app->loop); in main()