Commit 39afe7a8 authored by Ghislain MARY's avatar Ghislain MARY

Add API to deactivate the video starter (it is no longer needed once we have...

Add API to deactivate the video starter (it is no longer needed once we have received a VFU request).
parent 78b425a0
......@@ -37,11 +37,13 @@ extern "C"{
typedef struct MSVideoStarter {
uint64_t next_time;
int i_frame_count;
bool_t active;
} MSVideoStarter;
MS2_PUBLIC void ms_video_starter_init(MSVideoStarter *vs);
MS2_PUBLIC void ms_video_starter_first_frame(MSVideoStarter *vs, uint64_t curtime);
MS2_PUBLIC bool_t ms_video_starter_need_i_frame(MSVideoStarter *vs, uint64_t curtime);
MS2_PUBLIC void ms_video_starter_deactivate(MSVideoStarter *vs);
#ifdef __cplusplus
}
......
......@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void ms_video_starter_init(MSVideoStarter *vs) {
vs->next_time = 0;
vs->i_frame_count = 0;
vs->active = TRUE;
}
void ms_video_starter_first_frame(MSVideoStarter *vs, uint64_t curtime) {
......@@ -33,7 +34,7 @@ void ms_video_starter_first_frame(MSVideoStarter *vs, uint64_t curtime) {
}
bool_t ms_video_starter_need_i_frame(MSVideoStarter *vs, uint64_t curtime) {
if (vs->next_time == 0) return FALSE;
if ((vs->active == FALSE) || (vs->next_time == 0)) return FALSE;
if (curtime >= vs->next_time) {
vs->i_frame_count++;
if (vs->i_frame_count == 1) {
......@@ -45,3 +46,7 @@ bool_t ms_video_starter_need_i_frame(MSVideoStarter *vs, uint64_t curtime) {
}
return FALSE;
}
void ms_video_starter_deactivate(MSVideoStarter *vs) {
vs->active = FALSE;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment