1 OUTDATED, methods have different names now
2 ------------------------------------------
5 Here's a pipeline that does audio/video MPEG streams with a queue on
6 either side of each decompressor, for a total of 5 threads (read/split,
7 decode audio, decode video, play audio, play video):
9 NOTES: mpegsplit is the intelligence in this pipeline, providing an IDL
10 that allows one to connect things to a GUI.
14 Element(:disk_async_src) [StreamerAsyncSrc]
25 Element(:mpeg_audio_decode) [StreamerVideoFilter]
32 Element(:audio_play) [StreamerAudioSink]
39 Element(:mpeg_video_decode) [StreamerVideoFilter]
46 Element(:video_play) [StreamerVideoSink]
50 A simpler pipeline that just does MPEG videos:
54 Element(:disk_async_src) [GstAsyncSrc]
56 Element(:mpeg_control)
59 Element(:mpeg_video_decode) [GstVideoFilter]
66 Element(:video_play) [GstVideoSink]
69 The code for the above looks roughly like:
71 /* all the objects we're worried about */
72 GstPipeline *mpegplay;
75 GstControl *mpeg_control;
76 GstFilter *mpeg_video_decode;
81 /*** first we create all of the objects ***/
83 mpegplay = gst_pipeline_new();
84 reader = gst_thread_new();
85 disk_src = gst_async_disk_src_new("filename.mpg");
86 mpeg_control = gst_mpeg_control_new();
87 mpeg_video_decode = gst_mpeg_video_decode_new();
88 queue = gst_queue_new();
89 play = gst_thread_new();
90 video_play = gst_video_sink_new();
93 /*** now we start to create the pipeline ***/
95 /* first set up the reader thread */
96 gst_bin_add(reader,disk_src);
97 gst_object_connect(disk_src,"out",mpeg_control,"in");
98 gst_object_connect(mpeg_control,"out",mpeg_audio_decode,"in");
99 gst_bin_ghost_pad(reader,mpeg_audio_decode,"out");
101 /* then set up the player thread */
102 gst_bin_add(play,audio_play);
103 gst_bin_ghost_pad(play,audio_play,"in");
105 /* now plug them all into the main pipeline */
106 gst_bin_add(mp3play,reader);
107 gst_object_connect(reader,"out",queue,"in");
108 gst_object_connect(queue,"out",play,"in");