12
12
GF_BifsEngine *codec1 = NULL;
13
13
GF_BifsEngine * codec2 = NULL;
17
17
char update[] = "\n AT \n 500 \n { \n REPLACE \n M.emissiveColor BY 1 0 0 } \n";
19
codec1 = gf_beng_init(NULL, argv[1], NULL);
20
gf_beng_get_stream_config(codec1, &config, &config_size);
21
fprintf(stdout, "EncodedBifsConfig size is %d \n", config_size);
23
gf_beng_encode_context(codec1, SampleCallBack, NULL);
24
gf_beng_save_context(codec1, "initial_context.mp4", NULL);
25
gf_beng_encode_from_string(codec1, (char *) update, SampleCallBack, NULL);
26
gf_beng_save_context(codec1, "non_aggregated_context.mp4", NULL);
27
gf_beng_aggregate_context(codec1, NULL);
28
gf_beng_save_context(codec1, "aggregated_context.mp4", NULL);
19
codec1 = gf_beng_init(NULL, argv[1]);
20
gf_beng_get_stream_config(codec1, &config, &config_size);
21
fprintf(stdout, "EncodedBifsConfig size is %d \n", config_size);
23
gf_beng_encode_context(codec1, SampleCallBack);
24
gf_beng_save_context(codec1, "initial_context.mp4");
25
gf_beng_encode_from_string(codec1, (char *) update, SampleCallBack);
26
gf_beng_save_context(codec1, "non_aggregated_context.mp4");
27
gf_beng_aggregate_context(codec1);
28
gf_beng_save_context(codec1, "aggregated_context.mp4");
29
gf_beng_terminate(codec1);
33
char scene[] = "OrderedGroup {children [Background2D {backColor 1 1 1}Shape {appearance Appearance {material DEF M Material2D {emissiveColor 0 0 1 filled TRUE } } geometry Rectangle { size 100 75 } } ] }";
34
char update[] = "\n AT \n 500 \n { \n REPLACE \n M.emissiveColor BY 1 0 0 \n REPLACE \n M.filled BY FALSE} \n";
36
codec1 = gf_beng_init_from_string(NULL, scene, 200, 200, 1);
37
gf_beng_get_stream_config(codec1, &config, &config_size);
38
fprintf(stdout, "EncodedBifsConfig size is %d \n", config_size);
40
gf_beng_encode_context(codec1, SampleCallBack);
41
gf_beng_save_context(codec1, "initial_context.mp4");
42
gf_beng_encode_from_string(codec1, (char *) update, SampleCallBack);
43
gf_beng_save_context(codec1, "non_aggregated_context.mp4");
44
gf_beng_aggregate_context(codec1);
45
gf_beng_save_context(codec1, "aggregated_context.mp4");
29
46
gf_beng_terminate(codec1);
45
62
strcpy(in_context, "rect.bt");
48
codec2 = gf_beng_init(NULL, in_context, NULL);
65
codec2 = gf_beng_init(NULL, in_context);
50
67
sprintf(timed_update, "AT %i { %s }", 1000 + i, update);
52
gf_beng_encode_from_string(codec2, timed_update, SampleCallBack, NULL);
69
gf_beng_encode_from_string(codec2, timed_update, SampleCallBack);
54
71
sprintf(mp4_out_na_context, "na_%s_%i.mp4", context_rootname, i+1);
55
72
sprintf(bt_out_na_context, "na_%s_%i.bt", context_rootname, i+1);
56
73
sprintf(mp4_out_agg_context, "agg_%s_%i.mp4", context_rootname, i+1);
57
74
sprintf(bt_out_agg_context, "agg_%s_%i.bt", context_rootname, i+1);
59
gf_beng_save_context(codec2, mp4_out_na_context, NULL);
60
gf_beng_save_context(codec2, bt_out_na_context, NULL);
61
gf_beng_aggregate_context(codec2, NULL);
62
gf_beng_save_context(codec2, mp4_out_agg_context, NULL);
63
gf_beng_save_context(codec2, bt_out_agg_context, NULL);
76
gf_beng_save_context(codec2, mp4_out_na_context);
77
gf_beng_save_context(codec2, bt_out_na_context);
78
gf_beng_aggregate_context(codec2);
79
gf_beng_save_context(codec2, mp4_out_agg_context);
80
gf_beng_save_context(codec2, bt_out_agg_context);
65
82
gf_beng_terminate(codec2);