@@ -86,15 +86,13 @@ void ConfigureAudio()
8686 // const char *codec_ptr = trackAudio.codec_data.c_str();
8787 // codecData.data = std::vector<uint8_t>( codec_ptr, &codec_ptr[trackAudio.codec_data.size()] );
8888
89- std::unique_ptr<IMediaPipeline::MediaSourceAudio> sourceAudio =
90- std::make_unique<IMediaPipeline::MediaSourceAudio>(
91- mimeType,
92- hasDrm,
93- alignment,
94- streamFormat,
95- trackAudio.audio .rate ,
96- trackAudio.audio .channels ,
97- std::make_shared<CodecData>(codecData) );
89+ std::unique_ptr<IMediaPipeline::MediaSourceAudio> sourceAudio = std::make_unique<IMediaPipeline::MediaSourceAudio>(
90+ mimeType,
91+ hasDrm,
92+ audioConfig,
93+ SegmentAlignment::UNDEFINED,
94+ streamFormat,
95+ nullptr /* codecData*/ );
9896
9997 gstMediaPipeline->attachSource ( std::move (sourceAudio), sourceIdAudio );
10098}
@@ -151,7 +149,8 @@ void InjectAudio()
151149 LoadAndDemuxSegment (trackAudio, " audio/chunk-stream0-00001.m4s" );
152150 std::cout << " loading rialtotest /tmp/data/bipbop-gen/audio/chunk-stream0-00001.m4s" << std::endl;
153151
154- size_t segmentCount = trackAudio.getNbSegments (); // Corrected function name
152+ // size_t segmentCount = trackAudio.getNbSegments();
153+ size_t segmentCount = trackAudio.count ();
155154 printf (" adding %zu audio frames\n " , segmentCount);
156155
157156 for (size_t i = 0 ; i < segmentCount; ++i)
@@ -180,7 +179,8 @@ void InjectVideo()
180179 LoadAndDemuxSegment (trackVideo, " video/chunk-stream0-00001.m4s" );
181180 std::cout << " loading rialtotest /tmp/data/bipbop-gen/video/chunk-stream0-00001.m4s" << std::endl;
182181
183- size_t segmentCount = trackVideo.getNbSegments (); // Corrected function name
182+ // size_t segmentCount = trackVideo.getNbSegments();
183+ size_t segmentCount = trackVideo.count ();
184184 printf (" adding %zu video frames\n " , segmentCount);
185185
186186 for (size_t i = 0 ; i < segmentCount; ++i)
@@ -222,23 +222,25 @@ int my_main(int argc, char **argv)
222222 return -1 ;
223223 }
224224
225- if (!gstMediaPipeline->setVideoWindow (0 , 0 , 1920 , 1080 ))
226- {
227- fprintf (stderr, " Warning: Failed to set video window. Video may not appear.\n " );
228- }
225+ // if (!gstMediaPipeline->setVideoWindow(0, 0, 1920, 1080))
226+ // {
227+ // fprintf(stderr, "Warning: Failed to set video window. Video may not appear.\n");
228+ // }
229229
230- gstMediaPipeline->play ();
230+ // MUST happen before any attachSource() to create a Rialto Gstreamer player
231+ gstMediaPipeline->load (MediaType::AUDIO_VIDEO, " video/mp4" , " test://local" ); // Dummy values
231232
232233 ConfigureAudio ();
233234 ConfigureVideo ();
234235 ConfigureComplete ();
235236
236237 InjectAudio ();
237238 InjectVideo ();
239+ gstMediaPipeline->play ();
238240
239- std::this_thread::sleep_for (std::chrono::seconds (5 ));
241+ // std::this_thread::sleep_for(std::chrono::seconds(5));
240242
241- gstMediaPipeline->stop ();
243+ // gstMediaPipeline->stop();
242244
243245 return 0 ;
244246}
0 commit comments