@@ -61,8 +61,6 @@ uint32_t WaitForNeedDataRequest(int32_t sourceId, int timeoutMs = 5000)
6161 return requestId;
6262}
6363
64-
65-
6664void LoadAndDemuxSegment (Mp4Demux &mp4Demux, const char *path)
6765{
6866 char fullpath[512 ];
@@ -147,8 +145,8 @@ void ConfigureVideo()
147145 bool hasDrm = false ;
148146 std::string mimeType;
149147 StreamFormat streamFormat;
150- // int32_t width = trackVideo.video.width;
151- // int32_t height = trackVideo.video.height;
148+ int32_t width = trackVideo.video .width ;
149+ int32_t height = trackVideo.video .height ;
152150 SegmentAlignment alignment = SegmentAlignment::AU;
153151
154152 switch ( trackVideo.codec_type )
@@ -168,10 +166,6 @@ void ConfigureVideo()
168166 CodecData codecData;
169167 const char *codec_ptr = trackVideo.codec_data .c_str ();
170168 codecData.data = std::vector<uint8_t >( codec_ptr, codec_ptr + trackVideo.codec_data .size () );
171-
172- // Temp hack
173- int32_t width = 1920 ;
174- int32_t height = 1080 ;
175169
176170 std::unique_ptr<IMediaPipeline::MediaSourceVideo> sourceVideo =
177171 std::make_unique<IMediaPipeline::MediaSourceVideo>(
@@ -196,7 +190,6 @@ void InjectAudio(int32_t needDataId)
196190 LoadAndDemuxSegment (trackAudio, " audio/chunk-stream0-00001.m4s" );
197191 std::cout << " loading rialtotest /tmp/data/bipbop-gen/audio/chunk-stream0-00001.m4s" << std::endl;
198192
199- // size_t segmentCount = trackAudio.getNbSegments();
200193 size_t segmentCount = trackAudio.count ();
201194 printf (" adding %zu audio frames\n " , segmentCount);
202195
@@ -271,27 +264,27 @@ int my_main(int argc, char **argv)
271264
272265
273266 // MUST happen before any attachSource() to create a Rialto Gstreamer player
274- gstMediaPipeline->load (MediaType::MSE, " " , " file:///tmp/data/bipbop-gen/main.mpd " ); // Temp
267+ gstMediaPipeline->load (MediaType::MSE, " video/mp4 " , " file:///tmp/data/bipbop-gen/chunk-stream0-00001.m4s " ); // Temp
275268
276269 if (!gstMediaPipeline->setVideoWindow (0 , 0 , 1920 , 1080 ))
277270 {
278271 fprintf (stderr, " Warning: Failed to set video window. Video may not appear.\n " );
279272 }
280273
281- // ConfigureAudio();
282- // ConfigureVideo();
283- // ConfigureComplete();
274+ ConfigureAudio ();
275+ ConfigureVideo ();
276+ ConfigureComplete ();
284277
285278 gstMediaPipeline->play ();
286279
287- // uint32_t audioReqId = WaitForNeedDataRequest(sourceIdAudio);
288- // uint32_t videoReqId = WaitForNeedDataRequest(sourceIdVideo);
280+ uint32_t audioReqId = WaitForNeedDataRequest (sourceIdAudio);
281+ uint32_t videoReqId = WaitForNeedDataRequest (sourceIdVideo);
289282
290- // if (audioReqId != UINT32_MAX)
291- // InjectAudio(audioReqId);
283+ if (audioReqId != UINT32_MAX)
284+ InjectAudio (audioReqId);
292285
293- // if (videoReqId != UINT32_MAX)
294- // InjectVideo(videoReqId);
286+ if (videoReqId != UINT32_MAX)
287+ InjectVideo (videoReqId);
295288
296289
297290 std::this_thread::sleep_for (std::chrono::seconds (7 ));
0 commit comments