1 Here's a pipeline that does audio/video MPEG streams with a queue on
2 either side of each decompressor, for a total of 5 threads (read/split,
3 decode audio, decode video, play audio, play video):
5 NOTES: mpegsplit is the intelligence in this pipeline, providing an IDL
6 that allows one to connect things to a GUI.
10 Element(:disk_async_src) [StreamerAsyncSrc]
21 Element(:mpeg_audio_decode) [StreamerVideoFilter]
28 Element(:audio_play) [StreamerAudioSink]
35 Element(:mpeg_video_decode) [StreamerVideoFilter]
42 Element(:video_play) [StreamerVideoSink]
46 A simpler pipeline that just does MPEG videos:
50 Element(:disk_async_src) [GstAsyncSrc]
52 Element(:mpeg_control)
55 Element(:mpeg_video_decode) [GstVideoFilter]
62 Element(:video_play) [GstVideoSink]
65 The code for the above looks roughly like:
67 /* all the objects we're worried about */
68 GstPipeline *mpegplay;
71 GstControl *mpeg_control;
72 GstFilter *mpeg_video_decode;
77 /*** first we create all of the objects ***/
79 mpegplay = gst_pipeline_new();
80 reader = gst_thread_new();
81 disk_src = gst_async_disk_src_new("filename.mpg");
82 mpeg_control = gst_mpeg_control_new();
83 mpeg_video_decode = gst_mpeg_video_decode_new();
84 queue = gst_queue_new();
85 play = gst_thread_new();
86 video_play = gst_video_sink_new();
89 /*** now we start to create the pipeline ***/
91 /* first set up the reader thread */
92 gst_bin_add(reader,disk_src);
93 gst_object_connect(disk_src,"out",mpeg_control,"in");
94 gst_object_connect(mpeg_control,"out",mpeg_audio_decode,"in");
95 gst_bin_ghost_pad(reader,mpeg_audio_decode,"out");
97 /* then set up the player thread */
98 gst_bin_add(play,audio_play);
99 gst_bin_ghost_pad(play,audio_play,"in");
101 /* now plug them all into the main pipeline */
102 gst_bin_add(mp3play,reader);
103 gst_object_connect(reader,"out",queue,"in");
104 gst_object_connect(queue,"out",play,"in");