mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 12:02:27 +00:00
Update example
Add some more docs and remove some old code from the example.
This commit is contained in:
parent
6f9b659b1d
commit
83cf4d8ee0
1 changed files with 6 additions and 16 deletions
|
@ -40,29 +40,19 @@ main (int argc, char *argv[])
|
||||||
* that be used to map uri mount points to media factories */
|
* that be used to map uri mount points to media factories */
|
||||||
mapping = gst_rtsp_server_get_media_mapping (server);
|
mapping = gst_rtsp_server_get_media_mapping (server);
|
||||||
|
|
||||||
/* make a media factory for a webcam. The default media factory can use
|
/* make a media factory for a test stream. The default media factory can use
|
||||||
* gst-launch syntax to create pipelines. */
|
* gst-launch syntax to create pipelines.
|
||||||
factory = gst_rtsp_media_factory_new ();
|
* any launch line works as long as it contains elements named pay%d. Each
|
||||||
#if 0
|
|
||||||
gst_rtsp_media_factory_set_launch (factory, "( "
|
|
||||||
"v4l2src ! video/x-raw-yuv,width=352,height=288,framerate=15/1 ! "
|
|
||||||
"queue ! videorate ! ffmpegcolorspace ! "
|
|
||||||
"x264enc bitrate=300 ! rtph264pay name=pay0 pt=96 "
|
|
||||||
"alsasrc ! audio/x-raw-int,rate=8000 ! queue ! "
|
|
||||||
"amrnbenc ! rtpamrpay name=pay1 pt=97 "
|
|
||||||
")");
|
|
||||||
#endif
|
|
||||||
/* any launch line works as long as it contains elements named pay%d. Each
|
|
||||||
* element with pay%d names will be a stream */
|
* element with pay%d names will be a stream */
|
||||||
|
factory = gst_rtsp_media_factory_new ();
|
||||||
gst_rtsp_media_factory_set_launch (factory, "( "
|
gst_rtsp_media_factory_set_launch (factory, "( "
|
||||||
"videotestsrc ! video/x-raw-yuv,width=352,height=288,framerate=15/1 ! "
|
"videotestsrc ! video/x-raw-yuv,width=352,height=288,framerate=15/1 ! "
|
||||||
"x264enc bitrate=300 ! rtph264pay name=pay0 pt=96 "
|
"x264enc bitrate=300 ! rtph264pay name=pay0 pt=96 "
|
||||||
"audiotestsrc ! audio/x-raw-int,rate=8000 ! "
|
"audiotestsrc ! audio/x-raw-int,rate=8000 ! "
|
||||||
"alawenc ! rtppcmapay name=pay1 pt=97 "
|
"alawenc ! rtppcmapay name=pay1 pt=97 "
|
||||||
")");
|
")");
|
||||||
|
/* attach the test factory to the /test url */
|
||||||
/* attach the factory to the /camera url */
|
gst_rtsp_media_mapping_add_factory (mapping, "/test", factory);
|
||||||
gst_rtsp_media_mapping_add_factory (mapping, "/camera", factory);
|
|
||||||
|
|
||||||
/* don't need the ref to the mapper anymore */
|
/* don't need the ref to the mapper anymore */
|
||||||
g_object_unref (mapping);
|
g_object_unref (mapping);
|
||||||
|
|
Loading…
Reference in a new issue