From 9ef61a844faab4b53df8d365237ba478d11da933 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Mon, 28 Oct 2019 13:11:05 +0900 Subject: [PATCH] Modify static link test case for mp4 Change-Id: I57740991bd3bfce88e133982787f73f1e520b80c Signed-off-by: Hyunil --- test/media_streamer_test.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/test/media_streamer_test.c b/test/media_streamer_test.c index 848b73e..6c7a92e 100644 --- a/test/media_streamer_test.c +++ b/test/media_streamer_test.c @@ -531,8 +531,13 @@ static void _create_static_video_mp4_playing(void) media_streamer_node_add(current_media_streamer, filesrc); APPEND_NODE(filesrc); + media_streamer_node_h qt_demux = NULL; + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_DEMUXER, cfmt_mp4, NULL, &qt_demux); + media_streamer_node_add(current_media_streamer, qt_demux); + APPEND_NODE(qt_demux); + media_streamer_node_h video_decoder = NULL; - media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, cfmt_mp4, NULL, &video_decoder); + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER, vfmt_h264, NULL, &video_decoder); media_streamer_node_add(current_media_streamer, video_decoder); APPEND_NODE(video_decoder); @@ -546,8 +551,20 @@ static void _create_static_video_mp4_playing(void) media_streamer_node_set_param(video_sink, MEDIA_STREAMER_PARAM_DISPLAY, (void*)ad.win); APPEND_NODE(video_sink); - media_streamer_node_link(filesrc, "src", video_decoder, "sink"); + media_streamer_node_h audio_decoder = NULL; + media_streamer_node_create(MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER, afmt_aac, NULL, &audio_decoder); + media_streamer_node_add(current_media_streamer, audio_decoder); + APPEND_NODE(audio_decoder); + + media_streamer_node_h audio_sink = NULL; + media_streamer_node_create_sink(MEDIA_STREAMER_NODE_SINK_TYPE_AUDIO, &audio_sink); + media_streamer_node_add(current_media_streamer, audio_sink); + APPEND_NODE(audio_sink); + + media_streamer_node_link(filesrc, "src", qt_demux, "sink"); + /* mediastreamer link demux to video_decoder and audio_decoder automatically. so we don't need to link. */ media_streamer_node_link(video_decoder, "src", video_sink, "sink"); + media_streamer_node_link(audio_decoder, "src", audio_sink, "sink"); } static void _create_videotestsrc_videosink(void) -- 2.7.4