2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <gst/rtsp-server/rtsp-server.h>
23 #define PACKAGE "mtpr_rtsp_test"
28 #define LOG_TAG "MTPR_TEST"
30 #define DEFAULT_RTSP_PORT "8554"
32 int main(int argc, char *argv[])
35 GstRTSPServer *server;
36 GstRTSPMountPoints *mounts;
37 GstRTSPMediaFactory *factory;
40 g_print("Enter launch cmd : \"( decodebin name=depay0 ! videoconvert ! tizenwlsink )\"\n");
45 loop = g_main_loop_new(NULL, FALSE);
47 server = gst_rtsp_server_new();
48 g_object_set(server, "service", DEFAULT_RTSP_PORT, NULL);
50 mounts = gst_rtsp_server_get_mount_points(server);
52 factory = gst_rtsp_media_factory_new();
53 gst_rtsp_media_factory_set_transport_mode(factory, GST_RTSP_TRANSPORT_MODE_RECORD);
54 gst_rtsp_media_factory_set_launch(factory, argv[1]);
56 gst_rtsp_mount_points_add_factory(mounts, "/test", factory);
57 g_object_unref(mounts);
59 gst_rtsp_server_attach(server, NULL);
61 g_print("stream ready at rtsp://127.0.0.1:%s/test\n", DEFAULT_RTSP_PORT);
62 g_main_loop_run(loop);