ret = media_streamer_src_set_buffer_status_cb(app_src, buffer_status_cb, NULL);
assert_eq(ret, MEDIA_STREAMER_ERROR_NONE);
- ret = media_streamer_node_push_packet(app_src, packet);
-
ret = media_streamer_prepare(streamer);
assert_eq(ret, MEDIA_STREAMER_ERROR_NONE);
wait_for_async(PLAY_TIME);
- ret = media_streamer_play(streamer);
- assert_eq(ret, MEDIA_STREAMER_ERROR_NONE);
- wait_for_async(PLAY_TIME);
-
int data_size = PACKET_SIZE * sizeof(char);
char *data = (char *) malloc(data_size);
- media_packet_create_from_external_memory (vfmt_encoded, (void*)data, data_size, NULL, NULL, &packet);
+ media_packet_create_from_external_memory(vfmt_encoded, (void*)data, data_size, NULL, NULL, &packet);
if(!packet)
free(data);
if (buffer_status == MEDIA_STREAMER_CUSTOM_BUFFER_OVERFLOW)
break;
}
-
printf("Send [%d] packets before overflow.", sent_packets_count);
- assert_eq(buffer_status, MEDIA_STREAMER_CUSTOM_BUFFER_UNDERRUN);
-
- ret = media_streamer_node_push_packet(app_src, packet);
- assert_eq(ret, MEDIA_STREAMER_ERROR_INVALID_OPERATION);
media_packet_destroy(packet);
- wait_for_async(PLAY_TIME);
-
free(data);
return 0;
assert_eq(ret, MEDIA_STREAMER_ERROR_NONE);
wait_for_async(PLAY_TIME);
+ /* End of stream */
+ ret = media_streamer_node_push_packet(app_src, NULL);
+ assert_eq(ret, MEDIA_STREAMER_ERROR_NONE);
+
ret = media_streamer_unprepare(streamer);
assert_eq(ret, MEDIA_STREAMER_ERROR_NONE);